Skip to content

Commit

Permalink
[MIRROR] Fix duplicate vv_get_dropdown() on atom/movable [MDB IGNORE]…
Browse files Browse the repository at this point in the history
… (#25212) (#796)

* Fix duplicate vv_get_dropdown() on atom/movable (#79890)

## About The Pull Request
Fix duplicate vv_get_dropdown() on atom/movable
I just merged the old format into the new one.

* Fix duplicate vv_get_dropdown() on atom/movable

---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: Xander3359 <[email protected]>
  • Loading branch information
3 people authored Nov 23, 2023
1 parent 19e9830 commit d382320
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/vv.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@
#define VV_HK_ARMOR_MOD "mod_obj_armor"

// /atom/movable
#define VV_HK_OBSERVE_FOLLOW "observe_follow"
#define VV_HK_GET_MOVABLE "get_movable"
#define VV_HK_DEADCHAT_PLAYS "deadchat_plays"

// /obj
Expand Down
22 changes: 16 additions & 6 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1460,12 +1460,6 @@
animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff, transform=rotated_transform, time = 1, easing=BACK_EASING|EASE_IN, flags = ANIMATION_PARALLEL)
animate(pixel_x = pixel_x - pixel_x_diff, pixel_y = pixel_y - pixel_y_diff, transform=initial_transform, time = 2, easing=SINE_EASING, flags = ANIMATION_PARALLEL)

/atom/movable/vv_get_dropdown()
. = ..()
. += "<option value='?_src_=holder;[HrefToken()];adminplayerobservefollow=[REF(src)]'>Follow</option>"
. += "<option value='?_src_=holder;[HrefToken()];admingetmovable=[REF(src)]'>Get</option>"


/* Language procs
* Unless you are doing something very specific, these are the ones you want to use.
*/
Expand Down Expand Up @@ -1630,6 +1624,9 @@

/atom/movable/vv_get_dropdown()
. = ..()
VV_DROPDOWN_OPTION("", "---------")
VV_DROPDOWN_OPTION(VV_HK_OBSERVE_FOLLOW, "Observe Follow")
VV_DROPDOWN_OPTION(VV_HK_GET_MOVABLE, "Get Movable")
VV_DROPDOWN_OPTION(VV_HK_EDIT_PARTICLES, "Edit Particles")
VV_DROPDOWN_OPTION(VV_HK_DEADCHAT_PLAYS, "Start/Stop Deadchat Plays")
VV_DROPDOWN_OPTION(VV_HK_ADD_FANTASY_AFFIX, "Add Fantasy Affix")
Expand All @@ -1640,6 +1637,19 @@
if(!.)
return

if(href_list[VV_HK_OBSERVE_FOLLOW])
if(!check_rights(R_ADMIN))
return
usr.client?.admin_follow(src)

if(href_list[VV_HK_GET_MOVABLE])
if(!check_rights(R_ADMIN))
return

if(QDELETED(src))
return
forceMove(get_turf(usr))

if(href_list[VV_HK_EDIT_PARTICLES] && check_rights(R_VAREDIT))
var/client/C = usr.client
C?.open_particle_editor(src)
Expand Down

0 comments on commit d382320

Please sign in to comment.