Skin color switching for amputations working
This commit is contained in:
@@ -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>
|
||||||
@@ -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>
|
||||||
@@ -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>
|
||||||
@@ -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>
|
||||||
@@ -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>
|
||||||
@@ -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>
|
||||||
@@ -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
|
||||||
|
|||||||
20
media/lua/client/TOC_Visuals.lua
Normal file
20
media/lua/client/TOC_Visuals.lua
Normal 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
|
||||||
@@ -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
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
BIN
media/textures/Clothes/skin02.png
Normal file
BIN
media/textures/Clothes/skin02.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
BIN
media/textures/Clothes/skin03.png
Normal file
BIN
media/textures/Clothes/skin03.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
BIN
media/textures/Clothes/skin04.png
Normal file
BIN
media/textures/Clothes/skin04.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
BIN
media/textures/Clothes/skin05.png
Normal file
BIN
media/textures/Clothes/skin05.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Reference in New Issue
Block a user