This repository has been archived by the owner on May 3, 2024. It is now read-only.
forked from SierraBay/SierraBay12
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Что этот PR делает Копипизднул Orbit и прочие плюшки для гостов - ss220-space/Baystation12#721 ## Почему это хорошо для игры Удобно ебать ## Изображения изменений <details> <summary>Скриншоты</summary> ![image](https://github.com/ss220club/WyccerraBay220/assets/69762909/cf6e5c1d-89a8-40ac-b982-f5724f1f961e) </details> ## Тестирование Ага ## Changelog :cl: add: Добавлены плюшки для гостов, в том числе Orbit /:cl: <!-- Оба :cl:'а должны быть на месте, что-бы чейнджлог работал! Вы можете написать свой ник справа от первого :cl:, если хотите. Иначе будет использован ваш ник на ГитХабе. --> <!-- Вы можете использовать несколько записей с одинаковым префиксом (Они используются только для иконки в игре) и удалить ненужные. Помните, что чейнджлог должен быть понятен обычным игроком. --> <!-- Если чейнджлог не влияет на игроков(например, это рефактор), вы можете исключить всю секцию. -->
- Loading branch information
Showing
10 changed files
with
442 additions
and
93 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/mob/screen_ghost.dmi' | ||
|
||
/obj/screen/ghost/MouseEntered(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") | ||
ui.set_autoupdate(FALSE) | ||
ui.open() | ||
|
||
/datum/orbit_menu/tgui_act(action, list/params) | ||
if(..()) | ||
return | ||
. = TRUE | ||
|
||
switch(action) | ||
if("orbit") | ||
var/datum/follow_holder/follow_holder = locate(params["ref"]) in get_follow_targets() | ||
var/atom/movable/atom = follow_holder.followed_instance | ||
var/mob/observer/ghost/ghost = usr | ||
if(atom != usr) | ||
ghost.start_following(atom) | ||
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/follow_holder in get_follow_targets()) | ||
var/atom/movable/follow_instance = follow_holder.followed_instance | ||
var/list/serialized = list() | ||
serialized["name"] = follow_instance.name | ||
serialized["ref"] = "[REF(follow_holder)]" | ||
|
||
if(!istype(follow_instance, /mob)) | ||
data["misc"] += list(serialized) | ||
continue | ||
var/mob/mob = follow_instance | ||
if(isobserver(mob)) | ||
data["ghosts"] += list(serialized) | ||
continue | ||
|
||
if(mob.stat == DEAD) | ||
data["dead"] += list(serialized) | ||
continue | ||
|
||
if(isnull(mob.mind)) | ||
data["npcs"] += list(serialized) | ||
continue | ||
|
||
data["alive"] += list(serialized) | ||
|
||
var/mob/observer/ghost/observer = user | ||
if(observer.antagHUD && mob.get_antag_info()) | ||
var/antag_serialized = serialized.Copy() | ||
for(var/antag_category in mob.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.