[MIRROR] some fixes (#11182)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-07-13 08:27:51 -07:00
committed by GitHub
parent 9900eeb6fe
commit ec90bd33a4
9 changed files with 153 additions and 128 deletions

View File

@@ -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

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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()

View File

@@ -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

View File

@@ -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

View File

@@ -28,35 +28,27 @@ export const EntityNarrate = (props) => {
const { act, data } = useBackend<data>();
return (
<Window width={800} height={470} theme="abstract">
<Window.Content scrollable>
<Section>
<Stack>
<Stack.Item grow={2}>
<Section scrollable>
<EntitySelection />
</Section>
<Window.Content>
<Section fill>
<Stack fill>
<Stack.Item grow={2.2}>
<EntitySelection />
</Stack.Item>
<Stack.Item grow={0.25}>
<Divider vertical />
</Stack.Item>
<Stack.Item grow={6.75}>
<Section>
<Stack direction="column" justify="space-between">
<Stack.Item>
<Section title="Details">
<DisplayDetails />
</Section>
</Stack.Item>
<Stack.Item>
<Section title="Select Behaviour">
<ModeSelector />
</Section>
</Stack.Item>
<Stack.Item>
<NarrationInput />
</Stack.Item>
</Stack>
</Section>
<Stack vertical fill>
<Stack.Item>
<DisplayDetails />
</Stack.Item>
<Stack.Item>
<ModeSelector />
</Stack.Item>
<Stack.Item grow>
<NarrationInput />
</Stack.Item>
</Stack>
</Stack.Item>
</Stack>
</Section>
@@ -71,33 +63,31 @@ export const EntitySelection = (props) => {
const { act, data } = useBackend<data>();
const { selection_mode, multi_id_selection, entity_names } = data;
return (
<Stack direction="column">
<Stack.Item>
<Section
title="Choose!"
buttons={
<Button
selected={selection_mode}
onClick={() => act('change_mode_multi')}
>
Multi-Selection
</Button>
}
<Section
title="Choose!"
fill
scrollable
buttons={
<Button
selected={selection_mode}
onClick={() => act('change_mode_multi')}
>
<Tabs vertical>
{entity_names.map((name) => (
<Tabs.Tab
key={name}
selected={multi_id_selection.includes(name)}
onClick={() => act('select_entity', { id_selected: name })}
>
<Box inline>{name}</Box>
</Tabs.Tab>
))}
</Tabs>
</Section>
</Stack.Item>
</Stack>
Multi-Selection
</Button>
}
>
<Tabs vertical>
{entity_names.map((name) => (
<Tabs.Tab
key={name}
selected={multi_id_selection.includes(name)}
onClick={() => act('select_entity', { id_selected: name })}
>
<Box inline>{name}</Box>
</Tabs.Tab>
))}
</Tabs>
</Section>
);
};
@@ -110,21 +100,41 @@ export const DisplayDetails = (props) => {
selected_name,
selected_type,
} = data;
if (selection_mode) {
return (
<Box>
<b>Number of entities selected:</b> {number_mob_selected}
</Box>
);
} else {
return (
<Box>
<b>Selected ID:</b> {selected_id} <br />
<b>Selected Name:</b> {selected_name} <br />
<b>Selected Type:</b> {selected_type} <br />
</Box>
);
}
return (
<Section title="Details">
<Stack vertical fill>
{selection_mode ? (
<Stack.Item>
<Stack>
<Stack.Item bold>Number of entities selected:</Stack.Item>
<Stack.Item>{number_mob_selected}</Stack.Item>
</Stack>
</Stack.Item>
) : (
<>
<Stack.Item>
<Stack>
<Stack.Item bold>Selected ID:</Stack.Item>
<Stack.Item>{selected_id}</Stack.Item>
</Stack>
</Stack.Item>
<Stack.Item>
<Stack>
<Stack.Item bold>Selected Name:</Stack.Item>
<Stack.Item>{selected_name}</Stack.Item>
</Stack>
</Stack.Item>
<Stack.Item>
<Stack>
<Stack.Item bold>Selected Type:</Stack.Item>
<Stack.Item>{selected_type}</Stack.Item>
</Stack>
</Stack.Item>
</>
)}
</Stack>
</Section>
);
};
export const ModeSelector = (props) => {
@@ -132,64 +142,81 @@ export const ModeSelector = (props) => {
const { privacy_select, mode_select } = data;
return (
<Stack direction="row">
<Stack.Item grow>
<Button
onClick={() => act('change_mode_privacy')}
selected={privacy_select}
fluid
tooltip={
'This button changes whether your narration is loud (any who see/hear) or subtle (range of 1 tile)' +
' ' +
(privacy_select
? 'Click here to disable subtle mode'
: 'Click here to enable subtle mode')
}
>
{privacy_select ? 'Currently: Subtle' : 'Currently: Loud'}
</Button>
</Stack.Item>
<Stack.Item grow>
<Button
onClick={() => act('change_mode_narration')}
selected={mode_select}
fluid
tooltip={
'This button sets your narration to talk audiably or emote visibly' +
' ' +
(mode_select
? 'Click here to emote visibly.'
: 'Click here to talk audiably.')
}
>
{mode_select ? 'Currently: Emoting' : 'Currently: Talking'}
</Button>
</Stack.Item>
</Stack>
<Section title="Select Behaviour">
<Stack fill>
<Stack.Item grow>
<Button
onClick={() => act('change_mode_privacy')}
selected={privacy_select}
fluid
tooltip={
'This button changes whether your narration is loud (any who see/hear) or subtle (range of 1 tile)' +
' ' +
(privacy_select
? 'Click here to disable subtle mode'
: 'Click here to enable subtle mode')
}
>
{privacy_select ? 'Currently: Subtle' : 'Currently: Loud'}
</Button>
</Stack.Item>
<Stack.Item grow>
<Button
onClick={() => act('change_mode_narration')}
selected={mode_select}
fluid
tooltip={
'This button sets your narration to talk audiably or emote visibly' +
' ' +
(mode_select
? 'Click here to emote visibly.'
: 'Click here to talk audiably.')
}
>
{mode_select ? 'Currently: Emoting' : 'Currently: Talking'}
</Button>
</Stack.Item>
</Stack>
</Section>
);
};
export const NarrationInput = (props) => {
const { act, data } = useBackend<data>();
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 (
<Section
title="Narration Text"
fill
buttons={
<Button onClick={() => act('narrate', { message: narration })}>
<Button
disabled={isDisbaled}
tooltip={isDisbaled ? 'Select a reference first' : undefined}
onClick={doSendMessage}
>
Send Narration
</Button>
}
>
<Stack>
<Stack.Item width="85%">
<TextArea
height={'18rem'}
onBlur={(val) => setNarration(val)}
value={narration || ''}
/>
</Stack.Item>
</Stack>
<TextArea
height="100%"
fluid
onBlur={(val) => setNarration(val)}
value={narration || ''}
/>
</Section>
);
};