yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
panel_visibility.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_SYSTEM_WORKSPACE_PANEL_VISIBILITY_H_
2#define YAZE_APP_EDITOR_SYSTEM_WORKSPACE_PANEL_VISIBILITY_H_
3
4#include "absl/strings/match.h"
5#include "absl/strings/string_view.h"
6
7namespace yaze::editor {
8
9// These windows are opened by an explicit action, never by saved startup state.
10// Use the base panel ID, without a session prefix.
11inline bool IsTransientPanelVisibilityId(absl::string_view panel_id) {
12 if (panel_id == "overworld.cutscene_camera") {
13 return true;
14 }
15 constexpr absl::string_view kRoomPanelPrefix = "dungeon.room_";
16 if (!absl::StartsWith(panel_id, kRoomPanelPrefix) ||
17 panel_id.size() <= kRoomPanelPrefix.size()) {
18 return false;
19 }
20 for (char ch : panel_id.substr(kRoomPanelPrefix.size())) {
21 if (ch < '0' || ch > '9') {
22 return false;
23 }
24 }
25 return true;
26}
27
28} // namespace yaze::editor
29
30#endif // YAZE_APP_EDITOR_SYSTEM_WORKSPACE_PANEL_VISIBILITY_H_
Editors are the view controllers for the application.
bool IsTransientPanelVisibilityId(absl::string_view panel_id)