| 61 | } |
| 62 | |
| 63 | void Game_ConfigGame::LoadFromArgs(CmdlineParser& cp) { |
| 64 | cp.Rewind(); |
| 65 | |
| 66 | while (!cp.Done()) { |
| 67 | CmdlineArg arg; |
| 68 | long li_value = 0; |
| 69 | |
| 70 | if (cp.ParseNext(arg, 0, {"--new-game", "--no-new-game"})) { |
| 71 | new_game.Set(arg.ArgIsOn()); |
| 72 | continue; |
| 73 | } |
| 74 | if (cp.ParseNext(arg, 1, "--engine")) { |
| 75 | if (arg.NumValues() > 0) { |
| 76 | const auto& v = arg.Value(0); |
| 77 | engine_str.Set(v); |
| 78 | } |
| 79 | continue; |
| 80 | } |
| 81 | if (cp.ParseNext(arg, 0, "--no-patch")) { |
| 82 | patch_support.Set(false); |
| 83 | patch_dynrpg.Lock(false); |
| 84 | patch_maniac.Lock(false); |
| 85 | patch_unlock_pics.Lock(false); |
| 86 | patch_common_this_event.Lock(false); |
| 87 | patch_key_patch.Lock(false); |
| 88 | patch_rpg2k3_commands.Lock(false); |
| 89 | patch_anti_lag_switch.Lock(0); |
| 90 | patch_direct_menu.Lock(0); |
| 91 | patch_override = true; |
| 92 | continue; |
| 93 | } |
| 94 | if (cp.ParseNext(arg, 0, {"--patch-easyrpg", "--no-patch-easyrpg"})) { |
| 95 | patch_easyrpg.Set(arg.ArgIsOn()); |
| 96 | patch_override = true; |
| 97 | continue; |
| 98 | } |
| 99 | if (cp.ParseNext(arg, 0, {"--patch-dynrpg", "--no-patch-dynrpg"})) { |
| 100 | patch_dynrpg.Set(arg.ArgIsOn()); |
| 101 | patch_override = true; |
| 102 | continue; |
| 103 | } |
| 104 | if (cp.ParseNext(arg, 1, {"--patch-maniac", "--no-patch-maniac"})) { |
| 105 | patch_maniac.Set(arg.ArgIsOn()); |
| 106 | |
| 107 | if (arg.ArgIsOn() && arg.ParseValue(0, li_value)) { |
| 108 | patch_maniac.Set(li_value); |
| 109 | } |
| 110 | |
| 111 | patch_override = true; |
| 112 | continue; |
| 113 | } |
| 114 | if (cp.ParseNext(arg, 0, {"--patch-common-this", "--no-patch-common-this"})) { |
| 115 | patch_common_this_event.Set(arg.ArgIsOn()); |
| 116 | patch_override = true; |
| 117 | continue; |
| 118 | } |
| 119 | if (cp.ParseNext(arg, 0, {"--patch-pic-unlock", "--no-patch-pic-unlock"})) { |
| 120 | patch_unlock_pics.Set(arg.ArgIsOn()); |