Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored display-class theme initialization #6601

Merged
merged 1 commit into from Mar 31, 2022
Merged

Conversation

Vultraz
Copy link
Member

@Vultraz Vultraz commented Mar 31, 2022

  • controller_base::get_theme was removed and replaced with theme::get_theme_config. There was already a static map
    of theme configs in the theme class, so no need to reinvent the wheel.
  • Renamed theme::get_known_themes to theme::get_basic_theme_info
  • Hidden themes will be included in the known_themes map. Filtering now happens in get_basic_theme_info, which now
    has an additional include_hidden (false by default) argument.
  • display::set_theme now takes the theme id instead of config
  • editor_display no longer takes a theme_config/id argument and instead simply initializes its base class with the
    "editor" theme directly.
  • display now takes the theme id instead of config. game_display was adjusted accordingly

* controller_base::get_theme was removed and replaced with theme::get_theme_config. There was already a static map
  of theme configs in the theme class, so no need to reinvent the wheel.
* Renamed theme::get_known_themes to theme::get_basic_theme_info
* Hidden themes will be included in the known_themes map. Filtering now happens in get_basic_theme_info, which now
  has an additional `include_hidden` (false by default) argument.
* display::set_theme now takes the theme id instead of config
* editor_display no longer takes a theme_config/id argument and instead simply initializes its base class with the
  "editor" theme directly.
* display now takes the theme id instead of config. game_display was adjusted accordingly
@github-actions github-actions bot added Editor Map/scenario editor issues. Lua API Issues with the Lua engine and API. labels Mar 31, 2022

static const config& get_theme_config(const std::string& id);

static std::vector<theme_info> get_basic_theme_info(bool include_hidden = false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some documentation, clarify that it's "basic info" rather than "info about the basic theme".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add in separate commit.

@Vultraz Vultraz merged commit 9ff098f into master Mar 31, 2022
@Vultraz Vultraz deleted the theme-init-refactor branch March 31, 2022 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Editor Map/scenario editor issues. Lua API Issues with the Lua engine and API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants