From df2ec1b4b6596c3b418cf161b97ee6fd3fb3a7bf Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Tue, 10 May 2022 19:53:30 +0200 Subject: [PATCH 1/1] add race option to aosr command --- app/DiscordAppCommands/AosrPresetCommand.php | 12 +++++++++++- app/Http/Controllers/AosSeedController.php | 4 ++-- resources/js/i18n/de.js | 4 ++-- resources/js/i18n/en.js | 4 ++-- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/DiscordAppCommands/AosrPresetCommand.php b/app/DiscordAppCommands/AosrPresetCommand.php index a023fcb..96db00c 100644 --- a/app/DiscordAppCommands/AosrPresetCommand.php +++ b/app/DiscordAppCommands/AosrPresetCommand.php @@ -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' => [ diff --git a/app/Http/Controllers/AosSeedController.php b/app/Http/Controllers/AosSeedController.php index 9aea748..3e3a2b0 100644 --- a/app/Http/Controllers/AosSeedController.php +++ b/app/Http/Controllers/AosSeedController.php @@ -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(); diff --git a/resources/js/i18n/de.js b/resources/js/i18n/de.js index 7d2aab0..89303ab 100644 --- a/resources/js/i18n/de.js +++ b/resources/js/i18n/de.js @@ -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: { diff --git a/resources/js/i18n/en.js b/resources/js/i18n/en.js index 4f0bcc6..4140fdd 100644 --- a/resources/js/i18n/en.js +++ b/resources/js/i18n/en.js @@ -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: { -- 2.39.2