UI / LeaderboardMainPanelBase
LeaderboardMainPanelBase<T> Class
Leaderboard main interface
Type parameters
T | extends ILeaderboardPanelView |
|---|
Hierarchy
BasePanel<T>↳
LeaderboardMainPanelBase
Table of contents
Properties
onClose: Action |
|---|
| Event called when closed |
Accessors
Methods
addField(fieldId: number, fieldName: string, valueStyle?: string): LeaderboardMainPanelBase<T> other |
|---|
| Add a field |
creatItem(): LeaderboardItemPanelBase<{ mContent: [Canvas](mw.Canvas.md) } & UIScript> other |
| Create an item sub UI to display a ranking information |
onHide(): void other |
| When the UI hides call |
onSelfFieldSet(rankIndex: number, fieldId: number, fieldValue: string number, textBlockIndex: number, textBlock: TextBlock): void other |
| Call after setting your own field content (the bottom line of the interface). Please copy if necessary |
onShow(playerDataList: LeaderboardPlayerData[]): void other |
| When the UI displays call |
onSort(dataList: LeaderboardPlayerData[]): LeaderboardPlayerData[] other |
| When calling for sorting, please rewrite it |
setSortFields(...fieldIds: number[]): LeaderboardMainPanelBase<T> other |
| Set the sort field ID, you can set multi field sort, and only support sort from large to small |
setStyle(title: string, fieldsAutoLayout: boolean, showPlayerNum: number, itemSpacing: number): LeaderboardMainPanelBase<T> other |
| Set the style of the leaderboard |
showRankField(fieldName: string, valueStyle?: string, notListed?: string): LeaderboardMainPanelBase<T> other |
| The "Rank" field is displayed and set. It is not displayed by default |
click
Methods
onAdded(): void other |
|---|
| Lifecycle - Triggered when added to the parent node, may be called multiple times |
onAwake(): void other |
| Life cycle method - the construction panel is automatically triggered and will only be called call |
Properties
onClose
• Readonly onClose: Action
Event called when closed
Accessors
Methods
addField
• addField(fieldId, fieldName, valueStyle?): LeaderboardMainPanelBase<T> other
Add a field
Parameters
fieldId number | Field ID range: determined by ID length type: |
|---|---|
fieldName string | Field title range: |
valueStyle? string | Display style of field value (example: {0} points) default: null range: unlimited |
Returns
LeaderboardMainPanelBase<T> | Return to yourself, which can be used for chained call |
|---|
creatItem
• Protected Abstract creatItem(): LeaderboardItemPanelBase<{ mContent: [Canvas](mw.Canvas.md) } & UIScript> other
Create an item sub UI to display a ranking information
Returns
LeaderboardItemPanelBase<{ mContent: [Canvas](mw.Canvas.md) } & UIScript> | An item sub UI for ranking information |
|---|
onHide
• Protected onHide(): void other
When the UI hides call
Precautions
If you want to replicate this method, remember to call super. onHide ()
onSelfFieldSet
• Protected onSelfFieldSet(rankIndex, fieldId, fieldValue, textBlockIndex, textBlock): void other
Call after setting your own field content (the bottom line of the interface). Please copy if necessary
Parameters
rankIndex number | Ranking index (starting from 0) range: reasonable, no restrictions type: integer |
|---|---|
fieldId number | Field index (if it is a ranking field, this parameter is mull) range: reasonable, no restrictions type: integer |
fieldValue string number | Field display content: range: reasonable, no restrictions. Type: integer |
textBlockIndex number | Text control index range: reasonable, no restrictions. Type: integer |
textBlock TextBlock | Text widget |
onShow
• Protected onShow(playerDataList): void other
When the UI displays call
Parameters
playerDataList LeaderboardPlayerData[] | Player Data List |
|---|
Precautions
If you want to duplicate this method, remember to call super. onShow()
onSort
• Protected onSort(dataList): LeaderboardPlayerData[] other
When calling for sorting, please rewrite it
Parameters
dataList LeaderboardPlayerData[] | Ranking data array |
|---|
Returns
LeaderboardPlayerData[] | Sorted data queue |
|---|
setSortFields
• setSortFields(...fieldIds): LeaderboardMainPanelBase<T> other
Set the sort field ID, you can set multi field sort, and only support sort from large to small
Parameters
...fieldIds number[] | Sort Field |
|---|
Returns
LeaderboardMainPanelBase<T> | Return to yourself, which can be used for chained call |
|---|
setStyle
• setStyle(title, fieldsAutoLayout, showPlayerNum, itemSpacing): LeaderboardMainPanelBase<T> other
Set the style of the leaderboard
Parameters
title string | UI Title range: UI title information |
|---|---|
fieldsAutoLayout boolean | Whether the field is automatically layout (true - uniform distribute, false - what you put is what you get) |
showPlayerNum number | The maximum number of Player displayed range: reasonable, type: integer |
itemSpacing number | The spacing between each piece of data should be reasonable. Type: integer |
Returns
LeaderboardMainPanelBase<T> | Return to yourself, which can be used for chained call |
|---|
showRankField
• showRankField(fieldName, valueStyle?, notListed?): LeaderboardMainPanelBase<T> other
The "Rank" field is displayed and set. It is not displayed by default
Parameters
fieldName string | Field title range: determined by ID length type: |
|---|---|
valueStyle? string | Field value style default: null range: no restriction |
notListed? string | Not on the list (if not on the list, display "ranking", please fill in null) default: null range: no restrictions |
Returns
LeaderboardMainPanelBase<T> | Return to yourself, which can be used for chained call |
|---|
Editor API