diff --git a/content/psdk/ui-development/02-main-menu.md b/content/psdk/ui-development/02-main-menu.md new file mode 100644 index 0000000..a0f00d5 --- /dev/null +++ b/content/psdk/ui-development/02-main-menu.md @@ -0,0 +1,156 @@ +--- +title: "How to customize the Main Menu in PSDK?" +slug: customize-main-menu +sidebar_position: 2 +description: "This guide explains how the Main Menu works and how to customize it: adding a button, changing a button's look and defining a custom button order. It is one of the simplest UI customizations in PSDK, perfect as a first contact with the engine's UI code." +--- + +This guide explains how the **Main Menu** works and how to customize it: adding a button, changing a button's look and defining a custom button order. It is one of the simplest UI customizations in PSDK, perfect as a first contact with the engine's UI code. + +## How the Main Menu works + +![The Main Menu in game](/img/psdk/ui-development/main-menu.png) + +The Main Menu (often just called **Menu**) lets the player access the main interfaces of the game. Internally, its model is simple: an ordered list of buttons, where each button is registered with two pieces of information. + +- An **action**: a Symbol naming the method of `GamePlay::Menu` that is called when the player presses the button. +- A **visibility condition**: a block evaluated every time the menu opens. The button only shows when the block returns a truthy value. + +This is why the screenshot above has no Dex and no party button: their conditions are false as long as the player has no Dex and no creature. Here are the buttons PSDK registers by default: + +| Button | Action | Condition | Meaning | +| ------------ | ------------- | ---------------------------------- | ------------------------------------------ | +| Dex | `:open_dex` | `$game_switches[Yuki::Sw::Pokedex]` | The game switch enabling the Dex is on | +| Party | `:open_party` | `$actors.any?` | The player has at least one creature | +| Bag | `:open_bag` | `!$bag.locked` | The bag is not locked by an event | +| Trainer card | `:open_tcard` | `true` | Always visible | +| Options | `:open_option`| `true` | Always visible | +| Save | `:open_save` | `!$game_system.save_disabled` | Saving is not disabled by an event | +| Quit | `:open_quit` | `true` | Always visible, always pushed to the end | + +Since the conditions are re-evaluated each time the menu opens, a button appears as soon as its condition becomes true. For example, the party button shows up right after the player receives their first creature. + +## How to open the menu + +In game, press V (the physical key bound to the X input by default). + +From a script, call `GamePlay.open_menu`. + +If you want to replace the PSDK Main Menu with your own fully home-made Menu, assign your class to `GamePlay.menu_class`. This is an advanced move: your class must respect `MenuMixin` (`scripts/4 Systems/100 Menu/099 MenuMixin.rb`), which defines the `execute_skill_process` function that `Scene_Map` needs to execute field moves properly. For most needs, the customizations below are enough, with no need to rewrite the whole scene. + +## Where to write your customizations + +Never edit the engine files: the next PSDK update would overwrite your changes. Instead, write your customizations in your own script inside your project's `scripts/` folder, by reopening the `GamePlay::Menu` class. If this technique is new to you, read [What is monkey-patching and how to apply it in PSDK?](/getting-started/monkey-patching-in-psdk) first. + +```ruby +module GamePlay + # Reopen the engine class to add our own registrations + class Menu + # Your customizations go here + end +end +``` + +All the examples below go inside this block. + +## How to add a button + +Call `GamePlay::Menu.register_button` with the action Symbol and the visibility condition. One important thing to understand: the engine has **already registered** the seven default buttons when your script runs. `register_button` appends to that list, it does not replace anything. So registering `:open_party` again would give the menu two party buttons; use `register_button` to add **new** buttons only (to modify the default ones, see the last section). + +The action Symbol must name a method of `GamePlay::Menu`. For a brand new button, you define that method yourself in the reopened class. A complete example with a quest journal: + +```ruby +module GamePlay + class Menu + register_button(:open_quests) { $game_switches[42] } + + private + + # Open the quest journal UI + def open_quests + call_scene(MyGame::QuestUI) + end + end +end +``` + +Here `MyGame::QuestUI` stands for whatever scene your button should open, and game switch 42 controls when the button shows up. `call_scene` is the same helper the engine uses for its own buttons (look at `open_save` in `scripts/4 Systems/100 Menu/100 Menu.rb`). + +:::warning + +A new button displays the **Quit** icon and text by default! Read on to understand why, and how to fix it. + +::: + +Each button finds its icon and its text through its index in the registration list: + +- The icon comes from the `menu_icons` file in your project's interface graphics. It is a sprite sheet of 2 columns (normal and selected state) by 8 rows, and the button uses the row matching its index. Your first custom button has index 7, so draw its icon on the 8th row (by default that row holds the girl bag variant: replace it or use a button overwrite). +- The text comes from the `text` method of `UI::PSDKMenuButtonBase` (`scripts/4 Systems/100 Menu/300 MenuButtonBase.rb`), which is a `case` on the index. Any index it does not know falls back to the Quit text, hence the warning above. Patch this method with `prepend`, the technique detailed in [the monkey-patching guide](/getting-started/monkey-patching-in-psdk), to add your own entry: + +```ruby +module UI + class PSDKMenuButtonBase + # Patch to add the text of the quest button (index 7) + module QuestButtonText + # Get the text based on the index + # @return [String] + def text + return 'Quests' if @index == 7 + + super + end + end + + prepend QuestButtonText + end +end +``` + +## How to change a button's look + +A button overwrite replaces the button class used for one specific index, which lets you change anything: icon, text, or the whole look. The engine itself uses one: when the player plays a girl, the bag button (index 2) is rendered by `UI::GirlBagMenuButton`, which uses the 8th row of `menu_icons` instead of the 3rd. + +```ruby +GamePlay::Menu.register_button_overwrite(2) { $trainer.playing_girl ? UI::GirlBagMenuButton : nil } +``` + +The block is evaluated when the menu opens: return a class to use it, or `nil` to keep the default button. + +:::note + +Overwrites target the `real_index` (the position in the registration list), not the position on screen. The two differ as soon as a button is hidden: if the player has no Dex, the party button keeps `real_index` 1 but is drawn first on screen (`positional_index` 0). The `real_index` drives the icon and text, the `positional_index` drives the position (see `UI::PSDKMenuButtonBase`). + +::: + +## How to change the default buttons + +To remove a default button, change its condition or reorder the list, you cannot edit a registered entry: clear everything and re-register the list your way. + +```ruby +module GamePlay + class Menu + clear_previous_registers + register_button(:open_party) { $actors.any? } + register_button(:open_bag) { !$bag.locked } + register_button(:open_save) { !$game_system.save_disabled } + register_button(:open_quit) { true } + end +end +``` + +The default registration in `scripts/4 Systems/100 Menu/100 Menu.rb` (shown in the table at the top) is your reference for the actions and conditions to re-register. + +:::warning + +Reordering changes every button's index, and the icons and texts are indexed: with the order above, the party button would display the Dex icon. Fix the `menu_icons` rows and the `text` method of `UI::PSDKMenuButtonBase` to match your new order. + +::: + +## Conclusion + +- The Main Menu is an ordered list of buttons; each button is an **action** (a method of `GamePlay::Menu`) plus a **visibility condition** evaluated when the menu opens. +- Write your customizations in your own script by reopening `GamePlay::Menu`, and never edit the engine files. +- `register_button(:action) { condition }` **appends** a new button; the seven default buttons are already registered. +- A brand new button needs three things: the registration, the action method, and its icon/text (row in `menu_icons` plus a `prepend` patch of `text` in `UI::PSDKMenuButtonBase`). +- `register_button_overwrite(real_index) { CustomClass }` changes how one button is rendered. +- `clear_previous_registers` then re-registering everything is the way to remove, modify or reorder the default buttons. Keep `menu_icons` and `text` consistent with the new order. diff --git a/content/psdk/ui-development/_category_.json b/content/psdk/ui-development/_category_.json index 2676a8e..7dff0d5 100644 --- a/content/psdk/ui-development/_category_.json +++ b/content/psdk/ui-development/_category_.json @@ -4,6 +4,6 @@ "link": { "type": "generated-index", "slug": "/psdk/ui-development", - "description": "Build a full Mystery Gift plugin from scratch and master PSDK's UI layer: scenes, compositions, input, animations and i18n." + "description": "Master PSDK's UI layer: a step-by-step Mystery Gift series, plus standalone guides such as customizing the Main Menu." } } diff --git a/content/psdk/ui-development/00-setup.md b/content/psdk/ui-development/mystery-gift/00-setup.md similarity index 100% rename from content/psdk/ui-development/00-setup.md rename to content/psdk/ui-development/mystery-gift/00-setup.md diff --git a/content/psdk/ui-development/01-ui-scene.md b/content/psdk/ui-development/mystery-gift/01-ui-scene.md similarity index 100% rename from content/psdk/ui-development/01-ui-scene.md rename to content/psdk/ui-development/mystery-gift/01-ui-scene.md diff --git a/content/psdk/ui-development/02-composition.md b/content/psdk/ui-development/mystery-gift/02-composition.md similarity index 100% rename from content/psdk/ui-development/02-composition.md rename to content/psdk/ui-development/mystery-gift/02-composition.md diff --git a/content/psdk/ui-development/03-spritestack.md b/content/psdk/ui-development/mystery-gift/03-spritestack.md similarity index 100% rename from content/psdk/ui-development/03-spritestack.md rename to content/psdk/ui-development/mystery-gift/03-spritestack.md diff --git a/content/psdk/ui-development/04-mystery-gift-data.md b/content/psdk/ui-development/mystery-gift/04-mystery-gift-data.md similarity index 100% rename from content/psdk/ui-development/04-mystery-gift-data.md rename to content/psdk/ui-development/mystery-gift/04-mystery-gift-data.md diff --git a/content/psdk/ui-development/05-keyboard.md b/content/psdk/ui-development/mystery-gift/05-keyboard.md similarity index 100% rename from content/psdk/ui-development/05-keyboard.md rename to content/psdk/ui-development/mystery-gift/05-keyboard.md diff --git a/content/psdk/ui-development/06-mouse.md b/content/psdk/ui-development/mystery-gift/06-mouse.md similarity index 100% rename from content/psdk/ui-development/06-mouse.md rename to content/psdk/ui-development/mystery-gift/06-mouse.md diff --git a/content/psdk/ui-development/07-i18n.md b/content/psdk/ui-development/mystery-gift/07-i18n.md similarity index 100% rename from content/psdk/ui-development/07-i18n.md rename to content/psdk/ui-development/mystery-gift/07-i18n.md diff --git a/content/psdk/ui-development/08-dialogs.md b/content/psdk/ui-development/mystery-gift/08-dialogs.md similarity index 100% rename from content/psdk/ui-development/08-dialogs.md rename to content/psdk/ui-development/mystery-gift/08-dialogs.md diff --git a/content/psdk/ui-development/09-animations.md b/content/psdk/ui-development/mystery-gift/09-animations.md similarity index 100% rename from content/psdk/ui-development/09-animations.md rename to content/psdk/ui-development/mystery-gift/09-animations.md diff --git a/content/psdk/ui-development/10-genericbase.md b/content/psdk/ui-development/mystery-gift/10-genericbase.md similarity index 100% rename from content/psdk/ui-development/10-genericbase.md rename to content/psdk/ui-development/mystery-gift/10-genericbase.md diff --git a/content/psdk/ui-development/mystery-gift/_category_.json b/content/psdk/ui-development/mystery-gift/_category_.json new file mode 100644 index 0000000..6151f10 --- /dev/null +++ b/content/psdk/ui-development/mystery-gift/_category_.json @@ -0,0 +1,9 @@ +{ + "label": "Mystery Gift", + "position": 1, + "link": { + "type": "generated-index", + "slug": "/psdk/ui-development/mystery-gift", + "description": "An 11-step series building a complete Mystery Gift plugin from scratch: scenes, compositions, input, animations and i18n. Follow it in order." + } +} diff --git a/i18n/fr/docusaurus-plugin-content-docs/current.json b/i18n/fr/docusaurus-plugin-content-docs/current.json index 2a805c7..2dc694b 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current.json +++ b/i18n/fr/docusaurus-plugin-content-docs/current.json @@ -28,9 +28,17 @@ "description": "The label for category 'UI Development' in sidebar 'mainSidebar'" }, "sidebar.mainSidebar.category.UI Development.link.generated-index.description": { - "message": "Construire un plugin Mystery Gift complet et maîtriser la couche UI de PSDK : scènes, compositions, entrées, animations et i18n.", + "message": "Maîtriser la couche UI de PSDK : une série Mystery Gift pas à pas, plus des guides autonomes comme la personnalisation du menu principal.", "description": "The generated-index page description for category UI Development in sidebar mainSidebar" }, + "sidebar.mainSidebar.category.Mystery Gift": { + "message": "Mystery Gift", + "description": "The label for category 'Mystery Gift' in sidebar 'mainSidebar'" + }, + "sidebar.mainSidebar.category.Mystery Gift.link.generated-index.description": { + "message": "Une série en 11 étapes qui construit un plugin Mystery Gift complet de zéro : scènes, compositions, entrées, animations et i18n. À suivre dans l'ordre.", + "description": "The generated-index page description for category Mystery Gift in sidebar mainSidebar" + }, "sidebar.mainSidebar.category.Battle Engine": { "message": "Moteur de Combat", "description": "The label for category 'Battle Engine' in sidebar 'mainSidebar'" diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/02-main-menu.md b/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/02-main-menu.md new file mode 100644 index 0000000..3304480 --- /dev/null +++ b/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/02-main-menu.md @@ -0,0 +1,156 @@ +--- +title: "Comment personnaliser le menu principal dans PSDK ?" +slug: personnaliser-le-menu-principal +sidebar_position: 2 +description: "Ce guide explique le fonctionnement du menu principal et comment le personnaliser : ajouter un bouton, changer l'apparence d'un bouton et définir un ordre personnalisé. C'est l'une des personnalisations d'UI les plus simples de PSDK, parfaite comme premier contact avec le code d'interface du moteur." +--- + +Ce guide explique le fonctionnement du **menu principal** et comment le personnaliser : ajouter un bouton, changer l'apparence d'un bouton et définir un ordre personnalisé. C'est l'une des personnalisations d'UI les plus simples de PSDK, parfaite comme premier contact avec le code d'interface du moteur. + +## Fonctionnement du menu principal + +![Le menu principal en jeu](/img/psdk/ui-development/main-menu.png) + +Le menu principal (souvent appelé simplement **Menu**) permet au joueur d'accéder aux interfaces principales du jeu. En interne, son modèle est simple : une liste ordonnée de boutons, où chaque bouton est enregistré avec deux informations. + +- Une **action** : un Symbol qui nomme la méthode de `GamePlay::Menu` appelée quand le joueur active le bouton. +- Une **condition de visibilité** : un bloc évalué à chaque ouverture du menu. Le bouton ne s'affiche que si le bloc renvoie une valeur vraie. + +C'est pour cela que la capture ci-dessus n'a ni bouton Dex ni bouton équipe : leurs conditions sont fausses tant que le joueur n'a ni Dex ni créature. Voici les boutons que PSDK enregistre par défaut : + +| Bouton | Action | Condition | Signification | +| ---------------- | -------------- | ----------------------------------- | ---------------------------------------------- | +| Dex | `:open_dex` | `$game_switches[Yuki::Sw::Pokedex]` | L'interrupteur de jeu activant le Dex est on | +| Équipe | `:open_party` | `$actors.any?` | Le joueur a au moins une créature | +| Sac | `:open_bag` | `!$bag.locked` | Le sac n'est pas verrouillé par un événement | +| Carte dresseur | `:open_tcard` | `true` | Toujours visible | +| Options | `:open_option` | `true` | Toujours visible | +| Sauvegarde | `:open_save` | `!$game_system.save_disabled` | La sauvegarde n'est pas désactivée | +| Quitter | `:open_quit` | `true` | Toujours visible, toujours placé en dernier | + +Comme les conditions sont réévaluées à chaque ouverture du menu, un bouton apparaît dès que sa condition devient vraie. Par exemple, le bouton équipe s'affiche juste après que le joueur a reçu sa première créature. + +## Comment ouvrir le menu + +En jeu, on appuie sur V (la touche physique associée par défaut à l'entrée X). + +Depuis un script, on appelle `GamePlay.open_menu`. + +Si vous voulez remplacer le menu principal de PSDK par votre propre Menu entièrement fait maison, assignez votre classe à `GamePlay.menu_class`. C'est une opération avancée : votre classe doit respecter `MenuMixin` (`scripts/4 Systems/100 Menu/099 MenuMixin.rb`), qui définit la fonction `execute_skill_process` dont `Scene_Map` a besoin pour exécuter correctement les capacités de terrain. Pour la plupart des besoins, les personnalisations ci-dessous suffisent, sans avoir à réécrire toute la scène. + +## Où écrire vos personnalisations + +Ne modifiez jamais les fichiers du moteur : la prochaine mise à jour de PSDK écraserait vos changements. Écrivez plutôt vos personnalisations dans votre propre script, dans le dossier `scripts/` de votre projet, en rouvrant la classe `GamePlay::Menu`. Si cette technique est nouvelle pour vous, lisez d'abord [Qu'est-ce que le monkey-patch et comment l'appliquer dans PSDK ?](/getting-started/monkey-patch-dans-psdk). + +```ruby +module GamePlay + # Reopen the engine class to add our own registrations + class Menu + # Your customizations go here + end +end +``` + +Tous les exemples ci-dessous se placent dans ce bloc. + +## Comment ajouter un bouton + +On appelle `GamePlay::Menu.register_button` avec le Symbol de l'action et la condition de visibilité. Une chose importante à comprendre : le moteur a **déjà enregistré** les sept boutons par défaut quand votre script s'exécute. `register_button` ajoute à la fin de cette liste, il ne remplace rien. Enregistrer `:open_party` une deuxième fois donnerait donc deux boutons équipe au menu ; utilisez `register_button` uniquement pour ajouter de **nouveaux** boutons (pour modifier ceux par défaut, voir la dernière section). + +Le Symbol de l'action doit nommer une méthode de `GamePlay::Menu`. Pour un bouton entièrement nouveau, c'est vous qui définissez cette méthode dans la classe rouverte. Un exemple complet avec un journal de quêtes : + +```ruby +module GamePlay + class Menu + register_button(:open_quests) { $game_switches[42] } + + private + + # Open the quest journal UI + def open_quests + call_scene(MyGame::QuestUI) + end + end +end +``` + +Ici, `MyGame::QuestUI` représente la scène que votre bouton doit ouvrir, et l'interrupteur de jeu 42 contrôle le moment où le bouton apparaît. `call_scene` est le même helper que le moteur utilise pour ses propres boutons (regardez `open_save` dans `scripts/4 Systems/100 Menu/100 Menu.rb`). + +:::warning + +Un nouveau bouton affiche l'icône et le texte de **Quitter** par défaut ! Lisez la suite pour comprendre pourquoi, et comment corriger ça. + +::: + +Chaque bouton trouve son icône et son texte grâce à son index dans la liste d'enregistrement : + +- L'icône vient du fichier `menu_icons` dans les graphismes d'interface de votre projet. C'est une feuille de sprites de 2 colonnes (état normal et sélectionné) par 8 lignes, et le bouton utilise la ligne correspondant à son index. Votre premier bouton personnalisé a l'index 7 : dessinez donc son icône sur la 8e ligne (par défaut, cette ligne contient la variante féminine du sac ; remplacez-la ou utilisez une surcharge de bouton). +- Le texte vient de la méthode `text` de `UI::PSDKMenuButtonBase` (`scripts/4 Systems/100 Menu/300 MenuButtonBase.rb`), qui est un `case` sur l'index. Tout index inconnu retombe sur le texte de Quitter, d'où l'avertissement ci-dessus. Patchez cette méthode avec `prepend`, la technique détaillée dans [le guide du monkey-patch](/getting-started/monkey-patch-dans-psdk), pour ajouter votre entrée : + +```ruby +module UI + class PSDKMenuButtonBase + # Patch to add the text of the quest button (index 7) + module QuestButtonText + # Get the text based on the index + # @return [String] + def text + return 'Quêtes' if @index == 7 + + super + end + end + + prepend QuestButtonText + end +end +``` + +## Comment changer l'apparence d'un bouton + +Une surcharge de bouton remplace la classe de bouton utilisée pour un index précis, ce qui permet de tout changer : icône, texte, ou l'apparence entière. Le moteur lui-même en utilise une : quand le joueur incarne une fille, le bouton du sac (index 2) est affiché par `UI::GirlBagMenuButton`, qui utilise la 8e ligne de `menu_icons` au lieu de la 3e. + +```ruby +GamePlay::Menu.register_button_overwrite(2) { $trainer.playing_girl ? UI::GirlBagMenuButton : nil } +``` + +Le bloc est évalué à l'ouverture du menu : renvoyez une classe pour l'utiliser, ou `nil` pour garder le bouton par défaut. + +:::note + +Les surcharges ciblent le `real_index` (la position dans la liste d'enregistrement), et non la position à l'écran. Les deux divergent dès qu'un bouton est masqué : si le joueur n'a pas de Dex, le bouton équipe garde le `real_index` 1 mais est dessiné en premier à l'écran (`positional_index` 0). Le `real_index` pilote l'icône et le texte, le `positional_index` pilote la position (voir `UI::PSDKMenuButtonBase`). + +::: + +## Comment modifier les boutons par défaut + +Pour retirer un bouton par défaut, changer sa condition ou réordonner la liste, on ne peut pas éditer une entrée déjà enregistrée : il faut tout effacer et réenregistrer la liste à sa façon. + +```ruby +module GamePlay + class Menu + clear_previous_registers + register_button(:open_party) { $actors.any? } + register_button(:open_bag) { !$bag.locked } + register_button(:open_save) { !$game_system.save_disabled } + register_button(:open_quit) { true } + end +end +``` + +L'enregistrement par défaut dans `scripts/4 Systems/100 Menu/100 Menu.rb` (présenté dans le tableau en haut de page) vous sert de référence pour les actions et conditions à réenregistrer. + +:::warning + +Réordonner change l'index de tous les boutons, et les icônes comme les textes sont indexés : avec l'ordre ci-dessus, le bouton équipe afficherait l'icône du Dex. Adaptez les lignes de `menu_icons` et la méthode `text` de `UI::PSDKMenuButtonBase` à votre nouvel ordre. + +::: + +## Conclusion + +- Le menu principal est une liste ordonnée de boutons ; chaque bouton est une **action** (une méthode de `GamePlay::Menu`) plus une **condition de visibilité** évaluée à l'ouverture du menu. +- On écrit ses personnalisations dans son propre script en rouvrant `GamePlay::Menu`, jamais en éditant les fichiers du moteur. +- `register_button(:action) { condition }` **ajoute** un nouveau bouton ; les sept boutons par défaut sont déjà enregistrés. +- Un bouton entièrement nouveau demande trois choses : l'enregistrement, la méthode d'action, et son icône/texte (ligne dans `menu_icons` plus un patch `prepend` de `text` dans `UI::PSDKMenuButtonBase`). +- `register_button_overwrite(real_index) { ClassePersonnalisee }` change l'affichage d'un seul bouton. +- `clear_previous_registers` puis tout réenregistrer est la façon de retirer, modifier ou réordonner les boutons par défaut. On garde `menu_icons` et `text` cohérents avec le nouvel ordre. diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/00-setup.md b/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/00-setup.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/00-setup.md rename to i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/00-setup.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/01-ui-scene.md b/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/01-ui-scene.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/01-ui-scene.md rename to i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/01-ui-scene.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/02-composition.md b/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/02-composition.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/02-composition.md rename to i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/02-composition.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/03-spritestack.md b/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/03-spritestack.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/03-spritestack.md rename to i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/03-spritestack.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/04-mystery-gift-data.md b/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/04-mystery-gift-data.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/04-mystery-gift-data.md rename to i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/04-mystery-gift-data.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/05-keyboard.md b/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/05-keyboard.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/05-keyboard.md rename to i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/05-keyboard.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/06-mouse.md b/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/06-mouse.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/06-mouse.md rename to i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/06-mouse.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/07-i18n.md b/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/07-i18n.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/07-i18n.md rename to i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/07-i18n.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/08-dialogs.md b/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/08-dialogs.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/08-dialogs.md rename to i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/08-dialogs.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/09-animations.md b/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/09-animations.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/09-animations.md rename to i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/09-animations.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/10-genericbase.md b/i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/10-genericbase.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/10-genericbase.md rename to i18n/fr/docusaurus-plugin-content-docs/current/psdk/ui-development/mystery-gift/10-genericbase.md diff --git a/src/theme/DocItem/Layout/index.tsx b/src/theme/DocItem/Layout/index.tsx index d25c367..15ba0f8 100644 --- a/src/theme/DocItem/Layout/index.tsx +++ b/src/theme/DocItem/Layout/index.tsx @@ -27,7 +27,7 @@ export default function DocItemLayout(props: Props) { label={rubyChapterLabel} /> )} - {metadata.sourceDirName === "psdk/ui-development" && ( + {metadata.sourceDirName === "psdk/ui-development/mystery-gift" && (