yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::PlanningEditor Class Reference

#include <planning_editor.h>

Inheritance diagram for yaze::editor::PlanningEditor:
Collaboration diagram for yaze::editor::PlanningEditor:

Public Member Functions

 PlanningEditor ()
 
void Initialize () override
 
absl::Status Load () override
 
absl::Status Save () override
 
absl::Status Update () override
 
absl::Status Undo () override
 
absl::Status Redo () override
 
absl::Status Cut () override
 
absl::Status Copy () override
 
absl::Status Paste () override
 
absl::Status Find () override
 
bool CanUndo () const override
 
bool CanRedo () const override
 
bool CanCut () const override
 
bool CanCopy () const override
 
bool CanPaste () const override
 
void DrawOverview ()
 
void DrawRoute ()
 
bool dirty () const
 
bool HasPendingProjectDraftChanges () const
 
void DiscardProjectDraftChanges ()
 
const std::optional< core::ProjectPlan > & plan () const
 
- Public Member Functions inherited from yaze::editor::Editor
 Editor ()=default
 
virtual ~Editor ()=default
 
virtual void SetDependencies (const EditorDependencies &deps)
 
virtual void SetGameData (zelda3::GameData *game_data)
 
virtual absl::Status BeginSaveTransaction ()
 
virtual void RollbackSaveTransaction ()
 
virtual void CommitSaveTransaction ()
 
virtual void PrepareForSessionTeardown ()
 
virtual std::string GetUndoDescription () const
 
virtual std::string GetRedoDescription () const
 
const UndoManager & undo_manager () const
 
virtual absl::Status Clear ()
 
virtual bool CanFind () const
 
virtual void ContributeStatus (StatusBar *)
 
virtual void DrawEditorMenu ()
 
virtual void DrawEditMenuItems ()
 
virtual EditorContextSnapshot BuildContextSnapshot () const
 
EditorType type () const
 
bool * active ()
 
void set_active (bool active)
 
void toggle_active ()
 
virtual bool IsRomLoaded () const
 
virtual std::string GetRomStatus () const
 
Rom * rom () const
 
zelda3::GameData * game_data () const
 
project::YazeProject * project () const
 
core::VersionManager * version_manager () const
 
EditorContext context () const
 
bool HasContext () const
 

Private Member Functions

absl::Status SyncWithProject ()
 
absl::Status Reload (bool discard_changes=false)
 
bool DrawPlanHeader ()
 
void DrawNoPlan ()
 
void DrawGoal ()
 
void DrawMilestones ()
 
void DrawRouteStrip ()
 
void DrawDecisionQueue ()
 
void DrawReferences ()
 
void DrawAgentStatus ()
 
void DrawAgentObservation (const std::string &key)
 
void DrawStepList ()
 
void DrawStepDetail ()
 
void DrawItems ()
 
void DrawTargets (const std::vector< std::string > &targets, const char *id)
 
void OpenTarget (const std::string &target)
 
void MarkDirty ()
 

Private Attributes

std::string plan_path_
 
std::string project_path_
 
std::string loaded_source_
 
std::optional< core::ProjectPlan > plan_
 
std::string load_error_
 
std::string save_error_
 
std::string new_plan_path_
 
bool dirty_ = false
 
bool panels_registered_ = false
 
int selected_step_ = -1
 
int selected_item_ = -1
 
bool items_at_step_only_ = true
 

Friends

class PlanningEditorTestPeer
 

Additional Inherited Members

- Protected Member Functions inherited from yaze::editor::Editor
std::string MakePanelTitle (const std::string &base_title) const
 
std::string MakeWindowId (const std::string &base_id) const
 
template<typename T >
absl::StatusOr< T > SafeRomAccess (std::function< T()> accessor, const std::string &operation="") const
 
- Protected Attributes inherited from yaze::editor::Editor
bool active_ = false
 
EditorType type_
 
EditorDependencies dependencies_
 
UndoManager undo_manager_
 

Detailed Description

Definition at line 16 of file planning_editor.h.

Constructor & Destructor Documentation

◆ PlanningEditor()

yaze::editor::PlanningEditor::PlanningEditor ( )
inline

Definition at line 20 of file planning_editor.h.

References yaze::editor::kPlanning, and yaze::editor::Editor::type_.

Member Function Documentation

◆ Initialize()

void yaze::editor::PlanningEditor::Initialize ( )
overridevirtual

◆ Load()

absl::Status yaze::editor::PlanningEditor::Load ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 23 of file planning_editor.h.

◆ Save()

absl::Status yaze::editor::PlanningEditor::Save ( )
overridevirtual

