forked from townforge/townforge
game: add startup tutorial trigger
This commit is contained in:
parent
651488432f
commit
d909ba4dc3
@ -577,6 +577,9 @@ private:
|
||||
|
||||
bool showWalletInfo_;
|
||||
|
||||
Urho3D::Timer startupTutorialTimer_;
|
||||
bool startupTutorialTriggered_;
|
||||
|
||||
std::list<std::shared_ptr<QueuedCommand>> queued_commands;
|
||||
|
||||
struct AddBlockCommand: public QueuedCommand
|
||||
@ -668,7 +671,8 @@ CryptoCityUrho3D::CryptoCityUrho3D(Context *ctx):
|
||||
placing_model_dh(0),
|
||||
placing_model_dr(0),
|
||||
enableUserLight_(false),
|
||||
showWalletInfo_(false)
|
||||
showWalletInfo_(false),
|
||||
startupTutorialTriggered_(false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -2100,6 +2104,16 @@ void CryptoCityUrho3D::HandleUpdate(StringHash eventType, VariantMap& eventData)
|
||||
|
||||
static uint32_t update_count = 0;
|
||||
|
||||
if (update_count == 0)
|
||||
startupTutorialTimer_.Reset();
|
||||
else if (!startupTutorialTriggered_ && startupTutorialTimer_.GetMSec(false) >= 3000)
|
||||
{
|
||||
VariantMap eventData;
|
||||
eventData[TutorialTrigger::P_TAG] = "startup";
|
||||
HandleTutorialTrigger(E_CRYPTOCITY_TUTORIAL_TRIGGER, eventData);
|
||||
startupTutorialTriggered_ = true;
|
||||
}
|
||||
|
||||
if (++update_count == 2)
|
||||
ui->RefreshNotifications();
|
||||
if (newCity_ && gameState.cityState.ready)
|
||||
|
Loading…
Reference in New Issue
Block a user