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

TGUIv4 - Adjustments, Fixes, and Tweaks v3 #23807

Merged
merged 11 commits into from
Jan 21, 2024
3 changes: 1 addition & 2 deletions code/modules/atmospherics/machinery/airalarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -784,8 +784,7 @@

else if(ishuman(user))
for(var/obj/machinery/computer/atmoscontrol/AC in range(1, user))
var/datum/tgui/active_ui = SStgui.get_open_ui(user, AC)
if(istype(active_ui) && !AC.stat && is_authenticated(user, active_ui))
if(!AC.stat)
return GLOB.always_state

return GLOB.default_state
Expand Down
1 change: 0 additions & 1 deletion code/modules/hydroponics/hydroponics_tray.dm
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,6 @@
to_chat(user, "- Toxicity level: <span class='notice'>[toxic] / 100</span>")
to_chat(user, "- Water level: <span class='notice'>[waterlevel] / [maxwater]</span>")
to_chat(user, "- Nutrition level: <span class='notice'>[nutrilevel] / [maxnutri]</span>")
to_chat(user, "")

else if(istype(O, /obj/item/cultivator))
if(weedlevel > 0)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/hydroponics/seed_extractor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,13 @@
. = FALSE
switch(action)
if("vend")
vend_seed(text2num(params["seedid"]), params["seedvariant"], vend_amount)
vend_seed(params["seedid"], params["seedvariant"], vend_amount)
add_fingerprint(usr)
. = TRUE
if("set_vend_amount")
if(!length(params["vend_amount"]))
return
vend_amount = clamp(text2num(params["vend_amount"]), 1, MAX_DISPENSE_SEEDS)
vend_amount = clamp(params["vend_amount"], 1, MAX_DISPENSE_SEEDS)
add_fingerprint(usr)
. = TRUE

Expand Down
2 changes: 0 additions & 2 deletions code/modules/tgui/modules/atmos_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
alarm.ui_interact(usr)

/datum/ui_module/atmos_control/ui_state(mob/user)
if(issilicon(usr))
return GLOB.self_state
if(isliving(usr))
return GLOB.human_adjacent_state
return GLOB.default_state
Expand Down
2 changes: 0 additions & 2 deletions code/modules/tgui/modules/crew_monitor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
viewing_current_z_level = text2num(params["new_level"])

/datum/ui_module/crew_monitor/ui_state(mob/user)
if(issilicon(user))
return GLOB.self_state
return GLOB.default_state

/datum/ui_module/crew_monitor/ui_interact(mob/user, datum/tgui/ui = null)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/tgui/modules/ert_manager.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
if(cyborg_slots > 0)
slots_list += "cyborg: [cyborg_slots]"

var/silenced = text2bool(params["silent"])
var/silenced = (params["silent"])
D.silent = silenced

var/slot_text = english_list(slots_list)
Expand Down
3 changes: 0 additions & 3 deletions code/modules/tgui/modules/power_monitor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
powermonitor = ui_host()

/datum/ui_module/power_monitor/ui_state(mob/user)
if(issilicon(user))
return GLOB.self_state

return GLOB.default_state

