Solarus-Games English Forum

Solarus => Development => Topic started by: Nate-Devv on July 26, 2016, 10:21:21 PM

Title: Adding a Quest to the Solarus GUI Launcher on Install
Post by: Nate-Devv on July 26, 2016, 10:21:21 PM
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.
Title: Re: Adding a Quest to the Solarus GUI Launcher on Install
Post by: Christopho on July 27, 2016, 01:24:02 AM
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
Title: Re: Adding a Quest to the Solarus GUI Launcher on Install
Post by: Christopho on July 27, 2016, 01:30:42 AM
I am working right now on adding a command-line option to the launcher executable for quests to register themselves.
Title: Re: Adding a Quest to the Solarus GUI Launcher on Install
Post by: Christopho on July 27, 2016, 02:09:42 AM
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.
Title: Re: Adding a Quest to the Solarus GUI Launcher on Install
Post by: Nate-Devv on July 27, 2016, 07:05:07 PM
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. :'(