Skip to content
Permalink
Browse files

Move docs and media files into subfolders of the app

and have the app load stuff from the right locations.
The .wav files are now found also when the app was started via
double-click. The playback still doesn't work though, see #51.
  • Loading branch information
humdingerb committed Mar 6, 2018
1 parent 33e227e commit a688a6128cfc9a91260f3276eedfa29d9fb798be
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,13 +1,16 @@
#include <Roster.h>
#include <Alert.h>
#include <Entry.h>
#include <Roster.h>
#include <MenuBar.h>
#include <MenuItem.h>
#include <Path.h>
#include <String.h>
#include <TranslationUtils.h>
#include <TranslatorFormats.h>
#include <MenuItem.h>
#include <MenuBar.h>

#include <stdio.h>
#include <stdlib.h>
#include <Entry.h>

#include "AboutWindow.h"
#include "GridView.h"
#include "Preferences.h"
@@ -50,7 +53,17 @@ LoadSoundFile(BFileGameSound*& sound, const char* file)
if (sound != NULL)
return;

sound = new BFileGameSound(file, false);
app_info info;
BPath path;
be_roster->GetAppInfo("application/x-vnd.wgp-LightsOff", &info);
BEntry entry(&info.ref);

entry.GetPath(&path);
path.GetParent(&path);
path.Append("media");
path.Append(file);

sound = new BFileGameSound(path.Path(), false);

if (sound->InitCheck() == B_OK) {
sound->Preload();
@@ -233,10 +246,18 @@ void GridView::MessageReceived(BMessage *msg)
{
case M_SHOW_MANUAL:
{
app_info info;
BPath path;
be_roster->GetActiveAppInfo(&info);
BEntry entry(&info.ref);

entry.GetPath(&path);
path.GetParent(&path);
path.Append("docs/GettingStarted.html");

entry = path.Path();
entry_ref ref;
BEntry entry("GettingStarted.htm");
entry.GetRef(&ref);

be_roster->Launch(&ref);
break;
}

0 comments on commit a688a61

Please sign in to comment.
You can’t perform that action at this time.