local f0_local0 = module local f0_local1, f0_local2 = ... f0_local0( f0_local1, package.seeall ) DebugPrint( "Registering luitest menu" ) f0_local0 = function ( f1_arg0, f1_arg1 ) DebugPrint( "Got event " .. f1_arg1.name ) end f0_local1 = function ( f2_arg0 ) DebugPrint( "push func!" ) end f0_local2 = function ( f3_arg0 ) DebugPrint( "pop func!" ) end local f0_local3 = function () return { table1 = { key = "value", key2 = 2 }, item = 5 } end local f0_local4 = function () DebugPrint( "test function!!!!!!!!!!!!!!!!!!!!" ) local f5_local0 = f0_local3() f5_local0.item = 6 f5_local0.table1.key2 = 5 local f5_local1 = f0_local3() DebugPrint( f5_local1.item ) DebugPrint( f5_local1.table1.key2 ) end local f0_local5 = function () return { type = "UIText", states = { default = { leftAnchor = true, rightAnchor = true, topAnchor = true, bottomAnchor = false, left = 0, right = 0, top = 0, bottom = 25, alignment = LUI.Alignment.Left } } } end local f0_local6 = function () return { type = "debugText" } end debugFocus = true local f0_local7 = function ( f8_arg0 ) debugFocus = not debugFocus return debugFocus end local f0_local8 = function ( f9_arg0 ) return { { type = "debugButton", id = "button1", properties = { text = "Open This Menu", additional_handlers = { button_action = MBh.OpenMenu( "luitest", true ) } } }, { type = "debugButton", id = "button2", properties = { text = "Open Popup", defaultDuration = 3000, additional_handlers = { button_action = MBh.PopupMenu( "testPopup", true ) } } }, { type = "debugButton", id = "button3", properties = { text = "Handles Alt 1 As Well", additional_handlers = { button_action = function () crash = me end , button_alt1 = MBh.HandlePrint( "Button 3 Alt 1" ) } }, disabledFunc = f0_local7 }, { type = "derivedDebugText", properties = { text = "Hello" } }, { type = "derivedDebugText", properties = { text = "world" } } } end function debugList() return { type = "UIVerticalList", id = "testMenu", focusable = true, states = { default = { left = 0, top = 0, right = 0, bottom = 0, leftAnchor = true, topAnchor = true, rightAnchor = true, bottomAnchor = true } } } end function debugButton() return { type = "UIButton", id = "debugButtonDefaultId", properties = { text = "button", width = 400, height = 35, defaultDuration = 500 }, focusable = true, children = { { type = "UIImage", id = "image", properties = { defaultDuration = MBh.Property( "defaultDuration" ) }, states = { default = { leftAnchor = true, rightAnchor = true, topAnchor = true, bottomAnchor = true, left = 0, right = 0, top = 0, bottom = 0, material = RegisterMaterial( "white" ), scale = 1 }, button_over = MBh.BaseState( "default", { scale = 0.8 } ), pulse_1 = MBh.BaseState( "default" ), pulse_2 = MBh.BaseState( "default", { scale = 0.8 } ) }, handlers = { button_over = MBh.AnimateLoop( { { "pulse_1", 200, true, true }, { "pulse_2", 200, true, true } } ), button_up = MBh.AnimateToState( "default", 1000, true, true ), button_disable = MBh.AnimateToState( "default", 1000, true, true ) } }, { type = "derivedDebugText", id = "theText", properties = { text = MBh.Property( "text" ) }, states = { default = { leftAnchor = true, rightAnchor = true, topAnchor = true, bottomAnchor = false, left = 0, right = 0, top = 0, bottom = 25, alignment = LUI.Alignment.Left } } } }, states = { default = { leftAnchor = true, rightAnchor = false, topAnchor = true, bottomAnchor = false, left = 0, right = MBh.Property( "width" ), top = 0, bottom = 35, scale = 1, alpha = 1 }, disabled = { alpha = 0.5, scale = 1 }, button_over = MBh.BaseState( "default", { scale = 1.2 } ) }, handlers = { button_over = MBh.DoMultiple( { MBh.AnimateToState( "button_over", MBh.Property( "defaultDuration" ), true, true ), f0_local0 } ), button_up = MBh.AnimateToState( "default", 1000, true, true ), button_disable = MBh.AnimateToState( "disabled", 1000, true, true ) } } end local f0_local9 = function () return { type = "UIElement", id = "testDef", focusable = true, pushFunc = f0_local1, popFunc = f0_local2, properties = { menu_feeder = MBh.Function( f0_local8 ) }, children = { { type = "debugList", id = "debugList", properties = { menu_feeder = MBh.Property( "menu_feeder" ) }, childrenFeeder = MBh.Property( "menu_feeder" ) }, { type = "backButton", id = "backButton" }, { type = "UITimer", properties = { event = "menu_refresh", interval = 3000, disposable = false, broadcastToRoot = true } } }, states = { default = { left = 100, top = 100, right = 0, bottom = 0, leftAnchor = true, topAnchor = true, rightAnchor = true, bottomAnchor = true } }, handlers = { menu_create = f0_local4, menu_close = function () DebugPrint( "menu closed!" ) end } } end local f0_local10 = function () return { type = "UIBindButton", handlers = { button_secondary = MBh.LeaveMenu() } } end LUI.MenuBuilder.registerDef( "testPopup", function () return { type = "UIElement", focusable = true, id = "testPopup", properties = { text = "Popup text" }, children = { { type = "derivedDebugText", properties = { text = MBh.Property( "text" ) }, states = { default = { leftAnchor = true, rightAnchor = true, topAnchor = true, bottomAnchor = true, left = 0, right = 0, top = 0, bottom = 0, alignment = LUI.Alignment.Left } } }, { type = "backButton", id = "popupBackButton" } }, states = { default = { leftAnchor = false, rightAnchor = false, topAnchor = false, bottomAnchor = false, left = -100, right = 100, top = -20, bottom = 20 } } } end ) LUI.MenuBuilder.registerDef( "backButton", f0_local10 ) LUI.MenuBuilder.registerDef( "debugText", f0_local5 ) LUI.MenuBuilder.registerDef( "derivedDebugText", f0_local6 ) LUI.MenuBuilder.registerDef( "debugList", debugList ) LUI.MenuBuilder.registerDef( "debugButton", debugButton ) LUI.MenuBuilder.registerDef( "luitest", f0_local9 ) LockTable( _M )