yaze
0.3.2
Link to the Past ROM Editor
Loading...
Searching...
No Matches
usage_statistics_card.cc
Go to the documentation of this file.
1
#include "
app/editor/overworld/usage_statistics_card.h
"
2
3
#include "
app/gui/core/icons.h
"
4
#include "
app/gui/core/ui_helpers.h
"
5
#include "imgui/imgui.h"
6
#include "
zelda3/overworld/overworld.h
"
7
8
namespace
yaze::editor
{
9
10
UsageStatisticsCard::UsageStatisticsCard
(
zelda3::Overworld
* overworld)
11
: overworld_(overworld) {}
12
13
void
UsageStatisticsCard::Draw
(
bool
* p_open) {
14
if
(!
overworld_
|| !
overworld_
->
is_loaded
()) {
15
ImGui::TextDisabled(
"Overworld not loaded"
);
16
return
;
17
}
18
19
if
(ImGui::Begin(
"Usage Statistics"
, p_open)) {
20
if
(ImGui::BeginTabBar(
"UsageTabs"
)) {
21
if
(ImGui::BeginTabItem(
"Grid View"
)) {
22
DrawUsageGrid
();
23
ImGui::EndTabItem();
24
}
25
if
(ImGui::BeginTabItem(
"States"
)) {
26
DrawUsageStates
();
27
ImGui::EndTabItem();
28
}
29
ImGui::EndTabBar();
30
}
31
}
32
ImGui::End();
33
}
34
35
void
UsageStatisticsCard::DrawUsageGrid
() {
36
// Logic moved from OverworldEditor::DrawUsageGrid
37
// Simplified for card layout
38
39
ImGui::Text(
"Map Usage Grid (8x8)"
);
40
ImGui::Separator();
41
42
if
(ImGui::BeginTable(
"UsageGrid"
, 8, ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit)) {
43
for
(
int
y = 0; y < 8; y++) {
44
ImGui::TableNextRow();
45
for
(
int
x = 0; x < 8; x++) {
46
ImGui::TableNextColumn();
47
int
map_id = y * 8 + x;
48
49
// Determine color based on usage (placeholder logic, assuming we can query map status)
50
// For now, just show ID
51
ImGui::Text(
"%02X"
, map_id);
52
53
// TODO: Add actual usage data visualization here
54
// e.g., color code based on entity count or size
55
}
56
}
57
ImGui::EndTable();
58
}
59
}
60
61
void
UsageStatisticsCard::DrawUsageStates
() {
62
ImGui::Text(
"Global Usage Statistics"
);
63
ImGui::Separator();
64
65
// Placeholder for usage states
66
ImGui::Text(
"Total Maps: 64"
);
67
ImGui::Text(
"Large Maps: %d"
, 0);
// TODO: Query actual data
68
ImGui::Text(
"Small Maps: %d"
, 0);
69
}
70
71
}
// namespace yaze::editor
yaze::editor::UsageStatisticsCard::DrawUsageStates
void DrawUsageStates()
Definition
usage_statistics_card.cc:61
yaze::editor::UsageStatisticsCard::overworld_
zelda3::Overworld * overworld_
Definition
usage_statistics_card.h:19
yaze::editor::UsageStatisticsCard::Draw
void Draw(bool *p_open=nullptr)
Definition
usage_statistics_card.cc:13
yaze::editor::UsageStatisticsCard::DrawUsageGrid
void DrawUsageGrid()
Definition
usage_statistics_card.cc:35
yaze::editor::UsageStatisticsCard::UsageStatisticsCard
UsageStatisticsCard(zelda3::Overworld *overworld)
Definition
usage_statistics_card.cc:10
yaze::zelda3::Overworld
Represents the full Overworld data, light and dark world.
Definition
overworld.h:217
yaze::zelda3::Overworld::is_loaded
auto is_loaded() const
Definition
overworld.h:528
icons.h
yaze::editor
Editors are the view controllers for the application.
Definition
agent_chat.cc:23
overworld.h
ui_helpers.h
usage_statistics_card.h
src
app
editor
overworld
usage_statistics_card.cc
Generated by
1.10.0