◆ Update()

absl::Status yaze::editor::PlanningEditor::Update ( )
overridevirtual

Implements yaze::editor::Editor.

Definition at line 158 of file planning_editor.cc.

References SyncWithProject().

Here is the call graph for this function:

◆ Undo()

absl::Status yaze::editor::PlanningEditor::Undo ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 27 of file planning_editor.h.

◆ Redo()

absl::Status yaze::editor::PlanningEditor::Redo ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 28 of file planning_editor.h.

◆ Cut()

absl::Status yaze::editor::PlanningEditor::Cut ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 29 of file planning_editor.h.

◆ Copy()

absl::Status yaze::editor::PlanningEditor::Copy ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 30 of file planning_editor.h.

◆ Paste()

absl::Status yaze::editor::PlanningEditor::Paste ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 31 of file planning_editor.h.

◆ Find()

absl::Status yaze::editor::PlanningEditor::Find ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 32 of file planning_editor.h.

◆ CanUndo()

bool yaze::editor::PlanningEditor::CanUndo ( ) const
inlineoverridevirtual

Reimplemented from yaze::editor::Editor.

Definition at line 33 of file planning_editor.h.

◆ CanRedo()

bool yaze::editor::PlanningEditor::CanRedo ( ) const
inlineoverridevirtual

Reimplemented from yaze::editor::Editor.

Definition at line 34 of file planning_editor.h.

◆ CanCut()

bool yaze::editor::PlanningEditor::CanCut ( ) const
inlineoverridevirtual

Reimplemented from yaze::editor::Editor.

Definition at line 35 of file planning_editor.h.

◆ CanCopy()

bool yaze::editor::PlanningEditor::CanCopy ( ) const
inlineoverridevirtual

Reimplemented from yaze::editor::Editor.

Definition at line 36 of file planning_editor.h.

◆ CanPaste()

bool yaze::editor::PlanningEditor::CanPaste ( ) const
inlineoverridevirtual

Reimplemented from yaze::editor::Editor.

Definition at line 37 of file planning_editor.h.

◆ DrawOverview()

void yaze::editor::PlanningEditor::DrawOverview ( )

◆ DrawRoute()

void yaze::editor::PlanningEditor::DrawRoute ( )

Definition at line 574 of file planning_editor.cc.

References DrawItems(), DrawPlanHeader(), DrawStepDetail(), and DrawStepList().

Referenced by Initialize().

Here is the call graph for this function:

◆ dirty()

bool yaze::editor::PlanningEditor::dirty ( ) const
inline

Definition at line 42 of file planning_editor.h.

References dirty_.

◆ HasPendingProjectDraftChanges()

bool yaze::editor::PlanningEditor::HasPendingProjectDraftChanges ( ) const
inline

Definition at line 43 of file planning_editor.h.

References dirty_.

Referenced by yaze::editor::EditorSet::HasPendingPlanningProjectDraftChanges().

◆ DiscardProjectDraftChanges()

void yaze::editor::PlanningEditor::DiscardProjectDraftChanges ( )

Definition at line 244 of file planning_editor.cc.

References dirty_, loaded_source_, plan_, plan_path_, project_path_, save_error_, and SyncWithProject().

Here is the call graph for this function:

◆ plan()

const std::optional< core::ProjectPlan > & yaze::editor::PlanningEditor::plan ( ) const
inline

Definition at line 47 of file planning_editor.h.

References plan_.

◆ SyncWithProject()

absl::Status yaze::editor::PlanningEditor::SyncWithProject ( )
private

◆ Reload()

absl::Status yaze::editor::PlanningEditor::Reload ( bool discard_changes = false)
private

Definition at line 219 of file planning_editor.cc.

References dirty_, load_error_, loaded_source_, yaze::core::ProjectPlan::LoadFromFile(), plan_, plan_path_, save_error_, selected_item_, and selected_step_.

Referenced by DrawNoPlan(), DrawPlanHeader(), and SyncWithProject().

Here is the call graph for this function:

◆ DrawPlanHeader()

◆ DrawNoPlan()

◆ DrawGoal()

void yaze::editor::PlanningEditor::DrawGoal ( )
private

Definition at line 361 of file planning_editor.cc.

References ICON_MD_FLAG, MarkDirty(), and plan_.

Referenced by DrawOverview().

Here is the call graph for this function:

◆ DrawMilestones()

void yaze::editor::PlanningEditor::DrawMilestones ( )
private

◆ DrawRouteStrip()

void yaze::editor::PlanningEditor::DrawRouteStrip ( )
private

