Include new notify types
Jump to navigation
Jump to search
This HowTo explains, how new notify types can be added to code to make them configureable.
Message options allow you to configure, whether you want to receive notification messages for each type, whether a notification sound should be played (if associated) and whether game should stop on that event. These settings are stored in game data, so you could change settings as you wish depending on actual game advance.
Step by Step
- add new enumeration values to
nt_strings
(src/client/menu/m_messages.c
) andnotify_t
(src/client/menu/m_messages.h
)- do not include any whitespaces in
nt_strings
- these codes are used to store settings and have to be read byMSG_ReadString
as one string - feel free to rearrange defined types to group them (in the definitions) - as long as order is same for both definitions
- see msgcategory definition to see how types can be grouped for options
- don't forget to surround
nt_strings
value withN_()
to get them found for translation
- do not include any whitespaces in
- replace call of
MN_AddNewMessage
withMSO_CheckAddNewMessage
with definednotify_t
type - check whether to add default settings for new category to
base/ufos/msgoptions.ufo
- each line contains one "positive" setting - negative ones are not stored
- check whether to add newly defined type to either existing msgcategory or define a new one (in
base/ufos/msgcategories.ufo
)