Add InputTileInfo function for tile information input handling in GUI
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "app/gfx/bitmap.h"
|
||||
#include "app/gfx/snes_palette.h"
|
||||
#include "app/gfx/snes_tile.h"
|
||||
#include "app/gui/canvas.h"
|
||||
#include "app/gui/color.h"
|
||||
#include "imgui/imgui.h"
|
||||
@@ -246,6 +247,20 @@ bool ListBox(const char* label, int* current_item,
|
||||
height_in_items);
|
||||
}
|
||||
|
||||
bool InputTileInfo(const char* label, gfx::TileInfo* tile_info) {
|
||||
ImGui::PushID(label);
|
||||
ImGui::BeginGroup();
|
||||
bool changed = false;
|
||||
changed |= InputHexWord(label, &tile_info->id_);
|
||||
changed |= InputHexByte("Palette", &tile_info->palette_);
|
||||
changed |= ImGui::Checkbox("Priority", &tile_info->over_);
|
||||
changed |= ImGui::Checkbox("Vertical Flip", &tile_info->vertical_mirror_);
|
||||
changed |= ImGui::Checkbox("Horizontal Flip", &tile_info->horizontal_mirror_);
|
||||
ImGui::EndGroup();
|
||||
ImGui::PopID();
|
||||
return changed;
|
||||
}
|
||||
|
||||
ImGuiID GetID(const std::string& id) { return ImGui::GetID(id.c_str()); }
|
||||
|
||||
void FileDialogPipeline(absl::string_view display_key,
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "app/gfx/bitmap.h"
|
||||
#include "app/gfx/snes_palette.h"
|
||||
#include "app/gfx/snes_tile.h"
|
||||
#include "app/gui/canvas.h"
|
||||
#include "app/gui/color.h"
|
||||
#include "imgui/imgui.h"
|
||||
@@ -45,6 +46,8 @@ IMGUI_API bool ListBox(const char* label, int* current_item,
|
||||
const std::vector<std::string>& items,
|
||||
int height_in_items = -1);
|
||||
|
||||
bool InputTileInfo(const char* label, gfx::TileInfo* tile_info);
|
||||
|
||||
using ItemLabelFlags = enum ItemLabelFlag {
|
||||
Left = 1u << 0u,
|
||||
Right = 1u << 1u,
|
||||
|
||||
Reference in New Issue
Block a user