[calref/cboe]: Links in the welcome dialog are now clickable
This commit is contained in:
@@ -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();
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
eMenuChoice menuChoice=eMenuChoice::MENU_CHOICE_NONE;
|
eMenuChoice menuChoice=eMenuChoice::MENU_CHOICE_NONE;
|
||||||
@@ -122,7 +123,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);
|
||||||
@@ -252,6 +253,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;
|
||||||
@@ -643,7 +653,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;
|
||||||
|
Reference in New Issue
Block a user