Links in the welcome dialog are now clickable

This commit is contained in:
2020-12-19 17:51:56 -05:00
parent 27f687806f
commit 99ac7531a8

View File

@@ -107,6 +107,7 @@ sf::Clock animTimer;
extern long anim_ticks; extern long anim_ticks;
static void init_boe(int, char*[]); static void init_boe(int, char*[]);
static void showWelcome();
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
#if 0 #if 0
@@ -117,7 +118,7 @@ int main(int argc, char* argv[]) {
init_boe(argc, argv); init_boe(argc, argv);
if(!get_bool_pref("GameRunBefore")) if(!get_bool_pref("GameRunBefore"))
cChoiceDlog("welcome").show(); showWelcome();
else if(get_bool_pref("GiveIntroHint", true)) else if(get_bool_pref("GiveIntroHint", true))
tip_of_day(); tip_of_day();
set_pref("GameRunBefore", true); set_pref("GameRunBefore", true);
@@ -247,6 +248,15 @@ void init_boe(int argc, char* argv[]) {
showMenuBar(); showMenuBar();
} }
void showWelcome() {
cChoiceDlog welcome("welcome");
welcome->attachClickHandlers([](cDialog& self, std::string clicked, eKeyMod) {
launchURL(self[clicked].getText());
return false;
}, {"spidweb", "scen", "forum", "home", "src"});
welcome.show();
}
void handle_events() { void handle_events() {
sf::Event currentEvent; sf::Event currentEvent;
cFramerateLimiter fps_limiter; cFramerateLimiter fps_limiter;
@@ -617,7 +627,7 @@ void handle_menu_choice(eMenu item_hit) {
tip_of_day(); tip_of_day();
break; break;
case eMenu::LIBRARY_INTRO: case eMenu::LIBRARY_INTRO:
dialogToShow = "welcome"; showWelcome();
break; break;
case eMenu::ACTIONS_ALCHEMY: case eMenu::ACTIONS_ALCHEMY:
dummyEvent.key.code = sf::Keyboard::A; dummyEvent.key.code = sf::Keyboard::A;