Some more fixes post rewrite
This commit is contained in:
@@ -4,12 +4,37 @@ if TheOnlyCure == nil then
|
|||||||
TheOnlyCure = {}
|
TheOnlyCure = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-----------------------------------------
|
||||||
|
-- MP HANDLING CHECKS
|
||||||
function CheckIfCanBeCut(part_name)
|
function CheckIfCanBeCut(part_name)
|
||||||
-- This is just for MP handling... Not enough to check everything
|
-- This is just for MP handling... Not enough to check everything
|
||||||
return not getPlayer():getModData().TOC.Limbs[part_name].is_cut
|
|
||||||
|
local toc_data = getPlayer():getModData().TOC
|
||||||
|
local check = (not toc_data.Limbs[part_name].is_cut) and (not CheckIfProsthesisAlreadyInstalled(toc_data.Limbs, part_name))
|
||||||
|
|
||||||
|
return check
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function CheckIfCanBeOperated(part_name)
|
||||||
|
|
||||||
|
local part_data = getPlayer():getModData().TOC.Limbs
|
||||||
|
|
||||||
|
return part_data[part_name].is_operated == false and part_data[part_name].is_amputation_shown
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function CheckIfProsthesisCanBeEquipped(part_name)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function CheckIfProsthesisAlreadyInstalled(part_data, part_name)
|
function CheckIfProsthesisAlreadyInstalled(part_data, part_name)
|
||||||
|
|
||||||
local r = "Right"
|
local r = "Right"
|
||||||
@@ -28,14 +53,5 @@ function CheckIfProsthesisAlreadyInstalled(part_data, part_name)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function CheckIfCanBeOperated(part_name)
|
|
||||||
|
|
||||||
local part_data = getPlayer():getModData().TOC.Limbs
|
|
||||||
|
|
||||||
return part_data[part_name].is_operated == false and part_data[part_name].is_amputation_shown
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
function CheckIfProsthesisCanBeEquipped(part_name)
|
|
||||||
|
|
||||||
end
|
|
||||||
@@ -131,7 +131,7 @@ TocContextMenus.FillCutAndOperateMenus = function(local_player, clicked_player,
|
|||||||
|
|
||||||
|
|
||||||
if local_player == clicked_player then -- Local player
|
if local_player == clicked_player then -- Local player
|
||||||
if CheckIfCanBeCut(v) and not CheckIfProsthesisAlreadyInstalled(local_part_data, v) then
|
if CheckIfCanBeCut(v) then
|
||||||
cut_menu:addOption(getText('UI_ContextMenu_' .. v), _, TryTocAction, v, "Cut", local_player, local_player)
|
cut_menu:addOption(getText('UI_ContextMenu_' .. v), _, TryTocAction, v, "Cut", local_player, local_player)
|
||||||
|
|
||||||
elseif CheckIfCanBeOperated(v) then
|
elseif CheckIfCanBeOperated(v) then
|
||||||
|
|||||||
@@ -454,6 +454,13 @@ function SetupTocDescUI(surgeon, patient, toc_data, part_name)
|
|||||||
desc_ui["b1"]:setVisible(false)
|
desc_ui["b1"]:setVisible(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
else
|
||||||
|
desc_ui["status"]:setText("Not cut")
|
||||||
|
desc_ui["status"]:setColor(1, 1, 1, 1)
|
||||||
|
desc_ui["b1"]:setVisible(true)
|
||||||
|
desc_ui["b1"]:setText("Remove prosthesis before")
|
||||||
|
desc_ui["b1"]:addArg("option", "Nothing")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Prosthesis Level
|
-- Prosthesis Level
|
||||||
|
|||||||
@@ -14,5 +14,5 @@ IGUI_EN = {
|
|||||||
|
|
||||||
IGUI_perks_Right_Hand = "Right hand",
|
IGUI_perks_Right_Hand = "Right hand",
|
||||||
IGUI_perks_Left_Hand = "Left hand",
|
IGUI_perks_Left_Hand = "Left hand",
|
||||||
IGUI_perks_Prosthesis_Skill_desc = "Prosthesis skills",
|
IGUI_perks_Prosthesis = "Prosthesis skills",
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
VERSION = 1,
|
VERSION = 1,
|
||||||
|
|
||||||
perk Protheses
|
perk Prosthesis
|
||||||
{
|
{
|
||||||
parent = None,
|
parent = None,
|
||||||
translation = Protheses,
|
translation = Prosthesis,
|
||||||
passive = false,
|
passive = false,
|
||||||
xp1 = 0,
|
xp1 = 0,
|
||||||
xp2 = 0,
|
xp2 = 0,
|
||||||
@@ -19,9 +19,9 @@ perk Protheses
|
|||||||
|
|
||||||
perk Left_Hand
|
perk Left_Hand
|
||||||
{
|
{
|
||||||
parent = Protheses,
|
parent = Prosthesis,
|
||||||
name = LeftHand,
|
name = Left_Hand,
|
||||||
translation = LeftHand,
|
translation = Left_Hand,
|
||||||
passive = false,
|
passive = false,
|
||||||
xp1 = 50,
|
xp1 = 50,
|
||||||
xp2 = 100,
|
xp2 = 100,
|
||||||
@@ -37,9 +37,9 @@ perk Left_Hand
|
|||||||
|
|
||||||
perk Right_Hand
|
perk Right_Hand
|
||||||
{
|
{
|
||||||
parent = Protheses,
|
parent = Prosthesis,
|
||||||
name = RightHand,
|
name = Right_Hand,
|
||||||
translation = RightHand,
|
translation = Right_Hand,
|
||||||
passive = false,
|
passive = false,
|
||||||
xp1 = 50,
|
xp1 = 50,
|
||||||
xp2 = 100,
|
xp2 = 100,
|
||||||
|
|||||||
Reference in New Issue
Block a user