UI.StandardWindow
Hierarchy
- WindowGroup
- StandardWindow
Index
Constructors
Properties
Methods
- addWindow
- addWindowInstance
- close
- frame
- getAllWindows
- getContainer
- getContent
- getElements
- getStyle
- getStyleSafe
- getWindow
- getWindowContent
- getWindowNames
- invalidateAllContent
- invalidateDrawing
- invalidateElements
- isDynamic
- isInventoryNeeded
- isOpened
- moveOnTop
- onBackPressed
- open
- refreshAll
- refreshWindow
- removeWindow
- setBlockingBackground
- setCloseOnBackPressed
- setContainer
- setContent
- setDebugEnabled
- setStyle
- setWindowContent
Constructors
constructor
Constructs new UI.StandardWindow with specified content. Content is applied to the main window, header and inventory remain the same.
Parameters
content: StandardWindowContent
object containing window description
Returns StandardWindow
Properties
closeOnBackPressed
Methods
addWindow
Creates a new window using provided description and adds it to the group.
Parameters
name: string
window name
content: WindowContent
window description object
Returns Window
Created UI.Window object.
addWindowInstance
Adds window instance with specified name to the group.
Parameters
name: string
window name
window: IWindow
window to be added to the group
Returns void
close
Closes window without container. Use only if the window was opened without container.
Returns void
frame
Called up to 66 times a second to update window's content.
Parameters
time: number
current time in milliseconds
Returns void
getAllWindows
Returns Collection<Window>
Collection object containing all the UI.Windows in the group.
getContainer
Returns UiAbstractContainer
Currently UI.Container that was used to open this window or null, if the window wasn't opened in container.
getContent
Returns StandardWindowContent
nullfor WindowGroup.
getElements
getStyle
Returns Style
Object containing current style of the window.
getStyleSafe
- since: 3.1.0b126
Returns Style
getWindow
Parameters
name: string
window name
Returns Window
Window from the group by it's name or null if no window with such a name was added.
getWindowContent
Parameters
name: string
window name
Returns WindowContent
Window's description object if a window with specified name exists or null otherwise.
getWindowNames
Returns Collection<string>
Collection object containing string names of the windows in the group.
invalidateAllContent
Returns void
invalidateDrawing
Forces ui drawables of the window to refresh.
Parameters
onCurrentThread: boolean
if
true, the drawables will be refreshed immediately, otherwise refresh event will be posted; ensure you are in the UI thread if you passtrueas the parameter
Returns void
invalidateElements
Forces ui elements of the window to refresh.
Parameters
onCurrentThread: boolean
if
true, the drawables will be refreshed immediately, otherwise refresh event will be posted; ensure you are in the UI thread if you passtrueas the parameter
Returns void
isDynamic
Returns boolean
trueif the window can change it's contents position.
isInventoryNeeded
Returns boolean
trueif the window has an inventory that should be updated.
isOpened
Returns boolean
trueif the window is opened,falseotherwise.
moveOnTop
Moves window with specified name to the top of the group.
Parameters
name: string
window name
Returns void
onBackPressed
Returns boolean
Whether the window group can be closed on pressing back navigation button.
open
Opens window without container.
Returns void
refreshAll
Forces refresh for all windows.
Returns void
refreshWindow
Forces window refresh by it's name.
Parameters
name: string
name of the window to refresh
Returns void
removeWindow
Removes window from group by it's name.
Parameters
name: string
window name
Returns void
setBlockingBackground
Parameters
bb: boolean
Returns void
setCloseOnBackPressed
Gives the property to be closed on pressing back navigation button to the given window group.
Parameters
val: boolean
Returns void
setContainer
Sets container for the current window. Be careful when calling it manually. You should prefer opening the window via UI.Container.openAs call.
Parameters
container: UiAbstractContainer
UI.Container to be associated with current window or
nullto associate no container with current window.
Returns void
setContent
Parameters
content: StandardWindowContent
Returns void
setDebugEnabled
Turns debug mode for the window on and off.
Parameters
enabled: boolean
if
true, additional debug information will be drawn on the window canvas
Returns void
setStyle
Parameters
style: Style
Returns void
setWindowContent
Sets content for the window by it's name.
Parameters
name: string
window name
content: WindowContent
content object
Returns void
Class used to create standard UI for the mod's machines. UI.StandardWindow is a UI.WindowGroup that has three windows with names
"main","inventory"and"header". They represent custom window contents, player's inventory and window's header respectively.