From 9749c73a39ebb3e8400266d1e094518ae3eb4e6c Mon Sep 17 00:00:00 2001 From: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com> Date: Tue, 3 Feb 2026 21:20:10 -0600 Subject: [PATCH] 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: image ## 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) --- code/modules/art/paintings.dm | 4 ++++ tgui/packages/tgui/interfaces/Canvas.tsx | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/code/modules/art/paintings.dm b/code/modules/art/paintings.dm index eec2f93e5fe..45dfa4f179e 100644 --- a/code/modules/art/paintings.dm +++ b/code/modules/art/paintings.dm @@ -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( diff --git a/tgui/packages/tgui/interfaces/Canvas.tsx b/tgui/packages/tgui/interfaces/Canvas.tsx index 5ce942e8163..e1c8777f46f 100644 --- a/tgui/packages/tgui/interfaces/Canvas.tsx +++ b/tgui/packages/tgui/interfaces/Canvas.tsx @@ -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) => { {author} - {date && `- ${new Date(date).getFullYear() + 540}`} + {date && `- ${new Date(date).getFullYear() + year_offset}`} {medium} @@ -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, }} /> );