From eb13f57aeb802bc9449e256565b84c3eb63805fa Mon Sep 17 00:00:00 2001 From: Mathieu Comandon Date: Tue, 8 May 2018 00:24:18 -0700 Subject: [PATCH] Add custom-name directive to scripts (Fixes #715) --- docs/installers.rst | 11 +++++++++++ lutris/installer/interpreter.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/installers.rst b/docs/installers.rst index 4c8a3340c..2c24442ee 100644 --- a/docs/installers.rst +++ b/docs/installers.rst @@ -57,6 +57,17 @@ Example: ``main_file: game.rom`` For web games, specify the game's URL (or filename) with ``main_file``. Example: ``main_file: http://www...`` +Customizing the game's name +--------------------------- + +Use the ``custom-name`` directive to override the name of the game. Use this +only if the installer provides a significantly different game from the base +one. +(Note: In a future update, custom names will be added as game aliases so they +can be searchable) + +Example: ``custom-name: Quake Champions: Doom Edition`` + Presetting game parameters -------------------------- diff --git a/lutris/installer/interpreter.py b/lutris/installer/interpreter.py index 80804c7c3..5f6a259ed 100644 --- a/lutris/installer/interpreter.py +++ b/lutris/installer/interpreter.py @@ -75,7 +75,7 @@ class ScriptInterpreter(CommandsMixin): self.slug = installer['slug'] self.year = installer.get('year') self.runner = installer['runner'] - self.game_name = installer['name'] + self.game_name = self.script.get('custom-name') or installer['name'] self.game_slug = installer['game_slug'] self.steamid = installer.get('steamid')