Add setting for tail enabled, PM manage cape

Move cape to PartsManager so it can be disabled when tail is enabled
This commit is contained in:
NullBite 2022-03-23 14:33:51 -04:00
parent a0097ff86d
commit 6b64bc0a13
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A

View File

@ -209,6 +209,7 @@ do
["snore_enabled"]=true,
["print_settings"]=false,
["vanilla_partial"]=false,
["tail_enabled"]=true,
["aquatic_enabled"]=false
}
@ -377,34 +378,37 @@ do
--- Vanilla state
-- Show all in vanilla partial
PM.addPartGroupFunction(VANILLA_GROUPS.ALL, function() return
vanillaPartial() end)
-- no legs in water if tail enabled
PM.addPartGroupFunction(VANILLA_GROUPS.ALL, function() return vanillaPartial() end)
-- no cape if tail enabled (it clips)
PM.addPartFunction(vanilla_model.CAPE, function(last) return last and not local_state.tail_enabled end)
-- no legs in water if mtail enabled
PM.addPartGroupFunction(VANILLA_GROUPS.LEFT_LEG, function(last) return last and not aquaticTailVisible() end)
PM.addPartGroupFunction(VANILLA_GROUPS.RIGHT_LEG, function(last) return last and not aquaticTailVisible() end)
-- no vanilla head in partial vanilla
PM.addPartGroupFunction(VANILLA_GROUPS.HEAD, function(last)
return last and not vanillaPartial() end)
-- Always true if vanilla_enabled
PM.addPartGroupFunction(VANILLA_GROUPS.ALL,
function(last) return last or local_state.vanilla_enabled end)
PM.addPartGroupFunction(VANILLA_GROUPS.ALL, function(last) return last or local_state.vanilla_enabled end)
--- Armor state
PM.addPartGroupFunction(VANILLA_GROUPS.ARMOR,
function(last) return local_state.armor_enabled end)
PM.addPartGroupFunction(VANILLA_GROUPS.ARMOR, function(last) return local_state.armor_enabled end)
--- Custom state
-- Disable model in vanilla partial
PM.addPartGroupFunction(CUSTOM_GROUPS, function(last) return not vanillaPartial() end)
-- Enable certain parts in vanilla partial
local vanilla_partial_enabled={model.Head, model.Body_Tail}
PM.addPartGroupFunction(vanilla_partial_enabled, function(last) return last or vanillaPartial() end)
-- Enable tail setting
PM.addPartFunction(model.Body_Tail, function(last) return last and local_state.tail_enabled end)
-- no legs, regular tail in water if tail enabled
local mtail_mutually_exclusive={model.LeftLeg, model.RightLeg, model.Body_Tail}
PM.addPartGroupFunction(mtail_mutually_exclusive, function(last) return last and not aquaticTailVisible() end)
-- Enable certain parts in vanilla partial
local vanilla_partial_enabled={model.Head, model.Body_Tail}
PM.addPartGroupFunction(vanilla_partial_enabled, function(last) return last or vanillaPartial() end)
-- Disable when vanilla_enabled
PM.addPartGroupFunction(CUSTOM_GROUPS, function(last) return last and not local_state.vanilla_enabled end)
end
SNORES={"snore-1", "snore-2", "snore-3"}
@ -593,7 +597,6 @@ else
v.setEnabled(false)
end
end
vanilla_model.CAPE.setEnabled(true)
-- }}}