vegastrike / Vega-Strike-Engine-Source

Vega Strike Engine
Other
252 stars 44 forks source link

Launcher Application #369

Open BenjamenMeyer opened 3 years ago

BenjamenMeyer commented 3 years ago

We presently have two applications that get run and need context (location of game assets, configuration file) to run properly. It would probably be helpful to add a launcher program that can allow the user to launch the configuration or game from a single spot; possibly provide support for multiple games at the same time.

This application doesn't need to be complex. It should be something simple with a GUI like the following:

+----------------------------------------------------------------------+
| Vega Strike Launcher                                         [_] [x] |
+----------------------------------------------------------------------+
| +----------------------------------------------------------------+   |
| | [VS:UtCS Icon]  [Config Push Button] [Launch Push Button]      |   |
| +----------------------------------------------------------------+   |
+----------------------------------------------------------------------+

Since we're using Gtk3 for the settings application this should be another Gtk3 application.

Loki1950 commented 3 years ago

There was such a launcher at one time. Most likely still in our source tree. It is at Vega-Strike-Engine-Source/engine/launcher

BenjamenMeyer commented 3 years ago

Cool; will have to take a look; also see how expandable/configurable it is as it would be nice to use it as a point to kick off/configure the different games.

P-D-E commented 3 years ago

The old launcher can still be compiled after a little change; in general.cpp replace line 372

void ShowError(char *error_msg, char *error_code, int is_fatal) {

with

void ShowError(const char *error_msg, const char *error_code, int is_fatal) {

and then compile with

g++ -D_GLIBCXX_USE_CXX11_ABI=0 -I.. saveinterface.cpp general.cpp ../src/common/common.cpp -o saveinterface `pkg-
config --cflags --libs gtk+-2.0`

but then it tries to run the vegastrike executable (not vegastrike-engine) and there's no current support for the data directory argument. That's coherent with the old trick of running the game from inside the data directory, in fact this launcher looks for vegastrike.config only in the current directory and its parent.

BenjamenMeyer commented 3 years ago

@P-D-E thanks for the analysis. One of the things we'd like to do is make this a bigger thing that can launch multiple games, so some refactoring will probably be needed but good to know it's very close. We should probably call it vegastrike-launcher in line with our new naming convention for libraries and executables.

P-D-E commented 3 years ago

@BenjamenMeyer You're welcome, in the end you're imagining something like this:

image

This part would handle VS:UtCS and PWCU for instance;

image

It also handles the settings internally, but you may want to keep vegasettings external and just launch it;

image image