Skip to content

Commit

Permalink
Adds Reflection to VV Modify Transform (#4907)
Browse files Browse the repository at this point in the history
# About the pull request

<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

As it says on the tin. Just gives the option to flip transform matrixes
in VV Modify Transform.

# Explain why it's good for the game
More shenanigans

# Testing Photographs and Procedure
Tested on brief chairs


# Changelog
:cl:
admin: VV 'Modify Transform' can now be used to flip objects.
/:cl:
  • Loading branch information
fira authored Nov 16, 2023
1 parent 472ffb3 commit 44f6a75
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ Parameters are passed from New.
usr.client.cmd_admin_emp(src)

if(href_list[VV_HK_MODIFY_TRANSFORM] && check_rights(R_VAREDIT))
var/result = tgui_input_list(usr, "Choose the transformation to apply","Transform Mod", list("Scale","Translate","Rotate"))
var/result = tgui_input_list(usr, "Choose the transformation to apply","Transform Mod", list("Scale","Translate","Rotate", "Reflect X Axis", "Reflect Y Axis"))
if(!result)
return
if(!result)
Expand All @@ -749,7 +749,22 @@ Parameters are passed from New.
return
var/matrix/base_matrix = matrix(base_transform)
update_base_transform(base_matrix.Turn(angle))

if("Reflect X Axis")
var/matrix/current = matrix(base_transform)
var/matrix/reflector = matrix()
reflector.a = -1
reflector.d = 0
reflector.b = 0
reflector.e = 1
update_base_transform(current * reflector)
if("Reflect Y Axis")
var/matrix/current = matrix(base_transform)
var/matrix/reflector = matrix()
reflector.a = 1
reflector.d = 0
reflector.b = 0
reflector.e = -1
update_base_transform(current * reflector)
SEND_SIGNAL(src, COMSIG_ATOM_VV_MODIFY_TRANSFORM)

if(href_list[VV_HK_AUTO_RENAME] && check_rights(R_VAREDIT))
Expand Down

0 comments on commit 44f6a75

Please sign in to comment.