answer part 2:There isn't a set menu type that is an "on/off menu" the items used in the menu do different things
you create the buttons to turn functions on or off. im going to show you how to make a single function menu, not an array menu
(array menu tut can be found here
How to create a menu)
first you want to think about what style of menu you want! THAW has a few different styles, the main one used is a "label_menu", other common menus used are "theme_menu"'s, debug options uses THAW style "roundbar_menu"'s
each one of these menu types has a list of menu items you can use and most are the same across the board, however, their pointer name is different depending on the menu style.
but for starters i'll show you what you asked for and that's flag_item and how to use a menu_item that functions exactly as a flag_item
you'll need to link to your menu "$pad_choose_script$ = $THE_NAME_OF_YOUR_MENU_FUNCTION$"
this can be in any menu you like, it could be skater controls, or even text commands too.
then you'll want to create your menu...
Label menu...((using a quote because colors aren't parsed when wrapped in code tags)see code below)
%include "THE_NAME_OF_YOUR_MENU_FUNCTION.qb_table.qbi" #/ Table file
:i $hide_current_goal$
:i $make_label_menu$:s{
:i $title$ = %s(15,"Title Goes Here")
:i $title_pos$ = %vec2(100.000000,40.000000)$pos$ = %vec2(130.000000,120.000000)$title_rotation$ = %i(0,00000000)
:i $spacing$ = %i(1,00000001)
:i $Scrolling$
:i $padding_scale$ = %f(0.550000)
:i $dims$ = %vec2(250.000000,300.000000)
:i $pos$ = %vec2(120.000000,100.000000)
:i $pad_back_script$ = call $generic_menu_pad_back$ arguments
$pad_back_params$ = :s{$callback$ = $create_pause_menu$:s}
:i :s}
:i call $pause_menu_gradient$ arguments
$off$
:i $GoalManager_HideGoalPoints$
:i $GoalManager_HidePoints$
:i $unhide_root_window$
:i if call $GetGlobalFlag$ arguments
$flag$ = $YOUR_FLAG_NAME_GOES_HERE$
:i $hud_text$ = %s(2,"On")
:i else
:i $hud_text$ = %s(3,"Off")
:i endif
:i $add_label_menu_item$:s{$text$ = %s(28,"YOUR FUNCTION TEXT GOES HERE")
:i $extra_text$ = %GLOBAL%$hud_text$
:i $id$ = $BUTTON_ID_GOES_HERE, each must be different$
:i $pad_choose_script$ = $YOUR_FUNCTION_NAME_THAT_SETS_UNSETS_YOUR_FLAG_GOES_HERE$
:i :s}
:i $add_label_menu_flag_item$:s{
:i $text$ = %s(28,"YOUR FUNCTION TEXT GOES HERE")
:i $label_offset$ = %vec2(0.000000,0.000000)
:i $id$ = $BUTTON_ID_GOES_HERE, each must be different$
:i $flag$ = $YOUR_FLAG_NAME_GOES_HERE$
:i $reverse$
:i $no_bg$
:i :s}
:i $label_menu_finish$
:i endfunction
this must be here, it tells the game to create this type of menu, also the finish of the menu MUST be there toothis is the title of your menu and title parametersthis tells the game that this is a scrolling menu, remove this parameter if you don't want it to scrollthis is the function that is called when the "back" button is pressedthis is the background gradient, this can be set to on, off, left, righthides hud items, objects, misc.this is a menu item setup to act as an on/off or flag_item, these are more commonly used when you need to do more than just set or unset a flagthis is a flag_item, its functions are found deeper in the game, if your object is off but your text says "on" add the reverse parameter, these are the easiest way to turn on/off a flag IF that is all you need it to docode only of above menu...Code: Select all
%include "THE_NAME_OF_YOUR_MENU_FUNCTION.qb_table.qbi" #/ Table file
:i $hide_current_goal$
:i $make_label_menu$:s{
:i $title$ = %s(15,"Title Goes Here")
:i $title_pos$ = %vec2(100.000000,40.000000)$pos$ = %vec2(130.000000,120.000000)$title_rotation$ = %i(0,00000000)
:i $spacing$ = %i(1,00000001)
:i $Scrolling$
:i $padding_scale$ = %f(0.550000)
:i $dims$ = %vec2(250.000000,300.000000)
:i $pos$ = %vec2(120.000000,100.000000)
:i $pad_back_script$ = call $generic_menu_pad_back$ arguments
$pad_back_params$ = :s{$callback$ = $create_pause_menu$:s}
:i :s}
:i call $pause_menu_gradient$ arguments
$off$
:i $GoalManager_HideGoalPoints$
:i $GoalManager_HidePoints$
:i $unhide_root_window$
:i if call $GetGlobalFlag$ arguments
$flag$ = $YOUR_FLAG_NAME_GOES_HERE$
:i $hud_text$ = %s(2,"On")
:i else
:i $hud_text$ = %s(3,"Off")
:i endif
:i $add_label_menu_item$:s{$text$ = %s(28,"YOUR FUNCTION TEXT GOES HERE")
:i $extra_text$ = %GLOBAL%$hud_text$
:i $id$ = $BUTTON_ID_GOES_HERE, each must be different$
:i $pad_choose_script$ = $YOUR_FUNCTION_NAME_THAT_SETS_UNSETS_YOUR_FLAG_GOES_HERE$
:i :s}
:i $add_label_menu_flag_item$:s{
:i $text$ = %s(28,"YOUR FUNCTION TEXT GOES HERE")
:i $label_offset$ = %vec2(0.000000,0.000000)
:i $id$ = $BUTTON_ID_GOES_HERE, each must be different$
:i $flag$ = $YOUR_FLAG_NAME_GOES_HERE$
:i $reverse$
:i $no_bg$
:i :s}
:i $label_menu_finish$
:i endfunction
now i'm going to show you 2 different ways to set and unset a flag,
first we'll start with the easiest method and that's simply using the "$add_label_menu_flag_item$"
basically, for this to work you need to know what you want to turn on/off, you'll need to find the script or scripts that house your data
why, you may be asking yourself? because you need to set a flag in that place...i'm going to use my cheesy animations function as an example
i'll show you PART of it, it is in multiple scripts that i have this flag placed this one in particular is in the grabtrick function
Code: Select all
:i if call $GotParam$ arguments
$SpecialItem_details$
:i if NOT call $GetGlobalFlag$ arguments
$flag$ = $FLAG_NO_CHESSY_ANIM$
:i if call $StructureContains$ arguments
$structure$ = %GLOBAL%$SpecialItem_details$$force_unflipped$
:i if $flipped$
:i $Flip$
:i $Rotate$
:i $boardrotate$
:i $BlendPeriod$ = %i(0,00000000)
:i endif
:i endif
:i call $TurnOnSpecialItem$ arguments
$SpecialItem_details$ = %GLOBAL%$SpecialItem_details$
:i else
:i $TurnOffSpecialItem$
:i endif
:i endif
what this says is IF the flag isn't set, to run the function normally, else $TurnOffSpecialItem$
to make this flag work you need to add it to global_flags.qb and to the flag_item
now for the other method..
since some items can't have a flag placed inline with the code you need to write a function to change a value
the flag in this case is used to tell IF the value is one thing then this item is on, else its off
physics options are an example of this method
i'm going to use my sticker slap/wall plant angle change function as an example...
Code: Select all
:i if NOT call $GetGlobalFlag$ arguments
$flag$ = $FLAG_EXPERT_MODE_SS_WP_ANGLE$
:i call $SetScreenElementProps$ arguments
$id$ = :s{$menu_toggle_sswp$$child$ = %i(3,00000003):s}$text$ = %s(2,"On")
:i call $change$ arguments
$Physics_Wallplant_Min_Approach_Angle$ = %i(20,00000014)
:i call $SetGlobalFlag$ arguments
$flag$ = $FLAG_EXPERT_MODE_SS_WP_ANGLE$
:i else
:i call $SetScreenElementProps$ arguments
$id$ = :s{$menu_toggle_sswp$$child$ = %i(3,00000003):s}$text$ = %s(3,"Off")
:i call $change$ arguments
$Physics_Wallplant_Min_Approach_Angle$ = %i(50,00000032)
:i call $UnsetGlobalFlag$ arguments
$flag$ = $FLAG_EXPERT_MODE_SS_WP_ANGLE$
:i endif
:i endfunction
what this says is IF our flag isn't set then our physics value is normal
so it sets the flag and changes the physics value, now with the flag set the game knows that this function is on
for the button at the menu to function properly with setting the on or off screen element text the $id$ in this function MUST match the button $id$the button should call on the name of this script
same as before, to make this flag work you need to add it to global_flags.qb and to the menu_item
that's it for setting flags
now with THAW you must compile each function separately and add them to the game one by one
read this tut
How to create a menu for more detailed instructions on adding your script using QueenBee
now with flags currently in the game you can go about setting or un-setting those flags to gain new functionality
but let it be known that there are blocks in the code for certain flags and no i wont tell you how to bypass this to cheat%