LUADOC - Farming Simulator 22

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
87function TabbedMenuFrameElement:clearMenuButtonInfoDirty()
88 self.menuButtonsDirty = false
89end

getHasCustomMenuButtons

Description
Check if this menu frame requires menu button customization.
Definition
getHasCustomMenuButtons()
Code
54function TabbedMenuFrameElement:getHasCustomMenuButtons()
55 return self.hasCustomMenuButtons
56end

getMainElementPosition

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

getMainElementSize

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

getMenuButtonInfo

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

initialize

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

isMenuButtonInfoDirty

Description
Get the menu button info dirty state (has changed).
Definition
isMenuButtonInfoDirty()
Code
81function TabbedMenuFrameElement:isMenuButtonInfoDirty()
82 return self.menuButtonsDirty
83end

new

Description
Create a new TabbedMenuFrameElement instance.
Definition
new()
Code
26function TabbedMenuFrameElement.new(target, customMt)
27 local self = FrameElement.new(target, customMt or TabbedMenuFrameElement_mt)
28
29 self:registerControls(TabbedMenuFrameElement.CONTROLS)
30
31 self.hasCustomMenuButtons = false
32 self.menuButtonInfo = {}
33 self.menuButtonsDirty = false
34 self.title = nil
35 self.tabbingMenuVisibleDirty = false
36 self.tabbingMenuVisible = true
37 self.currentPage = 1
38
39 self:setNumberOfPages(1)
40
41 self.requestCloseCallback = NO_CALLBACK -- close request accepted callback
42
43 return self
44end

onFrameClose

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

onFrameOpen

Description
Called when this frame is opened by its container.
Definition
onFrameOpen()
Code
115function TabbedMenuFrameElement:onFrameOpen()
116 self:updatePagingButtons()
117
118 if GS_IS_MOBILE_VERSION and self.subPageSelector ~= nil and self.numberOfPages > 1 then
119 self:onPageChanged(self.currentPage, self.currentPage)
120 end
121end

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
108function TabbedMenuFrameElement:requestClose(callback)
109 self.requestCloseCallback = callback or NO_CALLBACK
110 return true
111end

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
68function TabbedMenuFrameElement:setMenuButtonInfo(menuButtonInfo)
69 self.menuButtonInfo = menuButtonInfo
70 self.hasCustomMenuButtons = menuButtonInfo ~= nil
71end

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
75function TabbedMenuFrameElement:setMenuButtonInfoDirty()
76 self.menuButtonsDirty = true
77end

setTitle

Description
Set a new title for the frame
Definition
setTitle()
Code
132function TabbedMenuFrameElement:setTitle(title)
133 self.title = title
134 if self.pagingTitle ~= nil then
135 self.pagingTitle:setText(title)
136 end
137end