Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #/ LevelEditor>Template::Morten1337
- #/ Template q for creating new "tools"
- %include "leveleditor_template.qb_table.qbi" #/ Table file
- #///////////////////////////////////////////
- #//Spawn the object/ do action?
- :i function $Leveleditor_SpawnTemplate$
- :i $LevelEditor$.$GetCursorPosition$
- #///////////////////////////////////////////
- #//This will generate a unique name/checksum
- #//"gen_global_num" is a inteeger located in "leveleditor.qb"
- :i %GLOBAL%$num$ = (($gen_global_num$) + %i(1,00000001))
- :i call $change$ arguments
- $gen_global_num$ = %GLOBAL%$num$
- :i %GLOBAL%$name$ = ($gen_Template$+%GLOBAL%$num$)
- #// ex %GLOBAL%$name$ = "gen_Template09", 09 = num(gen_global_num + 1)
- :i $CreateCompositeObject$:s{
- :i $Components$ =
- :i :a{
- :i :s{$component$ = $motion$:s}
- #//$motion$ is a MUST! if not, Obj_ functions will not work.
- :i :a}
- :i $params$ = :s{$pos$ = (%GLOBAL%$pos$ - %vec3(0.000000,20.000000,0.000000))$name$ = %GLOBAL%$name$:s}
- #//%GLOBAL%$pos$ is $LevelEditor$.$GetCursorPosition$, name is %GLOBAL%$name$ see line 16
- :i :s}
- #//Set the orientation of the object to the same as the "cursor"
- :i %GLOBAL%$name$.call $Obj_SetOrientation$ arguments
- $y$ = %GLOBAL%$angle$
- :i endfunction
- #///////////////////////////////////////////
- #//The menu that spawns when you press triangle
- :i function $LevelEditor_m_template_settings$
- :i call $pause_menu_gradient$ arguments
- $on$
- :i $SelectionArrow_Destroy$
- :i call $KillSpawnedScript$ arguments
- $name$ = $SelectionArrow_Create$
- :i call $KillSpawnedScript$ arguments
- $name$ = $LevelEditor_Debug_text$
- :i if call $ObjectExists$ arguments
- $id$ = $debug_info_id$
- :i call $DestroyScreenElement$ arguments
- $id$ = $debug_info_id$
- :i endif
- :i call $DestroyScreenElement$ arguments
- $id$ = $LevelEditor_buttons_id$
- :i if call $ObjectExists$ arguments
- $id$ = $current_menu_anchor$
- :i call $DestroyScreenElement$ arguments
- $id$ = $current_menu_anchor$
- :i endif
- :i $console_hide$
- :i call $make_new_themed_sub_menu$ arguments
- $title$ = %s(0,"")$no_grad_bar$
- :i $SetScreenElementProps$:s{
- :i $id$ = $sub_menu$
- :i $event_handlers$ = :a{:s{call $pad_back$ arguments
- $generic_menu_pad_back$$params$ = :s{$callback$ = $leveleditor_menu_exit$:s}:s}:a}
- :i $replace_handlers$
- :i :s}
- :i $theme_menu_add_item$:s{
- :i $text$ = %s(0,"First item")
- #/:i $no_bg$
- :i $first_item$
- :i $text_pos$ = %vec2(70.000000,-5.000000)
- :i $centered$ = %i(1,00000001)
- :i $pad_choose_script$ = $nullscript$
- :i :s}
- :i $theme_menu_add_item$:s{$text$ = %s(0,"Second item")
- :i $id$ = $menu_id_here$
- :i $extra_text$ = %s(0,"null")
- :i $text_pos$ = %vec2(70.000000,-5.000000)
- :i $pad_choose_script$ = $nullscript$
- :i :s}
- :i $theme_menu_add_item$:s{
- :i $text$ = %s(4,"Done")
- :i $pad_choose_script$ = $leveleditor_menu_exit$
- :i $last_item$
- :i $centered$ = %i(1,00000001)
- :i $last_menu_item$ = %i(1,00000001)
- :i :s}
- :i $finish_themed_sub_menu$
- :i call $SetScreenElementProps$ arguments
- $id$ = $root_window$$tags$ = :s{$menu_state$ = $on$:s}
- :i $LevelEditor$.$Suspend$
- :i endfunction
- #////////////////////////////////////////////////////////
- #//array for the next function, see line 107
- :i $leveleditor_template_array$ = :a{
- :i :s{
- :i $something$ = $something01$
- :i $name$ = %s(0,"something01")
- :i :s}
- :i :s{
- :i $something$ = $something02$
- :i $name$ = %s(0,"something02")
- :i :s}
- :i :a}
- #////////////////////////////////////////////////////////
- #//Creates a from array elements, good for listing stuff.
- :i function $LevelEditor_m_template_list$
- :i $leveleditor_menu_exit$
- :i call $pause_menu_gradient$ arguments
- $on$
- :i $SelectionArrow_Destroy$
- :i call $KillSpawnedScript$ arguments
- $name$ = $SelectionArrow_Create$
- :i call $KillSpawnedScript$ arguments
- $name$ = $LevelEditor_Debug_text$
- :i if call $ObjectExists$ arguments
- $id$ = $debug_info_id$
- :i call $DestroyScreenElement$ arguments
- $id$ = $debug_info_id$
- :i endif
- :i call $DestroyScreenElement$ arguments
- $id$ = $LevelEditor_buttons_id$
- :i if call $ObjectExists$ arguments
- $id$ = $current_menu_anchor$
- :i call $DestroyScreenElement$ arguments
- $id$ = $current_menu_anchor$
- :i endif
- :i $leveleditor$.$Suspend$
- :i $console_hide$
- :i call $make_new_themed_scrolling_menu$ arguments
- $title$ = %s(9,"Menu Title")$no_bar$
- :i $SetScreenElementProps$:s{
- :i $id$ = $sub_menu$
- :i $event_handlers$ = :a{:s{call $pad_back$ arguments
- $generic_menu_pad_back$$params$ = :s{$callback$ = $leveleditor_menu_exit$:s}:s}:a}
- :i $replace_handlers$
- :i :s}
- :i %GLOBAL%$array_name$ = $leveleditor_template_array$
- :i call $GetArraySize$ arguments
- %GLOBAL%$array_name$
- :i %GLOBAL%$index$ = %i(0,00000000)
- :i while
- $text$ = ((%GLOBAL%$array_name$:a{%GLOBAL%$index$:a}) ->$name$)
- $something$ = ((%GLOBAL%$array_name$:a{%GLOBAL%$index$:a}) ->$something$)
- :i $theme_menu_add_item$:s{
- :i $text$ = %GLOBAL%$text$
- :i $no_bg$
- :i $centered$
- :i $pad_choose_script$ = $nullscript$
- :i $pad_choose_params$ = :s{$something$ = %GLOBAL%$something$$index$ = %GLOBAL%$index$:s}
- :i :s}
- :i %GLOBAL%$index$ = (%GLOBAL%$index$ + %i(1,00000001))
- :i loop_to %GLOBAL%$array_size$
- :i $finish_themed_scrolling_menu$
- :i call $SetScreenElementProps$ arguments
- $id$ = $root_window$$tags$ = :s{$menu_state$ = $on$:s}
- :i endfunction
- :i :end
- #/ END....., no shit?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement