-
Notifications
You must be signed in to change notification settings - Fork 186
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
jetrotal
wants to merge
12
commits into
EasyRPG:master
Choose a base branch
from
EasyRPG-NewFeatures:ShowStringPic-Selectable
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
New Command 2058 - String Picture Menu #3246
jetrotal
wants to merge
12
commits into
EasyRPG:master
from
EasyRPG-NewFeatures:ShowStringPic-Selectable
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…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.
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.
9dea2b3
to
1b5c622
Compare
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
1b5c622
to
c0d7560
Compare
Can you move this up by one? Want to put "Delete Map Event" on 2057. |
Sure, gimme a sec. |
As requested by @Ghabry
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Transforms a String Picture into a menu.
![image](https://private-user-images.githubusercontent.com/45118493/351083058-063fb809-7449-4507-9def-4b0d06d1ede3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU4MjgzNjcsIm5iZiI6MTcyNTgyODA2NywicGF0aCI6Ii80NTExODQ5My8zNTEwODMwNTgtMDYzZmI4MDktNzQ0OS00NTA3LTlkZWYtNGIwZDA2ZDFlZGUzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA4VDIwNDEwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY4ZWY3ZWJiN2RlZDQ0YTMwNGU5ZTRmY2IwYjgwYmFkZmNmM2UwM2FiNjMyYzJlMjI3NmNkYmNlZGVlYzZjN2QmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.c0K5sX-B29BvjENfqqkOlBwk0Amol5_WhQKhLA6UkjY)
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
andMenu's cursor state
.B - Add a
Show Choices Command
right bellow theString 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().
Thanks to @MackValentine, for the initial commits.