101 if (ImGui::BeginTable(
"oracle_menu_bins_table", 6,
102 ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg |
103 ImGuiTableFlags_Resizable | ImGuiTableFlags_ScrollY,
105 ImGui::TableSetupColumn(
"Label");
106 ImGui::TableSetupColumn(
"Bin Path");
107 ImGui::TableSetupColumn(
"Bytes", ImGuiTableColumnFlags_WidthFixed, 70.0f);
108 ImGui::TableSetupColumn(
"Status", ImGuiTableColumnFlags_WidthFixed, 70.0f);
109 ImGui::TableSetupColumn(
"ASM");
110 ImGui::TableSetupColumn(
"Line", ImGuiTableColumnFlags_WidthFixed, 55.0f);
111 ImGui::TableHeadersRow();
118 ImGui::TableNextRow();
119 ImGui::TableSetColumnIndex(0);
120 ImGui::TextUnformatted(entry.label.empty() ?
"(unlabeled)"
121 : entry.label.c_str());
122 ImGui::TableSetColumnIndex(1);
123 ImGui::TextUnformatted(entry.resolved_bin_path.c_str());
124 ImGui::TableSetColumnIndex(2);
125 ImGui::Text(
"%llu",
static_cast<unsigned long long>(entry.size_bytes));
126 ImGui::TableSetColumnIndex(3);
128 entry.exists ? theme.status_success : theme.status_error,
"%s",
129 entry.exists ?
"OK" :
"MISSING");
130 ImGui::TableSetColumnIndex(4);
131 ImGui::TextUnformatted(entry.asm_path.c_str());
132 ImGui::TableSetColumnIndex(5);
133 ImGui::Text(
"%d", entry.line);
143 if (ImGui::BeginTable(
"oracle_menu_draw_table", 5,
144 ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg |
145 ImGuiTableFlags_Resizable | ImGuiTableFlags_ScrollY,
147 ImGui::TableSetupColumn(
"Routine");
148 ImGui::TableSetupColumn(
"ASM");
149 ImGui::TableSetupColumn(
"Line", ImGuiTableColumnFlags_WidthFixed, 55.0f);
150 ImGui::TableSetupColumn(
"Refs", ImGuiTableColumnFlags_WidthFixed, 50.0f);
151 ImGui::TableSetupColumn(
"Kind", ImGuiTableColumnFlags_WidthFixed, 60.0f);
152 ImGui::TableHeadersRow();
159 ImGui::TableNextRow();
160 ImGui::TableSetColumnIndex(0);
161 ImGui::TextUnformatted(routine.label.c_str());
162 ImGui::TableSetColumnIndex(1);
163 ImGui::TextUnformatted(routine.asm_path.c_str());
164 ImGui::TableSetColumnIndex(2);
165 ImGui::Text(
"%d", routine.line);
166 ImGui::TableSetColumnIndex(3);
167 ImGui::Text(
"%d", routine.references);
168 ImGui::TableSetColumnIndex(4);
169 ImGui::TextUnformatted(routine.local ?
"local" :
"global");
193 const float left_width = ImGui::GetContentRegionAvail().x * 0.58f;
194 ImGui::BeginChild(
"oracle_menu_components_list", ImVec2(left_width, 340.0f),
195 ImGuiChildFlags_Borders);
196 if (ImGui::BeginTable(
"oracle_menu_components_table", 5,
197 ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg |
198 ImGuiTableFlags_Resizable |
199 ImGuiTableFlags_ScrollY)) {
200 ImGui::TableSetupColumn(
"Table");
201 ImGui::TableSetupColumn(
"Index", ImGuiTableColumnFlags_WidthFixed, 55.0f);
202 ImGui::TableSetupColumn(
"Row", ImGuiTableColumnFlags_WidthFixed, 50.0f);
203 ImGui::TableSetupColumn(
"Col", ImGuiTableColumnFlags_WidthFixed, 50.0f);
204 ImGui::TableSetupColumn(
"Ref");
205 ImGui::TableHeadersRow();
209 ImGui::TableNextRow();
211 ImGui::TableSetColumnIndex(0);
213 std::string row_label =
214 absl::StrFormat(
"%s##oracle_component_%d", component->table_label, i);
215 if (ImGui::Selectable(row_label.c_str(), selected,
216 ImGuiSelectableFlags_SpanAllColumns)) {
222 ImGui::TableSetColumnIndex(1);
223 ImGui::Text(
"%d", component->index);
224 ImGui::TableSetColumnIndex(2);
225 ImGui::Text(
"%d", component->row);
226 ImGui::TableSetColumnIndex(3);
227 ImGui::Text(
"%d", component->col);
228 ImGui::TableSetColumnIndex(4);
229 ImGui::Text(
"%s:%d", component->asm_path.c_str(), component->line);
237 ImGui::BeginChild(
"oracle_menu_component_editor", ImVec2(0, 340.0f),
238 ImGuiChildFlags_Borders);
242 ImGui::TextDisabled(
"Select a component row to preview/apply edits.");
248 ImGui::Text(
"Table: %s", component->table_label.c_str());
249 ImGui::Text(
"Index: %d", component->index);
250 ImGui::Text(
"ASM: %s:%d", component->asm_path.c_str(), component->line);
251 if (!component->note.empty()) {
252 ImGui::TextDisabled(
"Note: %s", component->note.c_str());
265 if (ImGui::Button(
"Preview")) {
271 absl::StrFormat(
"Preview failed: %s", edit_or.status().message());
273 const auto& edit = edit_or.value();
275 "Preview %s[%d] (%d,%d) -> (%d,%d)", edit.table_label, edit.index,
276 edit.old_row, edit.old_col, edit.new_row, edit.new_col);
280 if (ImGui::Button(
"Apply")) {
286 absl::StrFormat(
"Apply failed: %s", edit_or.status().message());
288 const auto& edit = edit_or.value();
290 "Applied %s[%d] (%d,%d) -> (%d,%d)", edit.table_label, edit.index,
291 edit.old_row, edit.old_col, edit.new_row, edit.new_col);
absl::StatusOr< OracleMenuComponentEditResult > SetOracleMenuComponentOffset(const std::filesystem::path &project_root, const std::string &asm_relative_path, const std::string &table_label, int index, int row, int col, bool write_changes)
::yaze::project::YazeProject * current_project()
Get the current project instance.