Skip to content

Instantly share code, notes, and snippets.

@dpasca
Created December 9, 2012 01:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpasca/4242855 to your computer and use it in GitHub Desktop.
Save dpasca/4242855 to your computer and use it in GitHub Desktop.
Some UI logic
// are we waiting for the introduction to go away ?
if ( mStater[STATE_IN_COMM_INTRODUCTION].IsActive() )
{
if NOT( moCharDlgWin->IsActive() ) // is finally the dialog gone ?
{
mStater[STATE_IN_COMM_INTRODUCTION].Deactivate(); // the wait has ended
updateHomeButtonsState(); // set the fighters button on hover
}
}
else
if ( mStater[STATE_IN_COMM_GENERAL].IsActive() )
{
if NOT( moCharDlgWin->IsActive() ) // is finally the dialog gone ?
mStater[STATE_IN_COMM_GENERAL].Deactivate();
}
//
if ( mPendingCredits.size() && !mWidgets["MSGBOX"].IsActive() )
{
if ( mStater[STATE_WAIT_TO_GIVE_CREDS].IsActive() )
{
}
else
if ( mStater[STATE_WAIT_TO_GIVE_CREDS].GetDoneState() )
{
prof.mCredits += mPendingCredits[0].creds;
mPendingCredits.erase( mPendingCredits.begin() + 0 );
SUPERGAME->GetModProfiles()->Save();
}
else
if NOT( mWidgets["CREDITS_DIALOG"].IsActive() )
{
((DUIUT::ConfirmDialog *)&mWidgets["CREDITS_DIALOG"])->SetMessage( mPendingCredits[0].msg.c_str() );
mWidgets["CREDITS_DIALOG"].Activate( true );
}
else
{
if ( -1 != DUIUT::ConfirmDialog::AnimateChoice( &mWidgets["CREDITS_DIALOG"] ) )
mStater[STATE_WAIT_TO_GIVE_CREDS].Activate();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment