Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PINK: Open local webpages from the menu bar #2058

Merged
merged 4 commits into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions engines/pink/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*
*/

#include "common/config-manager.h"

#include "graphics/macgui/macwindowmanager.h"
#include "graphics/macgui/macmenu.h"

Expand Down Expand Up @@ -338,10 +340,33 @@ void PinkEngine::executeMenuCommand(uint id) {
_actor->loadPDA("SIBOVER");
break;

case kShowGameWebPage:
openLocalWebPage("PINK.HTM");
break;
case kShowTechSupport:
openLocalWebPage("SUPPORT.HTM");
break;
case kShowWinnnerPage:
openLocalWebPage("WINNER.HTM");
break;
case kShowWanderLustWebPage:
openLocalWebPage("LUST.HTM");
break;
case kShowOnlineHints:
openLocalWebPage("HINTS.HTM");
break;

default:
warning("Unprocessed command id %d", id);
break;
}
}

void PinkEngine::openLocalWebPage(const Common::String &pageName) const {
Common::FSNode gameFolder= Common::FSNode(ConfMan.get("path"));
Common::FSNode filePath = gameFolder.getChild("INSTALL").getChild(pageName);
Common::String fullUrl = Common::String::format("file:///%s", filePath.getPath().c_str());
_system->openUrl(fullUrl);
}

} // End of namespace Pink
2 changes: 2 additions & 0 deletions engines/pink/pink.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ class PinkEngine : public Engine {
void addModule(const Common::String &moduleName);
void removeModule();

void openLocalWebPage(const Common::String &pageName) const;

private:
Console *_console;
Common::RandomSource _rnd;
Expand Down