mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 13:30:06 +00:00
Fix: selected time is uninitialized on layer initialization
This commit is contained in:
parent
3ba569354e
commit
2f2516b998
4 changed files with 11 additions and 0 deletions
|
|
@ -112,6 +112,11 @@ public:
|
|||
TimelineManager::TimelineManager() : p(std::make_unique<Impl>(this)) {}
|
||||
TimelineManager::~TimelineManager() = default;
|
||||
|
||||
std::chrono::system_clock::time_point TimelineManager::GetSelectedTime() const
|
||||
{
|
||||
return p->selectedTime_;
|
||||
}
|
||||
|
||||
void TimelineManager::SetMapCount(std::size_t mapCount)
|
||||
{
|
||||
p->mapCount_ = mapCount;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ public:
|
|||
|
||||
static std::shared_ptr<TimelineManager> Instance();
|
||||
|
||||
std::chrono::system_clock::time_point GetSelectedTime() const;
|
||||
|
||||
void SetMapCount(std::size_t mapCount);
|
||||
|
||||
public slots:
|
||||
|
|
|
|||
|
|
@ -268,6 +268,8 @@ void AlertLayer::Initialize()
|
|||
|
||||
auto& alertLayerHandler = AlertLayerHandler::Instance();
|
||||
|
||||
p->selectedTime_ = manager::TimelineManager::Instance()->GetSelectedTime();
|
||||
|
||||
// Take a shared lock to prevent handling additional alerts while populating
|
||||
// initial lists
|
||||
std::shared_lock lock {alertLayerHandler.alertMutex_};
|
||||
|
|
|
|||
|
|
@ -122,6 +122,8 @@ void PlacefileLayer::Initialize()
|
|||
logger_->debug("Initialize()");
|
||||
|
||||
DrawLayer::Initialize();
|
||||
|
||||
p->selectedTime_ = manager::TimelineManager::Instance()->GetSelectedTime();
|
||||
}
|
||||
|
||||
void PlacefileLayer::Render(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue