[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) 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! 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")) var/confirm = tgui_alert(user, "You sure?", "Confirm", list("Yes", "No"))
if(confirm != "Yes") if(confirm != "Yes")
return return

View File

@@ -24,7 +24,7 @@
//Appears as a right click verb on any obj and mob within view range. //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. //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. //Making sure we got the list datum on our client.
if(!user.entity_narrate_holder) if(!user.entity_narrate_holder)
user.entity_narrate_holder = new /datum/entity_narrate() 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) var/which_entity = tgui_input_list(user, "Choose which mob to narrate", "Narrate mob", choices, null)
if(!which_entity) return if(!which_entity) return
if(which_entity == "Open TGUI") if(which_entity == "Open TGUI")
holder.tgui_interact(user) holder.tgui_interact(user.mob)
else else
var/mode = tgui_alert(user, "Speak or emote?", "mode", list("Speak", "Emote", "Cancel")) var/mode = tgui_alert(user, "Speak or emote?", "mode", list("Speak", "Emote", "Cancel"))
if(!mode || mode == "Cancel") return 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 //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 //We also need this so we can check for .client
var/datum/weakref/wref = holder.entity_refs[name] var/datum/weakref/wref = holder.entity_refs[name]
var/selection = wref.resolve() var/selection = wref?.resolve()
if(!selection) if(!selection)
to_chat(user, span_notice("[name] has invalid reference, deleting")) to_chat(user, span_notice("[name] has invalid reference, deleting"))
holder.entity_names -= name 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_type = ""
tgui_selected_name = "" tgui_selected_name = ""
tgui_selected_refs = null tgui_selected_refs = null
return TRUE
if("change_mode_privacy") if("change_mode_privacy")
tgui_narrate_privacy = !tgui_narrate_privacy tgui_narrate_privacy = !tgui_narrate_privacy
return TRUE
if("change_mode_narration") if("change_mode_narration")
tgui_narrate_mode = !tgui_narrate_mode tgui_narrate_mode = !tgui_narrate_mode
return TRUE
if("select_entity") if("select_entity")
if(tgui_selection_mode) if(tgui_selection_mode)
if(params["id_selected"] in tgui_selected_id_multi) 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 var/atom/A = tgui_selected_refs
tgui_selected_type = A.type tgui_selected_type = A.type
tgui_selected_name = A.name tgui_selected_name = A.name
return TRUE
if("narrate") if("narrate")
if(world.time < (tgui_last_message + 0.5 SECONDS)) 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")) 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_type = ""
tgui_selected_name = "" tgui_selected_name = ""
tgui_selected_refs = null tgui_selected_refs = null
return return TRUE
if(isliving(ref)) if(isliving(ref))
var/mob/living/L = ref var/mob/living/L = ref
if(L.client) 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)) else if(istype(ref, /atom))
var/atom/A = ref var/atom/A = ref
narrate_tgui_atom(A, message) narrate_tgui_atom(A, message)
return TRUE
/datum/entity_narrate/proc/narrate_tgui_mob(mob/living/L, message as text) /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. //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 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! 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 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.real_name = user.mob.name_archive
user.mob.name = user.mob.real_name user.mob.name = user.mob.real_name

View File

@@ -1,6 +1,6 @@
GLOBAL_VAR_INIT(global_vantag_hud, 0) 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")) var/confirm = tgui_alert(src, "Make [dropee] drop everything?", "Message", list("Yes", "No"))
if(confirm != "Yes") if(confirm != "Yes")
return return

View File

@@ -1,5 +1,4 @@
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)
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)
user.do_resize(L) //CHOMPEdit user.do_resize(L) //CHOMPEdit
/client/proc/do_resize(var/mob/living/L) //CHOMPEdit /client/proc/do_resize(var/mob/living/L) //CHOMPEdit

View File

@@ -325,13 +325,7 @@
admin_memo_show() 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 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. winset(src, null, "command=\".configure graphics-hwmode on\"")
// (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\"")
log_client_to_db() log_client_to_db()

View File

@@ -67,7 +67,7 @@ GLOBAL_LIST_EMPTY(env_messages)
/mob/living/verb/create_env_message() /mob/living/verb/create_env_message()
set name = "Create Env Message" set name = "Create Env Message"
set desc = "Create an ooc message in the environment for other players to see." 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) if(!istype(src) || !get_turf(src) || !src.ckey)
return return
@@ -92,7 +92,7 @@ GLOBAL_LIST_EMPTY(env_messages)
/mob/living/verb/remove_env_message() /mob/living/verb/remove_env_message()
set name = "Remove Env Message" set name = "Remove Env Message"
set desc = "Remove your current env message." set desc = "Remove your current env message."
set category = "OOC.Game" //CHOMPEdit set category = "OOC.Game"
if(!istype(src) || !src.ckey) if(!istype(src) || !src.ckey)
return return

View File

@@ -432,7 +432,7 @@
tab_data["set_action"] = DIGEST_OWNER tab_data["set_action"] = DIGEST_OWNER
tab_data["tooltip"] = "Displayed to you when your prey gets digested." tab_data["tooltip"] = "Displayed to you when your prey gets digested."
return tab_data return tab_data
if(message_subtab == ABSORBED_MESSAGE) if(message_subtab == ABSORB_MESSAGE)
tab_data["possible_messages"] = list(TO_PREY, TO_YOU) tab_data["possible_messages"] = list(TO_PREY, TO_YOU)
if(!selected_message) if(!selected_message)
selected_message = TO_PREY selected_message = TO_PREY

View File

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