Files
Bubberstation/code/modules/buildmode/buttons.dm
MrMelbert 7e55bba4fb Hud elements and certain in-world objects will now change your cursor to indicate they are clickable (windows style) (#88470)
## About The Pull Request

Basically just goes through and adds `mouse_over_pointer =
MOUSE_HAND_POINTER` to a bunch of screen elements (player hud and lobby
menu)

Also adds it to very small wall mounted objects like buttons, fire
alarms, and light switches


https://github.com/user-attachments/assets/c501cd3d-8efd-4fd0-a486-a53f2102a2cb


https://github.com/user-attachments/assets/89f7cdcb-b40c-4ef3-b578-fee66ddf1ce2

## Why It's Good For The Game

- Makes interacting with screen elements a bit more tactile
- Makes it a bit easier to click on tiny buttons and such (being able to
know when you're actually hovering the thing)
- Maybe can be expanded to more world objects to indicate they are
clickable vs non-interactable?

## Changelog

🆑 Melbert
qol: Hovering over clickable screen elements will now update your mouse
cursor to indicate they're clickable
qol: Hovering over small wall mounts (light switches, buttons, fire
alarms) will now update to mouse cursor indicating you're hovering them
/🆑
2024-12-12 19:32:33 +01:00

98 lines
2.3 KiB
Plaintext

/atom/movable/screen/buildmode
icon = 'icons/hud/buildmode.dmi'
mouse_over_pointer = MOUSE_HAND_POINTER
var/datum/buildmode/bd
// If we don't do this, we get occluded by item action buttons
plane = ABOVE_HUD_PLANE
/atom/movable/screen/buildmode/New(bld)
bd = bld
return ..()
/atom/movable/screen/buildmode/Destroy()
bd = null
return ..()
/atom/movable/screen/buildmode/mode
name = "Toggle Mode"
icon_state = "buildmode_basic"
screen_loc = "NORTH,WEST"
/atom/movable/screen/buildmode/mode/Click(location, control, params)
var/list/modifiers = params2list(params)
if(LAZYACCESS(modifiers, LEFT_CLICK))
bd.toggle_modeswitch()
else if(LAZYACCESS(modifiers, RIGHT_CLICK))
bd.mode.change_settings(usr.client)
update_appearance()
return 1
/atom/movable/screen/buildmode/mode/update_icon_state()
icon_state = bd.mode.get_button_iconstate()
return ..()
/atom/movable/screen/buildmode/help
icon_state = "buildhelp"
screen_loc = "NORTH,WEST+1"
name = "Buildmode Help"
/atom/movable/screen/buildmode/help/Click(location, control, params)
bd.mode.show_help(usr.client)
return 1
/atom/movable/screen/buildmode/bdir
icon_state = "build"
screen_loc = "NORTH,WEST+2"
name = "Change Dir"
/atom/movable/screen/buildmode/bdir/update_icon_state()
dir = bd.build_dir
return ..()
/atom/movable/screen/buildmode/bdir/Click()
bd.toggle_dirswitch()
update_appearance()
return 1
// used to switch between modes
/atom/movable/screen/buildmode/modeswitch
var/datum/buildmode_mode/modetype
/atom/movable/screen/buildmode/modeswitch/New(bld, mt)
modetype = mt
icon_state = "buildmode_[initial(modetype.key)]"
name = initial(modetype.key)
return ..(bld)
/atom/movable/screen/buildmode/modeswitch/Click()
bd.change_mode(modetype)
return 1
// used to switch between dirs
/atom/movable/screen/buildmode/dirswitch
icon_state = "build"
/atom/movable/screen/buildmode/dirswitch/New(bld, dir)
src.dir = dir
name = dir2text(dir)
return ..(bld)
/atom/movable/screen/buildmode/dirswitch/Click()
bd.change_dir(dir)
return 1
/atom/movable/screen/buildmode/quit
icon_state = "buildquit"
screen_loc = "NORTH,WEST+3"
name = "Quit Buildmode"
/atom/movable/screen/buildmode/quit/Click()
bd.quit()
return 1
/atom/movable/screen/buildmode/preview_item
name = "Selected Item"
icon_state = "template"
screen_loc = "NORTH,WEST+4"