Definition at line 444 of file planning_editor.cc.

References yaze::gui::ColoredText(), DrawAgentObservation(), DrawTargets(), ICON_MD_CHEVRON_RIGHT, ICON_MD_ROUTE, plan_, selected_item_, and selected_step_.

Referenced by DrawOverview().

Here is the call graph for this function:

◆ DrawDecisionQueue()

void yaze::editor::PlanningEditor::DrawDecisionQueue ( )
private

◆ DrawReferences()

void yaze::editor::PlanningEditor::DrawReferences ( )
private

Definition at line 548 of file planning_editor.cc.

References ICON_MD_CONTENT_COPY, ICON_MD_EVENT_NOTE, and plan_.

Referenced by DrawOverview().

◆ DrawAgentStatus()

◆ DrawAgentObservation()

void yaze::editor::PlanningEditor::DrawAgentObservation ( const std::string & key)
private

◆ DrawStepList()

void yaze::editor::PlanningEditor::DrawStepList ( )
private

Definition at line 595 of file planning_editor.cc.

References ICON_MD_ADD, yaze::core::PlanRouteStep::id, yaze::core::PlanRouteStep::kind, MarkDirty(), plan_, selected_step_, and yaze::core::PlanRouteStep::title.

Referenced by DrawRoute().

Here is the call graph for this function:

◆ DrawStepDetail()

void yaze::editor::PlanningEditor::DrawStepDetail ( )
private

Definition at line 652 of file planning_editor.cc.

References DrawAgentObservation(), DrawTargets(), ICON_MD_DELETE, MarkDirty(), plan_, save_error_, and selected_step_.

Referenced by DrawRoute().

Here is the call graph for this function:

◆ DrawItems()

◆ DrawTargets()

void yaze::editor::PlanningEditor::DrawTargets ( const std::vector< std::string > & targets,
const char * id )
private

Definition at line 893 of file planning_editor.cc.

References yaze::core::PlanTarget::NumericId(), OpenTarget(), and yaze::core::PlanTarget::Parse().

Referenced by DrawDecisionQueue(), DrawRouteStrip(), and DrawStepDetail().

Here is the call graph for this function:

◆ OpenTarget()

◆ MarkDirty()

void yaze::editor::PlanningEditor::MarkDirty ( )
inlineprivate

Definition at line 69 of file planning_editor.h.

References dirty_.

Referenced by DrawDecisionQueue(), DrawGoal(), DrawItems(), DrawMilestones(), DrawStepDetail(), and DrawStepList().

Friends And Related Symbol Documentation

◆ PlanningEditorTestPeer

friend class PlanningEditorTestPeer
friend

Definition at line 17 of file planning_editor.h.

Member Data Documentation

◆ plan_path_

std::string yaze::editor::PlanningEditor::plan_path_
private

◆ project_path_

std::string yaze::editor::PlanningEditor::project_path_
private

Definition at line 72 of file planning_editor.h.

Referenced by DiscardProjectDraftChanges(), Save(), and SyncWithProject().

◆ loaded_source_

std::string yaze::editor::PlanningEditor::loaded_source_
private

Definition at line 73 of file planning_editor.h.

Referenced by DiscardProjectDraftChanges(), Reload(), Save(), and SyncWithProject().

◆ plan_

◆ load_error_

std::string yaze::editor::PlanningEditor::load_error_
private

Definition at line 75 of file planning_editor.h.

Referenced by DrawNoPlan(), Reload(), and SyncWithProject().

◆ save_error_

std::string yaze::editor::PlanningEditor::save_error_
private

◆ new_plan_path_

std::string yaze::editor::PlanningEditor::new_plan_path_
private

Definition at line 77 of file planning_editor.h.

Referenced by DrawNoPlan().

◆ dirty_

bool yaze::editor::PlanningEditor::dirty_ = false
private

◆ panels_registered_

bool yaze::editor::PlanningEditor::panels_registered_ = false
private

Definition at line 79 of file planning_editor.h.

Referenced by Initialize().

◆ selected_step_

int yaze::editor::PlanningEditor::selected_step_ = -1
private

◆ selected_item_

int yaze::editor::PlanningEditor::selected_item_ = -1
private

Definition at line 81 of file planning_editor.h.

Referenced by DrawItems(), DrawRouteStrip(), Reload(), and SyncWithProject().

◆ items_at_step_only_

bool yaze::editor::PlanningEditor::items_at_step_only_ = true
private

Definition at line 82 of file planning_editor.h.

Referenced by DrawItems().


The documentation for this class was generated from the following files: