From 8e62a46009750bf018cba9061a126fa0df0c0d28 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Tue, 3 Jan 2023 01:34:58 -0800 Subject: [PATCH] display new logo for the hotkeys overlay widget --- plugins/lua/hotkeys.lua | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/plugins/lua/hotkeys.lua b/plugins/lua/hotkeys.lua index 999527d0d..bfe55e0a7 100644 --- a/plugins/lua/hotkeys.lua +++ b/plugins/lua/hotkeys.lua @@ -19,7 +19,6 @@ HotspotMenuWidget.ATTRS{ } function HotspotMenuWidget:init() - self:addviews{widgets.Label{text={'!DF!', NEWLINE, '!Ha!', NEWLINE, '!ck!'}}} self.mouseover = false end @@ -41,6 +40,34 @@ function HotspotMenuWidget:overlay_trigger() mouseover=self.mouseover}:show() end +local dscreen = dfhack.screen + +function HotspotMenuWidget:onRenderBody(dc) + local tpos = dfhack.textures.getDfhackLogoTexposStart() + local x, y = dc.x, dc.y + + if tpos == -1 then + dscreen.paintString(COLOR_WHITE, x, y+0, '!DF!') + dscreen.paintString(COLOR_WHITE, x, y+1, '!Ha!') + dscreen.paintString(COLOR_WHITE, x, y+2, '!ck!') + else + dscreen.paintTile(COLOR_WHITE, x+0, y+0, '!', tpos+0) + dscreen.paintTile(COLOR_WHITE, x+1, y+0, 'D', tpos+1) + dscreen.paintTile(COLOR_WHITE, x+2, y+0, 'F', tpos+2) + dscreen.paintTile(COLOR_WHITE, x+3, y+0, '!', tpos+3) + + dscreen.paintTile(COLOR_WHITE, x+0, y+1, '!', tpos+4) + dscreen.paintTile(COLOR_WHITE, x+1, y+1, 'H', tpos+5) + dscreen.paintTile(COLOR_WHITE, x+2, y+1, 'a', tpos+6) + dscreen.paintTile(COLOR_WHITE, x+3, y+1, '!', tpos+7) + + dscreen.paintTile(COLOR_WHITE, x+0, y+2, '!', tpos+8) + dscreen.paintTile(COLOR_WHITE, x+1, y+2, 'c', tpos+9) + dscreen.paintTile(COLOR_WHITE, x+2, y+2, 'k', tpos+10) + dscreen.paintTile(COLOR_WHITE, x+3, y+2, '!', tpos+11) + end +end + -- register the menu hotspot with the overlay OVERLAY_WIDGETS = {menu=HotspotMenuWidget}