yaze
0.3.2
Link to the Past ROM Editor
Loading...
Searching...
No Matches
oracle_state_library_panel.h
Go to the documentation of this file.
1
#ifndef YAZE_APP_EDITOR_AGENT_PANELS_ORACLE_STATE_LIBRARY_PANEL_H_
2
#define YAZE_APP_EDITOR_AGENT_PANELS_ORACLE_STATE_LIBRARY_PANEL_H_
3
4
#include <memory>
5
#include <string>
6
#include <vector>
7
8
#include "absl/status/status.h"
9
#include "
app/emu/mesen/mesen_socket_client.h
"
10
11
namespace
yaze
{
12
namespace
editor {
13
17
struct
StateEntry
{
18
std::string
id
;
19
std::string
label
;
20
std::string
path
;
21
std::string
status
;
// "draft", "canon", "deprecated"
22
std::string
md5
;
23
std::string
captured_by
;
24
std::string
verified_by
;
25
std::string
verified_at
;
26
std::string
deprecated_reason
;
27
std::vector<std::string>
tags
;
28
29
// Metadata
30
int
module
= 0;
31
int
room
= 0;
32
int
area
= 0;
33
bool
indoors
=
false
;
34
int
link_x
= 0;
35
int
link_y
= 0;
36
int
health
= 0;
37
int
max_health
= 0;
38
int
rupees
= 0;
39
std::string
location
;
40
std::string
summary
;
41
};
42
53
class
OracleStateLibraryPanel
{
54
public
:
55
OracleStateLibraryPanel
();
56
~OracleStateLibraryPanel
();
57
61
void
Draw
();
62
66
void
SetClient
(std::shared_ptr<emu::mesen::MesenSocketClient> client);
67
71
void
RefreshLibrary
();
72
76
absl::Status
LoadState
(
const
std::string& state_id);
77
81
absl::Status
VerifyState
(
const
std::string& state_id);
82
86
absl::Status
DeprecateState
(
const
std::string& state_id,
87
const
std::string& reason);
88
89
private
:
90
void
DrawToolbar
();
91
void
DrawStateList
();
92
void
DrawStateDetails
();
93
void
DrawVerificationDialog
();
94
void
LoadManifest
();
95
void
SaveManifest
();
96
97
std::shared_ptr<emu::mesen::MesenSocketClient>
client_
;
98
99
// Library data
100
std::vector<StateEntry>
entries_
;
101
std::string
library_root_
;
102
std::string
manifest_path_
;
103
104
// UI state
105
int
selected_index_
= -1;
106
bool
show_deprecated_
=
false
;
107
bool
show_draft_
=
true
;
108
bool
show_canon_
=
true
;
109
char
filter_text_
[128] = {};
110
char
tag_filter_
[64] = {};
111
112
// Verification dialog state
113
bool
show_verify_dialog_
=
false
;
114
std::string
verify_target_id_
;
115
char
verify_notes_
[256] = {};
116
117
// Deprecation dialog state
118
bool
show_deprecate_dialog_
=
false
;
119
std::string
deprecate_target_id_
;
120
char
deprecate_reason_
[256] = {};
121
122
// Status
123
std::string
status_message_
;
124
bool
status_is_error_
=
false
;
125
};
126
127
}
// namespace editor
128
}
// namespace yaze
129
130
#endif
// YAZE_APP_EDITOR_AGENT_PANELS_ORACLE_STATE_LIBRARY_PANEL_H_
yaze::editor::OracleStateLibraryPanel
ImGui panel for Oracle of Secrets save state library management.
Definition
oracle_state_library_panel.h:53
yaze::editor::OracleStateLibraryPanel::filter_text_
char filter_text_[128]
Definition
oracle_state_library_panel.h:109
yaze::editor::OracleStateLibraryPanel::tag_filter_
char tag_filter_[64]
Definition
oracle_state_library_panel.h:110
yaze::editor::OracleStateLibraryPanel::manifest_path_
std::string manifest_path_
Definition
oracle_state_library_panel.h:102
yaze::editor::OracleStateLibraryPanel::Draw
void Draw()
Draw the panel.
Definition
oracle_state_library_panel.cc:282
yaze::editor::OracleStateLibraryPanel::SetClient
void SetClient(std::shared_ptr< emu::mesen::MesenSocketClient > client)
Set the Mesen socket client for emulator communication.
Definition
oracle_state_library_panel.cc:65
yaze::editor::OracleStateLibraryPanel::show_canon_
bool show_canon_
Definition
oracle_state_library_panel.h:108
yaze::editor::OracleStateLibraryPanel::deprecate_reason_
char deprecate_reason_[256]
Definition
oracle_state_library_panel.h:120
yaze::editor::OracleStateLibraryPanel::DrawStateList
void DrawStateList()
Definition
oracle_state_library_panel.cc:353
yaze::editor::OracleStateLibraryPanel::status_is_error_
bool status_is_error_
Definition
oracle_state_library_panel.h:124
yaze::editor::OracleStateLibraryPanel::verify_target_id_
std::string verify_target_id_
Definition
oracle_state_library_panel.h:114
yaze::editor::OracleStateLibraryPanel::show_deprecated_
bool show_deprecated_
Definition
oracle_state_library_panel.h:106
yaze::editor::OracleStateLibraryPanel::client_
std::shared_ptr< emu::mesen::MesenSocketClient > client_
Definition
oracle_state_library_panel.h:97
yaze::editor::OracleStateLibraryPanel::verify_notes_
char verify_notes_[256]
Definition
oracle_state_library_panel.h:115
yaze::editor::OracleStateLibraryPanel::show_deprecate_dialog_
bool show_deprecate_dialog_
Definition
oracle_state_library_panel.h:118
yaze::editor::OracleStateLibraryPanel::VerifyState
absl::Status VerifyState(const std::string &state_id)
Verify and promote a state to canon.
Definition
oracle_state_library_panel.cc:251
yaze::editor::OracleStateLibraryPanel::DeprecateState
absl::Status DeprecateState(const std::string &state_id, const std::string &reason)
Deprecate a state.
Definition
oracle_state_library_panel.cc:267
yaze::editor::OracleStateLibraryPanel::LoadState
absl::Status LoadState(const std::string &state_id)
Load a state into the emulator.
Definition
oracle_state_library_panel.cc:196
yaze::editor::OracleStateLibraryPanel::RefreshLibrary
void RefreshLibrary()
Refresh the state library from disk.
Definition
oracle_state_library_panel.cc:70
yaze::editor::OracleStateLibraryPanel::selected_index_
int selected_index_
Definition
oracle_state_library_panel.h:105
yaze::editor::OracleStateLibraryPanel::library_root_
std::string library_root_
Definition
oracle_state_library_panel.h:101
yaze::editor::OracleStateLibraryPanel::show_draft_
bool show_draft_
Definition
oracle_state_library_panel.h:107
yaze::editor::OracleStateLibraryPanel::DrawStateDetails
void DrawStateDetails()
Definition
oracle_state_library_panel.cc:437
yaze::editor::OracleStateLibraryPanel::~OracleStateLibraryPanel
~OracleStateLibraryPanel()
yaze::editor::OracleStateLibraryPanel::DrawToolbar
void DrawToolbar()
Definition
oracle_state_library_panel.cc:310
yaze::editor::OracleStateLibraryPanel::SaveManifest
void SaveManifest()
Definition
oracle_state_library_panel.cc:146
yaze::editor::OracleStateLibraryPanel::show_verify_dialog_
bool show_verify_dialog_
Definition
oracle_state_library_panel.h:113
yaze::editor::OracleStateLibraryPanel::LoadManifest
void LoadManifest()
Definition
oracle_state_library_panel.cc:76
yaze::editor::OracleStateLibraryPanel::entries_
std::vector< StateEntry > entries_
Definition
oracle_state_library_panel.h:100
yaze::editor::OracleStateLibraryPanel::DrawVerificationDialog
void DrawVerificationDialog()
Definition
oracle_state_library_panel.cc:536
yaze::editor::OracleStateLibraryPanel::deprecate_target_id_
std::string deprecate_target_id_
Definition
oracle_state_library_panel.h:119
yaze::editor::OracleStateLibraryPanel::status_message_
std::string status_message_
Definition
oracle_state_library_panel.h:123
yaze::editor::OracleStateLibraryPanel::OracleStateLibraryPanel
OracleStateLibraryPanel()
Definition
oracle_state_library_panel.cc:52
mesen_socket_client.h
yaze
Definition
patch_export_usage.cc:8
yaze::editor::StateEntry
State entry from the Oracle save state library.
Definition
oracle_state_library_panel.h:17
yaze::editor::StateEntry::id
std::string id
Definition
oracle_state_library_panel.h:18
yaze::editor::StateEntry::location
std::string location
Definition
oracle_state_library_panel.h:39
yaze::editor::StateEntry::verified_by
std::string verified_by
Definition
oracle_state_library_panel.h:24
yaze::editor::StateEntry::max_health
int max_health
Definition
oracle_state_library_panel.h:37
yaze::editor::StateEntry::link_x
int link_x
Definition
oracle_state_library_panel.h:34
yaze::editor::StateEntry::rupees
int rupees
Definition
oracle_state_library_panel.h:38
yaze::editor::StateEntry::path
std::string path
Definition
oracle_state_library_panel.h:20
yaze::editor::StateEntry::tags
std::vector< std::string > tags
Definition
oracle_state_library_panel.h:27
yaze::editor::StateEntry::indoors
bool indoors
Definition
oracle_state_library_panel.h:33
yaze::editor::StateEntry::label
std::string label
Definition
oracle_state_library_panel.h:19
yaze::editor::StateEntry::md5
std::string md5
Definition
oracle_state_library_panel.h:22
yaze::editor::StateEntry::link_y
int link_y
Definition
oracle_state_library_panel.h:35
yaze::editor::StateEntry::health
int health
Definition
oracle_state_library_panel.h:36
yaze::editor::StateEntry::area
int area
Definition
oracle_state_library_panel.h:32
yaze::editor::StateEntry::summary
std::string summary
Definition
oracle_state_library_panel.h:40
yaze::editor::StateEntry::status
std::string status
Definition
oracle_state_library_panel.h:21
yaze::editor::StateEntry::room
int room
Definition
oracle_state_library_panel.h:31
yaze::editor::StateEntry::captured_by
std::string captured_by
Definition
oracle_state_library_panel.h:23
yaze::editor::StateEntry::deprecated_reason
std::string deprecated_reason
Definition
oracle_state_library_panel.h:26
yaze::editor::StateEntry::verified_at
std::string verified_at
Definition
oracle_state_library_panel.h:25
src
app
editor
agent
panels
oracle_state_library_panel.h
Generated by
1.10.0