| 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 |
|
|
| 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, |
| 299 |
|
break; |
| 300 |
|
case C_CMD: |
| 301 |
|
break; |
| 302 |
+ |
case C_FLOAT: |
| 303 |
+ |
STARTUPMESSAGE("Option %s.%s = %f (def %f)", config[s].name, co->name, co->value.floatVal, co->defaultValue.floatVal); |
| 304 |
+ |
break; |
| 305 |
|
default: |
| 306 |
|
STARTUPMESSAGE("Option %s.%s = %d (def %d)", config[s].name, co->name, co->value.intBoolVal, co->defaultValue.intBoolVal); |
| 307 |
|
} |
| 363 |
|
switch (type) { |
| 364 |
|
case C_INT: |
| 365 |
|
return "Int"; |
| 366 |
+ |
case C_FLOAT: |
| 367 |
+ |
return "Float"; |
| 368 |
|
case C_BOOL: |
| 369 |
|
return "Bool"; |
| 370 |
|
case C_STRING: |
| 395 |
|
return (boolV ? "true" : "false"); |
| 396 |
|
case C_CMD: |
| 397 |
|
return 0; |
| 398 |
+ |
case C_FLOAT: |
| 399 |
+ |
val = malloc(50); |
| 400 |
+ |
sprintf(val, "%f", optVal->floatVal); |
| 401 |
+ |
return val; |
| 402 |
|
default: |
| 403 |
|
val = malloc(20); |
| 404 |
|
sprintf(val, "%d", boolV); |
| 419 |
|
return 0; |
| 420 |
|
case C_INT: |
| 421 |
|
return opt->defaultValue.intBoolVal != opt->value.intBoolVal; |
| 422 |
+ |
case C_FLOAT: |
| 423 |
+ |
return opt->defaultValue.floatVal != opt->value.floatVal; |
| 424 |
|
} |
| 425 |
|
return 0; |
| 426 |
|
} |
| 537 |
|
case C_INT: |
| 538 |
|
co->value.intBoolVal = strtol(value, NULL, 0); |
| 539 |
|
break; |
| 540 |
+ |
case C_FLOAT: |
| 541 |
+ |
co->value.floatVal = strtof(value, NULL); |
| 542 |
+ |
break; |
| 543 |
|
case C_BOOL: |
| 544 |
|
co->value.intBoolVal = !_stricmp(value, "true"); |
| 545 |
|
break; |