From 93568fcb09f3e971c50ca10da9b57eccc754cbe6 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sat, 11 Nov 2017 14:20:00 -0500 Subject: Removed most of the debug print statements in the core Also did some other stuff I guess --- gamemode/inventorysystem/cl_common.lua | 17 ----------------- gamemode/inventorysystem/shapedinventory/cl_shaped.lua | 4 ---- gamemode/inventorysystem/shapedinventory/sh_shaped.lua | 14 -------------- gamemode/inventorysystem/skills/cl_skills.lua | 9 --------- gamemode/inventorysystem/skills/sh_skillcommon.lua | 4 ---- gamemode/inventorysystem/skills/sh_skills.lua | 17 ----------------- 6 files changed, 65 deletions(-) (limited to 'gamemode/inventorysystem') diff --git a/gamemode/inventorysystem/cl_common.lua b/gamemode/inventorysystem/cl_common.lua index 505c5d9..559c8f0 100644 --- a/gamemode/inventorysystem/cl_common.lua +++ b/gamemode/inventorysystem/cl_common.lua @@ -27,21 +27,6 @@ function com.generatereceiver() local fromid,toid = panels[1].info.id,self.info.id local frompos,topos = panels[1].info.pos,self.info.pos local frominv,toinv = panels[1].info.inv,self.info.inv - print("Something was dropped on:",x,y) - PrintTable(panels) - print("self is", self) - print("self.info is", self.info) - PrintTable(self.info) - print("froment:",froment) - print("toent:",toent) - print("fromid",fromid) - print("toid",toid) - print("frompos:",frompos) - PrintTable(panels[1].info.pos) - print("topos:",topos) - PrintTable(self.info.pos) - print("frominv",frominv) - print("toinv",toinv) --Do nothing if we don't actually want to move anything anywhere local posequal = true @@ -57,12 +42,10 @@ function com.generatereceiver() if posequal then return end local item = frominv:Get(frompos) - print("item was", item) --Fake remove the item, in case the position we want to move it to overlaps with where it is now. frominv:Remove(frompos) local cf = toinv:CanFitIn(topos,item) frominv:Put(frompos,item) - print("canfit was:",cf) if cf == true then --Send the request net.Start("art_RequestInvMove") diff --git a/gamemode/inventorysystem/shapedinventory/cl_shaped.lua b/gamemode/inventorysystem/shapedinventory/cl_shaped.lua index dde523f..d74b629 100644 --- a/gamemode/inventorysystem/shapedinventory/cl_shaped.lua +++ b/gamemode/inventorysystem/shapedinventory/cl_shaped.lua @@ -46,7 +46,6 @@ end --Draw the item in a position local function drawitemat(self,x,y,item) - print("Drawing item at ",x,y) local tp = self.gridpanels[x][y] if tp == nil then error("Unable to continue, could not find item at (" .. x .. "," .. y .. ")") @@ -67,7 +66,6 @@ local function drawitemat(self,x,y,item) end end if item.DoOnPanel then - print("Calling cl_shaped's DoOnPanel") item:DoOnPanel(tp) end if item.Paint then @@ -139,11 +137,9 @@ inv.DrawOnDPanel = function(self,panel) local observer = {} observer.Put = function(obs,position,item) - print("observer's put was called") drawitemat(self,position[1],position[2],item) end observer.Remove = function(obs,position) - print("observer's remove was called") undrawitemat(self,position[1],position[2]) end return observer diff --git a/gamemode/inventorysystem/shapedinventory/sh_shaped.lua b/gamemode/inventorysystem/shapedinventory/sh_shaped.lua index e9b2e91..5de6272 100644 --- a/gamemode/inventorysystem/shapedinventory/sh_shaped.lua +++ b/gamemode/inventorysystem/shapedinventory/sh_shaped.lua @@ -21,7 +21,6 @@ local function canfitin(self,arow,acol,shape) for rn,row in ipairs(shape) do for cn,col in ipairs(row) do local absrow,abscol = arow + rn - 1, acol + cn - 1 - print("absrow was",absrow,"abscol was",abscol) local slot = calcposition(self.width,self.height,absrow,abscol) if col and ((self.tracker[slot] ~= nil) or (absrow > self.width) or (abscol > self.height)) then return false @@ -53,7 +52,6 @@ function inv:CanFitIn(tbl,item) end function inv:Put(tbl,item) - print("Calling put") --Set the item's shape to true for rn,row in ipairs(item.Shape) do @@ -66,9 +64,7 @@ function inv:Put(tbl,item) end --Now set the item in the correct slot - print("Put item at ",tbl[1],tbl[2]) local slot = calcposition(self.width,self.height,tbl[1],tbl[2]) - print("Slot is",slot) self.tracker[slot] = item end @@ -81,10 +77,8 @@ function inv:Has(ptr) end for k,v in pairs(self.tracker) do if type(v) == "table" and compare_func(v) then - print("Found item in spot:",k) local row = math.ceil(k / self.width) local col = ((k - 1) % self.width) + 1 - print("Has is retuning",row,col) return {row,col} end end @@ -93,7 +87,6 @@ end function inv:Remove(tbl) local slot = calcposition(self.width,self.height,tbl[1],tbl[2]) - print("Slot is",slot) local item = self.tracker[slot] self.tracker[slot] = nil for rn,row in ipairs(item.Shape) do @@ -104,7 +97,6 @@ function inv:Remove(tbl) end end end - print("shaped is returning",item) return item end @@ -127,19 +119,13 @@ function inv:Serialize() end function inv:DeSerialize(str) - print("Deserialize str is", str) local ret = table.Copy(self) local tbl = util.JSONToTable(str) - print("unjsoned is",tbl,type(tbl)) - PrintTable(tbl) for k,v in pairs(tbl) do local name = k local pos = v[1] local data = v[2] local item = itm.GetItemFromData(name,data) - print("Got item",item) - PrintTable(item) - print("got pos",pos) ret:Put(pos,item) --ret.tracker[pos] = itm.GetItemFromData(name,data) end diff --git a/gamemode/inventorysystem/skills/cl_skills.lua b/gamemode/inventorysystem/skills/cl_skills.lua index fed0f46..d0a5421 100644 --- a/gamemode/inventorysystem/skills/cl_skills.lua +++ b/gamemode/inventorysystem/skills/cl_skills.lua @@ -16,17 +16,12 @@ local levelfunc = function(val) end local set_xp_of = function(name,ammt) - print("setting xp of", name," to ", ammt) local lvl,frac = levelfunc(ammt) elements[name].label:SetText(string.format("%s : %d (%2.5f%%)",name,lvl,frac)) elements[name].bar:SetFraction(frac) end inv.DrawOnDPanel = function(self,panel) - print("Drawing skills on panel") - PrintTable(sc.SkillList()) - print("with") - PrintTable(self.skills) local sheet = vgui.Create( "DColumnSheet", panel ) sheet:Dock( FILL ) @@ -59,14 +54,10 @@ inv.DrawOnDPanel = function(self,panel) local prox = {} prox.Put = function(s,position,item) - print("Calling inventory's put") - print("At time of call, skill was") - PrintTable(self) set_xp_of(position[1],self.skills[position[1]] or item.ammt)--Observer might be called before our put() end prox.Remove = function(s,position) - print("Calling inventory's remove") set_xp_of(position[1],self.skills[position[1]] or itm.ammt) end diff --git a/gamemode/inventorysystem/skills/sh_skillcommon.lua b/gamemode/inventorysystem/skills/sh_skillcommon.lua index fd05eaa..9640421 100644 --- a/gamemode/inventorysystem/skills/sh_skillcommon.lua +++ b/gamemode/inventorysystem/skills/sh_skillcommon.lua @@ -39,8 +39,6 @@ local lib = {} local skills = {} --Skillname is a table of {string_group,string_name} function lib.RegisterSkill(skillname) - print("funcs.RegisterSkill called with") - PrintTable(skillname) local group,name = skillname[1],skillname[2] if not skills[group] then skills[group] = {} @@ -57,8 +55,6 @@ function lib.RegisterSkill(skillname) else skills[group][#skills[group] + 1] = name end - print("After registering skill, skills is") - PrintTable(skills) end function lib.SkillList() diff --git a/gamemode/inventorysystem/skills/sh_skills.lua b/gamemode/inventorysystem/skills/sh_skills.lua index 9b6edd5..a1c878f 100644 --- a/gamemode/inventorysystem/skills/sh_skills.lua +++ b/gamemode/inventorysystem/skills/sh_skills.lua @@ -81,12 +81,9 @@ inv.skills = {} local function calculate_skills() for k,v in pairs(sc.SkillList()) do for i,j in pairs(v) do - print("settings inv's skills' ", j, " to 0") inv.skills[j] = 0 end end - print("After calculating skills, inv was") - PrintTable(inv) end calculate_skills() @@ -99,15 +96,9 @@ item should be } ]] inv.FindPlaceFor = function(self, item) - print("finding place for ") - PrintTable(item) if not item.isskill then return nil end - print("Skill inventory trying to find place for, looking in ") - PrintTable(inv.skills) - print("for") - print(item.name) if inv.skills[item.name] then return {item.name} else @@ -120,8 +111,6 @@ inv.CanFitIn = function(self,position,item) end inv.Put = function(self,position,item) - print("item is") - PrintTable(item) self.skills[position[1]] = (self.skills[position[1]] or 0) + item.ammt end @@ -155,17 +144,11 @@ inv.DeSerialize = function(self,data) return table.Copy(inv) end calculate_skills() - print("At the time we deserialized, sc.skilllist was") - PrintTable(sc.SkillList()) - print("Before making a copy of, inv is") - PrintTable(inv) local cpy = table.Copy(self) local gen = util.JSONToTable(data) for k,v in pairs(gen) do cpy.skills[k] = v end - print("AFter deserializing inventory, it is") - PrintTable(cpy) return cpy end -- cgit v1.2.3-70-g09d2