Closed m-hynek closed 2 years ago
Looks good at a glance. When I have a little more time, I'll take a closer look, test and merge if all goes well.
Have you tested if this works with redirect skins? Not sure if it will be an issue. See the maskin
implementation and the IsRedirectSkin
method for reference.
If there is an issue, we can probably update DeterminePrefabFromPlayerActiveDeployable
to call IsRedirectSkin
and update the latter method to output the full resource path so that DeterminePrefabFromPlayerActiveDeployable
can return it.
Here are some example redirect skins. Some examples which are probably relevant to this plugin include: disco floor, doors, skull trophies/spikes, inner tubes.
10180: hazmatsuit -> hazmatsuit.spacesuit
10189: door.hinged.metal -> door.hinged.industrial.a
10197: rock -> skull
10198: door.hinged.metal -> factorydoor
10201: hazmatsuit -> hazmatsuit.nomadsuit
10207: hazmatsuit -> hazmatsuit.arcticsuit
13029: innertube -> innertube.horse
13031: innertube -> innertube.unicorn
13040: sunglasses -> sunglasses02black
13041: sunglasses -> sunglasses02camo
13042: sunglasses -> sunglasses02red
13043: sunglasses -> sunglasses03black
13044: sunglasses -> sunglasses03chrome
13045: sunglasses -> sunglasses03gold
13050: skullspikes -> skullspikes.candles
13051: skullspikes -> skullspikes.pumpkin
13052: skull.trophy -> skull.trophy.jar
13053: skull.trophy -> skull.trophy.jar2
13054: skull.trophy -> skull.trophy.table
13056: sled -> sled.xmas
13057: discofloor -> discofloor.largetiles
13058: skylantern -> skylantern.skylantern.green
13059: skylantern -> skylantern.skylantern.purple
13067: skylantern -> skylantern.skylantern.orange
13068: snowmobile -> snowmobiletomaha
13069: skylantern -> skylantern.skylantern.red
13070: rifle.ak -> rifle.ak.ice
I couldn't identify any issue with these skins.
Tested: door.hinged.metal -> door.hinged.industrial.a innertube -> innertube.horse innertube -> innertube.unicorn discofloor -> discofloor.largetiles skylantern -> skylantern.skylantern.green skylantern -> skylantern.skylantern.purple skylantern -> skylantern.skylantern.orange
I see, I think those are fine because when you are holding the item (e.g., door.hinged.industrial.a
) it has no skin. It seems redirect skins are mainly used when a player wants to change a skin. For instance, when changing an item's skin at repair bench, if the target skin or source skin has a redirect, it'll change the item id.
6
Tested, looks good