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

"Census" overlay for the Room Matrix. More...

#include <room_matrix_census.h>

Collaboration diagram for yaze::editor::RoomMatrixCensusOverlay:

Public Types

using ManifestProvider = std::function<const core::HackManifest*()>
 

Public Member Functions

 RoomMatrixCensusOverlay ()
 
 ~RoomMatrixCensusOverlay ()
 
void SetManifestProvider (ManifestProvider provider)
 
bool enabled () const
 
void SetEnabled (bool enabled)
 
void Update (Rom *rom)
 
void Invalidate ()
 
void DrawControls (Rom *rom)
 
const zelda3::RoomCensus * census () const
 
bool computing () const
 
ImU32 FillColor (int room_id) const
 
std::optional< ImU32 > StatusOutline (int room_id) const
 
bool InLargestFreeBlock (int room_id) const
 
bool IsOrphan (int room_id) const
 
bool MatchesChips (int room_id) const
 
bool HasActiveChips () const
 
void DrawTooltip (int room_id) const
 
void SetFilterFree (bool on)
 
void SetFilterReclaimable (bool on)
 
void ToggleOwnerFilter (int owner_index)
 

Static Public Member Functions

static ImU32 OrphanMarkColor ()
 
static ImU32 BlockHaloColor (float alpha)
 
static ImVec4 OwnerColor (int owner_index, bool interior)
 

Private Member Functions

void StartComputation (Rom *rom)
 
bool DrawChip (const char *id, const std::string &label, ImVec4 swatch, bool outline_only, bool active, bool first)
 

Static Private Member Functions

static void WrapBeforeItem (float item_width, bool first)
 

Private Attributes

ManifestProvider manifest_provider_
 
bool enabled_ = false
 
bool stale_ = true
 
const Rom * computed_for_ = nullptr
 
uint64_t observed_asset_generation_ = 0
 
uint64_t observed_rom_revision_ = 0
 
bool observed_custom_enabled_ = false
 
std::optional< zelda3::RoomCensus > census_
 
std::string error_
 
std::future< absl::StatusOr< zelda3::RoomCensus > > pending_
 
util::StopSource stop_source_ {util::kNoStopState}
 
std::set< int > largest_block_
 
bool filter_free_ = false
 
bool filter_reclaimable_ = false
 
bool filter_orphan_ = false
 
std::set< int > filter_owners_
 

Friends

class RoomMatrixCensusTestPeer
 

Detailed Description

"Census" overlay for the Room Matrix.

Runs zelda3::ComputeRoomCensus (the model behind z3ed dungeon-room-census) on a copy of the ROM in the background, then colors cells by owner, outlines free (green) and reclaimable (yellow) rooms, draws the legend/filter chips and the largest-free-block summary, and fills the cell tooltip.

Definition at line 32 of file room_matrix_census.h.

Member Typedef Documentation

◆ ManifestProvider

Definition at line 34 of file room_matrix_census.h.

Constructor & Destructor Documentation

◆ RoomMatrixCensusOverlay()

yaze::editor::RoomMatrixCensusOverlay::RoomMatrixCensusOverlay ( )
default

◆ ~RoomMatrixCensusOverlay()

yaze::editor::RoomMatrixCensusOverlay::~RoomMatrixCensusOverlay ( )

Definition at line 78 of file room_matrix_census.cc.

References yaze::util::StopSource::request_stop(), and stop_source_.

Here is the call graph for this function:

Member Function Documentation

◆ SetManifestProvider()

void yaze::editor::RoomMatrixCensusOverlay::SetManifestProvider ( ManifestProvider provider)
inline

Definition at line 39 of file room_matrix_census.h.

References Invalidate(), and manifest_provider_.

Referenced by yaze::editor::RoomMatrixContent::DetachRuntimeContext(), and yaze::editor::RoomMatrixContent::SetCensusManifestProvider().

Here is the call graph for this function:

◆ enabled()

