Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
doom committed Sep 29, 2023
1 parent 0f85e1c commit dc1091a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
16 changes: 11 additions & 5 deletions code/controllers/subsystem/minimap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,9 @@ SUBSYSTEM_DEF(minimaps)
if(!ui)
current_map = get_current_tacmap_data(user, TRUE)
current_svg = get_current_tacmap_data(user, FALSE)
if(!current_map)
distribute_current_map_png(user)
current_map = get_current_tacmap_data(user, TRUE)


user.client.register_map_obj(map_holder.map)
Expand Down Expand Up @@ -616,9 +619,6 @@ SUBSYSTEM_DEF(minimaps)
if(ishuman(user) && skillcheck(user, SKILL_LEADERSHIP, SKILL_LEAD_EXPERT) || isqueen(user) && xeno_user.hivenumber == XENO_HIVE_NORMAL)
data["canDraw"] = TRUE
data["canViewHome"] = TRUE
if(!current_map)
distribute_current_map_png(user)
current_map = get_current_tacmap_data(user, TRUE)

return data

Expand Down Expand Up @@ -646,10 +646,16 @@ SUBSYSTEM_DEF(minimaps)
var/user = ui.user

switch (action)
if ("menuSelect")
if(params["selection"] == "new canvas")
distribute_current_map_png(user) // not updating?
current_map = get_current_tacmap_data(user, TRUE)

. = TRUE

if ("updateCanvas")
// forces state change
toolbar_updated_selection = "export"
distribute_current_map_png(user)
current_map = get_current_tacmap_data(user, TRUE)
updated_canvas = TRUE
. = TRUE

Expand Down
7 changes: 5 additions & 2 deletions tgui/packages/tgui/interfaces/TacticalMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,11 @@ export const TacticalMap = (props, context) => {
const [pageIndex, setPageIndex] = useLocalState(context, 'pageIndex', 0);
const PageComponent = PAGES[pageIndex].component();

const handleTacmapOnClick = (i) => {
const handleTacmapOnClick = (i, pageTitle) => {
setPageIndex(i);
act('menuSelect', {
selection: pageTitle,
});
};

return (
Expand All @@ -114,7 +117,7 @@ export const TacticalMap = (props, context) => {
color={data.isXeno ? 'purple' : 'blue'}
selected={i === pageIndex}
icon={page.icon}
onClick={() => handleTacmapOnClick(i)}>
onClick={() => handleTacmapOnClick(i, page.title)}>
{page.title}
</Tabs.Tab>
);
Expand Down

0 comments on commit dc1091a

Please sign in to comment.