mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge #5871
5871: Fix skin prefix button container being used for multiple buttons r=heinrich5991 a=Robyt3 This meant that only the first skin prefix button could be activated. Regression from #5633. <!-- What is the motivation for the changes of this pull request? --> <!-- Note that builds and other checks will be run for your change. Don't feel intimidated by failures in some of the checks. If you can't resolve them yourself, experienced devs can also resolve them before merging your pull request. --> ## Checklist - [X] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test (especially base/) or added coverage to integration test - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: Robert Müller <robytemueller@gmail.com>
This commit is contained in:
commit
3d1583d9a5
|
@ -510,14 +510,14 @@ void CMenus::RenderSettingsTee(CUIRect MainView)
|
|||
SkinPrefix.HSplitTop(2.0f, 0, &SkinPrefix);
|
||||
{
|
||||
static const char *s_apSkinPrefixes[] = {"kitty", "santa"};
|
||||
for(auto &pPrefix : s_apSkinPrefixes)
|
||||
static CButtonContainer s_aPrefixButtons[std::size(s_apSkinPrefixes)];
|
||||
for(size_t i = 0; i < std::size(s_apSkinPrefixes); i++)
|
||||
{
|
||||
SkinPrefix.HSplitTop(20.0f, &Button, &SkinPrefix);
|
||||
Button.HMargin(2.0f, &Button);
|
||||
static CButtonContainer s_PrefixButton;
|
||||
if(DoButton_Menu(&s_PrefixButton, pPrefix, 0, &Button))
|
||||
if(DoButton_Menu(&s_aPrefixButtons[i], s_apSkinPrefixes[i], 0, &Button))
|
||||
{
|
||||
str_copy(g_Config.m_ClSkinPrefix, pPrefix);
|
||||
str_copy(g_Config.m_ClSkinPrefix, s_apSkinPrefixes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue