Launch a local copy of the help, if one exists

This commit is contained in:
2015-06-27 02:29:30 -04:00
parent 386993f5fa
commit 225195c46f
3 changed files with 13 additions and 3 deletions

View File

@@ -5,6 +5,7 @@
#define BOOST_NO_CXX11_NUMERIC_LIMITS // Because my libc++ is old and not quite standard-compliant, which breaks Boost.Thread
#include <boost/thread.hpp>
#include <boost/filesystem/operations.hpp>
#include "boe.graphics.hpp"
#include "boe.newgraph.hpp"
#include "boe.fileio.hpp"
@@ -364,6 +365,7 @@ void close_program() {
sync_prefs();
}
extern fs::path progDir;
void handle_menu_choice(eMenu item_hit) {
std::string dialogToShow;
sf::Event dummyEvent = {sf::Event::KeyPressed};
@@ -580,7 +582,9 @@ void handle_menu_choice(eMenu item_hit) {
make_cursor_sword();
break;
case eMenu::HELP_TOC:
launchURL("https://blades.calref.net/doc/game/Contents.html");
if(fs::is_directory(progDir/"doc"))
launchURL("file://" + (progDir/"doc/game/Contents.html").string());
else launchURL("https://blades.calref.net/doc/game/Contents.html");
break;
case eMenu::ABOUT_MAGE:
case eMenu::ABOUT_PRIEST:

View File

@@ -1,6 +1,7 @@
#include <iostream>
#include <cstring>
#include <boost/filesystem/operations.hpp>
#include "pc.global.hpp"
#include "universe.hpp"
#include "pc.graphics.hpp"
@@ -308,7 +309,9 @@ void handle_menu_choice(eMenu item_hit) {
edit_stuff_done();
break;
case eMenu::HELP_TOC:
launchURL("https://blades.calref.net/doc/game/Editor.html");
if(fs::is_directory(progDir/"doc"))
launchURL("file://" + (progDir/"doc/game/Editor.html").string());
else launchURL("https://blades.calref.net/doc/game/Editor.html");
break;
}
}

View File

@@ -2,6 +2,7 @@
#define BOOST_NO_CXX11_NUMERIC_LIMITS // Because my libc++ is old and not quite standard-compliant, which breaks Boost.Thread
#include <cstdio>
#include <boost/thread.hpp>
#include <boost/filesystem/operations.hpp>
#include "scen.global.hpp"
#include "scenario.hpp"
@@ -514,7 +515,9 @@ void handle_menu_choice(eMenu item_hit) {
isHelp = true;
break;
case eMenu::HELP_TOC:
launchURL("https://blades.calref.net/doc/editor/About.html");
if(fs::is_directory(progDir/"doc"))
launchURL("file://" + (progDir/"doc/editor/About.html").string());
else launchURL("https://blades.calref.net/doc/editor/About.html");
break;
case eMenu::HELP_START:
helpDlog = "help-editing";