|
|
@ -1091,9 +1091,10 @@ end
|
|
|
|
-- RetireLocationOverlay
|
|
|
|
-- RetireLocationOverlay
|
|
|
|
--
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local mi = df.global.game.main_interface
|
|
|
|
|
|
|
|
|
|
|
|
local function location_details_is_on_top()
|
|
|
|
local function location_details_is_on_top()
|
|
|
|
return not df.global.game.main_interface.name_creator.open and
|
|
|
|
return not mi.name_creator.open and not mi.unit_selector.open
|
|
|
|
not df.global.game.main_interface.unit_selector.open
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
RetireLocationOverlay = defclass(RetireLocationOverlay, overlay.OverlayWidget)
|
|
|
|
RetireLocationOverlay = defclass(RetireLocationOverlay, overlay.OverlayWidget)
|
|
|
@ -1102,12 +1103,13 @@ RetireLocationOverlay.ATTRS{
|
|
|
|
default_pos={x=-39,y=6},
|
|
|
|
default_pos={x=-39,y=6},
|
|
|
|
default_enabled=true,
|
|
|
|
default_enabled=true,
|
|
|
|
viewscreens='dwarfmode/LocationDetails',
|
|
|
|
viewscreens='dwarfmode/LocationDetails',
|
|
|
|
frame={w=25, h=3},
|
|
|
|
frame={w=25, h=4},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function RetireLocationOverlay:init()
|
|
|
|
function RetireLocationOverlay:init()
|
|
|
|
self:addviews{
|
|
|
|
self:addviews{
|
|
|
|
widgets.Panel{
|
|
|
|
widgets.Panel{
|
|
|
|
|
|
|
|
frame={l=0, t=0, r=0, h=3},
|
|
|
|
frame_background=gui.CLEAR_PEN,
|
|
|
|
frame_background=gui.CLEAR_PEN,
|
|
|
|
frame_style=gui.FRAME_MEDIUM,
|
|
|
|
frame_style=gui.FRAME_MEDIUM,
|
|
|
|
visible=location_details_is_on_top,
|
|
|
|
visible=location_details_is_on_top,
|
|
|
@ -1120,11 +1122,16 @@ function RetireLocationOverlay:init()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
widgets.Label{
|
|
|
|
|
|
|
|
frame={l=1, b=0},
|
|
|
|
|
|
|
|
text='LOCATION RETIRED',
|
|
|
|
|
|
|
|
text_pen=COLOR_RED,
|
|
|
|
|
|
|
|
visible=function() return mi.location_details.selected_ab.flags.DOES_NOT_EXIST end
|
|
|
|
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function RetireLocationOverlay:retire()
|
|
|
|
function RetireLocationOverlay:retire()
|
|
|
|
local mi = df.global.game.main_interface
|
|
|
|
|
|
|
|
local details = mi.location_details
|
|
|
|
local details = mi.location_details
|
|
|
|
local location = details.selected_ab
|
|
|
|
local location = details.selected_ab
|
|
|
|
local has_occupations, has_zones = false, #location.contents.building_ids ~= 0
|
|
|
|
local has_occupations, has_zones = false, #location.contents.building_ids ~= 0
|
|
|
|