canvas year is properly synced with STATION_YEAR_OFFSET define (#95067)

## About The Pull Request
Passes the define to the UI via static data.

Works fine: 
<img width="419" height="596" alt="image"
src="https://github.com/user-attachments/assets/e84ed5df-ae72-43b4-a266-fa8fc9dd6533"
/>

## Why It's Good For The Game
We have defines for a reason, even if its a bit annoying, tsx files
should respect them as well.
## Changelog
N/A. unless your a downstream that changed the define number (Hi that's
me)
This commit is contained in:
FalloutFalcon
2026-02-03 22:20:10 -05:00
committed by GitHub
parent 2f87da7532
commit 9749c73a39
2 changed files with 10 additions and 2 deletions
+4
View File
@@ -132,6 +132,10 @@ GLOBAL_LIST_INIT(canvas_dimensions, init_canvas_dimensions())
ui_interact(user)
return ITEM_INTERACT_SUCCESS
/obj/item/canvas/ui_static_data(mob/user)
. = ..()
.["year_offset"] = STATION_YEAR_OFFSET
/obj/item/canvas/ui_data(mob/user)
. = ..()
var/list/metadata = list(
+6 -2
View File
@@ -30,6 +30,7 @@ type CanvasData = {
editable: BooleanLike;
allowColorPicker: BooleanLike;
showPlaque: BooleanLike;
year_offset: number;
};
type ZoomProps = {
@@ -222,7 +223,7 @@ const EditableCanvas = (props: EditableCanvasProps) => {
type FinalizedCanvasProps = { data: AdvancedCanvasPropsBase['data'] } & Pick<
CanvasData,
'metadata' | 'showPlaque'
'metadata' | 'showPlaque' | 'year_offset'
> &
CanvasCommonProps;
@@ -236,6 +237,7 @@ const FinalizedCanvas = (props: FinalizedCanvasProps) => {
pixelsPerUnit,
width,
height,
year_offset,
} = props;
const { title, author, date, medium, patron } = metadata;
const { act } = useBackend();
@@ -270,7 +272,7 @@ const FinalizedCanvas = (props: FinalizedCanvasProps) => {
</Box>
<Box bold>
{author}
{date && `- ${new Date(date).getFullYear() + 540}`}
{date && `- ${new Date(date).getFullYear() + year_offset}`}
</Box>
<Box italic>{medium}</Box>
<Box italic>
@@ -300,6 +302,7 @@ export const Canvas = () => {
editable,
allowColorPicker,
showPlaque,
year_offset,
} = data;
const { sprite } = editorData;
const { width, height } = sprite;
@@ -320,6 +323,7 @@ export const Canvas = () => {
zoom,
setZoom,
pixelsPerUnit,
year_offset,
}}
/>
);