Adds Rest hud button, adds small delay to getting up (#39052)

* Adds Rest hud button, adds small delay to getting up

* icons and icon code
This commit is contained in:
XDTM
2018-07-11 21:14:59 +02:00
committed by Jordan Brown
parent d80ae38e1e
commit 1532545638
15 changed files with 54 additions and 11 deletions

View File

@@ -77,7 +77,8 @@
//Lower right, persistent menu
#define ui_drop_throw "EAST-1:28,SOUTH+1:7"
#define ui_pull_resist "EAST-2:26,SOUTH+1:7"
#define ui_above_movement "EAST-2:26,SOUTH+1:7"
#define ui_above_intent "EAST-3:24, SOUTH+1:7"
#define ui_movi "EAST-2:26,SOUTH:5"
#define ui_acti "EAST-3:24,SOUTH:5"
#define ui_zonesel "EAST-1:28,SOUTH:5"

View File

@@ -73,7 +73,7 @@
using = new /obj/screen/resist()
using.icon = ui_style
using.screen_loc = ui_pull_resist
using.screen_loc = ui_above_movement
hotkeybuttons += using
throw_icon = new /obj/screen/throw_catch()
@@ -84,7 +84,7 @@
pull_icon = new /obj/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon(mymob)
pull_icon.screen_loc = ui_pull_resist
pull_icon.screen_loc = ui_above_movement
static_inventory += pull_icon
//begin indicators

View File

@@ -18,7 +18,7 @@
pull_icon = new /obj/screen/pull()
pull_icon.icon = 'icons/mob/screen_alien.dmi'
pull_icon.update_icon(mymob)
pull_icon.screen_loc = ui_pull_resist
pull_icon.screen_loc = ui_above_movement
hotkeybuttons += pull_icon
using = new/obj/screen/language_menu

View File

@@ -38,6 +38,7 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
var/obj/screen/action_intent
var/obj/screen/zone_select
var/obj/screen/pull_icon
var/obj/screen/rest_icon
var/obj/screen/throw_icon
var/obj/screen/module_store_icon

View File

@@ -207,7 +207,7 @@
using = new /obj/screen/resist()
using.icon = ui_style
using.screen_loc = ui_pull_resist
using.screen_loc = ui_above_intent
hotkeybuttons += using
using = new /obj/screen/human/toggle()
@@ -274,6 +274,11 @@
throw_icon.screen_loc = ui_drop_throw
hotkeybuttons += throw_icon
rest_icon = new /obj/screen/rest()
rest_icon.icon = ui_style
rest_icon.screen_loc = ui_above_movement
static_inventory += rest_icon
internals = new /obj/screen/internals()
infodisplay += internals
@@ -290,7 +295,7 @@
pull_icon = new /obj/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon(mymob)
pull_icon.screen_loc = ui_pull_resist
pull_icon.screen_loc = ui_above_intent
static_inventory += pull_icon
lingchemdisplay = new /obj/screen/ling/chems()

View File

@@ -87,7 +87,7 @@
pull_icon = new /obj/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon(mymob)
pull_icon.screen_loc = ui_pull_resist
pull_icon.screen_loc = ui_above_movement
static_inventory += pull_icon
lingchemdisplay = new /obj/screen/ling/chems()
@@ -106,7 +106,7 @@
using = new /obj/screen/resist()
using.icon = ui_style
using.screen_loc = ui_pull_resist
using.screen_loc = ui_above_intent
hotkeybuttons += using
for(var/obj/screen/inventory/inv in (static_inventory + toggleable_inventory))

View File

@@ -352,6 +352,27 @@
var/mob/living/L = usr
L.resist()
/obj/screen/rest
name = "rest"
icon = 'icons/mob/screen_midnight.dmi'
icon_state = "act_rest"
layer = HUD_LAYER
plane = HUD_PLANE
/obj/screen/rest/Click()
if(isliving(usr))
var/mob/living/L = usr
L.lay_down()
/obj/screen/rest/update_icon(mob/mymob)
if(!isliving(mymob))
return
var/mob/living/L = mymob
if(!L.resting)
icon_state = "act_rest"
else
icon_state = "act_rest0"
/obj/screen/storage
name = "storage"
icon_state = "block"

View File

@@ -338,9 +338,19 @@
set name = "Rest"
set category = "IC"
resting = !resting
to_chat(src, "<span class='notice'>You are now [resting ? "resting" : "getting up"].</span>")
update_canmove()
if(!resting)
resting = TRUE
to_chat(src, "<span class='notice'>You are now resting.</span>")
update_rest_hud_icon()
update_canmove()
else
if(do_after(src, 10, target = src))
to_chat(src, "<span class='notice'>You get up.</span>")
resting = FALSE
update_rest_hud_icon()
update_canmove()
else
to_chat(src, "<span class='notice'>You fail to get up.</span>")
//Recursive function to find everything a mob is holding. Really shitty proc tbh.
/mob/living/get_contents()

View File

@@ -352,6 +352,11 @@
if(hud_used.pull_icon)
hud_used.pull_icon.update_icon(src)
/mob/proc/update_rest_hud_icon()
if(hud_used)
if(hud_used.rest_icon)
hud_used.rest_icon.update_icon(src)
/mob/verb/mode()
set name = "Activate Held Object"
set category = "Object"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB