housekeeping
This commit is contained in:
@@ -393,8 +393,8 @@ void DrawSpriteTable(std::function<void(int)> onSpriteSelect) {
|
|||||||
if (ImGui::BeginTable("##sprites", 2,
|
if (ImGui::BeginTable("##sprites", 2,
|
||||||
ImGuiTableFlags_Sortable | ImGuiTableFlags_Resizable)) {
|
ImGuiTableFlags_Sortable | ImGuiTableFlags_Resizable)) {
|
||||||
ImGui::TableSetupColumn("ID", ImGuiTableColumnFlags_DefaultSort, 0.0f,
|
ImGui::TableSetupColumn("ID", ImGuiTableColumnFlags_DefaultSort, 0.0f,
|
||||||
MyItemColumnID_ID);
|
SpriteItemColumnID_ID);
|
||||||
ImGui::TableSetupColumn("Name", 0, 0.0f, MyItemColumnID_Name);
|
ImGui::TableSetupColumn("Name", 0, 0.0f, SpriteItemColumnID_Name);
|
||||||
ImGui::TableHeadersRow();
|
ImGui::TableHeadersRow();
|
||||||
|
|
||||||
// Handle sorting
|
// Handle sorting
|
||||||
@@ -441,6 +441,12 @@ void DrawSpriteInserterPopup() {
|
|||||||
}
|
}
|
||||||
SameLine();
|
SameLine();
|
||||||
|
|
||||||
|
if (Button(ICON_MD_DELETE)) {
|
||||||
|
new_sprite_id = -1;
|
||||||
|
ImGui::CloseCurrentPopup();
|
||||||
|
}
|
||||||
|
SameLine();
|
||||||
|
|
||||||
if (Button(ICON_MD_CANCEL)) {
|
if (Button(ICON_MD_CANCEL)) {
|
||||||
ImGui::CloseCurrentPopup();
|
ImGui::CloseCurrentPopup();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
#ifndef YAZE_APP_EDITOR_OVERWORLD_ENTITY_H
|
#ifndef YAZE_APP_EDITOR_OVERWORLD_ENTITY_H
|
||||||
#define YAZE_APP_EDITOR_OVERWORLD_ENTITY_H
|
#define YAZE_APP_EDITOR_OVERWORLD_ENTITY_H
|
||||||
|
|
||||||
#include "imgui/imgui.h"
|
|
||||||
|
|
||||||
#include "app/zelda3/common.h"
|
#include "app/zelda3/common.h"
|
||||||
|
#include "app/zelda3/overworld/overworld_entrance.h"
|
||||||
#include "app/zelda3/overworld/overworld_exit.h"
|
#include "app/zelda3/overworld/overworld_exit.h"
|
||||||
#include "app/zelda3/overworld/overworld_item.h"
|
#include "app/zelda3/overworld/overworld_item.h"
|
||||||
#include "app/zelda3/overworld/overworld_entrance.h"
|
|
||||||
#include "app/zelda3/sprite/sprite.h"
|
#include "app/zelda3/sprite/sprite.h"
|
||||||
|
#include "imgui/imgui.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace editor {
|
namespace editor {
|
||||||
@@ -34,12 +33,14 @@ void DrawItemInsertPopup();
|
|||||||
|
|
||||||
bool DrawItemEditorPopup(zelda3::OverworldItem &item);
|
bool DrawItemEditorPopup(zelda3::OverworldItem &item);
|
||||||
|
|
||||||
enum MyItemColumnID {
|
/**
|
||||||
MyItemColumnID_ID,
|
* @brief Column IDs for the sprite table.
|
||||||
MyItemColumnID_Name,
|
*
|
||||||
MyItemColumnID_Action,
|
*/
|
||||||
MyItemColumnID_Quantity,
|
enum SpriteItemColumnID {
|
||||||
MyItemColumnID_Description
|
SpriteItemColumnID_ID,
|
||||||
|
SpriteItemColumnID_Name,
|
||||||
|
SpriteItemColumnID_Description
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SpriteItem {
|
struct SpriteItem {
|
||||||
@@ -62,10 +63,10 @@ struct SpriteItem {
|
|||||||
&s_current_sort_specs->Specs[n];
|
&s_current_sort_specs->Specs[n];
|
||||||
int delta = 0;
|
int delta = 0;
|
||||||
switch (sort_spec->ColumnUserID) {
|
switch (sort_spec->ColumnUserID) {
|
||||||
case MyItemColumnID_ID:
|
case SpriteItemColumnID_ID:
|
||||||
delta = (a.id - b.id);
|
delta = (a.id - b.id);
|
||||||
break;
|
break;
|
||||||
case MyItemColumnID_Name:
|
case SpriteItemColumnID_Name:
|
||||||
delta = strcmp(a.name + 2, b.name + 2);
|
delta = strcmp(a.name + 2, b.name + 2);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1066,7 +1066,6 @@ void TextEditor::Render(const char* aTitle, const ImVec2& aSize, bool aBorder) {
|
|||||||
|
|
||||||
if (mHandleKeyboardInputs) {
|
if (mHandleKeyboardInputs) {
|
||||||
HandleKeyboardInputs();
|
HandleKeyboardInputs();
|
||||||
ImGui::PushAllowKeyboardFocus(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mHandleMouseInputs) HandleMouseInputs();
|
if (mHandleMouseInputs) HandleMouseInputs();
|
||||||
@@ -1074,7 +1073,6 @@ void TextEditor::Render(const char* aTitle, const ImVec2& aSize, bool aBorder) {
|
|||||||
ColorizeInternal();
|
ColorizeInternal();
|
||||||
Render();
|
Render();
|
||||||
|
|
||||||
if (mHandleKeyboardInputs) ImGui::PopAllowKeyboardFocus();
|
|
||||||
|
|
||||||
if (!mIgnoreImGuiChild) ImGui::EndChild();
|
if (!mIgnoreImGuiChild) ImGui::EndChild();
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <variant>
|
#include <variant>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define HOVER_HINT(string) \
|
#define HOVER_HINT(string) \
|
||||||
if (ImGui::IsItemHovered()) ImGui::SetTooltip(string);
|
if (ImGui::IsItemHovered()) ImGui::SetTooltip(string)
|
||||||
|
|
||||||
#define PRINT_IF_ERROR(expression) \
|
#define PRINT_IF_ERROR(expression) \
|
||||||
{ \
|
{ \
|
||||||
|
|||||||
Reference in New Issue
Block a user