From c6d4aaa9c4aad5e6372fd9b0f6d74e6b38092fa2 Mon Sep 17 00:00:00 2001 From: Pao Date: Wed, 18 Jan 2023 03:26:33 +0100 Subject: [PATCH] More stuff that needed to be changed --- media/lua/client/TOC_Checks.lua | 2 +- .../lua/client/{TOC_Test.lua => TOC_Test.lua2} | 0 media/lua/client/TOC_UI.lua | 4 ++-- media/lua/client/TOC_main.lua | 16 ++++++++++++++-- media/ui/TOC/{LeftHand => Left_Hand}/Base.png | Bin media/ui/TOC/{LeftHand => Left_Hand}/Bite.png | Bin media/ui/TOC/{LeftHand => Left_Hand}/Bleed.png | Bin media/ui/TOC/{LeftHand => Left_Hand}/Cut.png | Bin media/ui/TOC/{LeftHand => Left_Hand}/Hook.png | Bin .../TOC/{LeftHand => Left_Hand}/MetalHand.png | Bin .../ui/TOC/{LeftHand => Left_Hand}/Operate.png | Bin .../TOC/{LeftForearm => Left_LowerArm}/Base.png | Bin .../TOC/{LeftForearm => Left_LowerArm}/Bite.png | Bin .../{LeftForearm => Left_LowerArm}/Bleed.png | Bin .../TOC/{LeftForearm => Left_LowerArm}/Cut.png | Bin .../{LeftForearm => Left_LowerArm}/Operate.png | Bin .../Prothesis.png | Bin .../ui/TOC/{LeftArm => Left_UpperArm}/Base.png | Bin .../ui/TOC/{LeftArm => Left_UpperArm}/Bite.png | Bin .../ui/TOC/{LeftArm => Left_UpperArm}/Bleed.png | Bin media/ui/TOC/{LeftArm => Left_UpperArm}/Cut.png | Bin .../TOC/{LeftArm => Left_UpperArm}/Operate.png | Bin media/ui/TOC/{RightHand => Right_Hand}/Base.png | Bin media/ui/TOC/{RightHand => Right_Hand}/Bite.png | Bin .../ui/TOC/{RightHand => Right_Hand}/Bleed.png | Bin media/ui/TOC/{RightHand => Right_Hand}/Cut.png | Bin media/ui/TOC/{RightHand => Right_Hand}/Hook.png | Bin .../TOC/{RightHand => Right_Hand}/MetalHand.png | Bin .../TOC/{RightHand => Right_Hand}/Operate.png | Bin .../{RightForearm => Right_LowerArm}/Base.png | Bin .../{RightForearm => Right_LowerArm}/Bite.png | Bin .../{RightForearm => Right_LowerArm}/Bleed.png | Bin .../{RightForearm => Right_LowerArm}/Cut.png | Bin .../Operate.png | Bin .../Prothesis.png | Bin .../TOC/{RightArm => Right_UpperArm}/Base.png | Bin .../TOC/{RightArm => Right_UpperArm}/Bite.png | Bin .../TOC/{RightArm => Right_UpperArm}/Bleed.png | Bin .../ui/TOC/{RightArm => Right_UpperArm}/Cut.png | Bin .../{RightArm => Right_UpperArm}/Operate.png | Bin 40 files changed, 17 insertions(+), 5 deletions(-) rename media/lua/client/{TOC_Test.lua => TOC_Test.lua2} (100%) rename media/ui/TOC/{LeftHand => Left_Hand}/Base.png (100%) rename media/ui/TOC/{LeftHand => Left_Hand}/Bite.png (100%) rename media/ui/TOC/{LeftHand => Left_Hand}/Bleed.png (100%) rename media/ui/TOC/{LeftHand => Left_Hand}/Cut.png (100%) rename media/ui/TOC/{LeftHand => Left_Hand}/Hook.png (100%) rename media/ui/TOC/{LeftHand => Left_Hand}/MetalHand.png (100%) rename media/ui/TOC/{LeftHand => Left_Hand}/Operate.png (100%) rename media/ui/TOC/{LeftForearm => Left_LowerArm}/Base.png (100%) rename media/ui/TOC/{LeftForearm => Left_LowerArm}/Bite.png (100%) rename media/ui/TOC/{LeftForearm => Left_LowerArm}/Bleed.png (100%) rename media/ui/TOC/{LeftForearm => Left_LowerArm}/Cut.png (100%) rename media/ui/TOC/{LeftForearm => Left_LowerArm}/Operate.png (100%) rename media/ui/TOC/{LeftForearm => Left_LowerArm}/Prothesis.png (100%) rename media/ui/TOC/{LeftArm => Left_UpperArm}/Base.png (100%) rename media/ui/TOC/{LeftArm => Left_UpperArm}/Bite.png (100%) rename media/ui/TOC/{LeftArm => Left_UpperArm}/Bleed.png (100%) rename media/ui/TOC/{LeftArm => Left_UpperArm}/Cut.png (100%) rename media/ui/TOC/{LeftArm => Left_UpperArm}/Operate.png (100%) rename media/ui/TOC/{RightHand => Right_Hand}/Base.png (100%) rename media/ui/TOC/{RightHand => Right_Hand}/Bite.png (100%) rename media/ui/TOC/{RightHand => Right_Hand}/Bleed.png (100%) rename media/ui/TOC/{RightHand => Right_Hand}/Cut.png (100%) rename media/ui/TOC/{RightHand => Right_Hand}/Hook.png (100%) rename media/ui/TOC/{RightHand => Right_Hand}/MetalHand.png (100%) rename media/ui/TOC/{RightHand => Right_Hand}/Operate.png (100%) rename media/ui/TOC/{RightForearm => Right_LowerArm}/Base.png (100%) rename media/ui/TOC/{RightForearm => Right_LowerArm}/Bite.png (100%) rename media/ui/TOC/{RightForearm => Right_LowerArm}/Bleed.png (100%) rename media/ui/TOC/{RightForearm => Right_LowerArm}/Cut.png (100%) rename media/ui/TOC/{RightForearm => Right_LowerArm}/Operate.png (100%) rename media/ui/TOC/{RightForearm => Right_LowerArm}/Prothesis.png (100%) rename media/ui/TOC/{RightArm => Right_UpperArm}/Base.png (100%) rename media/ui/TOC/{RightArm => Right_UpperArm}/Bite.png (100%) rename media/ui/TOC/{RightArm => Right_UpperArm}/Bleed.png (100%) rename media/ui/TOC/{RightArm => Right_UpperArm}/Cut.png (100%) rename media/ui/TOC/{RightArm => Right_UpperArm}/Operate.png (100%) diff --git a/media/lua/client/TOC_Checks.lua b/media/lua/client/TOC_Checks.lua index aa32262..dc858df 100644 --- a/media/lua/client/TOC_Checks.lua +++ b/media/lua/client/TOC_Checks.lua @@ -6,7 +6,7 @@ end function CheckIfCanBeCut(part_name) -- This is just for MP handling... Not enough to check everything - return not getPlayer():getModData().TOC[part_name].is_cut + return not getPlayer():getModData().TOC.Limbs[part_name].is_cut end diff --git a/media/lua/client/TOC_Test.lua b/media/lua/client/TOC_Test.lua2 similarity index 100% rename from media/lua/client/TOC_Test.lua rename to media/lua/client/TOC_Test.lua2 diff --git a/media/lua/client/TOC_UI.lua b/media/lua/client/TOC_UI.lua index d212070..5aae821 100644 --- a/media/lua/client/TOC_UI.lua +++ b/media/lua/client/TOC_UI.lua @@ -441,11 +441,11 @@ function SetupTocDescUI(surgeon, patient, toc_data, part_name) -- TODO add check for cuts and scratches desc_ui["status"]:setText("Not cut") desc_ui["status"]:setColor(1, 1, 1, 1) - if GetSawInInventory(surgeon) and not CheckIfProsthesisAlreadyInstalled(toc_data, part_name) then + if GetSawInInventory(surgeon) and not CheckIfProsthesisAlreadyInstalled(toc_data.Limbs, part_name) then desc_ui["b1"]:setVisible(true) desc_ui["b1"]:setText("Cut") desc_ui["b1"]:addArg("option", "Cut") - elseif GetSawInInventory(surgeon) and CheckIfProsthesisAlreadyInstalled(toc_data, part_name) then + elseif GetSawInInventory(surgeon) and CheckIfProsthesisAlreadyInstalled(toc_data.Limbs, part_name) then desc_ui["b1"]:setVisible(true) desc_ui["b1"]:setText("Remove prosthesis before") desc_ui["b1"]:addArg("option", "Nothing") diff --git a/media/lua/client/TOC_main.lua b/media/lua/client/TOC_main.lua index 48ba71c..ad3ed50 100644 --- a/media/lua/client/TOC_main.lua +++ b/media/lua/client/TOC_main.lua @@ -16,14 +16,26 @@ function TheOnlyCure.InitTheOnlyCure(_, player) local mod_data = player:getModData() if mod_data.TOC == nil then - mod_data.TOC = {} + + print("TOC: Creating mod_data.TOC") mod_data.TOC = { Limbs = { + Right_Hand = {}, + Right_LowerArm = {}, + Right_UpperArm = {}, + + Left_Hand = {}, + Left_LowerArm = {}, + Left_UpperArm = {}, is_other_bodypart_infected = false }, - Prosthesis = {}, + Prosthesis = { + WoodenHook = {}, + MetalHook = {}, + MetalHand = {} + }, Generic = {}, } -------- diff --git a/media/ui/TOC/LeftHand/Base.png b/media/ui/TOC/Left_Hand/Base.png similarity index 100% rename from media/ui/TOC/LeftHand/Base.png rename to media/ui/TOC/Left_Hand/Base.png diff --git a/media/ui/TOC/LeftHand/Bite.png b/media/ui/TOC/Left_Hand/Bite.png similarity index 100% rename from media/ui/TOC/LeftHand/Bite.png rename to media/ui/TOC/Left_Hand/Bite.png diff --git a/media/ui/TOC/LeftHand/Bleed.png b/media/ui/TOC/Left_Hand/Bleed.png similarity index 100% rename from media/ui/TOC/LeftHand/Bleed.png rename to media/ui/TOC/Left_Hand/Bleed.png diff --git a/media/ui/TOC/LeftHand/Cut.png b/media/ui/TOC/Left_Hand/Cut.png similarity index 100% rename from media/ui/TOC/LeftHand/Cut.png rename to media/ui/TOC/Left_Hand/Cut.png diff --git a/media/ui/TOC/LeftHand/Hook.png b/media/ui/TOC/Left_Hand/Hook.png similarity index 100% rename from media/ui/TOC/LeftHand/Hook.png rename to media/ui/TOC/Left_Hand/Hook.png diff --git a/media/ui/TOC/LeftHand/MetalHand.png b/media/ui/TOC/Left_Hand/MetalHand.png similarity index 100% rename from media/ui/TOC/LeftHand/MetalHand.png rename to media/ui/TOC/Left_Hand/MetalHand.png diff --git a/media/ui/TOC/LeftHand/Operate.png b/media/ui/TOC/Left_Hand/Operate.png similarity index 100% rename from media/ui/TOC/LeftHand/Operate.png rename to media/ui/TOC/Left_Hand/Operate.png diff --git a/media/ui/TOC/LeftForearm/Base.png b/media/ui/TOC/Left_LowerArm/Base.png similarity index 100% rename from media/ui/TOC/LeftForearm/Base.png rename to media/ui/TOC/Left_LowerArm/Base.png diff --git a/media/ui/TOC/LeftForearm/Bite.png b/media/ui/TOC/Left_LowerArm/Bite.png similarity index 100% rename from media/ui/TOC/LeftForearm/Bite.png rename to media/ui/TOC/Left_LowerArm/Bite.png diff --git a/media/ui/TOC/LeftForearm/Bleed.png b/media/ui/TOC/Left_LowerArm/Bleed.png similarity index 100% rename from media/ui/TOC/LeftForearm/Bleed.png rename to media/ui/TOC/Left_LowerArm/Bleed.png diff --git a/media/ui/TOC/LeftForearm/Cut.png b/media/ui/TOC/Left_LowerArm/Cut.png similarity index 100% rename from media/ui/TOC/LeftForearm/Cut.png rename to media/ui/TOC/Left_LowerArm/Cut.png diff --git a/media/ui/TOC/LeftForearm/Operate.png b/media/ui/TOC/Left_LowerArm/Operate.png similarity index 100% rename from media/ui/TOC/LeftForearm/Operate.png rename to media/ui/TOC/Left_LowerArm/Operate.png diff --git a/media/ui/TOC/LeftForearm/Prothesis.png b/media/ui/TOC/Left_LowerArm/Prothesis.png similarity index 100% rename from media/ui/TOC/LeftForearm/Prothesis.png rename to media/ui/TOC/Left_LowerArm/Prothesis.png diff --git a/media/ui/TOC/LeftArm/Base.png b/media/ui/TOC/Left_UpperArm/Base.png similarity index 100% rename from media/ui/TOC/LeftArm/Base.png rename to media/ui/TOC/Left_UpperArm/Base.png diff --git a/media/ui/TOC/LeftArm/Bite.png b/media/ui/TOC/Left_UpperArm/Bite.png similarity index 100% rename from media/ui/TOC/LeftArm/Bite.png rename to media/ui/TOC/Left_UpperArm/Bite.png diff --git a/media/ui/TOC/LeftArm/Bleed.png b/media/ui/TOC/Left_UpperArm/Bleed.png similarity index 100% rename from media/ui/TOC/LeftArm/Bleed.png rename to media/ui/TOC/Left_UpperArm/Bleed.png diff --git a/media/ui/TOC/LeftArm/Cut.png b/media/ui/TOC/Left_UpperArm/Cut.png similarity index 100% rename from media/ui/TOC/LeftArm/Cut.png rename to media/ui/TOC/Left_UpperArm/Cut.png diff --git a/media/ui/TOC/LeftArm/Operate.png b/media/ui/TOC/Left_UpperArm/Operate.png similarity index 100% rename from media/ui/TOC/LeftArm/Operate.png rename to media/ui/TOC/Left_UpperArm/Operate.png diff --git a/media/ui/TOC/RightHand/Base.png b/media/ui/TOC/Right_Hand/Base.png similarity index 100% rename from media/ui/TOC/RightHand/Base.png rename to media/ui/TOC/Right_Hand/Base.png diff --git a/media/ui/TOC/RightHand/Bite.png b/media/ui/TOC/Right_Hand/Bite.png similarity index 100% rename from media/ui/TOC/RightHand/Bite.png rename to media/ui/TOC/Right_Hand/Bite.png diff --git a/media/ui/TOC/RightHand/Bleed.png b/media/ui/TOC/Right_Hand/Bleed.png similarity index 100% rename from media/ui/TOC/RightHand/Bleed.png rename to media/ui/TOC/Right_Hand/Bleed.png diff --git a/media/ui/TOC/RightHand/Cut.png b/media/ui/TOC/Right_Hand/Cut.png similarity index 100% rename from media/ui/TOC/RightHand/Cut.png rename to media/ui/TOC/Right_Hand/Cut.png diff --git a/media/ui/TOC/RightHand/Hook.png b/media/ui/TOC/Right_Hand/Hook.png similarity index 100% rename from media/ui/TOC/RightHand/Hook.png rename to media/ui/TOC/Right_Hand/Hook.png diff --git a/media/ui/TOC/RightHand/MetalHand.png b/media/ui/TOC/Right_Hand/MetalHand.png similarity index 100% rename from media/ui/TOC/RightHand/MetalHand.png rename to media/ui/TOC/Right_Hand/MetalHand.png diff --git a/media/ui/TOC/RightHand/Operate.png b/media/ui/TOC/Right_Hand/Operate.png similarity index 100% rename from media/ui/TOC/RightHand/Operate.png rename to media/ui/TOC/Right_Hand/Operate.png diff --git a/media/ui/TOC/RightForearm/Base.png b/media/ui/TOC/Right_LowerArm/Base.png similarity index 100% rename from media/ui/TOC/RightForearm/Base.png rename to media/ui/TOC/Right_LowerArm/Base.png diff --git a/media/ui/TOC/RightForearm/Bite.png b/media/ui/TOC/Right_LowerArm/Bite.png similarity index 100% rename from media/ui/TOC/RightForearm/Bite.png rename to media/ui/TOC/Right_LowerArm/Bite.png diff --git a/media/ui/TOC/RightForearm/Bleed.png b/media/ui/TOC/Right_LowerArm/Bleed.png similarity index 100% rename from media/ui/TOC/RightForearm/Bleed.png rename to media/ui/TOC/Right_LowerArm/Bleed.png diff --git a/media/ui/TOC/RightForearm/Cut.png b/media/ui/TOC/Right_LowerArm/Cut.png similarity index 100% rename from media/ui/TOC/RightForearm/Cut.png rename to media/ui/TOC/Right_LowerArm/Cut.png diff --git a/media/ui/TOC/RightForearm/Operate.png b/media/ui/TOC/Right_LowerArm/Operate.png similarity index 100% rename from media/ui/TOC/RightForearm/Operate.png rename to media/ui/TOC/Right_LowerArm/Operate.png diff --git a/media/ui/TOC/RightForearm/Prothesis.png b/media/ui/TOC/Right_LowerArm/Prothesis.png similarity index 100% rename from media/ui/TOC/RightForearm/Prothesis.png rename to media/ui/TOC/Right_LowerArm/Prothesis.png diff --git a/media/ui/TOC/RightArm/Base.png b/media/ui/TOC/Right_UpperArm/Base.png similarity index 100% rename from media/ui/TOC/RightArm/Base.png rename to media/ui/TOC/Right_UpperArm/Base.png diff --git a/media/ui/TOC/RightArm/Bite.png b/media/ui/TOC/Right_UpperArm/Bite.png similarity index 100% rename from media/ui/TOC/RightArm/Bite.png rename to media/ui/TOC/Right_UpperArm/Bite.png diff --git a/media/ui/TOC/RightArm/Bleed.png b/media/ui/TOC/Right_UpperArm/Bleed.png similarity index 100% rename from media/ui/TOC/RightArm/Bleed.png rename to media/ui/TOC/Right_UpperArm/Bleed.png diff --git a/media/ui/TOC/RightArm/Cut.png b/media/ui/TOC/Right_UpperArm/Cut.png similarity index 100% rename from media/ui/TOC/RightArm/Cut.png rename to media/ui/TOC/Right_UpperArm/Cut.png diff --git a/media/ui/TOC/RightArm/Operate.png b/media/ui/TOC/Right_UpperArm/Operate.png similarity index 100% rename from media/ui/TOC/RightArm/Operate.png rename to media/ui/TOC/Right_UpperArm/Operate.png