mirror of
https://gitlab.com/square-game-liberation-front/F.E.I.S.git
synced 2024-11-15 03:27:41 +01:00
Frendlier error message when font does not exist
This commit is contained in:
parent
ca78a8ee69
commit
03ddbc2695
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@ CMakeFiles
|
||||
cmake-default
|
||||
|
||||
build/**
|
||||
imgui.ini
|
11
src/main.cpp
11
src/main.cpp
@ -30,6 +30,17 @@ int main(int argc, char** argv) {
|
||||
|
||||
ImGui::SFML::Init(window, false);
|
||||
|
||||
auto font_path = assets_folder / "fonts" / "NotoSans-Medium.ttf";
|
||||
if (not std::filesystem::exists(font_path)) {
|
||||
tinyfd_messageBox(
|
||||
"Error",
|
||||
("Could not open "+font_path.string()).c_str(),
|
||||
"ok",
|
||||
"error",
|
||||
1
|
||||
);
|
||||
return -1;
|
||||
}
|
||||
ImGuiIO& IO = ImGui::GetIO();
|
||||
IO.Fonts->Clear();
|
||||
IO.Fonts->AddFontFromFileTTF(
|
||||
|
Loading…
Reference in New Issue
Block a user