ManaPlus
Macros
gamemodifiers.cpp File Reference

(986a3bf)

#include "gamemodifiers.h"
#include "configuration.h"
#include "game.h"
#include "settings.h"
#include "soundmanager.h"
#include "being/localplayer.h"
#include "gui/viewport.h"
#include "gui/windows/chatwindow.h"
#include "gui/windows/okdialog.h"
#include "gui/windows/outfitwindow.h"
#include "gui/widgets/createwidget.h"
#include "gui/widgets/tabs/chat/chattab.h"
#include "listeners/gamemodifierlistener.h"
#include "resources/map/map.h"
#include "listeners/awaylistener.h"
#include "listeners/updatestatuslistener.h"
#include "utils/gettext.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define addModifier(name1, name2, sz, ...)
 
#define addModifier2(name1, name2, str, sz, ...)
 
#define changeMethod(name1, name2, str)
 

Macro Definition Documentation

◆ addModifier

#define addModifier (   name1,
  name2,
  sz,
  ... 
)
Value:
const unsigned GameModifiers::m##name1##Size = sz; \
const char *const GameModifiers::m##name1##Strings[] = \
__VA_ARGS__; \
std::string GameModifiers::get##name1##String() \
{ \
return gettext(getVarItem(&m##name1##Strings[0], \
CAST_U32(settings.name2), m##name1##Size)); \
}
#define CAST_U32
Definition: cast.h:31
AttributesT get(const std::string &key)
Settings settings
Definition: settings.cpp:32

Definition at line 52 of file gamemodifiers.cpp.

◆ addModifier2

#define addModifier2 (   name1,
  name2,
  str,
  sz,
  ... 
)
Value:
const unsigned GameModifiers::m##name1##Size = sz; \
const char *const GameModifiers::m##name1##Strings[] = \
__VA_ARGS__; \
void GameModifiers::change##name1(const bool forward) \
{ \
changeMode(&settings.name2, m##name1##Size, str, \
&GameModifiers::get##name1##String, 0, true, forward); \
} \
std::string GameModifiers::get##name1##String() \
{ \
return gettext(getVarItem(&m##name1##Strings[0], \
settings.name2, m##name1##Size)); \
}

Definition at line 62 of file gamemodifiers.cpp.

◆ changeMethod

#define changeMethod (   name1,
  name2,
  str 
)
Value:
void GameModifiers::change##name1(const bool forward) \
{ \
changeMode(&settings.name2, m##name1##Size, str, \
&GameModifiers::get##name1##String, 0, true, forward); \
}

Definition at line 77 of file gamemodifiers.cpp.