Skip to content

Commit

Permalink
Merge pull request #626 from AntlerForce/unicorn
Browse files Browse the repository at this point in the history
Turn favourite star into a checkbox to add focuscolor
  • Loading branch information
AntlerForce authored Apr 3, 2024
2 parents ce05991 + 0247dee commit 9b08ca0
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
Binary file removed LuaMenu/images/star_on.png
Binary file not shown.
8 changes: 8 additions & 0 deletions LuaMenu/widgets/chili/skins/Armada Blues/skin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,14 @@ skin.battle_default_button = { --Blue
DrawControl = DrawButton,
}

skin.favourite_check = {
TileImageFG = ":cl:star_on.png",
TileImageBK = ":cl:star_off.png",
tiles = {0, 0, 0, 0}, --// tile widths: left,top,right,bottom
boxsize = 24,

DrawControl = DrawCheckbox,
}

skin.combobox = {
TileImageBK = ":cl:combobox_ctrl.png",
Expand Down
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 6 additions & 8 deletions LuaMenu/widgets/gui_maplist_panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ local favMaps = {}
local FILE_FAV_MAPS = "favourite_maps.txt"
local IMG_READY = LUA_DIRNAME .. "images/downloadready.png"
local IMG_UNREADY = LUA_DIRNAME .. "images/downloadnotready.png"
local IMG_STAR_OFF = LUA_DIRNAME .. "images/star_off.png"
local IMG_STAR_ON = LUA_DIRNAME .. "images/star_on.png"

local MINIMAP_TOOLTIP_PREFIX = "minimap_tooltip_"

Expand Down Expand Up @@ -242,24 +240,24 @@ local function CreateMapEntry(mapName, mapData, CloseFunc)--{"ResourceID":7098,"
parent = mapButton,
}

local favouriteImg = Image:New {
local favouriteBtn = Checkbox:New {
x = 748,
y = 2,
width = 24,
height = 24,
file = (isFavourite and IMG_STAR_ON) or IMG_STAR_OFF,
caption = "",
checked = isFavourite,
classname = "favourite_check",
parent = root,
OnClick = {
function (self)
OnClick = {
function ()
if isFavourite then
isFavourite = false;
favMaps[mapName] = nil;
else
isFavourite = true;
favMaps[mapName] = 1;
end

self.file = (isFavourite and IMG_STAR_ON) or IMG_STAR_OFF;
end
}
}
Expand Down

0 comments on commit 9b08ca0

Please sign in to comment.