/obj/screen --> /atom/movable/screen
This commit is contained in:
@@ -1,37 +1,37 @@
|
||||
/obj/screen/action_bar
|
||||
/atom/movable/screen/action_bar
|
||||
|
||||
/obj/screen/action_bar/Destroy()
|
||||
/atom/movable/screen/action_bar/Destroy()
|
||||
STOP_PROCESSING(SShuds, src)
|
||||
return ..()
|
||||
|
||||
/obj/screen/action_bar/proc/mark_dirty()
|
||||
/atom/movable/screen/action_bar/proc/mark_dirty()
|
||||
var/mob/living/L = hud?.mymob
|
||||
if(L?.client && update_to_mob(L))
|
||||
START_PROCESSING(SShuds, src)
|
||||
|
||||
/obj/screen/action_bar/process()
|
||||
/atom/movable/screen/action_bar/process()
|
||||
var/mob/living/L = hud?.mymob
|
||||
if(!L?.client || !update_to_mob(L))
|
||||
return PROCESS_KILL
|
||||
|
||||
/obj/screen/action_bar/proc/update_to_mob(mob/living/L)
|
||||
/atom/movable/screen/action_bar/proc/update_to_mob(mob/living/L)
|
||||
return FALSE
|
||||
|
||||
/datum/hud/var/obj/screen/action_bar/clickdelay/clickdelay
|
||||
/datum/hud/var/atom/movable/screen/action_bar/clickdelay/clickdelay
|
||||
|
||||
/obj/screen/action_bar/clickdelay
|
||||
/atom/movable/screen/action_bar/clickdelay
|
||||
name = "click delay"
|
||||
icon = 'icons/effects/progessbar.dmi'
|
||||
icon_state = "prog_bar_100"
|
||||
layer = 20 // under hand buttons
|
||||
|
||||
/obj/screen/action_bar/clickdelay/Initialize()
|
||||
/atom/movable/screen/action_bar/clickdelay/Initialize()
|
||||
. = ..()
|
||||
var/matrix/M = new
|
||||
M.Scale(2, 1)
|
||||
transform = M
|
||||
|
||||
/obj/screen/action_bar/clickdelay/update_to_mob(mob/living/L)
|
||||
/atom/movable/screen/action_bar/clickdelay/update_to_mob(mob/living/L)
|
||||
var/estimated = L.EstimatedNextActionTime()
|
||||
var/diff = estimated - L.last_action
|
||||
var/left = estimated - world.time
|
||||
@@ -41,14 +41,14 @@
|
||||
icon_state = "prog_bar_[round(clamp(((diff - left)/diff) * 100, 0, 100), 5)]"
|
||||
return TRUE
|
||||
|
||||
/datum/hud/var/obj/screen/action_bar/resistdelay/resistdelay
|
||||
/datum/hud/var/atom/movable/screen/action_bar/resistdelay/resistdelay
|
||||
|
||||
/obj/screen/action_bar/resistdelay
|
||||
/atom/movable/screen/action_bar/resistdelay
|
||||
name = "resist delay"
|
||||
icon = 'icons/effects/progessbar.dmi'
|
||||
icon_state = "prog_bar_100"
|
||||
|
||||
/obj/screen/action_bar/resistdelay/update_to_mob(mob/living/L)
|
||||
/atom/movable/screen/action_bar/resistdelay/update_to_mob(mob/living/L)
|
||||
var/diff = L.next_resist - L.last_resist
|
||||
var/left = L.next_resist - world.time
|
||||
if(left < 0 || diff < 0)
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
/obj/screen/mov_intent
|
||||
/atom/movable/screen/mov_intent
|
||||
icon = 'modular_citadel/icons/ui/screen_midnight.dmi'
|
||||
|
||||
/obj/screen/sprintbutton
|
||||
/atom/movable/screen/sprintbutton
|
||||
name = "toggle sprint"
|
||||
icon = 'modular_citadel/icons/ui/screen_midnight.dmi'
|
||||
icon_state = "act_sprint"
|
||||
layer = ABOVE_HUD_LAYER - 0.1
|
||||
var/mutable_appearance/flashy
|
||||
|
||||
/obj/screen/sprintbutton/Click()
|
||||
/atom/movable/screen/sprintbutton/Click()
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
H.default_toggle_sprint()
|
||||
|
||||
/obj/screen/sprintbutton/update_icon_state()
|
||||
/atom/movable/screen/sprintbutton/update_icon_state()
|
||||
var/mob/living/user = hud?.mymob
|
||||
if(!istype(user))
|
||||
return
|
||||
@@ -24,7 +24,7 @@
|
||||
else
|
||||
icon_state = "act_sprint"
|
||||
|
||||
/obj/screen/sprintbutton/update_overlays()
|
||||
/atom/movable/screen/sprintbutton/update_overlays()
|
||||
. = ..()
|
||||
var/mob/living/carbon/user = hud?.mymob
|
||||
if(!istype(user) || !user.client)
|
||||
@@ -38,20 +38,20 @@
|
||||
. += flashy
|
||||
|
||||
//Sprint buffer onscreen code.
|
||||
/datum/hud/var/obj/screen/sprint_buffer/sprint_buffer
|
||||
/datum/hud/var/atom/movable/screen/sprint_buffer/sprint_buffer
|
||||
|
||||
/obj/screen/sprint_buffer
|
||||
/atom/movable/screen/sprint_buffer
|
||||
name = "sprint buffer"
|
||||
icon = 'icons/effects/progessbar.dmi'
|
||||
icon_state = "prog_bar_100"
|
||||
|
||||
/obj/screen/sprint_buffer/Click()
|
||||
/atom/movable/screen/sprint_buffer/Click()
|
||||
if(isliving(usr))
|
||||
var/mob/living/L = usr
|
||||
to_chat(L, "<span class='boldnotice'>Your sprint buffer's maximum capacity is [L.sprint_buffer_max]. It is currently at [L.sprint_buffer], regenerating at [L.sprint_buffer_regen_ds * 10] per second. \
|
||||
Sprinting while this is empty will incur a [L.sprint_stamina_cost] stamina cost per tile.</span>")
|
||||
|
||||
/obj/screen/sprint_buffer/proc/update_to_mob(mob/living/L)
|
||||
/atom/movable/screen/sprint_buffer/proc/update_to_mob(mob/living/L)
|
||||
var/amount = 0
|
||||
if(L.sprint_buffer_max > 0)
|
||||
amount = round(clamp((L.sprint_buffer / L.sprint_buffer_max) * 100, 0, 100), 5)
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/datum/hud/var/obj/screen/staminas/staminas
|
||||
/datum/hud/var/obj/screen/staminabuffer/staminabuffer
|
||||
/datum/hud/var/atom/movable/screen/staminas/staminas
|
||||
/datum/hud/var/atom/movable/screen/staminabuffer/staminabuffer
|
||||
|
||||
/obj/screen/staminas
|
||||
/atom/movable/screen/staminas
|
||||
icon = 'modular_citadel/icons/ui/screen_gen.dmi'
|
||||
name = "stamina"
|
||||
icon_state = "stamina0"
|
||||
screen_loc = ui_stamina
|
||||
mouse_opacity = 1
|
||||
|
||||
/obj/screen/staminas/Click(location,control,params)
|
||||
/atom/movable/screen/staminas/Click(location,control,params)
|
||||
if(isliving(usr))
|
||||
var/mob/living/L = usr
|
||||
CONFIG_CACHE_ENTRY_AND_FETCH_VALUE(number/stamina_combat/buffer_max, buffer_max)
|
||||
to_chat(L, "<span class='notice'>You have <b>[L.getStaminaLoss()]</b> stamina loss.<br>\
|
||||
<br>Your stamina buffer is <b>[round((L.stamina_buffer / buffer_max) * 100, 0.1)]%</b> full.</span>")
|
||||
|
||||
/obj/screen/staminas/update_icon_state()
|
||||
/atom/movable/screen/staminas/update_icon_state()
|
||||
var/mob/living/carbon/user = hud?.mymob
|
||||
if(!user)
|
||||
return
|
||||
@@ -26,21 +26,21 @@
|
||||
else
|
||||
icon_state = "stamina[clamp(FLOOR(user.getStaminaLoss() /20, 1), 0, 6)]"
|
||||
|
||||
/obj/screen/staminas/update_overlays()
|
||||
/atom/movable/screen/staminas/update_overlays()
|
||||
. = ..()
|
||||
var/mob/living/carbon/user = hud?.mymob
|
||||
if(!user)
|
||||
return
|
||||
var/percent = user.getStaminaLoss() / STAMINA_CRIT
|
||||
if((user.stat == DEAD) || (user.combat_flags & COMBAT_FLAG_HARD_STAMCRIT) || (user.hal_screwyhud in 1 to 2))
|
||||
. += list("stamina_alert3")
|
||||
. += list("stamina_alert3")
|
||||
else if(percent >= 0.85)
|
||||
. += list("stamina_alert2")
|
||||
else if(percent >= 0.7)
|
||||
. += list("stamina_alert1")
|
||||
|
||||
//stam buffer
|
||||
/obj/screen/staminabuffer
|
||||
/atom/movable/screen/staminabuffer
|
||||
icon = 'modular_citadel/icons/ui/screen_gen.dmi'
|
||||
name = "stamina buffer"
|
||||
icon_state = "stambuffer0"
|
||||
@@ -48,19 +48,19 @@
|
||||
layer = ABOVE_HUD_LAYER + 0.1
|
||||
mouse_opacity = 0
|
||||
|
||||
/obj/screen/staminabuffer/proc/mark_dirty()
|
||||
/atom/movable/screen/staminabuffer/proc/mark_dirty()
|
||||
if(update_to_mob())
|
||||
START_PROCESSING(SShuds, src)
|
||||
|
||||
/obj/screen/staminabuffer/process()
|
||||
/atom/movable/screen/staminabuffer/process()
|
||||
if(!update_to_mob())
|
||||
return PROCESS_KILL
|
||||
|
||||
/obj/screen/staminabuffer/Destroy()
|
||||
/atom/movable/screen/staminabuffer/Destroy()
|
||||
STOP_PROCESSING(SShuds, src)
|
||||
return ..()
|
||||
|
||||
/obj/screen/staminabuffer/proc/update_to_mob()
|
||||
/atom/movable/screen/staminabuffer/proc/update_to_mob()
|
||||
var/mob/living/carbon/user = hud?.mymob
|
||||
user.UpdateStaminaBuffer(FALSE)
|
||||
CONFIG_CACHE_ENTRY_AND_FETCH_VALUE(number/stamina_combat/buffer_max, buffer_max)
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/obj/screen/storage
|
||||
/atom/movable/screen/storage
|
||||
name = "storage"
|
||||
var/insertion_click = FALSE
|
||||
|
||||
/obj/screen/storage/Initialize(mapload, new_master)
|
||||
/atom/movable/screen/storage/Initialize(mapload, new_master)
|
||||
. = ..()
|
||||
master = new_master
|
||||
|
||||
/obj/screen/storage/Click(location, control, params)
|
||||
/atom/movable/screen/storage/Click(location, control, params)
|
||||
if(!insertion_click)
|
||||
return ..()
|
||||
if(hud?.mymob && (hud.mymob != usr))
|
||||
@@ -18,7 +18,7 @@
|
||||
master.attackby(null, I, usr, params)
|
||||
return TRUE
|
||||
|
||||
/obj/screen/storage/boxes
|
||||
/atom/movable/screen/storage/boxes
|
||||
name = "storage"
|
||||
icon_state = "block"
|
||||
screen_loc = "7,7 to 10,8"
|
||||
@@ -26,83 +26,83 @@
|
||||
plane = HUD_PLANE
|
||||
insertion_click = TRUE
|
||||
|
||||
/obj/screen/storage/close
|
||||
/atom/movable/screen/storage/close
|
||||
name = "close"
|
||||
layer = ABOVE_HUD_LAYER
|
||||
plane = ABOVE_HUD_PLANE
|
||||
icon_state = "backpack_close"
|
||||
|
||||
/obj/screen/storage/close/Click()
|
||||
/atom/movable/screen/storage/close/Click()
|
||||
var/datum/component/storage/S = master
|
||||
S.close(usr)
|
||||
return TRUE
|
||||
|
||||
/obj/screen/storage/left
|
||||
/atom/movable/screen/storage/left
|
||||
icon_state = "storage_start"
|
||||
insertion_click = TRUE
|
||||
|
||||
/obj/screen/storage/right
|
||||
/atom/movable/screen/storage/right
|
||||
icon_state = "storage_end"
|
||||
insertion_click = TRUE
|
||||
|
||||
/obj/screen/storage/continuous
|
||||
/atom/movable/screen/storage/continuous
|
||||
icon_state = "storage_continue"
|
||||
insertion_click = TRUE
|
||||
|
||||
/obj/screen/storage/volumetric_box
|
||||
/atom/movable/screen/storage/volumetric_box
|
||||
icon_state = "stored_continue"
|
||||
layer = VOLUMETRIC_STORAGE_BOX_LAYER
|
||||
plane = VOLUMETRIC_STORAGE_BOX_PLANE
|
||||
var/obj/item/our_item
|
||||
|
||||
/obj/screen/storage/volumetric_box/Initialize(mapload, new_master, obj/item/our_item)
|
||||
/atom/movable/screen/storage/volumetric_box/Initialize(mapload, new_master, obj/item/our_item)
|
||||
src.our_item = our_item
|
||||
RegisterSignal(our_item, COMSIG_ITEM_MOUSE_ENTER, .proc/on_item_mouse_enter)
|
||||
RegisterSignal(our_item, COMSIG_ITEM_MOUSE_EXIT, .proc/on_item_mouse_exit)
|
||||
return ..()
|
||||
|
||||
/obj/screen/storage/volumetric_box/Destroy()
|
||||
/atom/movable/screen/storage/volumetric_box/Destroy()
|
||||
makeItemInactive()
|
||||
our_item = null
|
||||
return ..()
|
||||
|
||||
/obj/screen/storage/volumetric_box/Click(location, control, params)
|
||||
/atom/movable/screen/storage/volumetric_box/Click(location, control, params)
|
||||
return our_item.Click(location, control, params)
|
||||
|
||||
/obj/screen/storage/volumetric_box/MouseDrop(atom/over, src_location, over_location, src_control, over_control, params)
|
||||
/atom/movable/screen/storage/volumetric_box/MouseDrop(atom/over, src_location, over_location, src_control, over_control, params)
|
||||
return our_item.MouseDrop(over, src_location, over_location, src_control, over_control, params)
|
||||
|
||||
/obj/screen/storage/volumetric_box/MouseExited(location, control, params)
|
||||
/atom/movable/screen/storage/volumetric_box/MouseExited(location, control, params)
|
||||
makeItemInactive()
|
||||
|
||||
/obj/screen/storage/volumetric_box/MouseEntered(location, control, params)
|
||||
/atom/movable/screen/storage/volumetric_box/MouseEntered(location, control, params)
|
||||
makeItemActive()
|
||||
|
||||
/obj/screen/storage/volumetric_box/proc/on_item_mouse_enter()
|
||||
/atom/movable/screen/storage/volumetric_box/proc/on_item_mouse_enter()
|
||||
makeItemActive()
|
||||
|
||||
/obj/screen/storage/volumetric_box/proc/on_item_mouse_exit()
|
||||
/atom/movable/screen/storage/volumetric_box/proc/on_item_mouse_exit()
|
||||
makeItemInactive()
|
||||
|
||||
/obj/screen/storage/volumetric_box/proc/makeItemInactive()
|
||||
/atom/movable/screen/storage/volumetric_box/proc/makeItemInactive()
|
||||
return
|
||||
|
||||
/obj/screen/storage/volumetric_box/proc/makeItemActive()
|
||||
/atom/movable/screen/storage/volumetric_box/proc/makeItemActive()
|
||||
return
|
||||
|
||||
/obj/screen/storage/volumetric_box/center
|
||||
/atom/movable/screen/storage/volumetric_box/center
|
||||
icon_state = "stored_continue"
|
||||
var/obj/screen/storage/volumetric_edge/stored_left/left
|
||||
var/obj/screen/storage/volumetric_edge/stored_right/right
|
||||
var/obj/screen/storage/item_holder/holder
|
||||
var/atom/movable/screen/storage/volumetric_edge/stored_left/left
|
||||
var/atom/movable/screen/storage/volumetric_edge/stored_right/right
|
||||
var/atom/movable/screen/storage/item_holder/holder
|
||||
var/pixel_size
|
||||
|
||||
/obj/screen/storage/volumetric_box/center/Initialize(mapload, new_master, our_item)
|
||||
/atom/movable/screen/storage/volumetric_box/center/Initialize(mapload, new_master, our_item)
|
||||
left = new(null, src, our_item)
|
||||
right = new(null, src, our_item)
|
||||
return ..()
|
||||
|
||||
/obj/screen/storage/volumetric_box/center/Destroy()
|
||||
/atom/movable/screen/storage/volumetric_box/center/Destroy()
|
||||
QDEL_NULL(left)
|
||||
QDEL_NULL(right)
|
||||
vis_contents.Cut()
|
||||
@@ -110,13 +110,13 @@
|
||||
QDEL_NULL(holder)
|
||||
return ..()
|
||||
|
||||
/obj/screen/storage/volumetric_box/center/proc/on_screen_objects()
|
||||
/atom/movable/screen/storage/volumetric_box/center/proc/on_screen_objects()
|
||||
return list(src)
|
||||
|
||||
/**
|
||||
* Sets the size of this box screen object and regenerates its left/right borders. This includes the actual border's size!
|
||||
*/
|
||||
/obj/screen/storage/volumetric_box/center/proc/set_pixel_size(pixels)
|
||||
/atom/movable/screen/storage/volumetric_box/center/proc/set_pixel_size(pixels)
|
||||
if(pixel_size == pixels)
|
||||
return
|
||||
pixel_size = pixels
|
||||
@@ -139,59 +139,59 @@
|
||||
add_overlay(left)
|
||||
add_overlay(right)
|
||||
|
||||
/obj/screen/storage/volumetric_box/center/makeItemInactive()
|
||||
/atom/movable/screen/storage/volumetric_box/center/makeItemInactive()
|
||||
if(!holder)
|
||||
return
|
||||
holder.layer = VOLUMETRIC_STORAGE_ITEM_LAYER
|
||||
holder.plane = VOLUMETRIC_STORAGE_ITEM_PLANE
|
||||
|
||||
/obj/screen/storage/volumetric_box/center/makeItemActive()
|
||||
/atom/movable/screen/storage/volumetric_box/center/makeItemActive()
|
||||
if(!holder)
|
||||
return
|
||||
holder.our_item.layer = VOLUMETRIC_STORAGE_ACTIVE_ITEM_LAYER //make sure we display infront of the others!
|
||||
holder.our_item.plane = VOLUMETRIC_STORAGE_ACTIVE_ITEM_PLANE
|
||||
|
||||
/obj/screen/storage/volumetric_edge
|
||||
/atom/movable/screen/storage/volumetric_edge
|
||||
layer = VOLUMETRIC_STORAGE_BOX_LAYER
|
||||
plane = VOLUMETRIC_STORAGE_BOX_PLANE
|
||||
|
||||
/obj/screen/storage/volumetric_edge/Initialize(mapload, master, our_item)
|
||||
/atom/movable/screen/storage/volumetric_edge/Initialize(mapload, master, our_item)
|
||||
src.master = master
|
||||
return ..()
|
||||
|
||||
/obj/screen/storage/volumetric_edge/Click(location, control, params)
|
||||
/atom/movable/screen/storage/volumetric_edge/Click(location, control, params)
|
||||
return master.Click(location, control, params)
|
||||
|
||||
/obj/screen/storage/volumetric_edge/MouseDrop(atom/over, src_location, over_location, src_control, over_control, params)
|
||||
/atom/movable/screen/storage/volumetric_edge/MouseDrop(atom/over, src_location, over_location, src_control, over_control, params)
|
||||
return master.MouseDrop(over, src_location, over_location, src_control, over_control, params)
|
||||
|
||||
/obj/screen/storage/volumetric_edge/MouseExited(location, control, params)
|
||||
/atom/movable/screen/storage/volumetric_edge/MouseExited(location, control, params)
|
||||
return master.MouseExited(location, control, params)
|
||||
|
||||
/obj/screen/storage/volumetric_edge/MouseEntered(location, control, params)
|
||||
/atom/movable/screen/storage/volumetric_edge/MouseEntered(location, control, params)
|
||||
return master.MouseEntered(location, control, params)
|
||||
|
||||
/obj/screen/storage/volumetric_edge/stored_left
|
||||
/atom/movable/screen/storage/volumetric_edge/stored_left
|
||||
icon_state = "stored_start"
|
||||
appearance_flags = APPEARANCE_UI | KEEP_APART | RESET_TRANSFORM // Yes I know RESET_TRANSFORM is in APPEARANCE_UI but we're hard-asserting this incase someone changes it.
|
||||
|
||||
/obj/screen/storage/volumetric_edge/stored_right
|
||||
/atom/movable/screen/storage/volumetric_edge/stored_right
|
||||
icon_state = "stored_end"
|
||||
appearance_flags = APPEARANCE_UI | KEEP_APART | RESET_TRANSFORM
|
||||
|
||||
/obj/screen/storage/item_holder
|
||||
/atom/movable/screen/storage/item_holder
|
||||
var/obj/item/our_item
|
||||
vis_flags = NONE
|
||||
|
||||
/obj/screen/storage/item_holder/Initialize(mapload, new_master, obj/item/I)
|
||||
/atom/movable/screen/storage/item_holder/Initialize(mapload, new_master, obj/item/I)
|
||||
. = ..()
|
||||
our_item = I
|
||||
vis_contents += I
|
||||
|
||||
/obj/screen/storage/item_holder/Destroy()
|
||||
/atom/movable/screen/storage/item_holder/Destroy()
|
||||
vis_contents.Cut()
|
||||
our_item = null
|
||||
return ..()
|
||||
|
||||
/obj/screen/storage/item_holder/Click(location, control, params)
|
||||
/atom/movable/screen/storage/item_holder/Click(location, control, params)
|
||||
return our_item.Click(location, control, params)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/obj/screen/voretoggle
|
||||
/atom/movable/screen/voretoggle
|
||||
name = "toggle vore mode"
|
||||
icon = 'modular_citadel/icons/ui/screen_midnight.dmi'
|
||||
icon_state = "nom_off"
|
||||
|
||||
/obj/screen/voretoggle/Click()
|
||||
/atom/movable/screen/voretoggle/Click()
|
||||
if(usr != hud.mymob)
|
||||
return
|
||||
var/mob/living/carbon/C = usr
|
||||
@@ -12,7 +12,7 @@
|
||||
return
|
||||
C.toggle_vore_mode()
|
||||
|
||||
/obj/screen/voretoggle/update_icon_state()
|
||||
/atom/movable/screen/voretoggle/update_icon_state()
|
||||
var/mob/living/carbon/user = hud?.mymob
|
||||
if(!istype(user))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user