1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-01 23:12:49 +02:00

show random maps

This commit is contained in:
Laserlicht
2023-10-21 02:12:34 +02:00
committed by GitHub
parent f3acc939b9
commit 0eba0ee686
6 changed files with 33 additions and 5 deletions

View File

@@ -11,6 +11,8 @@
#include "RandomMapTab.h"
#include "CSelectionBase.h"
#include "CLobbyScreen.h"
#include "SelectionTab.h"
#include "../CGameInfo.h"
#include "../CServerHandler.h"
@@ -121,6 +123,16 @@ RandomMapTab::RandomMapTab():
const JsonNode config(JsonPath::builtin("config/widgets/randomMapTab.json"));
build(config);
if(auto w = widget<CButton>("buttonShowRandomMaps"))
{
w->addCallback([&]()
{
(static_cast<CLobbyScreen *>(parent))->toggleTab((static_cast<CLobbyScreen *>(parent))->tabSel);
(static_cast<CLobbyScreen *>(parent))->tabSel->showRandom = true;
(static_cast<CLobbyScreen *>(parent))->tabSel->filter(0, true);
});
}
//set combo box callbacks
if(auto w = widget<ComboBox>("templateList"))
{