Skip to content

Feature: Add a way to set a custom AI level to a trainer#443

Merged
AerunDev merged 7 commits intodevelopfrom
401-create-a-component-to-handle-custom-entries-from-a-select
Feb 17, 2025
Merged

Feature: Add a way to set a custom AI level to a trainer#443
AerunDev merged 7 commits intodevelopfrom
401-create-a-component-to-handle-custom-entries-from-a-select

Conversation

@Aelysya
Copy link
Collaborator

@Aelysya Aelysya commented Feb 10, 2025

Description

closes #401
Added a component that regroups a Select with a custom option and an Input that is displayed only if the custom option is selected. This allows the user to set a value of their choice to the related entity field. Some places where this operation was already implemented have been updated with the new component.

closes #380
The user can now set a custom value to the AI level of a trainer.

Tests to perform

Group Activation

Go to the Groups database page, following tests should pass in both creation and edition of a group
  • Editor testing

    • The 'Activation' Select component has a 'Custom' option
    • Selecting the 'Custom' option displays an Input below the Select
    • Selecting any other option doesn't display the Input below
  • Input testing

    • Entering a value that corresponds to another existing option in Input and un-focusing the Input reverts the Select to the existing option and the Input is not displayed anymore (Existing options are 11, 12, 13 and 14)
    • Entering a value that doesn't correpond to another existing option does not revert the Select
  • Entity testing

    • Select a non-custom option and finish the group creation/edition. The created/edited group displays the option you chose in the main frame.
    • Select the custom option and finish the group creation/edition. The created/edited group displays 'Custom' as its Activation condition in the main frame

Following tests are only related to edition

  • Data retention test
    • When opening the editor, the pre-selected value of the 'Activation' Select is the same as the one displayed in the main frame
    • When opening the editor, if the 'Activation' is 'Custom', the value in the Input is the same as the last value you chose

Trainer AI

Go to the Trainers database page, following tests should pass in both creation and edition of a trainer

  • Editor testing

    • The 'AI Level' Select component has a 'Custom' option
    • Selecting the 'Custom' option displays an Input below the Select
    • Selecting any other option doesn't display the Input below
  • Input testing

    • Entering a value that corresponds to another existing option in Input and un-focusing the Input reverts the Select to the existing option and the Input is not displayed anymore (Existing options are numbers between 1 and 7)
    • Entering a value that doesn't correpond to another existing option doesn't revert the Select
  • Entity testing

    • Select a non-custom option and finish the trainer creation/edition. The created/edited trainer displays the option you chose in the main frame.
    • Select the custom option and finish the trainer creation/edition. The created/edited trainer displays 'Custom' as its AI Level in the main frame

Following tests are only related to edition

  • Data retention test
    • When opening the editor, the pre-selected value of the 'AI Level' Select is the same as the one displayed in the main frame
    • When opening the editor, if the 'AI Level' is 'Custom', the value in the Input is the same as the last value you chose

Move Procedure

Go to the Moves database page and open the 'Setting' Editor

  • Editor testing

    • The 'Procedure' Select component has a 'Custom' option
    • Selecting the 'Custom' option displays an Input below the Select and the default value is the DbSymbol of the move prefixed with 's_'
    • Selecting any other option doesn't display the Input below
  • Input testing

    • Entering a value that corresponds to another existing option in Input and un-focusing the Input reverts the Select to the existing option and the Input is not displayed anymore (Existing options are 's_basic', 's_stat', 's_status', 's_multi_hit', 's_2hits', 's_ohko', 's_2turns', 's_self_stat' and 's_self_status')
    • Entering a value that doesn't correpond to another existing option doesn't revert the Select
  • Entity testing

    • Select a non-custom option and finish the move edition. The edited move displays the option you chose in the main frame.
    • Select the custom option and finish the move edition. The edited move displays 'Custom' as its Procedure in the main frame

Following tests are only related to edition

  • Data retention test
    • When opening the editor, the pre-selected value of the 'Procedure' Select is the same as the one displayed in the main frame
    • When opening the editor, if the 'Procedure' is 'Custom', the value in the Input is the same as the last value you chose

@Aelysya Aelysya self-assigned this Feb 10, 2025
@Aelysya Aelysya linked an issue Feb 10, 2025 that may be closed by this pull request
2 tasks
Copy link
Collaborator

@AerunDev AerunDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello ! 😄
J'ai pu tester cette PR et globalement rien à redire, c'est très cool, bien joué.

Je note ici quelques régressions qu'il faudrait tout de même qu'on traite avant de la merge. Notamment un crash dans l'input de l'IA personnalisée des dresseurs.

Activation des groupes

L'interrupteur ne devrait pas pouvoir être négatif ou zéro

  • ETANT DONNE QUE je souhaite modifier l'interrupteur d'activation d'un groupe de Pokémon sauvages,
  • QUAND je sélectionne "Personnalisé" dans la liste déroulante "Activation",
  • ET que je rentre un nombre dans le champ de texte "Interrupteur",
  • ALORS je peux rentrer un nombre négatif.

Note

Il n'était pas possible de le faire sur la version en prod.

IA custom pour un dresseur

Le texte affiché est en anglais pour la valeur "Custom"

  • ETANT DONNE QUE je souhaite préciser une IA personnalisée pour un dresseur
  • QUAND je clique sur la liste déroulante "Niveau de l'IA"
  • ALORS le texte "Custom" est affiché en dernière position au lieu de "Personnalisé"
  • ET le texte "Custom level" est affiché pour l'input au lieu de "Niveau personnalisé"

Crash lorsqu'on ne rentre pas de valeur pour le "Niveau personnalisé" d'une IA

  • ETANT DONNE QUE je souhaite préciser une IA personnalisée pour un dresseur
  • QUAND je clique sur la liste déroulante "Niveau de l'IA"
  • ET que je sélectionne l'entrée "Custom"
  • ET que je vide le contenu du champ de texte "Custom level"
  • OU que je précise un nombre négatif
  • ALORS un crash apparaît avec le log suivant
    image
    (Erreur 1 et 2 sur 3)
    image
    (Erreur 3 sur 3)

Tip

Peut-être afficher l'astérisque pour mentionner l'obligation de valeur également ?

Procédure d'une capacité

Manque de feedback sur la fonction personnalisée qui ne peut être vide

  • ETANT DONNE QUE je souhaite spécifier une fonction personnalisée comme Procédure d'une capacité
  • QUAND je sélectionne la liste déroulante "Procédure" pour choisir "Attaque personnalisée"
  • ET que je vide le contenu du champ de texte "Fonction"
  • ALORS je ne peux pas quitter la modale d'édition si je clique en dehors
  • ET je n'ai pas de feedback m'indiquant le caractère obligatoire du champ "Fonction" (astérisque rouge présente en prod) pour mieux comprendre le blocage

@Aelysya
Copy link
Collaborator Author

Aelysya commented Feb 10, 2025

Et hop, c'est fix 😄

Copy link
Collaborator

@AerunDev AerunDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Effectivement c'est nickel à présent, bien joué ! 🎉

Copy link
Collaborator

@Palbolsky Palbolsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai trouvé aucun bug. J'approuve. 🎉

@AerunDev AerunDev merged commit a290e2f into develop Feb 17, 2025
2 checks passed
@AerunDev AerunDev deleted the 401-create-a-component-to-handle-custom-entries-from-a-select branch February 17, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a component to handle custom entries from a Select Set a custom trainer AI

3 participants