Skip to content

Commit

Permalink
Sort skins alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
bkacjios committed Aug 7, 2022
1 parent 930b0c0 commit cb3e486
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/modules/gui/panels/skinselect.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ end

function PANEL:UpdateSkins()
local numskins = 0
for skin, tbl in pairs(overlay.getSkins()) do
for id, skin in ipairs(overlay.getSkins()) do
local SKIN = self:Add("RadioBox")
SKIN:SetText(skin)
SKIN:DockMargin(1, 1, 1, 1)
Expand Down
2 changes: 1 addition & 1 deletion source/music.lua
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ memory.hook("match.info.result", "Melee - GAME kill music", function(result)
end)

memory.hook("controller.*.buttons.pressed", "Melee - Music skipper", function(port, pressed)
if PANEL_SETTINGS:IsBinding() or PANEL_SETTINGS:IsSlippiReplay() then return end -- Don't skip when the user is setting a button combination or when watching a replay
if not memory.isMelee() or PANEL_SETTINGS:IsBinding() or PANEL_SETTINGS:IsSlippiReplay() then return end -- Don't skip when the user is setting a button combination or when watching a replay
local skipMask = PANEL_SETTINGS:GetMusicSkipMask()
local muteMask = PANEL_SETTINGS:GetMusicMuteMask()
if port == overlay.getPort() then
Expand Down
5 changes: 4 additions & 1 deletion source/overlay/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local overlay = {
m_tSkinList = {},
m_tRegisteredSkins = {},
m_fDisplayPortTime = 0,
}
Expand Down Expand Up @@ -54,10 +55,12 @@ end

function overlay.registerSkin(name, tbl)
overlay.m_tRegisteredSkins[name] = tbl
table.insert(overlay.m_tSkinList, name)
table.sort(overlay.m_tSkinList)
end

function overlay.getSkins()
return overlay.m_tRegisteredSkins
return overlay.m_tSkinList
end

do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,4 +327,4 @@ function SKIN:Paint(controller)
drawButtons(BUTTONS, controller)
end

overlay.registerSkin("S_Stick", SKIN)
overlay.registerSkin("S-Stick", SKIN)

0 comments on commit cb3e486

Please sign in to comment.