Adding a Quest to the Solarus GUI Launcher on Install

Started by Nate-Devv, July 26, 2016, 10:21:21 PM

Previous topic - Next topic
Testing the 1.5 version is really fun and I like how the GUI Launcher works. I was wondering if there was a way for a quest to load itself into the GUI Launcher. That would make it easier for end users (at least on platforms with package managers) to install the main executable and the quests they want and play and then just use the main executable.

July 27, 2016, 01:24:02 AM #1 Last Edit: July 27, 2016, 01:27:09 AM by Christopho
Good idea! It would be nice that I provide a portable way to do it. Right now, here is what you can do:

The install script of a quest can try to edit the settings files of the launcher GUI. On Debian or Ubuntu systems, I am pretty confident that it is always ~/.config/solarus/solarus.conf. This file looks like this:
[General]
last_quest=/home/christophe/jeux/zelda_roth_se
quest_fullscreen=false
quest_video_mode=normal
quests_paths=/home/christophe/jeux/zelda_mercuris_chest, /home/christophe/jeux/zelda_olb_se, /home/christophe/jeux/zsdx, /home/christophe/jeux/zsxd, /home/christophe/solarus/sample_quest, /home/christophe/jeux/zelda_roth_se
video_acceleration=true


You have to grep the quests_paths line to see if such a line exists and if the quest is already present.

And if the config file does not exist yet, you can just create it as
[General]
quests_paths=/usr/path/to/quest

I am working right now on adding a command-line option to the launcher executable for quests to register themselves.

July 27, 2016, 02:09:42 AM #3 Last Edit: July 27, 2016, 02:13:04 AM by Christopho
Done.
(This idea was just too good to wait :D)

Just call solarus -add /path/to/quest.
I also added a flag solarus -help to show the usage.

Adding this to the games DEB packages... It does install the change, but only to the root user. I'm going to leave the add command in, but it won't appear to do anything for end users. :'(