mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-30 07:28:53 +01:00
boolean... (#19205)
* boolean... * move to right secton * disconnect should be red * sync all styles * more ui theming * radio * also fix that
This commit is contained in:
@@ -30,3 +30,9 @@
|
||||
return
|
||||
|
||||
src.attack_self(usr)
|
||||
|
||||
/obj/item/communicator/integrated/tgui_static_data(mob/user)
|
||||
. = ..()
|
||||
if(isrobot(loc))
|
||||
var/mob/living/silicon/robot/robot_owner = loc
|
||||
.["theme"] = robot_owner.get_ui_theme()
|
||||
|
||||
@@ -143,6 +143,12 @@
|
||||
ui = new(user, src, "Radio", name, parent_ui)
|
||||
ui.open()
|
||||
|
||||
/obj/item/radio/tgui_static_data(mob/user)
|
||||
. = ..()
|
||||
if(isrobot(loc))
|
||||
var/mob/living/silicon/robot/robot_owner = loc
|
||||
.["theme"] = robot_owner.get_ui_theme()
|
||||
|
||||
/obj/item/radio/tgui_data(mob/user)
|
||||
var/data = list()
|
||||
|
||||
@@ -163,9 +169,9 @@
|
||||
data["chan_list"] = null
|
||||
|
||||
if(syndie)
|
||||
data["useSyndMode"] = 1
|
||||
data["useSyndMode"] = TRUE
|
||||
else
|
||||
data["useSyndMode"] = 0
|
||||
data["useSyndMode"] = FALSE
|
||||
|
||||
|
||||
data["minFrequency"] = PUBLIC_LOW_FREQ
|
||||
|
||||
@@ -57,9 +57,7 @@
|
||||
var/datum/asset/spritesheet_batched/robot_icons/spritesheet = GLOB.robot_sprite_sheets[target.modtype]
|
||||
|
||||
if(target)
|
||||
var/ui_theme = target.get_ui_theme()
|
||||
if(ui_theme)
|
||||
.["theme"] = ui_theme
|
||||
.["theme"] = target.get_ui_theme()
|
||||
.["target"] = list()
|
||||
.["target"]["name"] = target.name
|
||||
.["target"]["ckey"] = target.ckey
|
||||
|
||||
@@ -310,7 +310,7 @@
|
||||
"deliveryslot_3" = deliveryslot_3,
|
||||
"items_preserved" = items_preserved,
|
||||
"has_destructive_analyzer" = analyzer,
|
||||
"techweb_name" = handler?.linked_web ? "[handler.linked_web.id] / [handler.linked_web.organization]" : "Disconnected",
|
||||
"techweb_name" = handler?.linked_web ? "[handler.linked_web.id] / [handler.linked_web.organization]" : null
|
||||
)
|
||||
return data
|
||||
/obj/item/dogborg/sleeper/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
var/shown_robot_modules = 0 //Used to determine whether they have the module menu shown or not
|
||||
var/atom/movable/screen/robot_modules_background
|
||||
|
||||
var/ui_theme
|
||||
var/ui_theme = "ntos"
|
||||
var/selecting_module = FALSE
|
||||
|
||||
//3 Modules can be activated at any one time.
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
..()
|
||||
|
||||
/datum/robot_sprite/dogborg/command
|
||||
sprite_hud_icon_state = "clerical"
|
||||
name = "Commandhound V2"
|
||||
sprite_icon_state = "kcom"
|
||||
has_eye_light_sprites = TRUE
|
||||
|
||||
@@ -34,6 +34,12 @@
|
||||
/obj/item/pda/ai/can_use()
|
||||
return 1
|
||||
|
||||
/obj/item/pda/ai/tgui_static_data(mob/user)
|
||||
. = ..()
|
||||
if(isrobot(loc))
|
||||
var/mob/living/silicon/robot/robot_owner = loc
|
||||
.["theme"] = robot_owner.get_ui_theme()
|
||||
|
||||
/obj/item/pda/ai/attack_self(mob/user)
|
||||
. = ..(user)
|
||||
if(.)
|
||||
|
||||
@@ -314,6 +314,13 @@
|
||||
ui = new(user, src, "ExperimentConfigure", "[parent_atom ? "[parent_atom.name] | " : ""]Experiment Configuration")
|
||||
ui.open()
|
||||
|
||||
/datum/component/experiment_handler/tgui_static_data(mob/user)
|
||||
. = ..()
|
||||
var/atom/parent_atom = parent
|
||||
if(isrobot(parent_atom.loc))
|
||||
var/mob/living/silicon/robot/owner_robot = parent_atom.loc
|
||||
.["theme"] = owner_robot.get_ui_theme()
|
||||
|
||||
/datum/component/experiment_handler/tgui_data(mob/user)
|
||||
. = list(
|
||||
"always_active" = (config_flags & EXPERIMENT_CONFIG_ALWAYS_ACTIVE),
|
||||
|
||||
@@ -172,6 +172,12 @@
|
||||
ui = new(user, src, "XenoarchDepthScanner", name)
|
||||
ui.open()
|
||||
|
||||
/obj/item/depth_scanner/tgui_static_data(mob/user)
|
||||
. = ..()
|
||||
if(isrobot(loc))
|
||||
var/mob/living/silicon/robot/robot_owner = loc
|
||||
.["theme"] = robot_owner.get_ui_theme()
|
||||
|
||||
/obj/item/depth_scanner/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
|
||||
var/list/data = ..()
|
||||
|
||||
|
||||
@@ -11,11 +11,7 @@ export const BorgHypo = (props) => {
|
||||
const { data } = useBackend<Data>();
|
||||
const { isDispensingDrinks, theme } = data;
|
||||
return (
|
||||
<Window
|
||||
width={680}
|
||||
height={isDispensingDrinks ? 610 : 540}
|
||||
theme={theme || 'ntos'}
|
||||
>
|
||||
<Window width={680} height={isDispensingDrinks ? 610 : 540} theme={theme}>
|
||||
<Window.Content>
|
||||
<Stack fill>
|
||||
<Stack.Item grow>
|
||||
|
||||
@@ -14,5 +14,5 @@ export type Data = {
|
||||
selectedRecipeId: string;
|
||||
uiChemicalSearch: string;
|
||||
isDispensingDrinks: BooleanLike;
|
||||
theme: string | null;
|
||||
theme: string;
|
||||
};
|
||||
|
||||
@@ -25,7 +25,7 @@ import type { Data } from './types';
|
||||
export const Communicator = () => {
|
||||
const { act, data } = useBackend<Data>();
|
||||
|
||||
const { currentTab, video_comm } = data;
|
||||
const { theme, currentTab, video_comm } = data;
|
||||
|
||||
const tab: React.JSX.Element[] = [];
|
||||
|
||||
@@ -49,7 +49,7 @@ export const Communicator = () => {
|
||||
tab[tabs[9]] = <CommunicatorSettingsTab />;
|
||||
|
||||
return (
|
||||
<Window width={475} height={700}>
|
||||
<Window width={475} height={700} theme={theme}>
|
||||
<Window.Content>
|
||||
{video_comm && (
|
||||
<VideoComm
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { BooleanLike } from 'tgui-core/react';
|
||||
|
||||
export type Data = {
|
||||
theme?: string;
|
||||
// GENERAL
|
||||
currentTab: number;
|
||||
video_comm: BooleanLike;
|
||||
|
||||
@@ -33,6 +33,7 @@ type ExperimentData = {
|
||||
type Stage = [string, string, number, number];
|
||||
|
||||
type Data = {
|
||||
theme?: string;
|
||||
always_active: boolean;
|
||||
experiments: ExperimentData[];
|
||||
has_start_callback: boolean;
|
||||
@@ -175,7 +176,7 @@ export function Experiment(props) {
|
||||
|
||||
export function ExperimentConfigure(props) {
|
||||
const { act, data } = useBackend<Data>();
|
||||
const { always_active, has_start_callback } = data;
|
||||
const { theme, always_active, has_start_callback } = data;
|
||||
|
||||
const techwebs = data.techwebs ?? [];
|
||||
|
||||
@@ -205,7 +206,7 @@ export function ExperimentConfigure(props) {
|
||||
}
|
||||
|
||||
return (
|
||||
<Window width={600} height={735}>
|
||||
<Window width={600} height={735} theme={theme}>
|
||||
<Window.Content scrollable>
|
||||
<Section title="Servers">
|
||||
<Box color="label">
|
||||
|
||||
@@ -147,11 +147,7 @@ export const ModifyRobot = (props) => {
|
||||
);
|
||||
|
||||
return (
|
||||
<Window
|
||||
width={target?.module ? 900 : 400}
|
||||
height={700}
|
||||
theme={theme || 'ntos'}
|
||||
>
|
||||
<Window width={target?.module ? 900 : 400} height={700} theme={theme}>
|
||||
<Window.Content>
|
||||
<Stack fill vertical>
|
||||
<Stack.Item>
|
||||
|
||||
@@ -38,7 +38,7 @@ export type Data = {
|
||||
law_sets: law_pack[];
|
||||
active_ais: DropdownEntry[];
|
||||
selected_ai: string | null;
|
||||
theme: string | null;
|
||||
theme: string;
|
||||
};
|
||||
|
||||
export type DropdownEntry = {
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
import type { BooleanLike } from 'tgui-core/react';
|
||||
|
||||
type Data = {
|
||||
theme?: string;
|
||||
owner: string;
|
||||
ownjob: string;
|
||||
idInserted: BooleanLike;
|
||||
@@ -57,13 +58,13 @@ function getPdaApp(name: string): () => React.JSX.Element {
|
||||
export const Pda = (props) => {
|
||||
const { data } = useBackend<Data>();
|
||||
|
||||
const { app, owner, useRetro } = data;
|
||||
const { theme, app, owner, useRetro } = data;
|
||||
|
||||
const [settingsMode, setSettingsMode] = useState<BooleanLike>(false);
|
||||
|
||||
if (!owner) {
|
||||
return (
|
||||
<Window>
|
||||
<Window theme={theme}>
|
||||
<Window.Content>
|
||||
<Section stretchContents>
|
||||
Warning: No ID information found! Please swipe ID!
|
||||
@@ -76,7 +77,7 @@ export const Pda = (props) => {
|
||||
const App = getPdaApp(app.template);
|
||||
|
||||
return (
|
||||
<Window width={580} height={670} theme={useRetro ? 'pda_retro' : undefined}>
|
||||
<Window width={580} height={670} theme={useRetro ? 'pda_retro' : theme}>
|
||||
<Window.Content scrollable>
|
||||
<PDAHeader
|
||||
settingsMode={settingsMode}
|
||||
|
||||
@@ -12,6 +12,7 @@ import { round, toFixed } from 'tgui-core/math';
|
||||
import type { BooleanLike } from 'tgui-core/react';
|
||||
|
||||
type Data = {
|
||||
theme?: string;
|
||||
rawfreq: number;
|
||||
listening: BooleanLike;
|
||||
broadcasting: BooleanLike;
|
||||
@@ -37,6 +38,7 @@ type Data = {
|
||||
export const Radio = (props) => {
|
||||
const { act, data } = useBackend<Data>();
|
||||
const {
|
||||
theme,
|
||||
rawfreq,
|
||||
minFrequency,
|
||||
maxFrequency,
|
||||
@@ -66,7 +68,11 @@ export const Radio = (props) => {
|
||||
height += 38;
|
||||
}
|
||||
return (
|
||||
<Window width={310} height={height} theme={useSyndMode ? 'syndicate' : ''}>
|
||||
<Window
|
||||
width={310}
|
||||
height={height}
|
||||
theme={useSyndMode ? 'syndicate' : theme}
|
||||
>
|
||||
<Window.Content>
|
||||
<Section>
|
||||
<LabeledList>
|
||||
|
||||
@@ -24,7 +24,7 @@ export const RobotChoose = (props) => {
|
||||
} = data;
|
||||
|
||||
return (
|
||||
<Window width={800} height={605} theme={theme || 'ntos'}>
|
||||
<Window width={800} height={605} theme={theme}>
|
||||
<Window.Content>
|
||||
<Stack fill>
|
||||
<Stack.Item basis="30%">
|
||||
|
||||
@@ -4,7 +4,7 @@ export type Data = {
|
||||
possible_sprites?: spriteOption[];
|
||||
currentName: string;
|
||||
isDefaultName: boolean;
|
||||
theme: string | null;
|
||||
theme: string;
|
||||
selected_module?: string;
|
||||
sprite_datum?: string | null;
|
||||
sprite_datum_class?: string | null;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Box, Button, Input, Section, Stack } from 'tgui-core/components';
|
||||
import { createSearch } from 'tgui-core/string';
|
||||
|
||||
type Data = {
|
||||
theme: string | null;
|
||||
theme: string;
|
||||
all_decals?: string[] | null;
|
||||
all_animations?: string[] | null;
|
||||
active_decals: string[];
|
||||
@@ -28,7 +28,7 @@ export const RobotDecals = () => {
|
||||
const filteredAnimations = all_animations?.filter(animationSearcher) ?? [];
|
||||
|
||||
return (
|
||||
<Window width={350} height={400} theme={theme || 'ntos'}>
|
||||
<Window width={350} height={400} theme={theme}>
|
||||
<Window.Content>
|
||||
<Stack fill>
|
||||
<Stack.Item grow>
|
||||
|
||||
+1
-13
@@ -5,22 +5,10 @@ import type { Data } from '../../types';
|
||||
|
||||
export const SleeperButtons = (props) => {
|
||||
const { act, data } = useBackend<Data>();
|
||||
const {
|
||||
eject_port,
|
||||
cleaning,
|
||||
medsensor,
|
||||
name,
|
||||
has_destructive_analyzer,
|
||||
techweb_name,
|
||||
} = data;
|
||||
const { eject_port, cleaning, medsensor, name } = data;
|
||||
|
||||
return (
|
||||
<>
|
||||
{has_destructive_analyzer && (
|
||||
<Stack.Item>
|
||||
<Box color="label">Tech Web: {techweb_name}</Box>
|
||||
</Stack.Item>
|
||||
)}
|
||||
<Stack.Item>
|
||||
<Stack align="center">
|
||||
<Stack.Item>
|
||||
|
||||
+15
@@ -16,12 +16,27 @@ export const SleeperStatusPanel = (props: { name: string }) => {
|
||||
ore_storage,
|
||||
current_capacity,
|
||||
max_ore_storage,
|
||||
has_destructive_analyzer,
|
||||
techweb_name,
|
||||
} = data;
|
||||
const { name } = props;
|
||||
|
||||
return (
|
||||
<Section fill scrollable>
|
||||
<Stack fill vertical>
|
||||
{!!has_destructive_analyzer && (
|
||||
<>
|
||||
<Stack.Item>
|
||||
<Box color="label" inline>
|
||||
Tech Web:
|
||||
</Box>
|
||||
<Box inline preserveWhitespace color={!techweb_name && 'red'}>
|
||||
{` ${techweb_name || 'Disconnected'}`}
|
||||
</Box>
|
||||
</Stack.Item>
|
||||
<Stack.Divider />
|
||||
</>
|
||||
)}
|
||||
{(!!delivery || !!compactor) && !!contents.length && (
|
||||
<>
|
||||
<Stack.Item>
|
||||
|
||||
@@ -11,7 +11,7 @@ export const RobotSleeper = (props) => {
|
||||
|
||||
const { theme, chems, delivery, name } = data;
|
||||
return (
|
||||
<Window width={450} height={500} theme={theme || 'ntos'}>
|
||||
<Window width={450} height={500} theme={theme}>
|
||||
<Window.Content>
|
||||
<Stack vertical fill>
|
||||
{!!chems && (
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { BooleanLike } from 'tgui-core/react';
|
||||
|
||||
export type Data = {
|
||||
name?: string;
|
||||
theme: string | null;
|
||||
theme: string;
|
||||
chems?: RobotChem[];
|
||||
|
||||
our_patient: Patient | null;
|
||||
@@ -23,7 +23,7 @@ export type Data = {
|
||||
deliveryslot_3: string[];
|
||||
items_preserved: string[];
|
||||
has_destructive_analyzer: BooleanLike;
|
||||
techweb_name: string;
|
||||
techweb_name: string | null;
|
||||
};
|
||||
|
||||
export type RobotChem = { id: string; name: string };
|
||||
|
||||
@@ -18,7 +18,7 @@ export const Robotact = (props) => {
|
||||
}
|
||||
|
||||
return (
|
||||
<Window width={800} height={600} theme={data.theme || 'ntos'}>
|
||||
<Window width={800} height={600} theme={data.theme}>
|
||||
<Window.Content>{content}</Window.Content>
|
||||
</Window>
|
||||
);
|
||||
|
||||
@@ -31,7 +31,7 @@ export type Data = {
|
||||
max_health: number;
|
||||
|
||||
light_color: string;
|
||||
theme: string | null;
|
||||
theme: string;
|
||||
|
||||
// Modules
|
||||
modules_static: Module[];
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Window } from 'tgui/layouts';
|
||||
import { Box, Button, LabeledList, Section } from 'tgui-core/components';
|
||||
|
||||
type Data = {
|
||||
theme?: string;
|
||||
current: {
|
||||
index: string;
|
||||
time: string;
|
||||
@@ -16,10 +17,10 @@ type Data = {
|
||||
export const XenoarchDepthScanner = (props) => {
|
||||
const { act, data } = useBackend<Data>();
|
||||
|
||||
const { current, positive_locations } = data;
|
||||
const { theme, current, positive_locations } = data;
|
||||
|
||||
return (
|
||||
<Window width={300} height={500}>
|
||||
<Window width={300} height={500} theme={theme}>
|
||||
<Window.Content scrollable>
|
||||
{(Object.keys(current).length && (
|
||||
<Section
|
||||
|
||||
Reference in New Issue
Block a user