Skip to content

Commit

Permalink
Adds Reflection to VV Modify Transform
Browse files Browse the repository at this point in the history
  • Loading branch information
fira committed Nov 12, 2023
1 parent a97993d commit 3c1a8ea
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 3c1a8ea

Please sign in to comment.