Skip to content

Commit

Permalink
move up/down
Browse files Browse the repository at this point in the history
  • Loading branch information
ToasterBiome committed Oct 4, 2024
1 parent 0938a5f commit 18eb2c7
Show file tree
Hide file tree
Showing 8 changed files with 650 additions and 371 deletions.
936 changes: 577 additions & 359 deletions _maps/map_files/MiniStation/MiniStation.dmm

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions code/__DEFINES/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@
#define ui_combat_toggle "EAST-3:24,SOUTH:5"
#define ui_zonesel "EAST-1:28,SOUTH:5"
#define ui_acti_alt "EAST-1:28,SOUTH:5" //alternative intent switcher for when the interface is hidden (F12)
#define ui_crafting "EAST-4:22,SOUTH:5"
#define ui_building "EAST-4:22,SOUTH:21"
#define ui_crafting "EAST-4:4,SOUTH:5"
#define ui_building "EAST-4:4,SOUTH:21"
#define ui_borg_pull "EAST-2:26,SOUTH+1:7"
#define ui_borg_radio "EAST-1:28,SOUTH+1:7"
#define ui_borg_intents "EAST-2:26,SOUTH:5"
#define ui_language_menu "EAST-4:6,SOUTH:21"
#define ui_language_menu "EAST-5:20,SOUTH:21"
#define ui_move_up "EAST-4:22, SOUTH:21"
#define ui_move_down "EAST-4:22, SOUTH:5"

//Upper-middle right (alerts)
#define ui_alert1 "EAST-1:28,CENTER+5:27"
Expand Down Expand Up @@ -219,6 +221,8 @@
#define ui_ghost_chem "SOUTH: 22,CENTER+3:-8"
#define ui_ghost_nanite "SOUTH: 6,CENTER+3:8"
#define ui_ghost_wound "SOUTH: 22,CENTER+3:8"
#define ui_ghost_move_up "SOUTH: 22,CENTER+3:24"
#define ui_ghost_move_down "SOUTH: 6,CENTER+3:24"

// Defines relating to action button positions

Expand Down
10 changes: 10 additions & 0 deletions code/_onclick/hud/ghost.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@
using.icon = ui_style
static_inventory += using

using = new /atom/movable/screen/move(src)
using.icon = ui_style
using.screen_loc = ui_ghost_move_up
static_inventory += using

using = new /atom/movable/screen/move/down(src)
using.icon = ui_style
using.screen_loc = ui_ghost_move_down
static_inventory += using

/datum/hud/ghost/show_hud(version = 0, mob/viewmob)
// don't show this HUD if observing; show the HUD of the observee
var/mob/dead/observer/O = mymob
Expand Down
6 changes: 6 additions & 0 deletions code/_onclick/hud/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
var/atom/movable/screen/stamina
var/atom/movable/screen/healthdoll
var/atom/movable/screen/spacesuit

var/atom/movable/screen/move_up
var/atom/movable/screen/move_down

// subtypes can override this to force a specific UI style
var/ui_style

Expand Down Expand Up @@ -242,6 +246,8 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
blobpwrdisplay = null
alien_plasma_display = null
alien_queen_finder = null
move_up = null
move_down = null

QDEL_LIST_ASSOC_VAL(master_groups)
QDEL_LIST_ASSOC_VAL(plane_master_controllers)
Expand Down
12 changes: 12 additions & 0 deletions code/_onclick/hud/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,18 @@
pull_icon.screen_loc = ui_above_intent
static_inventory += pull_icon

move_up = new /atom/movable/screen/move(src)
move_up.icon = ui_style
move_up.update_appearance(UPDATE_ICON)
//move_up.screen_loc = ui_move_up
static_inventory += move_up

move_down = new /atom/movable/screen/move/down(src)
move_down.icon = ui_style
move_down.update_appearance(UPDATE_ICON)
//move_down.screen_loc = ui_move_down
static_inventory += move_down

devilsouldisplay = new /atom/movable/screen/devil/soul_counter(src)
infodisplay += devilsouldisplay

Expand Down
21 changes: 21 additions & 0 deletions code/_onclick/hud/screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -810,3 +810,24 @@
name = "stamina"
icon_state = "stamina0"
screen_loc = ui_stamina

/atom/movable/screen/move
name = "move up"
icon_state = "move_up"
screen_loc = ui_move_up
var/direction = UP

/atom/movable/screen/move/Click(location, control, params)
. = ..()
var/mob/M = usr
switch(direction)
if(UP)
M.up()
if(DOWN)
M.down()

/atom/movable/screen/move/down
name = "move down"
icon_state = "move_down"
screen_loc = ui_move_down
direction = DOWN
26 changes: 17 additions & 9 deletions code/modules/mob/mob_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -526,10 +526,15 @@
to_chat(src, span_warning("You are not Superman."))
return
balloon_alert(src, "moving up...")
if(!do_after(src, 1 SECONDS))
return
if(zMove(UP, z_move_flags = ZMOVE_FLIGHT_FLAGS|ZMOVE_FEEDBACK|ventcrawling_flag))
to_chat(src, span_notice("You move upwards."))
var/move_time = isobserver(src) ? 0 : 1 SECONDS
if(hud_used?.move_up && move_time)
hud_used.move_up.icon_state = "move_up_using"
if(do_after(src, move_time))
if(zMove(UP, z_move_flags = ZMOVE_FLIGHT_FLAGS|ZMOVE_FEEDBACK|ventcrawling_flag))
to_chat(src, span_notice("You move upwards."))
if(hud_used?.move_up)
hud_used.move_up.icon_state = initial(hud_used.move_up.icon_state)


///Moves a mob down a z level
/mob/verb/down()
Expand All @@ -552,11 +557,14 @@

var/ventcrawling_flag = HAS_TRAIT(src, TRAIT_MOVE_VENTCRAWLING) ? ZMOVE_VENTCRAWLING : 0
balloon_alert(src, "moving down...")
if(!do_after(src, 1 SECONDS))
return
if(zMove(DOWN, z_move_flags = ZMOVE_FLIGHT_FLAGS|ZMOVE_FEEDBACK|ventcrawling_flag))
to_chat(src, span_notice("You move down."))
return FALSE
var/move_time = isobserver(src) ? 0 : 1 SECONDS
if(hud_used?.move_down && move_time)
hud_used.move_down.icon_state = "move_down_using"
if(do_after(src, move_time))
if(zMove(DOWN, z_move_flags = ZMOVE_FLIGHT_FLAGS|ZMOVE_FEEDBACK|ventcrawling_flag))
to_chat(src, span_notice("You move down."))
if(hud_used?.move_down)
hud_used.move_down.icon_state = initial(hud_used.move_down.icon_state)

/mob/abstract_move(atom/destination)
var/turf/new_turf = get_turf(destination)
Expand Down
Binary file modified icons/mob/screen_midnight.dmi
Binary file not shown.

0 comments on commit 18eb2c7

Please sign in to comment.