OpenClonk
C4GameMessage.h File Reference
#include "lib/StdColors.h"
#include "script/C4Value.h"
Include dependency graph for C4GameMessage.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  C4GameMessage
 
class  C4GameMessageList
 

Functions

void GameMsgObject (const char *szText, C4Object *pTarget)
 
void GameMsgObjectPlayer (const char *szText, C4Object *pTarget, int32_t iPlayer)
 
void GameMsgObjectError (const char *szText, C4Object *pTarget, bool Red=true)
 
void GameMsgObjectDw (const char *szText, C4Object *pTarget, uint32_t dwClr)
 

Variables

const int32_t C4GM_MaxText = 256
 
const int32_t C4GM_MinDelay = 20
 
const int32_t C4GM_Global = 1
 
const int32_t C4GM_GlobalPlayer = 2
 
const int32_t C4GM_Target = 3
 
const int32_t C4GM_TargetPlayer = 4
 
const int32_t C4GM_NoBreak = 1<<0
 
const int32_t C4GM_Bottom = 1<<1
 
const int32_t C4GM_Multiple = 1<<2
 
const int32_t C4GM_Top = 1<<3
 
const int32_t C4GM_Left = 1<<4
 
const int32_t C4GM_Right = 1<<5
 
const int32_t C4GM_HCenter = 1<<6
 
const int32_t C4GM_VCenter = 1<<7
 
const int32_t C4GM_DropSpeech = 1<<8
 
const int32_t C4GM_WidthRel = 1<<9
 
const int32_t C4GM_XRel = 1<<10
 
const int32_t C4GM_YRel = 1<<11
 
const int32_t C4GM_Zoom = 1<<12
 
const int32_t C4GM_PositioningFlags = C4GM_Bottom | C4GM_Top | C4GM_Left | C4GM_Right | C4GM_HCenter | C4GM_VCenter
 
C4GameMessageList Messages
 

Function Documentation

◆ GameMsgObject()

void GameMsgObject ( const char *  szText,
C4Object pTarget 
)
inline

Definition at line 104 of file C4GameMessage.h.

105 {
106  ::Messages.New(C4GM_Target,szText,pTarget,NO_OWNER,0,0,C4RGB(0xff, 0xff, 0xff));
107 }
const int NO_OWNER
Definition: C4Constants.h:137
C4GameMessageList Messages
const int32_t C4GM_Target
Definition: C4GameMessage.h:31
#define C4RGB(r, g, b)
Definition: StdColors.h:26
bool New(int32_t iType, const StdStrBuf &Text, C4Object *pTarget, int32_t iPlayer, int32_t iX=-1, int32_t iY=-1, uint32_t dwClr=0xffFFFFFF, C4ID idDecoID=C4ID::None, C4PropList *pSrc=nullptr, uint32_t dwFlags=0u, int32_t width=0)

References C4GM_Target, C4RGB, Messages, C4GameMessageList::New(), and NO_OWNER.

Referenced by C4Object::ExecLife(), and C4Object::Promote().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GameMsgObjectDw()

void GameMsgObjectDw ( const char *  szText,
C4Object pTarget,
uint32_t  dwClr 
)
inline

Definition at line 116 of file C4GameMessage.h.

117 {
118  ::Messages.New(C4GM_Target,szText,pTarget,NO_OWNER,0,0,dwClr);
119 }

References C4GM_Target, Messages, C4GameMessageList::New(), and NO_OWNER.

Here is the call graph for this function:

◆ GameMsgObjectError()

void GameMsgObjectError ( const char *  szText,
C4Object pTarget,
bool  Red = true 
)

Definition at line 451 of file C4GameMessage.cpp.

452 {
453  ::Messages.New(C4GM_TargetPlayer,szText,pTarget,pTarget->Controller,0,0, Red ? C4RGB(0xca, 0, 0) : C4RGB(0xff, 0xff, 0xff));
454 }
C4GameMessageList Messages
const int32_t C4GM_TargetPlayer
Definition: C4GameMessage.h:32
int32_t Controller
Definition: C4Object.h:109

References C4GM_TargetPlayer, C4RGB, C4Object::Controller, Messages, and C4GameMessageList::New().

