housekeeping
This commit is contained in:
@@ -5,8 +5,6 @@
|
|||||||
|
|
||||||
#include "absl/strings/string_view.h"
|
#include "absl/strings/string_view.h"
|
||||||
|
|
||||||
#define BASIC_BUTTON(w) if (ImGui::Button(w))
|
|
||||||
|
|
||||||
#define TAB_BAR(w) if (ImGui::BeginTabBar(w)) {
|
#define TAB_BAR(w) if (ImGui::BeginTabBar(w)) {
|
||||||
#define END_TAB_BAR() \
|
#define END_TAB_BAR() \
|
||||||
ImGui::EndTabBar(); \
|
ImGui::EndTabBar(); \
|
||||||
@@ -17,11 +15,6 @@
|
|||||||
ImGui::EndTabItem(); \
|
ImGui::EndTabItem(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MENU_BAR() if (ImGui::BeginMenuBar()) {
|
|
||||||
#define END_MENU_BAR() \
|
|
||||||
ImGui::EndMenuBar(); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define MENU_ITEM(w) if (ImGui::MenuItem(w))
|
#define MENU_ITEM(w) if (ImGui::MenuItem(w))
|
||||||
#define MENU_ITEM2(w, v) if (ImGui::MenuItem(w, v))
|
#define MENU_ITEM2(w, v) if (ImGui::MenuItem(w, v))
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
#include <ImGuiColorTextEdit/TextEditor.h>
|
#include <ImGuiColorTextEdit/TextEditor.h>
|
||||||
|
|
||||||
#include "app/core/platform/file_dialog.h"
|
#include "app/core/platform/file_dialog.h"
|
||||||
#include "app/gui/widgets.h"
|
|
||||||
#include "app/gui/input.h"
|
|
||||||
#include "app/gui/icons.h"
|
#include "app/gui/icons.h"
|
||||||
|
#include "app/gui/input.h"
|
||||||
|
#include "app/gui/widgets.h"
|
||||||
#include "core/constants.h"
|
#include "core/constants.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
@@ -101,10 +101,11 @@ void AssemblyEditor::OpenFolder(const std::string& folder_path) {
|
|||||||
|
|
||||||
void AssemblyEditor::Update(bool& is_loaded) {
|
void AssemblyEditor::Update(bool& is_loaded) {
|
||||||
ImGui::Begin("Assembly Editor", &is_loaded);
|
ImGui::Begin("Assembly Editor", &is_loaded);
|
||||||
MENU_BAR()
|
if (ImGui::BeginMenuBar()) {
|
||||||
DrawFileMenu();
|
DrawFileMenu();
|
||||||
DrawEditMenu();
|
DrawEditMenu();
|
||||||
END_MENU_BAR()
|
ImGui::EndMenuBar();
|
||||||
|
}
|
||||||
|
|
||||||
auto cpos = text_editor_.GetCursorPosition();
|
auto cpos = text_editor_.GetCursorPosition();
|
||||||
SetEditorText();
|
SetEditorText();
|
||||||
|
|||||||
@@ -24,9 +24,6 @@ namespace context {
|
|||||||
* @brief Shared graphical context across editors.
|
* @brief Shared graphical context across editors.
|
||||||
*/
|
*/
|
||||||
class GfxContext {
|
class GfxContext {
|
||||||
public:
|
|
||||||
absl::Status Update();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Palettesets for the tile16 individual tiles
|
// Palettesets for the tile16 individual tiles
|
||||||
static std::unordered_map<uint8_t, gfx::Paletteset> palettesets_;
|
static std::unordered_map<uint8_t, gfx::Paletteset> palettesets_;
|
||||||
|
|||||||
@@ -79,10 +79,6 @@ class Tile16Editor : public context::GfxContext, public SharedRom {
|
|||||||
core::NotifyValue<uint32_t> notify_tile16;
|
core::NotifyValue<uint32_t> notify_tile16;
|
||||||
core::NotifyValue<uint8_t> notify_palette;
|
core::NotifyValue<uint8_t> notify_palette;
|
||||||
|
|
||||||
// Canvas dimensions
|
|
||||||
int canvas_width;
|
|
||||||
int canvas_height;
|
|
||||||
|
|
||||||
// Texture ID for the canvas
|
// Texture ID for the canvas
|
||||||
int texture_id;
|
int texture_id;
|
||||||
|
|
||||||
|
|||||||
@@ -356,30 +356,31 @@ void MasterEditor::DrawYazeMenu() {
|
|||||||
static bool show_display_settings = false;
|
static bool show_display_settings = false;
|
||||||
static bool show_command_line_interface = false;
|
static bool show_command_line_interface = false;
|
||||||
|
|
||||||
MENU_BAR()
|
if (ImGui::BeginMenuBar()) {
|
||||||
DrawFileMenu();
|
DrawFileMenu();
|
||||||
DrawEditMenu();
|
DrawEditMenu();
|
||||||
DrawViewMenu();
|
DrawViewMenu();
|
||||||
DrawProjectMenu();
|
DrawProjectMenu();
|
||||||
DrawHelpMenu();
|
DrawHelpMenu();
|
||||||
|
|
||||||
SameLine(ImGui::GetWindowWidth() - ImGui::GetStyle().ItemSpacing.x -
|
SameLine(ImGui::GetWindowWidth() - ImGui::GetStyle().ItemSpacing.x -
|
||||||
ImGui::CalcTextSize(ICON_MD_DISPLAY_SETTINGS).x - 150);
|
ImGui::CalcTextSize(ICON_MD_DISPLAY_SETTINGS).x - 150);
|
||||||
// Modify the style of the button to have no background color
|
// Modify the style of the button to have no background color
|
||||||
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
|
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
|
||||||
if (ImGui::Button(ICON_MD_DISPLAY_SETTINGS)) {
|
if (ImGui::Button(ICON_MD_DISPLAY_SETTINGS)) {
|
||||||
show_display_settings = !show_display_settings;
|
show_display_settings = !show_display_settings;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ImGui::Button(ICON_MD_TERMINAL)) {
|
||||||
|
show_command_line_interface = !show_command_line_interface;
|
||||||
|
}
|
||||||
|
ImGui::PopStyleColor();
|
||||||
|
|
||||||
|
Text("%s", absl::StrCat("yaze v", core::kYazeVersion).c_str());
|
||||||
|
|
||||||
|
ImGui::EndMenuBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::Button(ICON_MD_TERMINAL)) {
|
|
||||||
show_command_line_interface = !show_command_line_interface;
|
|
||||||
}
|
|
||||||
ImGui::PopStyleColor();
|
|
||||||
|
|
||||||
Text("%s", absl::StrCat("yaze v", core::kYazeVersion).c_str());
|
|
||||||
|
|
||||||
END_MENU_BAR()
|
|
||||||
|
|
||||||
if (show_display_settings) {
|
if (show_display_settings) {
|
||||||
ImGui::Begin("Display Settings", &show_display_settings,
|
ImGui::Begin("Display Settings", &show_display_settings,
|
||||||
ImGuiWindowFlags_None);
|
ImGuiWindowFlags_None);
|
||||||
|
|||||||
Reference in New Issue
Block a user