Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Command 2058 - String Picture Menu #3246

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

jetrotal
Copy link
Contributor

@jetrotal jetrotal commented Jul 22, 2024

Transforms a String Picture into a menu.
image

MAP DEMO: StringPicMenu.zip - Updated 01/August/24
Paste it inside a new project.


You can control the outputs from the menu through two approaches:

  • A - Points it to variables that will receive Menu's cursor position and Menu's cursor state.

  • B - Add a Show Choices Command right bellow the String Picture Menu Command.
    The Menu will replace the Show Choices UI, while reproducing its behavior.


Syntax (TPC):

Some of the parameters comes in pairs. The first parameter of each pair indicates whether you are using a direct value or a variable/indirect variable, through ValueOrVariable().

@raw 2058,
     "",           // [NOT USED. YOU CAN LEAVE IT BLANK]
      0,           // Mode [0: Enable Menu || 1: Disable Menu]
      0, 1,        // String Picture's ID
      0, 2,        // A variable that will store the current Cursor Position [Optional] 
      0, 3         // A variable that will store the current Cursor State [Optional]
                   // 👆 State Outputs: 0 means 'idle', 1 means 'confirm' and -1 means 'cancel'

Thanks to @MackValentine, for the initial commits.

image

MackValentine and others added 9 commits July 21, 2024 15:48
…ID (*)

Mode = 0 : Initialisation
Mode = 1 : RightAfter, you need ShowChoices command. Everything is automatic
Mode = 2 : Update You will need parameters after Mode
Mode = 3 : Disable window

Params with (*) is only for mode 2.
You always need mode 0 before mode 1/2/3
Mode 2/3 are for "manual" system
Mode 1 is for "automatic" system
command became:
```js
@raw 9992, "",
Mode,  // 0: Enable Menu || 1: Disable Menu
TargetIsVar, Target, // String Picture's ID
OutputIsVar, Output // Optional. A variable that will receive the current selected Menu;
```
To do that, I flicker between currently used system and the system extracted from a strpic.
Kinda hacky, but it does its job.
There's a hardcoded 4 in window_selectable.cpp I wonder if that value is always like this.
Also when the line spacer is smaller than 4, it creates a scrollable menu that is not necessary.
… borderless

more hardcoded numbers to re-center the menu when the border is off

Still need to figure out a problem when cursor index is 0 and when it's max amount of items.
The problem is that half of those cursors are cut in half, because it goes beyond its image container.
Change that fix an issue that happens when calling `window->CreateContents();`
- The issue is that It cuts text's image in half, not being possible to recover them when changing the window size.
- Lambda Functions
- Menu can output Position and State of Cursor as variables
- Show Choices properly mapped.
@jetrotal jetrotal changed the title Show string pic selectable New Command 2057 - String Picture Menu Jul 22, 2024
There was a big chunk of code that was written twice inside two for loops.
I put them inside a single lambda function to ease its readability.
@jetrotal jetrotal force-pushed the ShowStringPic-Selectable branch 3 times, most recently from 9dea2b3 to 1b5c622 Compare July 28, 2024 07:11
the substrings "\/" are the tag that points to a link

CommandStringPicMenu - Fix glitch related to the command is at the end of a list of commands
@jetrotal jetrotal force-pushed the ShowStringPic-Selectable branch from 1b5c622 to c0d7560 Compare July 28, 2024 20:17
@Ghabry
Copy link
Member

Ghabry commented Aug 1, 2024

Can you move this up by one? Want to put "Delete Map Event" on 2057.

@jetrotal
Copy link
Contributor Author

jetrotal commented Aug 1, 2024

Can you move this up by one? Want to put "Delete Map Event" on 2057.

Sure, gimme a sec.

@jetrotal jetrotal changed the title New Command 2057 - String Picture Menu New Command 2058 - String Picture Menu Aug 1, 2024
@jetrotal
Copy link
Contributor Author

jetrotal commented Aug 1, 2024

done

@Ghabry Ghabry added Event/Interpreter EasyRPG New functionality exclusive to EasyRPG Player and removed Building labels Aug 26, 2024
@fdelapena fdelapena added the Awaiting Rebase Pull requests with conflicting files due to former merge label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Rebase Pull requests with conflicting files due to former merge EasyRPG New functionality exclusive to EasyRPG Player Event/Interpreter Window/Scenes
Development

Successfully merging this pull request may close these issues.

4 participants