Referenced by ConstructionCheck(), C4Object::Lift(), ObjectComDig(), and C4Object::Push().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GameMsgObjectPlayer()

void GameMsgObjectPlayer ( const char *  szText,
C4Object pTarget,
int32_t  iPlayer 
)
inline

Definition at line 109 of file C4GameMessage.h.

110 {
111  ::Messages.New(C4GM_TargetPlayer,szText,pTarget,iPlayer,0,0, C4RGB(0xff, 0xff, 0xff));
112 }

References C4GM_TargetPlayer, C4RGB, Messages, and C4GameMessageList::New().

Here is the call graph for this function:

Variable Documentation

◆ C4GM_Bottom

const int32_t C4GM_Bottom = 1<<1

Definition at line 35 of file C4GameMessage.h.

Referenced by C4GameMessage::Draw().

◆ C4GM_DropSpeech

const int32_t C4GM_DropSpeech = 1<<8

Definition at line 42 of file C4GameMessage.h.

◆ C4GM_Global

◆ C4GM_GlobalPlayer

◆ C4GM_HCenter

const int32_t C4GM_HCenter = 1<<6

Definition at line 40 of file C4GameMessage.h.

Referenced by C4GameMessage::Draw().

◆ C4GM_Left

const int32_t C4GM_Left = 1<<4

Definition at line 38 of file C4GameMessage.h.

Referenced by C4GameMessage::Draw().

◆ C4GM_MaxText

const int32_t C4GM_MaxText = 256

Definition at line 26 of file C4GameMessage.h.

Referenced by C4Game::DrawCrewOverheadText().

◆ C4GM_MinDelay

const int32_t C4GM_MinDelay = 20

Definition at line 27 of file C4GameMessage.h.

Referenced by C4GameMessage::Init().

◆ C4GM_Multiple

const int32_t C4GM_Multiple = 1<<2

Definition at line 36 of file C4GameMessage.h.

Referenced by C4GameMessageList::New().

◆ C4GM_NoBreak

const int32_t C4GM_NoBreak = 1<<0

Definition at line 34 of file C4GameMessage.h.

Referenced by C4GameMessage::Draw().

◆ C4GM_PositioningFlags

const int32_t C4GM_PositioningFlags = C4GM_Bottom | C4GM_Top | C4GM_Left | C4GM_Right | C4GM_HCenter | C4GM_VCenter

Definition at line 48 of file C4GameMessage.h.

Referenced by C4GameMessage::GetPositioningFlags(), and C4GameMessageList::New().

◆ C4GM_Right

const int32_t C4GM_Right = 1<<5

Definition at line 39 of file C4GameMessage.h.

Referenced by C4GameMessage::Draw().

◆ C4GM_Target

const int32_t C4GM_Target = 3

◆ C4GM_TargetPlayer

const int32_t C4GM_TargetPlayer = 4

Definition at line 32 of file C4GameMessage.h.

Referenced by C4GameMessage::Draw(), GameMsgObjectError(), and GameMsgObjectPlayer().

◆ C4GM_Top

const int32_t C4GM_Top = 1<<3

Definition at line 37 of file C4GameMessage.h.

Referenced by C4GameMessage::Draw().

◆ C4GM_VCenter

const int32_t C4GM_VCenter = 1<<7

Definition at line 41 of file C4GameMessage.h.

Referenced by C4GameMessage::Draw().

◆ C4GM_WidthRel

const int32_t C4GM_WidthRel = 1<<9

Definition at line 43 of file C4GameMessage.h.

Referenced by C4GameMessage::Draw().

◆ C4GM_XRel

const int32_t C4GM_XRel = 1<<10

Definition at line 44 of file C4GameMessage.h.

Referenced by C4GameMessage::Draw().

◆ C4GM_YRel

const int32_t C4GM_YRel = 1<<11

Definition at line 45 of file C4GameMessage.h.

Referenced by C4GameMessage::Draw().

◆ C4GM_Zoom

const int32_t C4GM_Zoom = 1<<12

Definition at line 46 of file C4GameMessage.h.

Referenced by C4GameMessage::Draw().

◆ Messages