Added debug print func
This commit is contained in:
@@ -5,3 +5,11 @@ TOC_DEBUG.disablePaneMod = false
|
||||
function TOC_DEBUG.togglePaneMod()
|
||||
TOC_DEBUG.disablePaneMod = not TOC_DEBUG.disablePaneMod
|
||||
end
|
||||
|
||||
---comment
|
||||
---@param string string
|
||||
function TOC_DEBUG.print(string)
|
||||
if isDebugEnabled() then
|
||||
print("TOC: " .. string)
|
||||
end
|
||||
end
|
||||
@@ -40,7 +40,7 @@ end
|
||||
|
||||
---Starts bleeding from the point where the saw is being used
|
||||
function AmputationHandler:damageDuringAmputation()
|
||||
print("TOC: Damage patient")
|
||||
TOC_DEBUG.print("damage patient")
|
||||
local bodyDamage = self.patient:getBodyDamage()
|
||||
local bodyDamagePart = bodyDamage:getBodyPart(self.bodyPartType)
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ function ItemsHandler.RemoveClothingItem(playerObj, clothingItem)
|
||||
playerObj:removeWornItem(clothingItem)
|
||||
|
||||
playerObj:getInventory():Remove(clothingItem) -- Can be a InventoryItem too.. I guess? todo check it
|
||||
print("TOC: found and deleted " .. tostring(clothingItem))
|
||||
TOC_DEBUG.print("found and deleted" .. tostring(clothingItem))
|
||||
return true
|
||||
end
|
||||
return false
|
||||
@@ -87,7 +87,7 @@ end
|
||||
|
||||
---Spawns and equips the correct amputation item to the player.
|
||||
function ItemsHandler.SpawnAmputationItem(playerObj, limbName)
|
||||
print("Clothing name " .. StaticData.AMPUTATION_CLOTHING_ITEM_BASE .. limbName)
|
||||
TOC_DEBUG.print("clothing name " .. StaticData.AMPUTATION_CLOTHING_ITEM_BASE .. limbName)
|
||||
local clothingItem = playerObj:getInventory():AddItem(StaticData.AMPUTATION_CLOTHING_ITEM_BASE .. limbName)
|
||||
local texId = ItemsHandler.GetAmputationTexturesIndex(playerObj, false)
|
||||
|
||||
@@ -108,7 +108,7 @@ function ISInventoryPane:refreshContainer()
|
||||
for i=1, #self.itemslist do
|
||||
local cItem = self.itemslist[i]
|
||||
if cItem and cItem.cat == "Amputation" then
|
||||
--print("TOC: current item is an amputation, removing it from the list")
|
||||
TOC_DEBUG.print("current item is an amputation, removing it from the list")
|
||||
table.remove(self.itemslist, i)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -88,7 +88,7 @@ end
|
||||
---Cache the currently amputated limbs
|
||||
---@param limbName string
|
||||
function PlayerHandler.AddLocalAmputatedLimb(limbName)
|
||||
print("TOC: added " .. limbName .. " to known amputated limbs")
|
||||
TOC_DEBUG.print("added " .. limbName .. " to known amputated limbs")
|
||||
table.insert(PlayerHandler.amputatedLimbs, limbName) -- TODO This should be player specific, not generic
|
||||
end
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ end
|
||||
---@param bodyLocation string
|
||||
---@return boolean
|
||||
function ProsthesisHandler.CheckIfEquippable(bodyLocation)
|
||||
print("Current item is a prosthesis")
|
||||
TOC_DEBUG.print("current item is a prosthesis")
|
||||
local side = CommonMethods.GetSide(bodyLocation)
|
||||
|
||||
for i=1, #PlayerHandler.amputatedLimbs do
|
||||
|
||||
@@ -106,7 +106,7 @@ function CutLimbHandler:isValid(itemType)
|
||||
end
|
||||
|
||||
function CutLimbHandler:perform(previousAction, itemType)
|
||||
print("perform cutlimbhandler")
|
||||
TOC_DEBUG.print("perform CutLimbHandler")
|
||||
local item = self:getItemOfType(self.items.ITEMS, itemType)
|
||||
previousAction = self:toPlayerInventory(item, previousAction)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ local function AddBodyLocationBefore(newLocation, moveToLocation)
|
||||
local list = getClassFieldVal(group, getClassField(group, 1))
|
||||
group:getOrCreateLocation(newLocation)
|
||||
local newItem = list:get(list:size()-1)
|
||||
print("TOC: Created new body location" .. newItem:getId())
|
||||
TOC_DEBUG.print("created new body location" .. newItem:getId())
|
||||
list:remove(newItem) -- We can't use the Index, it works if we pass the item though!
|
||||
local i = group:indexOf(moveToLocation)
|
||||
list:add(i, newItem)
|
||||
|
||||
Reference in New Issue
Block a user