disabling menu control
Moderators: Bob the Hamster, marionline, SDHawk
- Willy Elektrix
- Liquid Metal Slime
- Posts: 910
- Joined: Sun Aug 15, 2010 11:30 pm
disabling menu control
I want to use a custom menu to display the heroes stats. However, I want to disable the player's control of that menu so that they can't move the cursor around and highlight different menu items. In other words, it will be formatted like a menu, but function like a text box.
The menu bitset "disable player control of menu" doesn't seem useful since the player is unable to cancel the menu while that is open.
Is there a command script which I can use to disable the arrow keys so the player cannot highlight different menu items. Or is there an even better approach to do this?
The menu bitset "disable player control of menu" doesn't seem useful since the player is unable to cancel the menu while that is open.
Is there a command script which I can use to disable the arrow keys so the player cannot highlight different menu items. Or is there an even better approach to do this?
- Spoonweaver
- Liquid Metal King Slime
- Posts: 6247
- Joined: Mon Dec 08, 2008 7:07 am
- Location: Home
- Contact:
- Willy Elektrix
- Liquid Metal Slime
- Posts: 910
- Joined: Sun Aug 15, 2010 11:30 pm
A text box has a limit to the number of lines it contains. A menu is much more useful in this regard.Spoonweaver wrote:Anyways, if the menu is just going to act like a text box, use a textbox. Otherwise, you'll need to provide more information about what you're actually talking about. Screenshots included.
I'm not sure what to show an image of that would help explain the problem. I've attached a picture of my custom menu from custom.exe.
I want the menu to look like that, but forbid the player to control it other than to cancel it. Originally I had tried to enable the "disable player control of menu" bitset. Then I had written a script like this:
Code: Select all
plotscript, statwindow, begin
open menu (1)
while(top menu == 1) do (
if (key is pressed (key: esc), or, key is pressed (key: space)) then (close menu (1))
wait (1)
)
end- Attachments
-
- voidmenu.png (2.66 KiB) Viewed 2842 times
- Spoonweaver
- Liquid Metal King Slime
- Posts: 6247
- Joined: Mon Dec 08, 2008 7:07 am
- Location: Home
- Contact:
try this
Code: Select all
plotscript, statwindow, begin
variable (Spoonhelpedme)
Spoonhelpedme:=0
open menu (1)
while(Spoonhelpedme == 0) do (
if (key is pressed (key: esc), or, key is pressed (key: space)) then (close menu (1),Spoonhelpedme:=1)
wait (1)
)
endI'm not sure if this is exactly what you'd want, but couldn't you just make it so each menu option had a tag that ensured it was never "Enabled"? They'd still be able to move the menu selector up and down, but they wouldn't be able to do anything, just hit escape to go back. Would save you a lot of needless scripting or shenanigans.
I guess what I mean is, why is it so important they can't move the cursor if it can't do anything?
I guess what I mean is, why is it so important they can't move the cursor if it can't do anything?
Last edited by Gizmog on Mon Oct 06, 2014 1:39 am, edited 1 time in total.
- FnrrfYgmSchnish
- Metal Slime
- Posts: 721
- Joined: Thu Jun 18, 2009 4:37 am
- Location: Middle of Nowhere, VA
Isn't it possible to set menu items as "not selectable?" I haven't fiddled with menus a whole lot, but I do know that option exists somewhere--maybe it's only for a specific type of menu item so it might not work in this case.
FYS:AHS -- Swapping out some step-on NPCs for zones + each step script
Puckamon -- Not until the reserve party is expanded.[/size]
Puckamon -- Not until the reserve party is expanded.[/size]
- Willy Elektrix
- Liquid Metal Slime
- Posts: 910
- Joined: Sun Aug 15, 2010 11:30 pm
I ended up working around this problem in a complete different way.
Now, when the player presses ESC to open the main menu, it simultaneously opens the stats menu right beside the main menu. Since the stats menu is not the top menu, it cannot be manipulated. However, the stats are visible whenever the main menu opens. It also saves the player a step to view his stats.
I'm very pleased.
Now, when the player presses ESC to open the main menu, it simultaneously opens the stats menu right beside the main menu. Since the stats menu is not the top menu, it cannot be manipulated. However, the stats are visible whenever the main menu opens. It also saves the player a step to view his stats.
I'm very pleased.
- FnrrfYgmSchnish
- Metal Slime
- Posts: 721
- Joined: Thu Jun 18, 2009 4:37 am
- Location: Middle of Nowhere, VA
Hey, nice workaround. Kinda reminds me of how the Final Fantasy games (well, the ones I've played anyway) have a screen-covering menu that has both its "Main Menu" stuff and your party's HP/MP/name/etc. at the same time.
FYS:AHS -- Swapping out some step-on NPCs for zones + each step script
Puckamon -- Not until the reserve party is expanded.[/size]
Puckamon -- Not until the reserve party is expanded.[/size]
- Willy Elektrix
- Liquid Metal Slime
- Posts: 910
- Joined: Sun Aug 15, 2010 11:30 pm
If I couldn't figure this out, my intent was to learn how to use slices. I'm slow to adopt new things, so I haven't really dug into slices much yet.Mystic wrote:Although you have solved this, is there a reason you're not using slices for this? That would have been a pretty easy thing to do, I think. Slices can basically be big text boxes, if you want. You can also put pictures in there, too, so your stats can have icons.
A good start to slices seems to just be to play around in the "Edit Slice Collections" section of the editor. I spent a lot of time just making pretty layouts of boxes and stuff to help me conceptualize what slices are and how they interact. Once you make it look good, you basically just set a variable equal to "load slice collection(0)" and it pops up. I don't know if that's the best way to learn, but that's the way I did it. Just spent time with it.
My pronouns are they/them
Ps. I love my wife
Ps. I love my wife
It's pretty much intended that you learn about slices by playing around with them in the editor. However the editor could be a lot more user friendly.
Regarding Willy's original question, the script that you posted was wrong. "top menu" returns a menu handle, not a menu ID number. Those are different things: a handle is just an opaque number like an npc reference. Writing "while (top menu)" or "while (menu is open(1))" instead should have worked, as would Spoonweaver's script. And of course don't forget the menu bit to allow scripts.
Regarding Willy's original question, the script that you posted was wrong. "top menu" returns a menu handle, not a menu ID number. Those are different things: a handle is just an opaque number like an npc reference. Writing "while (top menu)" or "while (menu is open(1))" instead should have worked, as would Spoonweaver's script. And of course don't forget the menu bit to allow scripts.
- Willy Elektrix
- Liquid Metal Slime
- Posts: 910
- Joined: Sun Aug 15, 2010 11:30 pm
I eventually figured this out, but another problem emerged. Using the ENTER key to open and close the menu required a lot of finicky WAIT statements. Otherwise, the menu would open and then immediately close. However, using the statements could cause the menu to stall briefly if it was opened and closed quickly. In other words, it wasn't very smooth.TMC wrote:Regarding Willy's original question, the script that you posted was wrong. "top menu" returns a menu handle, not a menu ID number. Those are different things: a handle is just an opaque number like an npc reference. Writing "while (top menu)" or "while (menu is open(1))" instead should have worked, as would Spoonweaver's script. And of course don't forget the menu bit to allow scripts.
- Spoonweaver
- Liquid Metal King Slime
- Posts: 6247
- Joined: Mon Dec 08, 2008 7:07 am
- Location: Home
- Contact:
Easily fixed with a short wait command. I like to go with 8, which is a half second.Willy Elektrix wrote:I eventually figured this out, but another problem emerged. Using the ENTER key to open and close the menu required a lot of finicky WAIT statements. Otherwise, the menu would open and then immediately close. However, using the statements could cause the menu to stall briefly if it was opened and closed quickly. In other words, it wasn't very smooth.
Code: Select all
plotscript, statwindow, begin
variable (Spoonhelpedme)
Spoonhelpedme:=0
open menu (1)
wait (8)
while(Spoonhelpedme == 0) do (
if (key is pressed (key: esc), or, key is pressed (key: space)) then (close menu (1),Spoonhelpedme:=1)
wait (1)
)
end