link controls auto-add click handler

This commit is contained in:
2024-11-19 15:06:43 -06:00
parent bf91f41675
commit cd6c0a0a30
4 changed files with 18 additions and 20 deletions

View File

@@ -246,17 +246,7 @@ void show_dialog_action(std::string xml_file) {
record_action("show_dialog_action", xml_file);
}
cChoiceDlog dlog(xml_file);
// Dialogs with hyperlinks need special handling:
if(xml_file == "about-boe"){
dlog->attachClickHandlers([](cDialog& self, std::string clicked, eKeyMod) {
launchURL(self[clicked].getText());
return false;
}, {"src", "issues"});
}
dlog.show();
cChoiceDlog(xml_file).show();
}
bool prime_time() {

View File

@@ -689,15 +689,7 @@ void init_boe(int argc, char* argv[]) {
}
void showWelcome() {
if(recording){
record_action("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();
show_dialog_action("welcome");
}
using Key = sf::Keyboard::Key;