/datum/ui_module/power_monitor/ui_interact(mob/user, datum/tgui/ui = null)
Expand Down
2 changes: 2 additions & 0 deletions tgui/bin/tgui-inspect-dev-tools.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
start %systemroot%\system32\f12\IEChooser.exe
2 changes: 1 addition & 1 deletion tgui/packages/tgui/interfaces/CloningConsole.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const viewRecordModalBodyOverride = (modal, context) => {
modal.args;
const damages = health.split(' - ');
return (
<Section level={2} m="-1rem" pb="1rem" title={'Records of ' + realname}>
<Section level={2} m="-1rem" pb="1.5rem" title={'Records of ' + realname}>
<LabeledList>
<LabeledList.Item label="Name">{realname}</LabeledList.Item>
<LabeledList.Item label="Damage">
Expand Down
44 changes: 26 additions & 18 deletions tgui/packages/tgui/interfaces/ExosuitFabricator.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const ExosuitFabricator = (properties, context) => {
const { act, data } = useBackend(context);
const { building } = data;
return (
<Window width={800} height={600}>
<Window width={950} height={625}>
<Window.Content className="Exofab">
<Stack fill>
<Stack.Item grow>
Expand Down Expand Up @@ -89,6 +89,7 @@ const Materials = (properties, context) => {
'plastic',
].map((name) => (
<MaterialCount
mt={-2}
key={name}
id={name}
bold={name === 'metal' || name === 'glass'}
Expand Down Expand Up @@ -118,7 +119,7 @@ const Designs = (properties, context) => {
className="Exofab__designs"
title={
<Dropdown
width="150px"
className="Exofab__dropdown"
selected={curCategory}
options={categories}
onSelected={(cat) =>
Expand Down Expand Up @@ -172,19 +173,22 @@ const Building = (properties, context) => {
start={buildStart}
current={worldTime}
end={buildEnd}
bold
>
<Box float="left">
<Icon name="cog" spin />
</Box>
Building {building}
&nbsp;(
<Countdown
current={worldTime}
timeLeft={buildEnd - worldTime}
format={(v, f) => f.substr(3)}
/>
)
<Stack>
<Stack.Item>
<Icon name="cog" spin />
</Stack.Item>
<Stack.Item>
Building {building}
&nbsp;(
<Countdown
current={worldTime}
timeLeft={buildEnd - worldTime}
format={(v, f) => f.substr(3)}
/>
)
</Stack.Item>
</Stack>
</ProgressBar.Countdown>
</Section>
);
Expand Down Expand Up @@ -333,6 +337,8 @@ const MaterialCount = (properties, context) => {
<Stack.Item
className="Exofab__material--amount"
color={insufficient && 'bad'}
ml={0}
mr={1}
>
{curAmount.toLocaleString('en-US')}
</Stack.Item>
Expand Down Expand Up @@ -372,10 +378,12 @@ const Design = (properties, context) => {
</Box>
))}
</Box>
<Box className="Exofab__design--time">
<Icon name="clock" />
{design.time > 0 ? <>{design.time / 10} seconds</> : 'Instant'}
</Box>
<Stack className="Exofab__design--time">
<Stack.Item>
<Icon name="clock" />
{design.time > 0 ? <>{design.time / 10} seconds</> : 'Instant'}
</Stack.Item>
</Stack>
</Box>
);
};
4 changes: 2 additions & 2 deletions tgui/packages/tgui/interfaces/LibraryComputer.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const reportModalBodyOverride = (modal, context) => {
<Section
level={2}
m="-1rem"
pb="1rem"
pb="1.5rem"
title="Report this book for Rule Violations"
>
<LabeledList>
Expand Down Expand Up @@ -187,7 +187,7 @@ const rateModalBodyOverride = (modal, context) => {
const { user_ckey } = data;

return (
<Section level={2} m="-1rem" pb="1rem">
<Section level={2} m="-1rem" pb="1.5rem">
<LabeledList>
<LabeledList.Item label="Title">{rate_content.title}</LabeledList.Item>
<LabeledList.Item label="Author">
Expand Down
2 changes: 1 addition & 1 deletion tgui/packages/tgui/interfaces/MedicalRecords.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const doEdit = (context, field) => {
const virusModalBodyOverride = (modal, context) => {
const virus = modal.args;
return (
<Section m="-1rem" pb="1rem" title={virus.name || 'Virus'}>
<Section m="-1rem" pb="1.5rem" title={virus.name || 'Virus'}>
<Box mx="0.5rem">
<LabeledList>
<LabeledList.Item label="Number of stages">
Expand Down
6 changes: 3 additions & 3 deletions tgui/packages/tgui/interfaces/Newscaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ const manageChannelModalBodyOverride = (modal, context) => {
return (
<Section
m="-1rem"
pb="1rem"
pb="1.5rem"
title={isEditing ? 'Manage ' + channel.name : 'Create New Channel'}
>
<Box mx="0.5rem">
Expand Down Expand Up @@ -748,7 +748,7 @@ const createStoryModalBodyOverride = (modal, context) => {
false
);
return (
<Section m="-1rem" pb="1rem" title="Create New Story">
<Section m="-1rem" pb="1.5rem" title="Create New Story">
<Box mx="0.5rem">
<LabeledList>
<LabeledList.Item label="Author">
Expand Down Expand Up @@ -892,7 +892,7 @@ const wantedNoticeModalBodyOverride = (modal, context) => {
wanted?.admin_locked === 1 || false
);
return (
<Section m="-1rem" pb="1rem" title="Manage Wanted Notice">
<Section m="-1rem" pb="1.5rem" title="Manage Wanted Notice">
<Box mx="0.5rem">
<LabeledList>
<LabeledList.Item label="Authority">
Expand Down
11 changes: 7 additions & 4 deletions tgui/packages/tgui/interfaces/common/ComplexModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,16 @@ export const ComplexModal = (props, context) => {
const { id, text, type } = data.modal;

let modalOnEnter;
let modalBody;
let modalFooter = (
let modalHeader = (
<Button
className="Button--modal"
icon="arrow-left"
content="Cancel"
color="grey"
onClick={() => modalClose(context)}
/>
);
let modalBody;
let modalFooter;
let overflowY = 'auto';

// Different contents depending on the type
Expand Down Expand Up @@ -185,8 +186,10 @@ export const ComplexModal = (props, context) => {
onEnter={modalOnEnter}
mx="auto"
overflowY={overflowY}
padding-bottom="5px"
>
<Box inline>{text}</Box>
{text && <Box inline>{text}</Box>}
{bodyOverrides[id] && modalHeader}
{modalBody}
{modalFooter}
</Modal>
Expand Down
6 changes: 6 additions & 0 deletions tgui/packages/tgui/styles/components/Button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,9 @@ $bg-map: colors.$bg-map !default;
.Button--selected {
@include button-color($color-selected);
}

.Button--modal {
float: right;
z-index: 1;
margin-top: -0.5rem;
}
2 changes: 1 addition & 1 deletion tgui/packages/tgui/styles/components/Dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@
white-space: nowrap;
height: base.em(17px);
width: calc(100% - 1.2em);
text-align: center;
text-align: left;
padding-top: 2.5px;
}
21 changes: 17 additions & 4 deletions tgui/packages/tgui/styles/interfaces/ExosuitFabricator.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
&--cost {
display: inline-block;
vertical-align: middle;
margin-top: 0.33rem;
margin-top: 0.25rem;

& > div {
display: inline-block;
Expand Down Expand Up @@ -122,13 +122,26 @@
}

.Exofab__building {
height: 40px;
height: 45px;

.ProgressBar {
width: 100%;
height: 100%;
height: 75%;
}
.ProgressBar__content {
line-height: 22px;
line-height: 26px;
text-align: right;
font-size: 12px;
font-weight: bold;
display: flex;
justify-content: flex-end;
}
}

.Exofab__dropdown {
line-height: 14px;
font-size: 12px;
width: 225px;
height: 85%;
margin-top: 1.5px;
}
2 changes: 1 addition & 1 deletion tgui/public/tgui-panel.bundle.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tgui/public/tgui.bundle.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tgui/public/tgui.bundle.js

Large diffs are not rendered by default.