ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/src/Daodan_Config.c
(Generate patch)

Comparing Daodan/src/Daodan_Config.c (file contents):
Revision 1007 by alloc, Fri Jul 4 15:42:25 2014 UTC vs.
Revision 1163 by rossy, Sun Oct 24 02:50:48 2021 UTC

# Line 2 | Line 2
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"
# Line 11 | Line 12
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  
# Line 47 | Line 46 | ConfigSection_t config[] = {
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,
# Line 62 | Line 71 | ConfigSection_t config[] = {
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,
# Line 237 | Line 251 | ConfigSection_t config[] = {
251                          C_BOOL,
252                          {.intBoolVal = true},
253                          {.intBoolVal = true} },
254 +                { "daodaninput",
255 +                        "New input system that reports input on every frame, supports Raw Input for mice.",
256 +                        C_BOOL,
257 +                        {.intBoolVal = true},
258 +                        {.intBoolVal = true} },
259                  { "directinput",
260                          "Enforces the usage of DirectInput on every system. Should be off for Linux/Wine.",
261                          C_BOOL,
262                          {.intBoolVal = true},
263                          {.intBoolVal = true} },
264 +                { "mousesensitivity",
265 +                        "Multiplier for Oni's mouse sensitivity. 1.0 is Oni's default.",
266 +                        C_FLOAT,
267 +                        {.floatVal = 1.0f},
268 +                        {.floatVal = 1.0f} },
269                  { "disablecmdline",
270                          "Disables Oni's existing command line parser as Daodan has its own.",
271                          C_BOOL,
# Line 285 | Line 309 | void DDrConfig_Print()
309                                          break;
310                                  case C_CMD:
311                                          break;
312 +                                case C_FLOAT:
313 +                                        STARTUPMESSAGE("Option %s.%s = %f (def %f)", config[s].name, co->name, co->value.floatVal, co->defaultValue.floatVal);
314 +                                        break;
315                                  default:
316                                          STARTUPMESSAGE("Option %s.%s = %d (def %d)", config[s].name, co->name, co->value.intBoolVal, co->defaultValue.intBoolVal);
317                          }
# Line 346 | Line 373 | const char* DDrConfig_GetOptionTypeName(
373          switch (type) {
374                  case C_INT:
375                          return "Int";
376 +                case C_FLOAT:
377 +                        return "Float";
378                  case C_BOOL:
379                          return "Bool";
380                  case C_STRING:
# Line 376 | Line 405 | const char* DDrConfig_GetOptionValueStri
405                          return (boolV ? "true" : "false");
406                  case C_CMD:
407                          return 0;
408 +                case C_FLOAT:
409 +                        val = malloc(50);
410 +                        sprintf(val, "%f", optVal->floatVal);
411 +                        return val;
412                  default:
413                          val = malloc(20);
414                          sprintf(val, "%d", boolV);
# Line 396 | Line 429 | char DDrConfig_NonDefaultOptionValue(Con
429                          return 0;
430                  case C_INT:
431                          return opt->defaultValue.intBoolVal != opt->value.intBoolVal;
432 +                case C_FLOAT:
433 +                        return opt->defaultValue.floatVal != opt->value.floatVal;
434          }
435          return 0;
436   }
# Line 512 | Line 547 | void DDrIniCallback(const char* section,
547                          case C_INT:
548                                  co->value.intBoolVal = strtol(value, NULL, 0);
549                                  break;
550 +                        case C_FLOAT:
551 +                                co->value.floatVal = strtof(value, NULL);
552 +                                break;
553                          case C_BOOL:
554                                  co->value.intBoolVal = !_stricmp(value, "true");
555                                  break;

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)