Skip to content

Commit

Permalink
Fix the status of the minimap's pin feature not being saved into the …
Browse files Browse the repository at this point in the history
…game.prefs file
  • Loading branch information
Basilisk3 authored Jan 29, 2024
1 parent 582be6d commit d9ebefa
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions lua/ui/game/minimap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,20 @@ function CreateMinimap(parent)
end
frameCount = frameCount + 1
end
controls.displayGroup.OnPinCheck = function(control, checked)
control:SetSizeLock(checked)
control:SetPositionLock(checked)
-- add save pin in prefs
end
controls.displayGroup.OnPinCheck = function(control, checked)
control:SetSizeLock(checked)
control:SetPositionLock(checked)
Prefs.SetToCurrentProfile('minimapPin', checked)
Prefs.SavePreferences()
end
Tooltip.AddCheckboxTooltip(controls.displayGroup._pinBtn, 'minimap_pin')

local minimapPin = Prefs.GetFromCurrentProfile('minimapPin')

if minimapPin ~= nil then
controls.displayGroup._pinBtn:SetCheck(minimapPin)
end

controls.displayGroup.resetBtn = Button(controls.displayGroup.TitleGroup,
UIUtil.SkinnableFile('/game/menu-btns/default_btn_up.dds'),
UIUtil.SkinnableFile('/game/menu-btns/default_btn_down.dds'),
Expand Down

0 comments on commit d9ebefa

Please sign in to comment.