102 if (ImGui::BeginTable(
"oracle_menu_bins_table", 6,
103 ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg |
104 ImGuiTableFlags_Resizable | ImGuiTableFlags_ScrollY,
106 ImGui::TableSetupColumn(
"Label");
107 ImGui::TableSetupColumn(
"Bin Path");
108 ImGui::TableSetupColumn(
"Bytes", ImGuiTableColumnFlags_WidthFixed, 70.0f);
109 ImGui::TableSetupColumn(
"Status", ImGuiTableColumnFlags_WidthFixed, 70.0f);
110 ImGui::TableSetupColumn(
"ASM");
111 ImGui::TableSetupColumn(
"Line", ImGuiTableColumnFlags_WidthFixed, 55.0f);
112 ImGui::TableHeadersRow();
119 ImGui::TableNextRow();
120 ImGui::TableSetColumnIndex(0);
121 ImGui::TextUnformatted(entry.label.empty() ?
"(unlabeled)"
122 : entry.label.c_str());
123 ImGui::TableSetColumnIndex(1);
124 ImGui::TextUnformatted(entry.resolved_bin_path.c_str());
125 ImGui::TableSetColumnIndex(2);
126 ImGui::Text(
"%llu",
static_cast<unsigned long long>(entry.size_bytes));
127 ImGui::TableSetColumnIndex(3);
129 entry.exists ? theme.status_success : theme.status_error,
"%s",
130 entry.exists ?
"OK" :
"MISSING");
131 ImGui::TableSetColumnIndex(4);
132 ImGui::TextUnformatted(entry.asm_path.c_str());
133 ImGui::TableSetColumnIndex(5);
134 ImGui::Text(
"%d", entry.line);
144 if (ImGui::BeginTable(
"oracle_menu_draw_table", 5,
145 ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg |
146 ImGuiTableFlags_Resizable | ImGuiTableFlags_ScrollY,
148 ImGui::TableSetupColumn(
"Routine");
149 ImGui::TableSetupColumn(
"ASM");
150 ImGui::TableSetupColumn(
"Line", ImGuiTableColumnFlags_WidthFixed, 55.0f);
151 ImGui::TableSetupColumn(
"Refs", ImGuiTableColumnFlags_WidthFixed, 50.0f);
152 ImGui::TableSetupColumn(
"Kind", ImGuiTableColumnFlags_WidthFixed, 60.0f);
153 ImGui::TableHeadersRow();
160 ImGui::TableNextRow();
161 ImGui::TableSetColumnIndex(0);
162 ImGui::TextUnformatted(routine.label.c_str());
163 ImGui::TableSetColumnIndex(1);
164 ImGui::TextUnformatted(routine.asm_path.c_str());
165 ImGui::TableSetColumnIndex(2);
166 ImGui::Text(
"%d", routine.line);
167 ImGui::TableSetColumnIndex(3);
168 ImGui::Text(
"%d", routine.references);
169 ImGui::TableSetColumnIndex(4);
170 ImGui::TextUnformatted(routine.local ?
"local" :
"global");
194 const float left_width = ImGui::GetContentRegionAvail().x * 0.58f;
195 ImGui::BeginChild(
"oracle_menu_components_list", ImVec2(left_width, 340.0f),
196 ImGuiChildFlags_Borders);
197 if (ImGui::BeginTable(
"oracle_menu_components_table", 5,
198 ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg |
199 ImGuiTableFlags_Resizable |
200 ImGuiTableFlags_ScrollY)) {
201 ImGui::TableSetupColumn(
"Table");
202 ImGui::TableSetupColumn(
"Index", ImGuiTableColumnFlags_WidthFixed, 55.0f);
203 ImGui::TableSetupColumn(
"Row", ImGuiTableColumnFlags_WidthFixed, 50.0f);
204 ImGui::TableSetupColumn(
"Col", ImGuiTableColumnFlags_WidthFixed, 50.0f);
205 ImGui::TableSetupColumn(
"Ref");
206 ImGui::TableHeadersRow();
210 ImGui::TableNextRow();
212 ImGui::TableSetColumnIndex(0);
214 std::string row_label =
215 absl::StrFormat(
"%s##oracle_component_%d", component->table_label, i);
216 if (ImGui::Selectable(row_label.c_str(), selected,
217 ImGuiSelectableFlags_SpanAllColumns)) {
223 ImGui::TableSetColumnIndex(1);
224 ImGui::Text(
"%d", component->index);
225 ImGui::TableSetColumnIndex(2);
226 ImGui::Text(
"%d", component->row);
227 ImGui::TableSetColumnIndex(3);
228 ImGui::Text(
"%d", component->col);
229 ImGui::TableSetColumnIndex(4);
230 ImGui::Text(
"%s:%d", component->asm_path.c_str(), component->line);
238 ImGui::BeginChild(
"oracle_menu_component_editor", ImVec2(0, 340.0f),
239 ImGuiChildFlags_Borders);
243 ImGui::TextDisabled(tr(
"Select a component row to preview/apply edits."));
249 ImGui::Text(tr(
"Table: %s"), component->table_label.c_str());
250 ImGui::Text(tr(
"Index: %d"), component->index);
251 ImGui::Text(tr(
"ASM: %s:%d"), component->asm_path.c_str(), component->line);
252 if (!component->note.empty()) {
253 ImGui::TextDisabled(tr(
"Note: %s"), component->note.c_str());
266 if (ImGui::Button(tr(
"Preview"))) {
272 absl::StrFormat(
"Preview failed: %s", edit_or.status().message());
274 const auto& edit = edit_or.value();
276 "Preview %s[%d] (%d,%d) -> (%d,%d)", edit.table_label, edit.index,
277 edit.old_row, edit.old_col, edit.new_row, edit.new_col);
281 if (ImGui::Button(tr(
"Apply"))) {
287 absl::StrFormat(
"Apply failed: %s", edit_or.status().message());
289 const auto& edit = edit_or.value();
291 "Applied %s[%d] (%d,%d) -> (%d,%d)", edit.table_label, edit.index,
292 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.