Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
doom committed Oct 3, 2023
1 parent 8938278 commit abbff0d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
26 changes: 17 additions & 9 deletions code/controllers/subsystem/minimap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -577,12 +577,16 @@ SUBSYSTEM_DEF(minimaps)

ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
current_map = get_current_tacmap_data(user, TRUE)
current_svg = get_current_tacmap_data(user, FALSE)
if(!current_map)
if(!distribute_current_map_png(user))
return


var/mob/living/carbon/xenomorph/xeno = user
if(ishuman(user) || isxeno(user) && xeno.hivenumber == XENO_HIVE_NORMAL)
current_map = get_current_tacmap_data(user, TRUE)
current_svg = get_current_tacmap_data(user, FALSE)
if(!current_map)
if(!distribute_current_map_png(user))
return
current_map = get_current_tacmap_data(user, TRUE)


user.client.register_map_obj(map_holder.map)
Expand Down Expand Up @@ -616,19 +620,22 @@ SUBSYSTEM_DEF(minimaps)
var/list/data = list()

data["canDraw"] = FALSE
data["canViewHome"] = FALSE
data["canViewTacmap"] = FALSE
data["canViewCanvas"] = TRUE
data["isXeno"] = FALSE
data["currentMapName"] = SSmapping.configs?[GROUND_MAP].map_name

var/mob/living/carbon/xenomorph/xeno_user
if(isxeno(user))
xeno_user = user
data["isXeno"] = TRUE
data["canViewHome"] = TRUE
if(xeno_user.hivenumber != XENO_HIVE_NORMAL)
data["canViewCanvas"] = FALSE
data["canViewTacmap"] = TRUE

if(ishuman(user) && skillcheck(user, SKILL_LEADERSHIP, SKILL_LEAD_EXPERT) || isqueen(user) && xeno_user.hivenumber == XENO_HIVE_NORMAL)
data["canDraw"] = TRUE
data["canViewHome"] = TRUE
data["canViewTacmap"] = TRUE

return data

Expand All @@ -637,7 +644,8 @@ SUBSYSTEM_DEF(minimaps)

data["currentMapName"] = SSmapping.configs?[GROUND_MAP].map_name
data["canDraw"] = FALSE
data["canViewHome"] = FALSE
data["canViewTacmap"] = FALSE
data["canViewCanvas"] = TRUE
data["isXeno"] = FALSE

return data
Expand Down
11 changes: 6 additions & 5 deletions tgui/packages/tgui/interfaces/TacticalMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ interface TacMapProps {
updatedCanvas: boolean;
themeId: number;
svgData: any;
canViewHome: number;
canViewTacmap: number;
canDraw: number;
isXeno: boolean;
canViewCanvas: number;
flatImage: string;
currentMapName: string;
mapRef: any;
Expand All @@ -30,15 +31,15 @@ const PAGES = [
component: () => ViewMapPanel,
icon: 'map',
canAccess: (data) => {
return data.canViewHome;
return data.canViewTacmap;
},
},
{
title: 'old canvas',
component: () => OldMapPanel,
icon: 'eye',
canAccess: () => {
return 1;
canAccess: (data) => {
return data.canViewCanvas;
},
},
{
Expand Down Expand Up @@ -136,7 +137,7 @@ const ViewMapPanel = (props, context) => {
const { data } = useBackend<TacMapProps>(context);

// byond ui can't resist trying to render
if (data.canViewHome !== 1) {
if (data.canViewTacmap === 0) {
return <OldMapPanel {...props} context={context} />;
}

Expand Down

0 comments on commit abbff0d

Please sign in to comment.