| 2 |
|
#include <string.h> |
| 3 |
|
#include <time.h> |
| 4 |
|
|
| 5 |
+ |
#include "Daodan.h" |
| 6 |
|
#include "Daodan_Config.h" |
| 7 |
|
#include "Daodan_Patch.h" |
| 8 |
|
#include "Patches/Utility.h" |
| 12 |
|
|
| 13 |
|
#include "Inifile_Reader.h" |
| 14 |
|
|
| 14 |
– |
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0])) |
| 15 |
– |
|
| 15 |
|
static const char* iniName = "daodan.ini"; |
| 16 |
|
static const char* helpFile = "daodan_help.txt"; |
| 17 |
|
|
| 18 |
|
static const char* defaultSection = "options"; |
| 19 |
|
|
| 20 |
< |
static char invalidCurParamaters[1000] = ""; |
| 21 |
< |
static char invalidTotalParamaters[3000] = ""; |
| 20 |
> |
static char invalidCurParamaters[2000] = ""; |
| 21 |
> |
static char invalidTotalParamaters[4000] = ""; |
| 22 |
|
|
| 23 |
|
void DDrConfig_PrintHelp(); |
| 24 |
|
|
| 46 |
|
{ 0, 0, 0, {0}, {0} } |
| 47 |
|
} }, |
| 48 |
|
{ "gameplay", "Gameplay", { |
| 49 |
+ |
{ "bindablecheats", |
| 50 |
+ |
"Allows cheats to be bound to keys. Requires 'customactions' and 'cheattable' to be true.", |
| 51 |
+ |
C_BOOL, |
| 52 |
+ |
{.intBoolVal = true}, |
| 53 |
+ |
{.intBoolVal = true} }, |
| 54 |
+ |
{ "characterawareness", |
| 55 |
+ |
"Makes AI remember the player.", |
| 56 |
+ |
C_BOOL, |
| 57 |
+ |
{.intBoolVal = true}, |
| 58 |
+ |
{.intBoolVal = true} }, |
| 59 |
|
{ "cheatsenabled", |
| 60 |
|
"Enables cheats without having to beat the game first.", |
| 61 |
|
C_BOOL, |
| 71 |
|
C_BOOL, |
| 72 |
|
{.intBoolVal = true}, |
| 73 |
|
{.intBoolVal = true} }, |
| 74 |
+ |
{ "customactions", |
| 75 |
+ |
"Allows more actions to be bound through Daodan.", |
| 76 |
+ |
C_BOOL, |
| 77 |
+ |
{.intBoolVal = true}, |
| 78 |
+ |
{.intBoolVal = true} }, |
| 79 |
|
{ "kickguns", |
| 80 |
|
"EXPERIMENTAL! Unfinished, do not use.", |
| 81 |
|
C_BOOL, |
| 544 |
|
STARTUPMESSAGE("Config value type unknown: %d", co->type); |
| 545 |
|
} |
| 546 |
|
} else { |
| 547 |
< |
char buf[50]; |
| 547 |
> |
char buf[100]; |
| 548 |
|
if (!_stricmp(section, "*")) |
| 549 |
< |
sprintf_s(buf, sizeof(buf), " %s\n", name); |
| 549 |
> |
sprintf(buf, " %s\n", name); |
| 550 |
|
else |
| 551 |
< |
sprintf_s(buf, sizeof(buf), " %s.%s\n", section, name); |
| 551 |
> |
sprintf(buf, " %s.%s\n", section, name); |
| 552 |
|
if (strlen(buf) + strlen(invalidCurParamaters) < sizeof(invalidCurParamaters) - 1) { |
| 553 |
|
strcpy(invalidCurParamaters + strlen(invalidCurParamaters), buf); |
| 554 |
|
} |
| 606 |
|
|
| 607 |
|
if (strlen(invalidCurParamaters) > 0) |
| 608 |
|
{ |
| 609 |
< |
sprintf_s(invalidTotalParamaters, sizeof(invalidTotalParamaters), "In %s:\n%s\n", iniName, invalidCurParamaters); |
| 609 |
> |
sprintf(invalidTotalParamaters, "In %s:\n%s\n", iniName, invalidCurParamaters); |
| 610 |
|
invalidCurParamaters[0] = 0; |
| 611 |
|
} |
| 612 |
|
|
| 616 |
|
|
| 617 |
|
if (strlen(invalidCurParamaters) > 0) |
| 618 |
|
{ |
| 619 |
< |
sprintf_s(invalidTotalParamaters, sizeof(invalidTotalParamaters), "%sOn command line:\n%s\n", invalidTotalParamaters, invalidCurParamaters); |
| 619 |
> |
sprintf(invalidTotalParamaters, "%sOn command line:\n%s\n", invalidTotalParamaters, invalidCurParamaters); |
| 620 |
|
} |
| 621 |
|
|
| 622 |
|
if (strlen(invalidTotalParamaters) > 0) |
| 623 |
|
{ |
| 624 |
< |
char msg[3200]; |
| 625 |
< |
sprintf_s(msg, sizeof(msg), "Invalid parameters given:\n%sContinue launching Oni?", invalidTotalParamaters); |
| 624 |
> |
char msg[4096]; |
| 625 |
> |
sprintf(msg, "Invalid parameters given:\n%sContinue launching Oni?", invalidTotalParamaters); |
| 626 |
|
int res = MessageBox(NULL, msg, "Parameters invalid", MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON1); |
| 627 |
|
if (res == IDNO) { |
| 628 |
|
exit(0); |