mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 21:12:24 +01:00
Refactor /obj/screen to /atom/movable/screen (#19852)
Part of backend stuff required for #19188. Should probably be test merged. --------- Co-authored-by: Cody Brittain <cbrittain10@live.com>
This commit is contained in:
co-authored by
Cody Brittain
parent
3c474b70df
commit
dc610520fe
@@ -1,14 +1,14 @@
|
||||
/obj/screen/psi
|
||||
/atom/movable/screen/psi
|
||||
icon = 'icons/mob/screen/psi.dmi'
|
||||
var/mob/living/owner
|
||||
var/hidden = TRUE
|
||||
|
||||
/obj/screen/psi/New(var/mob/living/_owner)
|
||||
/atom/movable/screen/psi/New(var/mob/living/_owner)
|
||||
loc = null
|
||||
owner = _owner
|
||||
update_icon()
|
||||
|
||||
/obj/screen/psi/Destroy()
|
||||
/atom/movable/screen/psi/Destroy()
|
||||
if(owner && owner.client)
|
||||
owner.client.screen -= src
|
||||
. = ..()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/screen/psi/hub
|
||||
/atom/movable/screen/psi/hub
|
||||
name = "Psi"
|
||||
icon_state = "psi_active"
|
||||
screen_loc = "EAST-1:28,CENTER-3:11"
|
||||
@@ -7,23 +7,23 @@
|
||||
maptext_y = -8
|
||||
var/image/on_cooldown
|
||||
|
||||
/obj/screen/psi/hub/New(var/mob/living/_owner)
|
||||
/atom/movable/screen/psi/hub/New(var/mob/living/_owner)
|
||||
on_cooldown = image(icon, "cooldown")
|
||||
..()
|
||||
START_PROCESSING(SSprocessing, src)
|
||||
|
||||
/obj/screen/psi/hub/update_icon()
|
||||
/atom/movable/screen/psi/hub/update_icon()
|
||||
if(!owner.psi)
|
||||
return
|
||||
|
||||
icon_state = owner.psi.suppressed ? "psi_suppressed" : "psi_active"
|
||||
|
||||
/obj/screen/psi/hub/Destroy()
|
||||
/atom/movable/screen/psi/hub/Destroy()
|
||||
STOP_PROCESSING(SSprocessing, src)
|
||||
owner = null
|
||||
. = ..()
|
||||
|
||||
/obj/screen/psi/hub/process()
|
||||
/atom/movable/screen/psi/hub/process()
|
||||
if(!istype(owner))
|
||||
qdel(src)
|
||||
return
|
||||
@@ -32,23 +32,23 @@
|
||||
maptext = SMALL_FONTS(7, "[round((owner.psi.stamina/owner.psi.max_stamina)*100)]%")
|
||||
update_icon()
|
||||
|
||||
/obj/screen/psi/hub/Click(var/location, var/control, var/params)
|
||||
/atom/movable/screen/psi/hub/Click(var/location, var/control, var/params)
|
||||
ui_interact(owner)
|
||||
update_icon()
|
||||
|
||||
/obj/screen/psi/hub/ui_interact(mob/user, datum/tgui/ui)
|
||||
/atom/movable/screen/psi/hub/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if (!ui)
|
||||
ui = new(user, src, "PsionicShop", "Psionic Point Shop", 400, 500)
|
||||
ui.open()
|
||||
|
||||
/obj/screen/psi/hub/ui_state(mob/user)
|
||||
/atom/movable/screen/psi/hub/ui_state(mob/user)
|
||||
return GLOB.conscious_state
|
||||
|
||||
/obj/screen/psi/hub/ui_status(mob/user, datum/ui_state/state)
|
||||
/atom/movable/screen/psi/hub/ui_status(mob/user, datum/ui_state/state)
|
||||
return UI_INTERACTIVE
|
||||
|
||||
/obj/screen/psi/hub/ui_data(mob/user)
|
||||
/atom/movable/screen/psi/hub/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
var/owner_rank = owner.psi.get_rank()
|
||||
data["available_psionics"] = list()
|
||||
@@ -83,7 +83,7 @@
|
||||
)
|
||||
return data
|
||||
|
||||
/obj/screen/psi/hub/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
/atom/movable/screen/psi/hub/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
. = ..()
|
||||
if(.)
|
||||
return TRUE
|
||||
|
||||
Reference in New Issue
Block a user