Skip to main content

The "vngen_get_log_button" Function

Syntax#

vngen_get_log_button([clear]);
ArgumentTypeDescription
[clear]booleanOptional: Enables or disables clearing the result from memory after returning it (enabled by default)

Description#

When run, this script will return the result of the most recently-selected log button, which is stored as the ID of the selected button. If buttons exist but none has been selected, -1 will be returned instead.

This script is intended to be used in conditional statements such as 'if' and 'switch' to take action based on the selected button. In order to prevent this conditional statement from repeatedly executing code, button results will be cleared from memory after being returned. To disable this behavior, it is possible to set the 'clear' argument to 'false', in which case button results can be cleared later with vngen_log_button_clear.

Example#

if (vngen_get_log_button(false) == "up") {
//Action
}
switch (vngen_get_log_button()) {
case "up": //Action; break;
case "dn": //Action; break;
}