]> git.localhorst.tv Git - alttp.git/commitdiff
add race option to aosr command
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 10 May 2022 17:53:30 +0000 (19:53 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 10 May 2022 17:53:30 +0000 (19:53 +0200)
app/DiscordAppCommands/AosrPresetCommand.php
app/Http/Controllers/AosSeedController.php
resources/js/i18n/de.js
resources/js/i18n/en.js

index a023fcbd45752ff704f223cf1a789260bbb33960..96db00cdb38fad94fc3a694066c02873a1e7fe48 100644 (file)
@@ -43,6 +43,14 @@ class AosrPresetCommand {
                                        'type' => 3,
                                        'required' => true,
                                        'choices' => $choices,
+                               ], [
+                                       'name' => 'race',
+                                       'description' => 'Generate race ROM, seed will be hidden',
+                                       'description_localizations' => [
+                                               'de' => 'Race ROM generieren, Seed wird versteckt.',
+                                       ],
+                                       'type' => 5,
+                                       'required' => false,
                                ]],
                        ]],
                ]);
@@ -55,10 +63,12 @@ class AosrPresetCommand {
                                ->acknowledgeWithResponse()
                                ->done(function() use($discord, $interaction) {
                                $presetName = $interaction->data->options['preset']->options['preset']->value;
+                               $race =  isset($interaction->data->options['preset']->options['race'])
+                                       ? $interaction->data->options['preset']->options['race']->value : false;
                                $message = MessageBuilder::new();
                                if (isset(static::$presets[$presetName])) {
                                        $preset = static::$presets[$presetName];
-                                       $seed = AosSeed::generateSurge($presetName, $preset['settings']);
+                                       $seed = AosSeed::generateSurge($presetName, $preset['settings'], $race);
 
                                        $embed = new Embed($discord, [
                                                'fields' => [
index 9aea7488ba4a520d70d6a08d4a43c728cefa5d88..3e3a2b05afcd293acd034bb2bf79f5e2e4daa9b4 100644 (file)
@@ -12,10 +12,10 @@ class AosSeedController extends Controller
                $seed = AosSeed::where('hash', '=', $hash)->firstOrFail();
 
                if ($seed->race) {
-                       $seed->hide('seed');
+                       $seed->makeHidden('seed');
                }
                if ($seed->mystery) {
-                       $seed->hide('settings');
+                       $seed->makeHidden('settings');
                }
 
                return $seed->toJson();
index 7d2aab09c24e95b8b69d6b8451d8ef065b54898e..89303abc35a4bb3edea9496267e45f6260b8d8b1 100644 (file)
@@ -17,7 +17,7 @@ export default {
                        generators: {
                                surge: 'Dieser Seed wurde mit dem Randomizer von fusecv auf aosrando.surge.sh generiert',
                        },
-                       mystery: 'Mystery',
+                       mystery: 'Mystery ROM, Einstellungen versteckt',
                        noMystery: 'Kein Mystery',
                        noRace: 'Kein Race',
                        patch: 'ROM patchen',
@@ -41,7 +41,7 @@ export default {
                                Tournament2021: 'Turnier 2021',
                                Tournament2022: 'Turnier 2022',
                        },
-                       race: 'Race',
+                       race: 'Race ROM, Seed versteckt',
                        seed: 'Seed',
                        status: 'Status',
                        statuses: {
index 4f0bcc6697730fa398a2da7fae6361d2bbcb7cf4..4140fdd17ca5e9114a8068872d14e24fda0fb87b 100644 (file)
@@ -17,7 +17,7 @@ export default {
                        generators: {
                                surge: 'This seed has been generated with fusecv\'s randomizer on aosrando.surge.sh.',
                        },
-                       mystery: 'Mystery',
+                       mystery: 'Mystery ROM, settings hidden',
                        noMystery: 'No mystery',
                        noRace: 'No race',
                        patch: 'Patch ROM',
@@ -41,7 +41,7 @@ export default {
                                Tournament2021: 'Tournament 2021',
                                Tournament2022: 'Tournament 2022',
                        },
-                       race: 'Race',
+                       race: 'Race ROM, seed hidden',
                        seed: 'Seed',
                        status: 'Status',
                        statuses: {