forked from infinitystation/Baystation12
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
358 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/obj/screen/ghost | ||
icon = 'icons/hud/screen_ghost.dmi' | ||
|
||
/obj/screen/ghost/MouseExited(location, control, params) | ||
. = ..() | ||
flick(icon_state + "_anim", src) | ||
|
||
/obj/screen/ghost/jumptomob | ||
name = "Jump to mob" | ||
icon_state = "jumptomob" | ||
screen_loc = ui_ghost_jumptomob | ||
|
||
/obj/screen/ghost/jumptomob/Click() | ||
var/mob/observer/ghost/G = usr | ||
G.jumptomob() | ||
|
||
/obj/screen/ghost/orbit | ||
name = "Orbit" | ||
icon_state = "orbit" | ||
screen_loc = ui_ghost_orbit | ||
|
||
/obj/screen/ghost/orbit/Click() | ||
var/mob/observer/ghost/G = usr | ||
G.follow() | ||
|
||
/obj/screen/ghost/reenter_corpse | ||
name = "Reenter corpse" | ||
icon_state = "reenter_corpse" | ||
screen_loc = ui_ghost_reenter_corpse | ||
|
||
/obj/screen/ghost/reenter_corpse/Click() | ||
var/mob/observer/ghost/G = usr | ||
G.reenter_corpse() | ||
|
||
/obj/screen/ghost/teleport | ||
name = "Teleport" | ||
icon_state = "teleport" | ||
screen_loc = ui_ghost_teleport | ||
|
||
/obj/screen/ghost/teleport/Click() | ||
var/mob/observer/ghost/G = usr | ||
G.dead_tele() | ||
|
||
/obj/screen/ghost/toggle_darkness | ||
name = "Toggle Darkness" | ||
icon_state = "toggle_darkness" | ||
screen_loc = ui_ghost_toggle_darkness | ||
|
||
/obj/screen/ghost/toggle_darkness/Click() | ||
var/mob/observer/ghost/G = usr | ||
G.toggle_darkness() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
GLOBAL_DATUM_INIT(orbit_menu, /datum/orbit_menu, new) | ||
|
||
/datum/orbit_menu | ||
|
||
/datum/orbit_menu/tgui_state(mob/user) | ||
return GLOB.tgui_observer_state | ||
|
||
/datum/orbit_menu/tgui_interact(mob/user, datum/tgui/ui) | ||
ui = SStgui.try_update_ui(user, src, ui) | ||
if (!ui) | ||
ui = new(user, src, "Orbit", "Orbit") | ||
ui.open() | ||
|
||
/datum/orbit_menu/tgui_act(action, list/params) | ||
. = ..() | ||
|
||
if(.) | ||
return | ||
|
||
switch(action) | ||
if("orbit") | ||
var/datum/follow_holder/fh = locate(params["ref"]) in get_follow_targets() | ||
var/atom/movable/a = fh.followed_instance | ||
var/mob/observer/ghost/G = usr | ||
if(a != usr) | ||
G.start_following(a) | ||
return TRUE | ||
if("refresh") | ||
update_tgui_static_data() | ||
return TRUE | ||
|
||
/datum/orbit_menu/tgui_static_data(mob/user) | ||
var/list/data = list() | ||
data["misc"] = list() | ||
data["ghosts"] = list() | ||
data["dead"] = list() | ||
data["npcs"] = list() | ||
data["alive"] = list() | ||
data["antagonists"] = list() | ||
for(var/datum/follow_holder/fh in get_follow_targets()) | ||
var/atom/movable/fi = fh.followed_instance | ||
var/list/serialized = list() | ||
serialized["name"] = fi.name | ||
serialized["ref"] = "\ref[fh]" | ||
|
||
if(!istype(fi, /mob)) | ||
data["misc"] += list(serialized) | ||
continue | ||
var/mob/M = fi | ||
if(isobserver(M)) | ||
data["ghosts"] += list(serialized) | ||
continue | ||
|
||
if(M.stat == DEAD) | ||
data["dead"] += list(serialized) | ||
continue | ||
|
||
if(M.mind == null) | ||
data["npcs"] += list(serialized) | ||
continue | ||
|
||
data["alive"] += list(serialized) | ||
|
||
var/mob/observer/ghost/O = user | ||
if(O.antagHUD && M.get_antag_info()) | ||
var/antag_serialized = serialized.Copy() | ||
for(var/antag_category in M.get_antag_info()) | ||
antag_serialized["antag"] += list(antag_category) | ||
data["antagonists"] += list(antag_serialized) | ||
|
||
return data | ||
|
||
/// Shows the UI to the specified user. | ||
/datum/orbit_menu/proc/show(mob/user) | ||
tgui_interact(user) |
Binary file not shown.
Oops, something went wrong.