mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
[MIRROR] Polish the microwave UI (#10748)
Co-authored-by: ShadowLarkens <shadowlarkens@gmail.com>
This commit is contained in:
committed by
GitHub
parent
8691060706
commit
c8c53b84ec
5
code/modules/asset_cache/assets/microwave.dm
Normal file
5
code/modules/asset_cache/assets/microwave.dm
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
/datum/asset/simple/microwave
|
||||||
|
assets = list(
|
||||||
|
"microwave.png" = 'icons/obj/microwave_ui/base.png',
|
||||||
|
"microwave.gif" = 'icons/obj/microwave_ui/microwave.gif',
|
||||||
|
)
|
||||||
@@ -253,7 +253,8 @@
|
|||||||
|
|
||||||
/obj/machinery/microwave/ui_assets(mob/user)
|
/obj/machinery/microwave/ui_assets(mob/user)
|
||||||
return list(
|
return list(
|
||||||
get_asset_datum(/datum/asset/spritesheet_batched/kitchen_recipes)
|
get_asset_datum(/datum/asset/spritesheet_batched/kitchen_recipes),
|
||||||
|
get_asset_datum(/datum/asset/simple/microwave)
|
||||||
)
|
)
|
||||||
|
|
||||||
/obj/machinery/microwave/tgui_static_data(mob/user)
|
/obj/machinery/microwave/tgui_static_data(mob/user)
|
||||||
|
|||||||
BIN
icons/obj/microwave_ui/base.png
Normal file
BIN
icons/obj/microwave_ui/base.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 63 KiB |
BIN
icons/obj/microwave_ui/microwave.gif
Normal file
BIN
icons/obj/microwave_ui/microwave.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 260 KiB |
@@ -1,9 +1,12 @@
|
|||||||
|
import { resolveAsset } from 'tgui/assets';
|
||||||
import { useBackend } from 'tgui/backend';
|
import { useBackend } from 'tgui/backend';
|
||||||
import { Window } from 'tgui/layouts';
|
import { Window } from 'tgui/layouts';
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
Button,
|
Button,
|
||||||
DmIcon,
|
DmIcon,
|
||||||
|
Icon,
|
||||||
|
Image,
|
||||||
Section,
|
Section,
|
||||||
Stack,
|
Stack,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
@@ -44,30 +47,78 @@ export const Microwave = (props) => {
|
|||||||
|
|
||||||
let inner;
|
let inner;
|
||||||
|
|
||||||
|
const first_item = items[0] || null;
|
||||||
|
|
||||||
if (broken) {
|
if (broken) {
|
||||||
inner = (
|
inner = (
|
||||||
<Section fill>
|
<Section fill>
|
||||||
<Box color="bad">Bzzzzttttt!!</Box>
|
<Stack vertical fill align="center" justify="center">
|
||||||
|
<Stack.Item>
|
||||||
|
<Box color="bad" fontSize={6}>
|
||||||
|
Bzzzzttttt!!
|
||||||
|
</Box>
|
||||||
|
</Stack.Item>
|
||||||
|
<Stack.Item>
|
||||||
|
<Stack align="center" justify="space-around">
|
||||||
|
<Stack.Item>
|
||||||
|
<Icon name="fire" color="orange" size={10} />
|
||||||
|
</Stack.Item>
|
||||||
|
<Stack.Item>
|
||||||
|
<Icon name="fire" color="orange" size={10} />
|
||||||
|
</Stack.Item>
|
||||||
|
<Stack.Item>
|
||||||
|
<Icon name="fire" color="orange" size={10} />
|
||||||
|
</Stack.Item>
|
||||||
|
</Stack>
|
||||||
|
</Stack.Item>
|
||||||
|
</Stack>
|
||||||
</Section>
|
</Section>
|
||||||
);
|
);
|
||||||
} else if (operating) {
|
} else if (operating) {
|
||||||
inner = (
|
inner = (
|
||||||
<Section fill>
|
<Section fill>
|
||||||
<Box color="good">
|
<Stack fill vertical align="center" justify="center">
|
||||||
Microwaving in progress!
|
<Stack.Item>
|
||||||
<br />
|
<Box position="relative" className="Microwave__Hover">
|
||||||
Please wait...!
|
<Image src={resolveAsset('microwave.png')} />
|
||||||
|
{first_item ? (
|
||||||
|
<Box
|
||||||
|
position="absolute"
|
||||||
|
className="Microwave__Hover"
|
||||||
|
left={8}
|
||||||
|
top={10}
|
||||||
|
>
|
||||||
|
<DmIcon
|
||||||
|
icon={first_item.icon.icon}
|
||||||
|
icon_state={first_item.icon.icon_state}
|
||||||
|
width="64px"
|
||||||
|
height="64px"
|
||||||
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
|
) : null}
|
||||||
|
<Image
|
||||||
|
position="absolute"
|
||||||
|
left={0}
|
||||||
|
top={0}
|
||||||
|
src={resolveAsset('microwave.gif')}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
</Stack.Item>
|
||||||
|
</Stack>
|
||||||
</Section>
|
</Section>
|
||||||
);
|
);
|
||||||
} else if (dirty) {
|
} else if (dirty) {
|
||||||
inner = (
|
inner = (
|
||||||
<Section fill>
|
<Section fill textAlign="center">
|
||||||
|
<Stack fill vertical align="center" justify="center" fontSize={2}>
|
||||||
|
<Stack.Item>
|
||||||
<Box color="bad">
|
<Box color="bad">
|
||||||
This microwave is dirty!
|
This microwave is dirty!
|
||||||
<br />
|
<br />
|
||||||
Please clean it before use!
|
Please clean it before use!
|
||||||
</Box>
|
</Box>
|
||||||
|
</Stack.Item>
|
||||||
|
</Stack>
|
||||||
</Section>
|
</Section>
|
||||||
);
|
);
|
||||||
} else if (items.length) {
|
} else if (items.length) {
|
||||||
@@ -75,14 +126,20 @@ export const Microwave = (props) => {
|
|||||||
} else {
|
} else {
|
||||||
inner = (
|
inner = (
|
||||||
<Section fill>
|
<Section fill>
|
||||||
<Box color="bad">{config.title} is empty.</Box>
|
<Stack fill align="center" justify="center">
|
||||||
|
<Stack.Item>
|
||||||
|
<Box color="bad" fontSize={2}>
|
||||||
|
{config.title} is empty.
|
||||||
|
</Box>
|
||||||
|
</Stack.Item>
|
||||||
|
</Stack>
|
||||||
</Section>
|
</Section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Window width={520} height={300}>
|
<Window width={520} height={300}>
|
||||||
<Window.Content scrollable>{inner}</Window.Content>
|
<Window.Content>{inner}</Window.Content>
|
||||||
</Window>
|
</Window>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -96,6 +153,7 @@ const MicrowaveContents = (props) => {
|
|||||||
<Section
|
<Section
|
||||||
fill
|
fill
|
||||||
title="Ingredients"
|
title="Ingredients"
|
||||||
|
scrollable
|
||||||
buttons={
|
buttons={
|
||||||
<Stack>
|
<Stack>
|
||||||
<Stack.Item>
|
<Stack.Item>
|
||||||
@@ -201,6 +259,10 @@ const MicrowaveContents = (props) => {
|
|||||||
ml="16px"
|
ml="16px"
|
||||||
mt="16px"
|
mt="16px"
|
||||||
className={classes(['kitchen_recipes32x32', recipe])}
|
className={classes(['kitchen_recipes32x32', recipe])}
|
||||||
|
style={{
|
||||||
|
transform: 'scale(3)',
|
||||||
|
imageRendering: 'pixelated',
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<DmIcon
|
<DmIcon
|
||||||
|
|||||||
15
tgui/packages/tgui/styles/interfaces/Microwave.scss
Normal file
15
tgui/packages/tgui/styles/interfaces/Microwave.scss
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
@keyframes microwave-floating {
|
||||||
|
0% {
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
transform: translateY(-16px);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.Microwave__Hover {
|
||||||
|
animation: microwave-floating 2s ease-in-out infinite;
|
||||||
|
}
|
||||||
@@ -36,6 +36,7 @@
|
|||||||
@include meta.load-css('./interfaces/CrewManifest.scss');
|
@include meta.load-css('./interfaces/CrewManifest.scss');
|
||||||
@include meta.load-css('./interfaces/ExperimentConfigure.scss');
|
@include meta.load-css('./interfaces/ExperimentConfigure.scss');
|
||||||
@include meta.load-css('./interfaces/FishingMinigame.scss');
|
@include meta.load-css('./interfaces/FishingMinigame.scss');
|
||||||
|
@include meta.load-css('./interfaces/Microwave.scss');
|
||||||
@include meta.load-css('./interfaces/NuclearBomb.scss');
|
@include meta.load-css('./interfaces/NuclearBomb.scss');
|
||||||
@include meta.load-css('./interfaces/Paper.scss');
|
@include meta.load-css('./interfaces/Paper.scss');
|
||||||
@include meta.load-css('./interfaces/Pda.scss');
|
@include meta.load-css('./interfaces/Pda.scss');
|
||||||
|
|||||||
@@ -2141,6 +2141,7 @@
|
|||||||
#include "code\modules\asset_cache\assets\fontawesome.dm"
|
#include "code\modules\asset_cache\assets\fontawesome.dm"
|
||||||
#include "code\modules\asset_cache\assets\icon_ref_map.dm"
|
#include "code\modules\asset_cache\assets\icon_ref_map.dm"
|
||||||
#include "code\modules\asset_cache\assets\jquery.dm"
|
#include "code\modules\asset_cache\assets\jquery.dm"
|
||||||
|
#include "code\modules\asset_cache\assets\microwave.dm"
|
||||||
#include "code\modules\asset_cache\assets\ntos.dm"
|
#include "code\modules\asset_cache\assets\ntos.dm"
|
||||||
#include "code\modules\asset_cache\assets\permissions.dm"
|
#include "code\modules\asset_cache\assets\permissions.dm"
|
||||||
#include "code\modules\asset_cache\assets\preferences.dm"
|
#include "code\modules\asset_cache\assets\preferences.dm"
|
||||||
|
|||||||
Reference in New Issue
Block a user