Choice-Move Handlers

This script provides a custom event (as in, event-driven programming) for choice windows called an "on cursor move" event. This event is triggered whenever the choice window cursor changes to a different option.

You can attach handlers to this event that will be fired whenever the event is triggered. Each handler holds a method and a set of arguments, and when the handler is called, it will pass the arguents to the method and call the method.



This script does not support changing scenes such as opening the party menu or save menu.

trans.gif
Download

Get it at Hime Works!

Installation

Place this script below Materials and above Main.

Usage

To assign an event handler, use the script call

choice_move_handler(choice_num, method_name, arg1, arg2, ... )Where`choice_num` is the number of the choice you want to assign this handler

to. 1 is the first choice.

`method_name` is the name of the method that will be called when this

handler is called.

`arg1, arg2, ...` are the arguments that will be passed to your method

when the handler is called.

You should have methods defined in Game_Interpreter for user convenience.

Example

Suppose we have the following method:

def show_gab(text) gab("Your selected choice is: %s" %text, 0) endIt takes some text and displays it in a gab window.We have a list of choices:

Code:
    One   Two   Three
Let's have each option display the option you have selected in a gab window 
Code:
    choice_move_handler(1, :show_gab, "One")   choice_move_handler(2, :show_gab, "Two")   choice_move_handler(3, :show_gab, "Three")
When you run the event and scroll through the options, you will see the gab window showing the appropriate text depending on which choice you have highlighted.
Ooh... This is cool... You can make quite a lot of neat things with this...

Original thread: https://forums.rpgmakerweb.com/threads/choice-move-handlers.16200/