diff options
Diffstat (limited to 'src/ui/maindialog.cpp')
-rw-r--r-- | src/ui/maindialog.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ui/maindialog.cpp b/src/ui/maindialog.cpp index f2fc60e..e46d613 100644 --- a/src/ui/maindialog.cpp +++ b/src/ui/maindialog.cpp @@ -322,6 +322,21 @@ void CMainDialog::ChangePhase(Phase phase) ddim.x = 0.09f; pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_USER); pb->SetState(STATE_SHADOW); + + try { + CLevelParser* level = new CLevelParser("levels/custom/config.txt"); + if(level->Exists()) { + level->Load(); + CLevelParserLine* line = level->Get("Button"); + if(line->GetParam("name")->IsDefined()) + pb->SetName(line->GetParam("name")->AsString()); + if(line->GetParam("tooltip")->IsDefined()) + pb->SetTooltip(line->GetParam("tooltip")->AsString()); + } + } + catch(CLevelParserException& e) { + CLogger::GetInstancePointer()->Error("Failed loading userlevel button name: %s\n", e.what()); + } } /*pos.x = 139.0f/640.0f; |