Compare commits

...

3 Commits

Author SHA1 Message Date
6d649292e2 [nostalgia/core/studio] Increase max tilesheet export size, fix input handling when popups open
All checks were successful
Build / build (push) Successful in 2m17s
2024-01-04 22:50:44 -06:00
7f56a77e7d [nostalgia/studio] Add version to Nostalgia Studio
All checks were successful
Build / build (push) Successful in 2m17s
2023-12-31 23:20:40 -06:00
055d64b125 [olympic] Add support for an AppLib app specific version
All checks were successful
Build / build (push) Successful in 2m20s
2023-12-31 23:18:17 -06:00
5 changed files with 24 additions and 4 deletions

View File

@ -109,8 +109,9 @@ void TileSheetEditorImGui::keyStateChanged(turbine::Key key, bool down) {
m_subsheetEditor.close(); m_subsheetEditor.close();
m_exportMenu.close(); m_exportMenu.close();
} }
auto pal = m_model.pal(); auto const popupOpen = m_subsheetEditor.isOpen() && m_exportMenu.isOpen();
if (pal) { auto const pal = m_model.pal();
if (pal && !popupOpen) {
const auto colorCnt = pal->colors.size(); const auto colorCnt = pal->colors.size();
if (key == turbine::Key::Alpha_D) { if (key == turbine::Key::Alpha_D) {
m_tool = Tool::Draw; m_tool = Tool::Draw;
@ -496,7 +497,7 @@ void TileSheetEditorImGui::ExportMenu::draw() noexcept {
ImGui::SetNextWindowSize(ImVec2(235, popupHeight)); ImGui::SetNextWindowSize(ImVec2(235, popupHeight));
if (ImGui::BeginPopupModal(popupName, &m_show, modalFlags)) { if (ImGui::BeginPopupModal(popupName, &m_show, modalFlags)) {
ImGui::InputInt("Scale", &m_scale); ImGui::InputInt("Scale", &m_scale);
m_scale = ox::clamp(m_scale, 1, 20); m_scale = ox::clamp(m_scale, 1, 50);
if (ImGui::Button("OK", ImVec2{50, 20})) { if (ImGui::Button("OK", ImVec2{50, 20})) {
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
m_show = false; m_show = false;

View File

@ -41,6 +41,8 @@ class TileSheetEditorImGui: public studio::Editor {
} }
void draw() noexcept; void draw() noexcept;
void close() noexcept; void close() noexcept;
[[nodiscard]]
inline bool isOpen() const noexcept { return m_show; }
}; };
class ExportMenu { class ExportMenu {
int m_scale = 0; int m_scale = 0;
@ -53,6 +55,8 @@ class TileSheetEditorImGui: public studio::Editor {
} }
void draw() noexcept; void draw() noexcept;
void close() noexcept; void close() noexcept;
[[nodiscard]]
inline bool isOpen() const noexcept { return m_show; }
}; };
std::size_t m_selectedPaletteIdx = 0; std::size_t m_selectedPaletteIdx = 0;
turbine::Context &m_ctx; turbine::Context &m_ctx;

View File

@ -9,6 +9,11 @@ target_link_libraries(
OlympicApplib OlympicApplib
) )
target_compile_definitions(
NostalgiaStudio PUBLIC
OLYMPIC_APP_VERSION="2023.12.0"
)
install( install(
TARGETS TARGETS
NostalgiaStudio NostalgiaStudio

View File

@ -13,6 +13,10 @@
#define OLYMPIC_APP_NAME "App" #define OLYMPIC_APP_NAME "App"
#endif #endif
#ifndef OLYMPIC_APP_VERSION
#define OLYMPIC_APP_VERSION "dev build"
#endif
#ifndef OLYMPIC_PROJECT_NAMESPACE #ifndef OLYMPIC_PROJECT_NAMESPACE
#define OLYMPIC_PROJECT_NAMESPACE project #define OLYMPIC_PROJECT_NAMESPACE project
#endif #endif
@ -31,6 +35,8 @@
namespace olympic { namespace olympic {
ox::String s_version = ox::String(OLYMPIC_APP_VERSION);
ox::Error run( ox::Error run(
ox::StringView project, ox::StringView project,
ox::StringView appName, ox::StringView appName,

View File

@ -7,10 +7,14 @@
#include <studio/imguiuitl.hpp> #include <studio/imguiuitl.hpp>
#include "aboutpopup.hpp" #include "aboutpopup.hpp"
namespace olympic {
extern ox::String s_version;
}
namespace studio { namespace studio {
AboutPopup::AboutPopup(turbine::Context &ctx) noexcept { AboutPopup::AboutPopup(turbine::Context &ctx) noexcept {
m_text = ox::sfmt("{} - dev build", keelCtx(ctx).appName); m_text = ox::sfmt("{} - {}", keelCtx(ctx).appName, olympic::s_version);
} }
void AboutPopup::open() noexcept { void AboutPopup::open() noexcept {