bool yaze::editor::RoomMatrixCensusOverlay::enabled ( ) const
inline

Definition at line 44 of file room_matrix_census.h.

References enabled_.

Referenced by yaze::editor::RoomMatrixContent::Draw(), and SetEnabled().

◆ SetEnabled()

void yaze::editor::RoomMatrixCensusOverlay::SetEnabled ( bool enabled)
inline

Definition at line 45 of file room_matrix_census.h.

References enabled(), enabled_, Invalidate(), and pending_.

Referenced by yaze::editor::RoomMatrixContent::DetachRuntimeContext().

Here is the call graph for this function:

◆ Update()

◆ Invalidate()

void yaze::editor::RoomMatrixCensusOverlay::Invalidate ( )
inline

◆ DrawControls()

void yaze::editor::RoomMatrixCensusOverlay::DrawControls ( Rom * rom)

◆ census()

const zelda3::RoomCensus * yaze::editor::RoomMatrixCensusOverlay::census ( ) const
inline

Definition at line 66 of file room_matrix_census.h.

References census_, and enabled_.

Referenced by yaze::editor::RoomMatrixContent::Draw(), and StartComputation().

◆ computing()

bool yaze::editor::RoomMatrixCensusOverlay::computing ( ) const
inline

Definition at line 69 of file room_matrix_census.h.

References pending_.

◆ FillColor()

ImU32 yaze::editor::RoomMatrixCensusOverlay::FillColor ( int room_id) const

Definition at line 414 of file room_matrix_census.cc.

Referenced by yaze::editor::RoomMatrixContent::Draw().

◆ StatusOutline()

std::optional< ImU32 > yaze::editor::RoomMatrixCensusOverlay::StatusOutline ( int room_id) const

◆ InLargestFreeBlock()

bool yaze::editor::RoomMatrixCensusOverlay::InLargestFreeBlock ( int room_id) const

◆ OrphanMarkColor()

ImU32 yaze::editor::RoomMatrixCensusOverlay::OrphanMarkColor ( )
static

◆ BlockHaloColor()

ImU32 yaze::editor::RoomMatrixCensusOverlay::BlockHaloColor ( float alpha)
static

◆ IsOrphan()

bool yaze::editor::RoomMatrixCensusOverlay::IsOrphan ( int room_id) const

◆ MatchesChips()

bool yaze::editor::RoomMatrixCensusOverlay::MatchesChips ( int room_id) const

◆ HasActiveChips()

bool yaze::editor::RoomMatrixCensusOverlay::HasActiveChips ( ) const
inline

Definition at line 81 of file room_matrix_census.h.

References filter_free_, filter_orphan_, filter_owners_, and filter_reclaimable_.

◆ DrawTooltip()

void yaze::editor::RoomMatrixCensusOverlay::DrawTooltip ( int room_id) const

◆ SetFilterFree()

void yaze::editor::RoomMatrixCensusOverlay::SetFilterFree ( bool on)
inline

Definition at line 90 of file room_matrix_census.h.

References filter_free_.

◆ SetFilterReclaimable()

void yaze::editor::RoomMatrixCensusOverlay::SetFilterReclaimable ( bool on)
inline

Definition at line 91 of file room_matrix_census.h.

References filter_reclaimable_.

◆ ToggleOwnerFilter()

void yaze::editor::RoomMatrixCensusOverlay::ToggleOwnerFilter ( int owner_index)

Definition at line 278 of file room_matrix_census.cc.

◆ OwnerColor()

ImVec4 yaze::editor::RoomMatrixCensusOverlay::OwnerColor ( int owner_index,
bool interior )
static

Definition at line 82 of file room_matrix_census.cc.

◆ StartComputation()

◆ WrapBeforeItem()

void yaze::editor::RoomMatrixCensusOverlay::WrapBeforeItem ( float item_width,
bool first )
staticprivate

Definition at line 189 of file room_matrix_census.cc.

◆ DrawChip()

