|
|
@ -708,8 +708,8 @@ function ZScreen:isOnTop()
|
|
|
|
return dfhack.gui.getCurViewscreen(true) == self._native
|
|
|
|
return dfhack.gui.getCurViewscreen(true) == self._native
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function ZScreen:toggleLocked()
|
|
|
|
function ZScreen:togglePinned()
|
|
|
|
self.locked = not self.locked
|
|
|
|
self.pinned = not self.pinned
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function ZScreen:onInput(keys)
|
|
|
|
function ZScreen:onInput(keys)
|
|
|
@ -734,11 +734,11 @@ function ZScreen:onInput(keys)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if keys.CUSTOM_ALT_L then
|
|
|
|
if keys.CUSTOM_ALT_L then
|
|
|
|
self:toggleLocked()
|
|
|
|
self:togglePinned()
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if (self:isMouseOver() or not self.locked)
|
|
|
|
if (self:isMouseOver() or not self.pinned)
|
|
|
|
and (keys.LEAVESCREEN or keys._MOUSE_R_DOWN) then
|
|
|
|
and (keys.LEAVESCREEN or keys._MOUSE_R_DOWN) then
|
|
|
|
self:dismiss()
|
|
|
|
self:dismiss()
|
|
|
|
-- ensure underlying DF screens don't also react to the click
|
|
|
|
-- ensure underlying DF screens don't also react to the click
|
|
|
@ -814,11 +814,11 @@ GREY_LINE_FRAME = {
|
|
|
|
title_pen = to_pen{ fg=COLOR_BLACK, bg=COLOR_GREY },
|
|
|
|
title_pen = to_pen{ fg=COLOR_BLACK, bg=COLOR_GREY },
|
|
|
|
inactive_title_pen = to_pen{ fg=COLOR_GREY, bg=COLOR_BLACK },
|
|
|
|
inactive_title_pen = to_pen{ fg=COLOR_GREY, bg=COLOR_BLACK },
|
|
|
|
signature_pen = to_pen{ fg=COLOR_GREY, bg=COLOR_BLACK },
|
|
|
|
signature_pen = to_pen{ fg=COLOR_GREY, bg=COLOR_BLACK },
|
|
|
|
locked_pen = to_pen{tile=779, ch=216, fg=COLOR_GREY, bg=COLOR_GREEN},
|
|
|
|
pinned_pen = to_pen{tile=779, ch=216, fg=COLOR_GREY, bg=COLOR_GREEN},
|
|
|
|
unlocked_pen = to_pen{tile=782, ch=216, fg=COLOR_GREY, bg=COLOR_BLACK},
|
|
|
|
unpinned_pen = to_pen{tile=782, ch=216, fg=COLOR_GREY, bg=COLOR_BLACK},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function paint_frame(dc,rect,style,title,show_lock,locked,inactive)
|
|
|
|
function paint_frame(dc,rect,style,title,show_pin,pinned,inactive)
|
|
|
|
local pen = style.frame_pen
|
|
|
|
local pen = style.frame_pen
|
|
|
|
local x1,y1,x2,y2 = dc.x1+rect.x1, dc.y1+rect.y1, dc.x1+rect.x2, dc.y1+rect.y2
|
|
|
|
local x1,y1,x2,y2 = dc.x1+rect.x1, dc.y1+rect.y1, dc.x1+rect.x2, dc.y1+rect.y2
|
|
|
|
dscreen.paintTile(style.lt_frame_pen or pen, x1, y1)
|
|
|
|
dscreen.paintTile(style.lt_frame_pen or pen, x1, y1)
|
|
|
@ -843,26 +843,26 @@ function paint_frame(dc,rect,style,title,show_lock,locked,inactive)
|
|
|
|
x, y1, tstr)
|
|
|
|
x, y1, tstr)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if show_lock then
|
|
|
|
if show_pin then
|
|
|
|
if locked and style.locked_pen then
|
|
|
|
if pinned and style.pinned_pen then
|
|
|
|
local pin_texpos = dfhack.textures.getGreenPinTexposStart()
|
|
|
|
local pin_texpos = dfhack.textures.getGreenPinTexposStart()
|
|
|
|
if pin_texpos == -1 then
|
|
|
|
if pin_texpos == -1 then
|
|
|
|
dscreen.paintTile(style.locked_pen, x2-1, y1)
|
|
|
|
dscreen.paintTile(style.pinned_pen, x2-1, y1)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
dscreen.paintTile(style.locked_pen, x2-2, y1-1, nil, pin_texpos+0)
|
|
|
|
dscreen.paintTile(style.pinned_pen, x2-2, y1-1, nil, pin_texpos+0)
|
|
|
|
dscreen.paintTile(style.locked_pen, x2-1, y1-1, nil, pin_texpos+1)
|
|
|
|
dscreen.paintTile(style.pinned_pen, x2-1, y1-1, nil, pin_texpos+1)
|
|
|
|
dscreen.paintTile(style.locked_pen, x2-2, y1, nil, pin_texpos+2)
|
|
|
|
dscreen.paintTile(style.pinned_pen, x2-2, y1, nil, pin_texpos+2)
|
|
|
|
dscreen.paintTile(style.locked_pen, x2-1, y1, nil, pin_texpos+3)
|
|
|
|
dscreen.paintTile(style.pinned_pen, x2-1, y1, nil, pin_texpos+3)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
elseif not locked and style.unlocked_pen then
|
|
|
|
elseif not pinned and style.unpinned_pen then
|
|
|
|
local pin_texpos = dfhack.textures.getRedPinTexposStart()
|
|
|
|
local pin_texpos = dfhack.textures.getRedPinTexposStart()
|
|
|
|
if pin_texpos == -1 then
|
|
|
|
if pin_texpos == -1 then
|
|
|
|
dscreen.paintTile(style.unlocked_pen, x2-1, y1)
|
|
|
|
dscreen.paintTile(style.unpinned_pen, x2-1, y1)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
dscreen.paintTile(style.unlocked_pen, x2-2, y1-1, nil, pin_texpos+0)
|
|
|
|
dscreen.paintTile(style.unpinned_pen, x2-2, y1-1, nil, pin_texpos+0)
|
|
|
|
dscreen.paintTile(style.unlocked_pen, x2-1, y1-1, nil, pin_texpos+1)
|
|
|
|
dscreen.paintTile(style.unpinned_pen, x2-1, y1-1, nil, pin_texpos+1)
|
|
|
|
dscreen.paintTile(style.unlocked_pen, x2-2, y1, nil, pin_texpos+2)
|
|
|
|
dscreen.paintTile(style.unpinned_pen, x2-2, y1, nil, pin_texpos+2)
|
|
|
|
dscreen.paintTile(style.unlocked_pen, x2-1, y1, nil, pin_texpos+3)
|
|
|
|
dscreen.paintTile(style.unpinned_pen, x2-1, y1, nil, pin_texpos+3)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|