stmm-games-doc  0.32.0
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
stmg::ShowTextEvent Class Reference
Inheritance diagram for stmg::ShowTextEvent:
Inheritance graph
[legend]

Classes

struct  Init
 
struct  LocalInit
 
struct  SobstItem
 

Public Types

enum  SOBST_TYPE { SOBST_TYPE_INPUT = 0, SOBST_TYPE_VAR_ID = 1, SOBST_TYPE_INTERVAL = 10 }
 
enum  SOBST_INPUT_TYPE {
  SOBST_INPUT_TYPE_MSG = 0, SOBST_INPUT_TYPE_VALUE = 1, SOBST_INPUT_TYPE_VALUE_X = 2, SOBST_INPUT_TYPE_VALUE_Y = 3,
  SOBST_INPUT_TYPE_TICK = 10, SOBST_INPUT_TYPE_EVENT = 11
}
 If SobstItem::m_eSobstType is SOBST_TYPE_INPUT, SobstItem::m_nParam1 contains a value from this enumeration. More...
 
enum  SOBST_INTERVAL_TYPE { SOBST_INTERVAL_TYPE_GAME = 0, SOBST_INTERVAL_TYPE_LEVEL = 1 }
 If SobstItem::m_eSobstType is SOBST_TYPE_INTERVAL, SobstItem::m_nParam1 contains a value from this enumeration. More...
 
enum  { MESSAGE_STOP_ANIMATION = 100, MESSAGE_START_ANIMATION_AT = 110 }
 
- Public Types inherited from stmg::Event
enum  MSG_FILTER_VALUE_OP {
  MSG_FILTER_VALUE_OP_FIRST = 0, MSG_FILTER_VALUE_OP_UNCHANGED = 0, MSG_FILTER_VALUE_OP_SET = 1, MSG_FILTER_VALUE_OP_MULT_ADD = 2,
  MSG_FILTER_VALUE_OP_DIV_ADD = 3, MSG_FILTER_VALUE_OP_PERCENT_ADD = 4, MSG_FILTER_VALUE_OP_PERMILL_ADD = 5, MSG_FILTER_VALUE_OP_MOD_ADD = 6,
  MSG_FILTER_VALUE_OP_MIN_ADD = 7, MSG_FILTER_VALUE_OP_MAX_ADD = 8, MSG_FILTER_VALUE_OP_LAST = 8
}
 Value filter. More...
 
enum  { LISTENER_GROUP_FINISHED = 0 }
 

Public Member Functions

 ShowTextEvent (Init &&oInit) noexcept
 Constructor. More...
 
void trigger (int32_t nMsg, int32_t nValue, Event *p0TriggeringEvent) noexcept override
 The trigger function. More...
 
- Public Member Functions inherited from stmg::Event
virtual ~Event () noexcept=default
 
virtual void addMsgFilter (int32_t nInFromMsg, int32_t nInToMsg, int32_t nInFromValue, int32_t nInToValue, bool bOutMsgDefined, int32_t nOutMsg, MSG_FILTER_VALUE_OP eOutValueOperator, int32_t nOutValueOperand, int32_t nOutValueAdd) noexcept
 Add a message filter. More...
 
virtual void addListener (int32_t nGroupId, Event *p0ListenerEvent, int32_t nMsg) noexcept
 Adds a listener to the event. More...
 
bool isActive () const noexcept
 Tells whether the event is active. More...
 
int32_t getTriggerTime () const noexcept
 The triggering time. More...
 
int32_t getPriority () const noexcept
 The priority. More...
 
int32_t getDebugTag () const noexcept
 The debug tag. More...
 

Static Public Attributes

static constexpr int32_t s_nShowTextEventDefaultZ = 100000
 

Protected Member Functions

void reInit (Init &&oInit) noexcept
 See constructor. More...
 
- Protected Member Functions inherited from stmg::Event
 Event (Init &&oInit) noexcept
 Constructor. More...
 
void reInit (Init &&oInit) noexcept
 Reinitialization. More...
 
virtual void informListeners (int32_t nGroupId, int32_t nValue) noexcept
 Calls the trigger function of a group of listeners. More...
 
const Levellevel () const noexcept
 The level this event belongs to. More...
 
Levellevel () noexcept
 The level this event belongs to. More...
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MESSAGE_STOP_ANIMATION 

Stop animation (if one is active).

MESSAGE_START_ANIMATION_AT 

Starts animation at position nValue packed with Util::packPointToInt32(x,y).

The width and the height are unchanged.

◆ SOBST_INPUT_TYPE

If SobstItem::m_eSobstType is SOBST_TYPE_INPUT, SobstItem::m_nParam1 contains a value from this enumeration.

Enumerator
SOBST_INPUT_TYPE_MSG 

The message number passed to the trigger function.

%im%%.

SOBST_INPUT_TYPE_VALUE 

The value passed to the trigger function.

%iv%%.

SOBST_INPUT_TYPE_VALUE_X 

The value as unpacked coords x passed to the trigger function.

%iv%%.

SOBST_INPUT_TYPE_VALUE_Y 

The value as unpacked coords x passed to the trigger function.

%iv%%.

SOBST_INPUT_TYPE_TICK 

The current game tick.

%it%%.

SOBST_INPUT_TYPE_EVENT 

Whether the event was triggered by another event (bool) or by the timer.

%ie%%.

◆ SOBST_INTERVAL_TYPE

If SobstItem::m_eSobstType is SOBST_TYPE_INTERVAL, SobstItem::m_nParam1 contains a value from this enumeration.

Enumerator
SOBST_INTERVAL_TYPE_GAME 

The current game interval in milliseconds.

%dg%%

SOBST_INTERVAL_TYPE_LEVEL 

The current level interval in milliseconds.

%dl%%

◆ SOBST_TYPE

Enumerator
SOBST_TYPE_INPUT 

Input message.

%im%% %iv%% %it%% %ie%% etc.

SOBST_TYPE_VAR_ID 

Variable content of game, level team or player.

%vm00Points%% %vgTime%% etc.

SOBST_TYPE_INTERVAL 

Game interval in milliseconds of game and level.

%fg%% %fl%% etc.

Constructor & Destructor Documentation

◆ ShowTextEvent()

stmg::ShowTextEvent::ShowTextEvent ( Init &&  oInit)
explicitnoexcept

Constructor.

Parameters
oInitThe parameters.

Member Function Documentation

◆ reInit()

void stmg::ShowTextEvent::reInit ( Init &&  oInit)
protectednoexcept

See constructor.

◆ trigger()

void stmg::ShowTextEvent::trigger ( int32_t  nMsg,
int32_t  nValue,
Event p0TriggeringEvent 
)
overridevirtualnoexcept

The trigger function.

This function provides the functionality of the event and can be called in two ways.

It can be called by an event through informListeners() this event was listening to. Note: events can listen to themselves.

It can also be called by the timer if the event was active.

When this function is called the event has already been deactivated by the level (if it was active in the first place).

When this function is called the filters of this event have already been applied.

Parameters
nMsgThe message received.
nValueThe value received.
p0TriggeringEventThe triggering event or null if triggered by timer.

Implements stmg::Event.

Member Data Documentation

◆ s_nShowTextEventDefaultZ

constexpr int32_t stmg::ShowTextEvent::s_nShowTextEventDefaultZ = 100000
static