-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add custom item system (nnextcitem.cpp, nnextcitem.h) #893
base: master
Are you sure you want to change the base?
Conversation
Replace IniFile class (inifile.cpp, inifile.h)
Please replace the tab in the makefile with spaces, thanks! |
Any other notes or i can merge it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you tell me a little bit about the changes to the INI parser? Did you change or expand the grammar and syntax of the file, beyond the addition of new fields?
if (VanillaMode()) | ||
{ | ||
if (gUserItemsInitialized) | ||
{ | ||
userItemsUninit(); | ||
gUserItemsInitialized = 0; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused. If this functionality is entirely new, why would VanillaMode
do anything at all here?
inline char PutKeyString(const char* section, const char* hiWord, const char* loWord = NULL) { return (KeyAdd(section, hiWord, loWord) >= 0); } | ||
inline char GetKeyBool(const char *section, const char *key, int nRetn) { return (GetKeyInt(section, key, nRetn) != 0); } | ||
inline int GetKeyHex(const char *section, const char *key, int nRetn) { return GetKeyInt(section, key, nRetn); } | ||
inline char KeyExists(const char* section, const char* key) { return (KeyFind(section, key) >= 0); } | ||
inline char SectionExists(const char* name) { return (SectionFind(name) >= 0); } | ||
inline char FindSection(const char* name) { return (SectionFind(name) >= 0); } | ||
inline void RemoveSection(const char* name) { SectionRemove(name); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the formatting here
void strTrim(char* str, char side = 0x03) | ||
{ | ||
head.next = &head; | ||
int l = strlen(str); | ||
int c; | ||
|
||
if (side & 0x01) | ||
{ | ||
c = 0; | ||
while(str[c] && isspace(str[c])) c++; | ||
if (c) | ||
memcpy(str, &str[c], l - c + 1), l-=c; | ||
} | ||
|
||
|
||
if (side & 0x02) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these magic constants for side
be INI_SKIPCM
, INI_SKIPZR
, etc?
kItemGroupItem = 0, | ||
kItemGroupWeapon, | ||
kItemGroupAmmo, | ||
kItemGroupArmor, | ||
kItemGroupHealth, | ||
kItemGroupPowerup, | ||
kItemGroupKey, | ||
kItemGroupMax, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you fix the indentation of the enums in this file?
struct ITEM | ||
{ | ||
char *name, *message; | ||
uint8_t group, type; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting
static char SetupActionLimits(ITEM::ACTION* pAct, char extLimits); | ||
static char SetupAction(const char* str, int nOperator, int nAction); | ||
static char SetupFlags(const char* str); | ||
static char SetupRespawn(const char* str); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting
static char showLog; | ||
//------------------------------------------------------------------------------- | ||
static int Setup(IniFile* pFile); | ||
static void ClearItem(ITEM* pItem); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting
Replace IniFile class (inifile.cpp, inifile.h)