From ec90bd33a455bb58bce430cc1c11ce936706ca7d Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Sun, 13 Jul 2025 08:27:51 -0700 Subject: [PATCH] [MIRROR] some fixes (#11182) Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> --- code/modules/admin/verbs/adminfun.dm | 2 +- code/modules/admin/verbs/entity_narrate.dm | 13 +- code/modules/admin/verbs/possess.dm | 2 +- code/modules/admin/verbs/randomverbs.dm | 2 +- code/modules/admin/verbs/resize.dm | 3 +- code/modules/client/client procs.dm | 8 +- code/modules/env_message/env_message.dm | 4 +- .../vorepanel_vore_subdata.dm | 2 +- .../tgui/interfaces/EntityNarrate.tsx | 245 ++++++++++-------- 9 files changed, 153 insertions(+), 128 deletions(-) diff --git a/code/modules/admin/verbs/adminfun.dm b/code/modules/admin/verbs/adminfun.dm index 32e53dffdb..a4853fac53 100644 --- a/code/modules/admin/verbs/adminfun.dm +++ b/code/modules/admin/verbs/adminfun.dm @@ -42,7 +42,7 @@ ADMIN_VERB(admin_emp, R_ADMIN|R_FUN, "EM Pulse", ADMIN_VERB_NO_DESCRIPTION, ADMI message_admins("[key_name_admin(user)] created an EM PUlse ([heavy],[med],[light],[long]) at ([orignator.x],[orignator.y],[orignator.z])", 1) feedback_add_details("admin_verb","EMP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -ADMIN_VERB(gib_them, (R_ADMIN|R_FUN), "Gib", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/victim in mob_list) +ADMIN_VERB_AND_CONTEXT_MENU(gib_them, (R_ADMIN|R_FUN), "Gib", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/victim in mob_list) var/confirm = tgui_alert(user, "You sure?", "Confirm", list("Yes", "No")) if(confirm != "Yes") return diff --git a/code/modules/admin/verbs/entity_narrate.dm b/code/modules/admin/verbs/entity_narrate.dm index 6b983e64bb..770af22d31 100644 --- a/code/modules/admin/verbs/entity_narrate.dm +++ b/code/modules/admin/verbs/entity_narrate.dm @@ -24,7 +24,7 @@ //Appears as a right click verb on any obj and mob within view range. //when not right clicking we get a list to pick from in aforementioned view range. -ADMIN_VERB(add_mob_for_narration, R_FUN, "Narrate Entity (Add ref)", "Saves a reference of target mob to be called when narrating.", "Fun.Narrate", E as obj|mob|turf in orange(world.view)) +ADMIN_VERB_AND_CONTEXT_MENU(add_mob_for_narration, R_FUN, "Narrate Entity (Add ref)", "Saves a reference of target mob to be called when narrating.", "Fun.Narrate", E as obj|mob|turf in orange(world.view)) //Making sure we got the list datum on our client. if(!user.entity_narrate_holder) user.entity_narrate_holder = new /datum/entity_narrate() @@ -106,7 +106,7 @@ ADMIN_VERB(narrate_mob, R_FUN, "Narrate Entity (Interface)", "Send either a visi var/which_entity = tgui_input_list(user, "Choose which mob to narrate", "Narrate mob", choices, null) if(!which_entity) return if(which_entity == "Open TGUI") - holder.tgui_interact(user) + holder.tgui_interact(user.mob) else var/mode = tgui_alert(user, "Speak or emote?", "mode", list("Speak", "Emote", "Cancel")) if(!mode || mode == "Cancel") return @@ -138,7 +138,7 @@ ADMIN_VERB(narrate_mob_args, R_FUN, "Narrate Entity", "Narrate entities using po //Separate definition for mob/living and /obj due to .say() code allowing us to engage with languages, stuttering etc //We also need this so we can check for .client var/datum/weakref/wref = holder.entity_refs[name] - var/selection = wref.resolve() + var/selection = wref?.resolve() if(!selection) to_chat(user, span_notice("[name] has invalid reference, deleting")) holder.entity_names -= name @@ -209,10 +209,13 @@ ADMIN_VERB(narrate_mob_args, R_FUN, "Narrate Entity", "Narrate entities using po tgui_selected_type = "" tgui_selected_name = "" tgui_selected_refs = null + return TRUE if("change_mode_privacy") tgui_narrate_privacy = !tgui_narrate_privacy + return TRUE if("change_mode_narration") tgui_narrate_mode = !tgui_narrate_mode + return TRUE if("select_entity") if(tgui_selection_mode) if(params["id_selected"] in tgui_selected_id_multi) @@ -252,6 +255,7 @@ ADMIN_VERB(narrate_mob_args, R_FUN, "Narrate Entity", "Narrate entities using po var/atom/A = tgui_selected_refs tgui_selected_type = A.type tgui_selected_name = A.name + return TRUE if("narrate") if(world.time < (tgui_last_message + 0.5 SECONDS)) to_chat(ui.user, span_notice("You can't messages that quickly! Wait at least half a second")) @@ -288,7 +292,7 @@ ADMIN_VERB(narrate_mob_args, R_FUN, "Narrate Entity", "Narrate entities using po tgui_selected_type = "" tgui_selected_name = "" tgui_selected_refs = null - return + return TRUE if(isliving(ref)) var/mob/living/L = ref if(L.client) @@ -297,6 +301,7 @@ ADMIN_VERB(narrate_mob_args, R_FUN, "Narrate Entity", "Narrate entities using po else if(istype(ref, /atom)) var/atom/A = ref narrate_tgui_atom(A, message) + return TRUE /datum/entity_narrate/proc/narrate_tgui_mob(mob/living/L, message as text) //say and custom_emote sanitize it themselves, not sanitizing here to avoid double encoding. diff --git a/code/modules/admin/verbs/possess.dm b/code/modules/admin/verbs/possess.dm index 62542ba4b0..df2c35cb4b 100644 --- a/code/modules/admin/verbs/possess.dm +++ b/code/modules/admin/verbs/possess.dm @@ -23,7 +23,7 @@ ADMIN_VERB_AND_CONTEXT_MENU(possess, R_POSSESS, "Possess Obj", "Possess an objec user.mob.control_object = O feedback_add_details("admin_verb","PO") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -ADMIN_VERB(release, R_POSSESS, "Release Object", "Stop possessing an object.", ADMIN_CATEGORY_OBJECT, obj/O as obj in world) +ADMIN_VERB_AND_CONTEXT_MENU(release, R_POSSESS, "Release Object", "Stop possessing an object.", ADMIN_CATEGORY_OBJECT, obj/O as obj in world) if(user.mob.control_object && user.mob.name_archive) //if you have a name archived and if you are actually relassing an object user.mob.real_name = user.mob.name_archive user.mob.name = user.mob.real_name diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index d043effd6c..0c8ebc9f56 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -1,6 +1,6 @@ GLOBAL_VAR_INIT(global_vantag_hud, 0) -ADMIN_VERB(drop_everything, R_ADMIN, "Drop Everything", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/living/dropee in mob_list) +ADMIN_VERB_AND_CONTEXT_MENU(drop_everything, R_ADMIN, "Drop Everything", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/living/dropee in mob_list) var/confirm = tgui_alert(src, "Make [dropee] drop everything?", "Message", list("Yes", "No")) if(confirm != "Yes") return diff --git a/code/modules/admin/verbs/resize.dm b/code/modules/admin/verbs/resize.dm index f9c42f00e4..afa48ba40f 100644 --- a/code/modules/admin/verbs/resize.dm +++ b/code/modules/admin/verbs/resize.dm @@ -1,5 +1,4 @@ - -ADMIN_VERB(resize, (R_ADMIN|R_FUN|R_VAREDIT), "Resize", "Resizes any living mob without any restrictions on size.", "Fun.Event Kit", mob/living/L in mob_list) +ADMIN_VERB_AND_CONTEXT_MENU(resize, (R_ADMIN|R_FUN|R_VAREDIT), "Resize", "Resizes any living mob without any restrictions on size.", "Fun.Event Kit", mob/living/L in mob_list) user.do_resize(L) //CHOMPEdit /client/proc/do_resize(var/mob/living/L) //CHOMPEdit diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index eade271a71..13c00231da 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -325,13 +325,7 @@ admin_memo_show() message_admins("Staff login: [key_name(src)]") // CHOMPEdit: Admin Login Notice //Edit2: This logs more than just admins so why not change it - // Forcibly enable hardware-accelerated graphics, as we need them for the lighting overlays. - // (but turn them off first, since sometimes BYOND doesn't turn them on properly otherwise) - spawn(5) // And wait a half-second, since it sounds like you can do this too fast. - if(src) - winset(src, null, "command=\".configure graphics-hwmode off\"") - sleep(2) // wait a bit more, possibly fixes hardware mode not re-activating right - winset(src, null, "command=\".configure graphics-hwmode on\"") + winset(src, null, "command=\".configure graphics-hwmode on\"") log_client_to_db() diff --git a/code/modules/env_message/env_message.dm b/code/modules/env_message/env_message.dm index 6124abb02a..e41e56c5e2 100644 --- a/code/modules/env_message/env_message.dm +++ b/code/modules/env_message/env_message.dm @@ -67,7 +67,7 @@ GLOBAL_LIST_EMPTY(env_messages) /mob/living/verb/create_env_message() set name = "Create Env Message" set desc = "Create an ooc message in the environment for other players to see." - set category = "OOC.Game" //CHOMPEdit + set category = "OOC.Game" if(!istype(src) || !get_turf(src) || !src.ckey) return @@ -92,7 +92,7 @@ GLOBAL_LIST_EMPTY(env_messages) /mob/living/verb/remove_env_message() set name = "Remove Env Message" set desc = "Remove your current env message." - set category = "OOC.Game" //CHOMPEdit + set category = "OOC.Game" if(!istype(src) || !src.ckey) return diff --git a/code/modules/vore/eating/panel_databackend/vorepanel_vore_subdata.dm b/code/modules/vore/eating/panel_databackend/vorepanel_vore_subdata.dm index 712d50eafc..8f7ba57fa0 100644 --- a/code/modules/vore/eating/panel_databackend/vorepanel_vore_subdata.dm +++ b/code/modules/vore/eating/panel_databackend/vorepanel_vore_subdata.dm @@ -432,7 +432,7 @@ tab_data["set_action"] = DIGEST_OWNER tab_data["tooltip"] = "Displayed to you when your prey gets digested." return tab_data - if(message_subtab == ABSORBED_MESSAGE) + if(message_subtab == ABSORB_MESSAGE) tab_data["possible_messages"] = list(TO_PREY, TO_YOU) if(!selected_message) selected_message = TO_PREY diff --git a/tgui/packages/tgui/interfaces/EntityNarrate.tsx b/tgui/packages/tgui/interfaces/EntityNarrate.tsx index fdad6fbd6d..43464cdaa1 100644 --- a/tgui/packages/tgui/interfaces/EntityNarrate.tsx +++ b/tgui/packages/tgui/interfaces/EntityNarrate.tsx @@ -28,35 +28,27 @@ export const EntityNarrate = (props) => { const { act, data } = useBackend(); return ( - -
- - -
- -
+ +
+ + + -
- - -
- -
-
- -
- -
-
- - - -
-
+ + + + + + + + + + +
@@ -71,33 +63,31 @@ export const EntitySelection = (props) => { const { act, data } = useBackend(); const { selection_mode, multi_id_selection, entity_names } = data; return ( - - -
act('change_mode_multi')} - > - Multi-Selection - - } +
act('change_mode_multi')} > - - {entity_names.map((name) => ( - act('select_entity', { id_selected: name })} - > - {name} - - ))} - -
- - + Multi-Selection + + } + > + + {entity_names.map((name) => ( + act('select_entity', { id_selected: name })} + > + {name} + + ))} + +
); }; @@ -110,21 +100,41 @@ export const DisplayDetails = (props) => { selected_name, selected_type, } = data; - if (selection_mode) { - return ( - - Number of entities selected: {number_mob_selected} - - ); - } else { - return ( - - Selected ID: {selected_id}
- Selected Name: {selected_name}
- Selected Type: {selected_type}
-
- ); - } + return ( +
+ + {selection_mode ? ( + + + Number of entities selected: + {number_mob_selected} + + + ) : ( + <> + + + Selected ID: + {selected_id} + + + + + Selected Name: + {selected_name} + + + + + Selected Type: + {selected_type} + + + + )} + +
+ ); }; export const ModeSelector = (props) => { @@ -132,64 +142,81 @@ export const ModeSelector = (props) => { const { privacy_select, mode_select } = data; return ( - - - - - - - - +
+ + + + + + + + +
); }; export const NarrationInput = (props) => { const { act, data } = useBackend(); const [narration, setNarration] = useState(''); + + const { number_mob_selected, selected_type } = data; + + const isDisbaled = !number_mob_selected && !selected_type; + + function doSendMessage() { + if (isDisbaled) { + return; + } + act('narrate', { message: narration }); + setNarration(''); + } + return (
act('narrate', { message: narration })}> + } > - - -