- Added TutorialMessage ability
-- Tutorial Messages are an ability like any other, except it can only be displayed once. Subsequent calls are ignored, the ability is removed from the game as soon as it is added -- This allows to add event triggered messages ingame. Messages are either text, or images (I don't have an image sample, but rules/classic.txt has a few examples that might help) -- only tested on Windows, although I made sure the PSP version compiles. Hopefully I also made the necessary for it to work in the touch version (touching the screen should be enough to close the tuto message) -- Room for improvement: possibility to choose a title in text mode, possibility to have some messages depending on others (e.g.: don't show message X until message Y has been shown), improve some of the abilities and triggers to give more flexibility, add events outside of game, to allow tuto messages in deck creator, etc...
This commit is contained in:
@@ -15,6 +15,7 @@ The Action Stack contains all information for Game Events that can be interrupte
|
||||
#include "Translate.h"
|
||||
#include "WResourceManager.h"
|
||||
#include "ModRules.h"
|
||||
#include "AllAbilities.h"
|
||||
|
||||
#include <typeinfo>
|
||||
|
||||
@@ -822,6 +823,12 @@ int ActionStack::receiveEventPlus(WEvent * event)
|
||||
|
||||
void ActionStack::Update(float dt)
|
||||
{
|
||||
|
||||
//This is a hack to avoid updating the stack while tuto messages are being shown
|
||||
//Ideally, the tuto messages should be moved to a layer above this one
|
||||
if (ATutorialMessage::Current)
|
||||
return;
|
||||
|
||||
askIfWishesToInterrupt = NULL;
|
||||
//modal = 0;
|
||||
GameObserver * game = GameObserver::GetInstance();
|
||||
@@ -1080,6 +1087,11 @@ void ActionStack::Fizzle(Interruptible * action)
|
||||
|
||||
void ActionStack::Render()
|
||||
{
|
||||
//This is a hack to avoid rendering the stack above the tuto messages
|
||||
//Ideally, the tuto messages should be moved to a layer above this one
|
||||
if (ATutorialMessage::Current)
|
||||
return;
|
||||
|
||||
static const float kSpacer = 8;
|
||||
static const float x0 = 250;
|
||||
static const float y0 = 0;
|
||||
|
||||
Reference in New Issue
Block a user