Refactoring and working drag n drop
This commit is contained in:
14
media/lua/client/TOC_Test.lua
Normal file
14
media/lua/client/TOC_Test.lua
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
-- TODO TestFramework stuff here
|
||||||
|
|
||||||
|
if not getActivatedMods():contains("TEST_FRAMEWORK") or not isDebugEnabled() then return end
|
||||||
|
local TestFramework = require("TestFramework/TestFramework")
|
||||||
|
local TestUtils = require("TestFramework/TestUtils")
|
||||||
|
|
||||||
|
TestFramework.registerTestModule("Functionality", "Cut Left Hand", function()
|
||||||
|
local Tests = {}
|
||||||
|
|
||||||
|
function Tests.CutLeftHand()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end)
|
||||||
@@ -3,6 +3,7 @@ require "TimedActions/ISBaseTimedAction"
|
|||||||
local CutLimbAction = ISBaseTimedAction:derive("CutLimbAction")
|
local CutLimbAction = ISBaseTimedAction:derive("CutLimbAction")
|
||||||
|
|
||||||
function CutLimbAction:new(patient, surgeon, partName)
|
function CutLimbAction:new(patient, surgeon, partName)
|
||||||
|
print("CUTLIMBACTION")
|
||||||
end
|
end
|
||||||
|
|
||||||
return CutLimbAction
|
return CutLimbAction
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
local BaseHandler = require("TOC_HealthPanelBaseHandler")
|
local BaseHandler = require("UI/TOC_HealthPanelBaseHandler")
|
||||||
local CutLimbAction = require("TOC_CutLimbAction")
|
local CutLimbAction = require("TimedActions/TOC_CutLimbAction")
|
||||||
|
|
||||||
---@class CutLimbHandler
|
---@class CutLimbHandler
|
||||||
local CutLimbHandler = BaseHandler:derive("CutLimbHandler")
|
local CutLimbHandler = BaseHandler:derive("CutLimbHandler")
|
||||||
@@ -48,10 +48,11 @@ function CutLimbHandler:dropItems(items)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function CutLimbHandler:isValid(itemType)
|
function CutLimbHandler:isValid(itemType)
|
||||||
return self:isInjured() and self:getItemOfType(self.items.ITEMS, itemType)
|
return self:getItemOfType(self.items.ITEMS, itemType)
|
||||||
end
|
end
|
||||||
|
|
||||||
function CutLimbHandler:perform(previousAction, itemType)
|
function CutLimbHandler:perform(previousAction, itemType)
|
||||||
|
print("perform cutlimbhandler")
|
||||||
local item = self:getItemOfType(self.items.ITEMS, itemType)
|
local item = self:getItemOfType(self.items.ITEMS, itemType)
|
||||||
previousAction = self:toPlayerInventory(item, previousAction)
|
previousAction = self:toPlayerInventory(item, previousAction)
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
local CutLimbHandler = require("TOC_UIHandler")
|
local CutLimbHandler = require("UI/TOC_CutLimbHandler")
|
||||||
|
|
||||||
-- TODO Use this to replace the sprites once a limb is cut
|
-- TODO Use this to replace the sprites once a limb is cut
|
||||||
ISHealthBodyPartPanel = ISBodyPartPanel:derive("ISHealthBodyPartPanel")
|
ISHealthBodyPartPanel = ISBodyPartPanel:derive("ISHealthBodyPartPanel")
|
||||||
Reference in New Issue
Block a user