Permalink
Browse files
Fixed to have special case weapons actually draw
I forgot about Clockwork's call order so some weapons wouldn't have their info changed in time to have them pass certain checks to actually draw.
- Loading branch information
Showing
with
7 additions
and 9 deletions.
| @@ -1,14 +1,12 @@ | ||
| local PLUGIN = PLUGIN; | ||
| local Clockwork = Clockwork; | ||
|
|
||
| -- A function to draw a weapon's information. | ||
| function PLUGIN:DrawWeaponInformation(itemTable, weapon, x, y, alpha) | ||
| -- Called when the important HUD should be painted. | ||
| function PLUGIN:PreDrawWeaponList(x, y, weaponLimit, displayAlpha, beforeWeapons, currentWeapon, afterWeapons, newWeapons) | ||
|
|
||
| -- Adding this so that weapons without the information will actually draw. | ||
| if (!weapon.Instructions) then weapon.Instructions = "x"; end; | ||
| if (!weapon.Purpose) then weapon.Purpose = "x"; end; | ||
| if (!weapon.Contact) then weapon.Contact = "x"; end; | ||
| if (!weapon.Author) then weapon.Author = "x"; end; | ||
| -- Adding this so that weapons without the information will actually draw, and so that weapons that do have information won't have a bunch of useless information added. | ||
| if (!currentWeapon.Instructions and !currentWeapon.Purpose and !currentWeapon.Contact and !currentWeapon.Author) then | ||
| currentWeapon.Instructions = "N/A"; | ||
| end; | ||
|
|
||
| weapon.DrawWeaponInfoBox = true; | ||
| currentWeapon.DrawWeaponInfoBox = true; | ||
| end; |