Skin color switching for amputations working

This commit is contained in:
Pao
2023-01-18 12:16:09 +01:00
parent 1d7f3d69c5
commit 22406dcef5
14 changed files with 55 additions and 12 deletions

View File

@@ -7,5 +7,9 @@
<m_AllowRandomHue>false</m_AllowRandomHue> <m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint> <m_AllowRandomTint>false</m_AllowRandomTint>
<m_Masks>4</m_Masks> <m_Masks>4</m_Masks>
<textureChoices>Clothes\prototype</textureChoices> <textureChoices>Clothes\skin01</textureChoices>
<textureChoices>Clothes\skin02</textureChoices>
<textureChoices>Clothes\skin03</textureChoices>
<textureChoices>Clothes\skin04</textureChoices>
<textureChoices>Clothes\skin05</textureChoices>
</clothingItem> </clothingItem>

View File

@@ -8,5 +8,9 @@
<m_AllowRandomTint>false</m_AllowRandomTint> <m_AllowRandomTint>false</m_AllowRandomTint>
<m_Masks>3</m_Masks> <m_Masks>3</m_Masks>
<m_Masks>4</m_Masks> <m_Masks>4</m_Masks>
<textureChoices>Clothes\prototype</textureChoices> <textureChoices>Clothes\skin01</textureChoices>
<textureChoices>Clothes\skin02</textureChoices>
<textureChoices>Clothes\skin03</textureChoices>
<textureChoices>Clothes\skin04</textureChoices>
<textureChoices>Clothes\skin05</textureChoices>
</clothingItem> </clothingItem>

View File

@@ -8,5 +8,9 @@
<m_AllowRandomTint>false</m_AllowRandomTint> <m_AllowRandomTint>false</m_AllowRandomTint>
<m_Masks>3</m_Masks> <m_Masks>3</m_Masks>
<m_Masks>4</m_Masks> <m_Masks>4</m_Masks>
<textureChoices>Clothes\prototype</textureChoices> <textureChoices>Clothes\skin01</textureChoices>
<textureChoices>Clothes\skin02</textureChoices>
<textureChoices>Clothes\skin03</textureChoices>
<textureChoices>Clothes\skin04</textureChoices>
<textureChoices>Clothes\skin05</textureChoices>
</clothingItem> </clothingItem>

View File

@@ -6,5 +6,9 @@
<m_AllowRandomHue>false</m_AllowRandomHue> <m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint> <m_AllowRandomTint>false</m_AllowRandomTint>
<m_Masks>6</m_Masks> <m_Masks>6</m_Masks>
<textureChoices>Clothes\prototype</textureChoices> <textureChoices>Clothes\skin01</textureChoices>
<textureChoices>Clothes\skin02</textureChoices>
<textureChoices>Clothes\skin03</textureChoices>
<textureChoices>Clothes\skin04</textureChoices>
<textureChoices>Clothes\skin05</textureChoices>
</clothingItem> </clothingItem>

View File

@@ -8,5 +8,9 @@
<m_AllowRandomTint>false</m_AllowRandomTint> <m_AllowRandomTint>false</m_AllowRandomTint>
<m_Masks>5</m_Masks> <m_Masks>5</m_Masks>
<m_Masks>6</m_Masks> <m_Masks>6</m_Masks>
<textureChoices>Clothes\prototype</textureChoices> <textureChoices>Clothes\skin01</textureChoices>
<textureChoices>Clothes\skin02</textureChoices>
<textureChoices>Clothes\skin03</textureChoices>
<textureChoices>Clothes\skin04</textureChoices>
<textureChoices>Clothes\skin05</textureChoices>
</clothingItem> </clothingItem>

View File

@@ -8,5 +8,9 @@
<m_AllowRandomTint>false</m_AllowRandomTint> <m_AllowRandomTint>false</m_AllowRandomTint>
<m_Masks>5</m_Masks> <m_Masks>5</m_Masks>
<m_Masks>6</m_Masks> <m_Masks>6</m_Masks>
<textureChoices>Clothes\prototype</textureChoices> <textureChoices>Clothes\skin01</textureChoices>
<textureChoices>Clothes\skin02</textureChoices>
<textureChoices>Clothes\skin03</textureChoices>
<textureChoices>Clothes\skin04</textureChoices>
<textureChoices>Clothes\skin05</textureChoices>
</clothingItem> </clothingItem>

View File

@@ -223,8 +223,8 @@ function TheOnlyCure.UpdateEveryTenMinutes()
if player == nil then if player == nil then
return return
end end
local part_data = player:getModData().TOC.Limbs local toc_data = player:getModData().TOC
local part_data = toc_data.Limbs
--Experience for prosthesis user --Experience for prosthesis user
for _, side in ipairs({"Left", "Right"}) do for _, side in ipairs({"Left", "Right"}) do

View File

@@ -0,0 +1,20 @@
-- 6 skin tones or 5?
function TocSetCorrectTextureForAmputation(item, player)
local human_visual = player:getHumanVisual()
local texture_string = human_visual:getSkinTexture()
print(texture_string)
local matched_index = string.match(texture_string, "%d$")
print(matched_index)
item:getVisual():setTextureChoice(tonumber(matched_index))
end

View File

@@ -14,8 +14,6 @@ Arm = "Arm"
function TheOnlyCure.InitTheOnlyCure(_, player) function TheOnlyCure.InitTheOnlyCure(_, player)
local mod_data = player:getModData() local mod_data = player:getModData()
-- TODO
if mod_data.TOC == nil then if mod_data.TOC == nil then
TocSetInitData(mod_data, player) TocSetInitData(mod_data, player)
else else
@@ -263,8 +261,9 @@ function TheOnlyCure.CutLimb(part_name, surgeon_factor, bandage_table, painkille
end end
--Equip model for amputation --Equip model for amputation
local cloth = player:getInventory():AddItem(TocFindAmputatedClothingFromPartName(part_name)) local amputation_clothing_item = player:getInventory():AddItem(TocFindAmputatedClothingFromPartName(part_name))
player:setWornItem(cloth:getBodyLocation(), cloth) TocSetCorrectTextureForAmputation(amputation_clothing_item, player)
player:setWornItem(amputation_clothing_item:getBodyLocation(), amputation_clothing_item)
player:transmitModData() player:transmitModData()
end end

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB