LUADOC - Farming Simulator 19

Script v1.7.1.0

Engine v1.7.1.0

Foundation Reference

TabbedMenuFrameElement

Description
Base class for frame elements for the in-game menu.
Parent
FrameElement
Functions

clearMenuButtonInfoDirty

Description
Clear menu button dirty flag.
Definition
clearMenuButtonInfoDirty()
Code
71function TabbedMenuFrameElement:clearMenuButtonInfoDirty()
72 self.menuButtonsDirty = false
73end

getHasCustomMenuButtons

Description
Check if this menu frame requires menu button customization.
Definition
getHasCustomMenuButtons()
Code
38function TabbedMenuFrameElement:getHasCustomMenuButtons()
39 return self.hasCustomMenuButtons
40end

getMainElementPosition

Description
Get the frame's main content element's screen position.
Definition
getMainElementPosition()
Code
83function TabbedMenuFrameElement:getMainElementPosition()
84 return {0, 0}
85end

getMainElementSize

Description
Get the frame's main content element's screen size.
Definition
getMainElementSize()
Code
77function TabbedMenuFrameElement:getMainElementSize()
78 return {1, 1}
79end

getMenuButtonInfo

Description
Get custom menu button information.
Definition
getMenuButtonInfo()
Return Values
tableArrayof button info as {i={inputAction=, text=, callback=}}
Code
45function TabbedMenuFrameElement:getMenuButtonInfo()
46 return self.menuButtonInfo
47end

initialize

Description
Late initialization of a menu frame. Override in sub-classes.
Definition
initialize()
Code
33function TabbedMenuFrameElement:initialize(...)
34end

isMenuButtonInfoDirty

Description
Get the menu button info dirty state (has changed).
Definition
isMenuButtonInfoDirty()
Code
65function TabbedMenuFrameElement:isMenuButtonInfoDirty()
66 return self.menuButtonsDirty
67end

new

Description
Create a new TabbedMenuFrameElement instance.
Definition
new()
Code
17function TabbedMenuFrameElement:new(target, customMt)
18 local self = FrameElement:new(target, customMt or TabbedMenuFrameElement_mt)
19
20 self.hasCustomMenuButtons = false
21 self.menuButtonInfo = {}
22 self.menuButtonsDirty = false
23 self.title = nil
24
25 self.requestCloseCallback = NO_CALLBACK -- close request accepted callback
26
27 return self
28end

onFrameClose

Description
Called when this frame is closed by its container.
Definition
onFrameClose()
Code
104function TabbedMenuFrameElement:onFrameClose()
105end

onFrameOpen

Description
Called when this frame is opened by its container.
Definition
onFrameOpen()
Code
99function TabbedMenuFrameElement:onFrameOpen()
100end

requestClose

Description
Request to close the frame. Frames can contain logic (e.g. saving pending changes) which should be handled before closing. Use this method in sub-classes request closing the frame so it can wrap up first. If a callback is provided and the initial request could not close the frame, the callback will be called as soon as the frame can be closed.
Definition
requestClose()
Code
92function TabbedMenuFrameElement:requestClose(callback)
93 self.requestCloseCallback = callback or NO_CALLBACK
94 return true
95end

setMenuButtonInfo

Description
Set custom menu button information.
Definition
setMenuButtonInfo(table menuButtonInfo)
Arguments
tablemenuButtonInfoArray of button info as {i={inputAction=, text=, callback=}} or nil to reset.
Code
52function TabbedMenuFrameElement:setMenuButtonInfo(menuButtonInfo)
53 self.menuButtonInfo = menuButtonInfo
54 self.hasCustomMenuButtons = menuButtonInfo ~= nil
55end

setMenuButtonInfoDirty

Description
Set the menu button info dirty flag which causes the menu to update the buttons from this element's information.
Definition
setMenuButtonInfoDirty()
Code
59function TabbedMenuFrameElement:setMenuButtonInfoDirty()
60 self.menuButtonsDirty = true
61end