bool yaze::editor::RoomMatrixCensusOverlay::DrawChip ( const char * id,
const std::string & label,
ImVec4 swatch,
bool outline_only,
bool active,
bool first )
private

Definition at line 201 of file room_matrix_census.cc.

References yaze::gui::AutoRegisterLastItem().

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ RoomMatrixCensusTestPeer

friend class RoomMatrixCensusTestPeer
friend

Definition at line 96 of file room_matrix_census.h.

Member Data Documentation

◆ manifest_provider_

ManifestProvider yaze::editor::RoomMatrixCensusOverlay::manifest_provider_
private

Definition at line 103 of file room_matrix_census.h.

Referenced by SetManifestProvider(), and StartComputation().

◆ enabled_

bool yaze::editor::RoomMatrixCensusOverlay::enabled_ = false
private

Definition at line 104 of file room_matrix_census.h.

Referenced by census(), enabled(), and SetEnabled().

◆ stale_

bool yaze::editor::RoomMatrixCensusOverlay::stale_ = true
private

Definition at line 105 of file room_matrix_census.h.

Referenced by Invalidate().

◆ computed_for_

const Rom* yaze::editor::RoomMatrixCensusOverlay::computed_for_ = nullptr
private

Definition at line 106 of file room_matrix_census.h.

◆ observed_asset_generation_

uint64_t yaze::editor::RoomMatrixCensusOverlay::observed_asset_generation_ = 0
private

Definition at line 107 of file room_matrix_census.h.

◆ observed_rom_revision_

uint64_t yaze::editor::RoomMatrixCensusOverlay::observed_rom_revision_ = 0
private

Definition at line 108 of file room_matrix_census.h.

◆ observed_custom_enabled_

bool yaze::editor::RoomMatrixCensusOverlay::observed_custom_enabled_ = false
private

Definition at line 109 of file room_matrix_census.h.

◆ census_

std::optional<zelda3::RoomCensus> yaze::editor::RoomMatrixCensusOverlay::census_
private

Definition at line 110 of file room_matrix_census.h.

Referenced by census(), and Invalidate().

◆ error_

std::string yaze::editor::RoomMatrixCensusOverlay::error_
private

Definition at line 111 of file room_matrix_census.h.

Referenced by Invalidate().

◆ pending_

std::future<absl::StatusOr<zelda3::RoomCensus> > yaze::editor::RoomMatrixCensusOverlay::pending_
private

Definition at line 112 of file room_matrix_census.h.

Referenced by computing(), SetEnabled(), and StartComputation().

◆ stop_source_

util::StopSource yaze::editor::RoomMatrixCensusOverlay::stop_source_ {util::kNoStopState}
private

Definition at line 113 of file room_matrix_census.h.

Referenced by Invalidate(), StartComputation(), and ~RoomMatrixCensusOverlay().

◆ largest_block_

std::set<int> yaze::editor::RoomMatrixCensusOverlay::largest_block_
private

Definition at line 114 of file room_matrix_census.h.

Referenced by Invalidate().

◆ filter_free_

bool yaze::editor::RoomMatrixCensusOverlay::filter_free_ = false
private

Definition at line 116 of file room_matrix_census.h.

Referenced by HasActiveChips(), and SetFilterFree().

◆ filter_reclaimable_

bool yaze::editor::RoomMatrixCensusOverlay::filter_reclaimable_ = false
private

Definition at line 117 of file room_matrix_census.h.

Referenced by HasActiveChips(), and SetFilterReclaimable().

◆ filter_orphan_

bool yaze::editor::RoomMatrixCensusOverlay::filter_orphan_ = false
private

Definition at line 118 of file room_matrix_census.h.

Referenced by HasActiveChips().

◆ filter_owners_

std::set<int> yaze::editor::RoomMatrixCensusOverlay::filter_owners_
private

Definition at line 119 of file room_matrix_census.h.

Referenced by HasActiveChips().


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