Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ghost HUD Respawn Button #4037

Merged
merged 3 commits into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/_onclick/hud/_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
#define ui_pai_view_images "SOUTH:6,WEST+13"

//Ghosts
#define ui_ghost_jumptomob "SOUTH:6,CENTER-3:24"
#define ui_ghost_respawn "SOUTH:6,CENTER-3:24"
#define ui_ghost_orbit "SOUTH:6,CENTER-2:24"
#define ui_ghost_reenter_corpse "SOUTH:6,CENTER-1:24"
#define ui_ghost_teleport "SOUTH:6,CENTER:24"
Expand Down
14 changes: 12 additions & 2 deletions code/_onclick/hud/ghost.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,23 @@
. = ..()
flick(icon_state + "_anim", src)

/*
/atom/movable/screen/ghost/jumptomob
name = "Jump to mob"
icon_state = "jumptomob"
/atom/movable/screen/ghost/jumptomob/Click()
var/mob/dead/observer/G = usr
G.jumptomob()
*/

/atom/movable/screen/ghost/respawn
name = "Respawn"
icon_state = "respawn"

/atom/movable/screen/ghost/respawn/Click()
var/mob/dead/observer/G = usr
G.respawn()

/atom/movable/screen/ghost/orbit
name = "Orbit"
Expand Down Expand Up @@ -58,8 +68,8 @@
..()
var/atom/movable/screen/using

using = new /atom/movable/screen/ghost/jumptomob()
using.screen_loc = ui_ghost_jumptomob
using = new /atom/movable/screen/ghost/respawn()
using.screen_loc = ui_ghost_respawn
using.hud = src
static_inventory += using

Expand Down
7 changes: 7 additions & 0 deletions code/modules/mob/dead/observer/observer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,13 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
else
to_chat(A, "<span class='danger'>This mob is not located in the game world.</span>")

/mob/dead/observer/verb/respawn()
if(can_reenter_corpse && client?.holder)
var/poll_client = tgui_alert(usr, "Returning to the title screen will forfeit any possible revival. Are you sure?", "Confirmation", list("Yes", "No"))
if(poll_client == "No")
return
abandon_mob()

/mob/dead/observer/verb/change_view_range()
set category = "Ghost"
set name = "View Range"
Expand Down
Binary file modified icons/hud/screen_ghost.dmi
Binary file not shown.
6 changes: 3 additions & 3 deletions shiptest.dme
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@
#include "code\__HELPERS\game.dm"
#include "code\__HELPERS\generators.dm"
#include "code\__HELPERS\global_lists.dm"
#include "code\__HELPERS\hearted.dm"
#include "code\__HELPERS\heap.dm"
#include "code\__HELPERS\hearted.dm"
#include "code\__HELPERS\icon_smoothing.dm"
#include "code\__HELPERS\icons.dm"
#include "code\__HELPERS\level_traits.dm"
Expand Down Expand Up @@ -3302,8 +3302,6 @@
#include "code\modules\ruins\objects_and_mobs\ash_walker_den.dm"
#include "code\modules\ruins\objects_and_mobs\necropolis_gate.dm"
#include "code\modules\ruins\objects_and_mobs\sin_ruins.dm"
#include "code\modules\ruins\rockplanet_ruin_code\mining_base.dm"
#include "code\modules\ruins\sandplanet_ruin_code\cave_base.dm"
#include "code\modules\ruins\objects_and_mobs\generic_hazards\hazard_info.dm"
#include "code\modules\ruins\objects_and_mobs\generic_hazards\hazard_code\_hazard.dm"
#include "code\modules\ruins\objects_and_mobs\generic_hazards\hazard_code\_shutoff.dm"
Expand All @@ -3317,6 +3315,8 @@
#include "code\modules\ruins\objects_and_mobs\generic_hazards\hazards\generic_electrical.dm"
#include "code\modules\ruins\objects_and_mobs\generic_hazards\hazards\radioactive_barrels.dm"
#include "code\modules\ruins\objects_and_mobs\generic_hazards\hazards\water_hazard.dm"
#include "code\modules\ruins\rockplanet_ruin_code\mining_base.dm"
#include "code\modules\ruins\sandplanet_ruin_code\cave_base.dm"
#include "code\modules\ruins\spaceruin_code\bigderelict1.dm"
#include "code\modules\ruins\spaceruin_code\TheDerelict.dm"
#include "code\modules\ruins\wasteplanet_ruin_code\tradepost.dm"
Expand Down
Loading