diff --git a/data/art/logo.png b/data/art/logo.png index 133dc5aaf8..c34407b372 100644 Binary files a/data/art/logo.png and b/data/art/logo.png differ diff --git a/data/art/logo_hovered.png b/data/art/logo_hovered.png deleted file mode 100644 index fe82cc1aed..0000000000 Binary files a/data/art/logo_hovered.png and /dev/null differ diff --git a/docs/dev/Lua API.rst b/docs/dev/Lua API.rst index d449c8810b..071ab48ecb 100644 --- a/docs/dev/Lua API.rst +++ b/docs/dev/Lua API.rst @@ -5945,6 +5945,8 @@ common text token lists that you can then pass as ``text`` to a ``Label``: Example 2: The DFHack logo - a graphical button in graphics mode and a text button in ASCII mode. The ASCII colors use the default for hovering:: + local logo_textures=dfhack.textures.loadTileset( + 'hack/data/art/logo.png', 8, 12, true), widgets.Label{ text=widgets.makeButtonLabelText{ chars={ @@ -5952,10 +5954,12 @@ common text token lists that you can then pass as ``text`` to a ``Label``: {179, 'H', 'a', 179}, {179, 'c', 'k', 179}, }, - tileset=dfhack.textures.loadTileset( - 'hack/data/art/logo.png', 8, 12, true), - tileset_hover=dfhack.textures.loadTileset( - 'hack/data/art/logo_hovered.png', 8, 12, true), + tileset=logo_textures, + tileset_offset=1, + tileset_stride=8, + tileset_hover=logo_textures, + tileset_hover_offset=5, + tileset_hover_stride=8, }, on_click=function() dfhack.run_command{'hotkeys', 'menu', self.name} diff --git a/plugins/lua/hotkeys.lua b/plugins/lua/hotkeys.lua index 74d0b96231..d0cecb5ba0 100644 --- a/plugins/lua/hotkeys.lua +++ b/plugins/lua/hotkeys.lua @@ -6,7 +6,6 @@ local overlay = require('plugins.overlay') local widgets = require('gui.widgets') local logo_textures = dfhack.textures.loadTileset('hack/data/art/logo.png', 8, 12, true) -local logo_hovered_textures = dfhack.textures.loadTileset('hack/data/art/logo_hovered.png', 8, 12, true) local function get_command(cmdline) local first_word = cmdline:trim():split(' +')[1] @@ -41,7 +40,11 @@ function HotspotMenuWidget:init() {VERT_BAR, 'c', 'k', VERT_BAR}, }, tileset=logo_textures, - tileset_hover=logo_hovered_textures, + tileset_offset=1, + tileset_stride=8, + tileset_hover=logo_textures, + tileset_hover_offset=5, + tileset_hover_stride=8, }, on_click=function() dfhack.run_command{'hotkeys', 'menu', self.name} end, },