Closed Wuzzy2 closed 7 years ago
To be fair, the wieldview.transform
table is global so it is already possible for a mod to insert a new entry if it exists. However, this method is more convenient and does not require any dependencies or global checks. I am just wondering if the same idea could be extended to my wield3d mod, so perhaps a more generic group name like wield_rotation
?
Since [transform
is capable of more that just rotation I think the wieldview_transform
group is fine. However, I may also add support for a wield_rotation
group that can work with both mods at a later date.
I have just noticed something, the number needs to be prefixed with 'R' therefore it can only be used for rotations. I will fix this and re-name the group to wield_rotation
after all, I hope you don't mind.
Sigh. Read again:
#### `[transform<t>`
* `<t>` = transformation(s) to apply
Rotates and/or flips the image.
`<t>` can be a number (between 0 and 7) or a transform name.
Rotations are counter-clockwise.
0 I identity
1 R90 rotate by 90 degrees
2 R180 rotate by 180 degrees
3 R270 rotate by 270 degrees
4 FX flip X
5 FXR90 flip X then rotate by 90 degrees
6 FY flip Y
7 FYR90 flip Y then rotate by 90 degrees
And again:
`<t>` can be a number (between 0 and 7) or a transform name.
This means, you can legally use [transform0
, [transform1
, [transform2
, etc. for all 8 transformations (including flips). That's what the group rating was meant for.
Sorry, I was not aware of that usage. I have just hard reset the last commit, thanks for letting me know. I still do not understand your negative reaction to also recognising a wield_rotation
group (or field even), that would then work with both mods which can indeed be used together.
This PR allows mods to define their own transformation via the new group
wieldview_transform
. The rating equals the number used for the texture modifier[transform
. E.g. you can usewieldview_transform=3
for a rotation by 270 degrees. The group takes precedence overtransform.lua
, which is still supported.Rationale: It is better to make the mods define the correct transformation instead of trying to support all items under the sun in a single mod.
This PR also removes the
default
dependency because this mod works withoutdefault
.