Skip to content

Commit

Permalink
Make imgui_base_config.ini optional and move it to resources/OpenSimC…
Browse files Browse the repository at this point in the history
…reator
  • Loading branch information
adamkewley committed Jan 17, 2025
1 parent 924a759 commit b5e0bf5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
guidelines.
- Negative scale factors are now supported by the 3D renderer, which can be handy for
mirroring meshes (thanks @carlosedubarreto, #974)
- `imgui_base_config.ini` is now optional, and should now be located at
`resources/OpenSimCreator`, rather than in the root `resources/` directory.

## [0.5.18] - 2025/01/16

Expand Down
8 changes: 6 additions & 2 deletions liboscar/UI/oscimgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,12 @@ namespace
// load application-level ImGui settings, then the user one,
// so that the user settings takes precedence
{
const std::string base_ini_data = loader.slurp("imgui_base_config.ini");
ImGui::LoadIniSettingsFromMemory(base_ini_data.data(), base_ini_data.size());
// TODO: this should be provided externally by osc/libOpenSimCreator, so that
// OpenSim-independent codebases aren't dependent on it
if (loader.resource_exists("OpenSimCreator/imgui_base_config.ini")) {
const std::string base_ini_data = loader.slurp("OpenSimCreator/imgui_base_config.ini");
ImGui::LoadIniSettingsFromMemory(base_ini_data.data(), base_ini_data.size());
}

// CARE: the reason this filepath is `static` is because ImGui requires that
// the string outlives the ImGui context
Expand Down
File renamed without changes.

0 comments on commit b5e0bf5

Please sign in to comment.