Refactor common functionality into zelda3 namespace; remove references to core::common

This commit is contained in:
scawful
2025-01-22 13:53:01 -05:00
parent 43fc52dec7
commit 26cda69d44
17 changed files with 35 additions and 53 deletions

View File

@@ -7,7 +7,6 @@ add_library(
py/yaze_py.cc
yaze.cc
app/rom.cc
app/core/common.cc
app/core/labeling.cc
app/zelda3/overworld/overworld_map.cc
app/zelda3/overworld/overworld.cc

View File

@@ -5,6 +5,7 @@
#include <ftxui/dom/elements.hpp>
#include <ftxui/screen/screen.hpp>
#include "absl/strings/str_cat.h"
#include "util/bps.h"
namespace yaze {
@@ -156,7 +157,8 @@ void GenerateSaveFileComponent(ftxui::ScreenInteractive &screen) {
for (size_t i = 0; i < items.size(); i += 4) {
auto row = Container::Horizontal({});
for (size_t j = 0; j < 4 && (i + j) < items.size(); ++j) {
row->Add(Checkbox(absl::StrCat(items[i + j], " ").data(), &values[i + j]));
row->Add(
Checkbox(absl::StrCat(items[i + j], " ").data(), &values[i + j]));
}
checkboxes->Add(row);
}
@@ -386,7 +388,8 @@ void HelpComponent(ftxui::ScreenInteractive &screen) {
auto help_text = vbox({
text("z3ed") | bold | color(Color::Yellow),
text("by scawful") | color(Color::Magenta),
text("The Legend of Zelda: A Link to the Past Hacking Tool") | color(Color::Red),
text("The Legend of Zelda: A Link to the Past Hacking Tool") |
color(Color::Red),
separator(),
hbox({
text("Command") | bold | underlined,
@@ -474,7 +477,8 @@ void HelpComponent(ftxui::ScreenInteractive &screen) {
auto help_text_component = Renderer([&] { return help_text; });
auto back_button = Button("Back", [&] { SwitchComponents(screen, LayoutID::kMainMenu); });
auto back_button =
Button("Back", [&] { SwitchComponents(screen, LayoutID::kMainMenu); });
auto container = Container::Vertical({
help_text_component,
@@ -483,10 +487,11 @@ void HelpComponent(ftxui::ScreenInteractive &screen) {
auto renderer = Renderer(container, [&] {
return vbox({
help_text_component->Render() | center,
separator(),
back_button->Render() | center,
}) | border;
help_text_component->Render() | center,
separator(),
back_button->Render() | center,
}) |
border;
});
screen.Loop(renderer);

View File

@@ -19,7 +19,6 @@ add_executable(
cli/handlers/patch.cc
cli/handlers/tile16_transfer.cc
app/rom.cc
app/core/common.cc
app/core/project.cc
app/core/platform/file_dialog.mm
app/core/platform/file_dialog.cc

View File

@@ -10,7 +10,6 @@
#include <vector>
#include "absl/status/status.h"
#include "app/core/common.h"
#include "app/rom.h"
#include "util/macro.h"