Skip to content
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
xRJx committed Nov 14, 2016
1 parent 0c8c5f9 commit dfc6d572851b9738943b3f81be26a27e08328fab
Showing with 7 additions and 9 deletions.
  1. +7 −9 drawallscrollwheelweapons/plugin/cl_plugin.lua
@@ -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;

0 comments on commit dfc6d57

Please sign in to comment.
You can’t perform that action at this time.