Skip to content

Commit

Permalink
Add displayGameName() and lootGameName() to plugin-base (#141)
Browse files Browse the repository at this point in the history
* Add `displayGameName()` and `lootGameName()` to plugin-base

# Modifications
- Add `lootGameName()` which gives the plugin a tad bit more control over LOOT cli args
- Add `displayGameName()` which will be used separate display-specific calls & more integral calls to `gameName()`, will also pave way for deeper plugin localization

* clang-format
  • Loading branch information
Twinki14 authored May 23, 2024
1 parent 6012dbb commit b0b6a70
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/iplugingame.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ class IPluginGame : public QObject, public IPlugin
*/
virtual QString gameName() const = 0;

/**
* used to override display-specific text in place of the gameName
* for example the text for the main window or the initial instance creation game
* plugin selection/list
*
* added for future translation purposes or to make plugins visually more accurate in
* the ui
*
* @return display-specific name of the game
*/
virtual QString displayGameName() const { return gameName(); }

template <typename T>
T* feature() const
{
Expand Down Expand Up @@ -257,6 +269,14 @@ class IPluginGame : public QObject, public IPlugin
*/
virtual QString gameShortName() const = 0;

/**
* @brief game name that's passed to the LOOT cli --game argument
*
* only applicable for games using LOOT based sorting
* defaults to gameShortName()
*/
virtual QString lootGameName() const { return gameShortName(); }

/**
* @brief Get any primary alternative 'short' name for the game
*
Expand Down

0 comments on commit b0b6a70

Please sign in to comment.