Author Topic: Adding a Quest to the Solarus GUI Launcher on Install  (Read 3362 times)

0 Members and 1 Guest are viewing this topic.

Nate-Devv

  • Newbie
  • *
  • Posts: 38
    • View Profile
Adding a Quest to the Solarus GUI Launcher on Install
« 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.

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1193
    • View Profile
Re: Adding a Quest to the Solarus GUI Launcher on Install
« Reply #1 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:
Code: [Select]
[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
Code: [Select]
[General]
quests_paths=/usr/path/to/quest
« Last Edit: July 27, 2016, 01:27:09 AM by Christopho »

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1193
    • View Profile
Re: Adding a Quest to the Solarus GUI Launcher on Install
« Reply #2 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.

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1193
    • View Profile
Re: Adding a Quest to the Solarus GUI Launcher on Install
« Reply #3 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.
« Last Edit: July 27, 2016, 02:13:04 AM by Christopho »

Nate-Devv

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Adding a Quest to the Solarus GUI Launcher on Install
« Reply #4 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. :'(