Class StatsTabUtils
java.lang.Object
io.github.thecsdev.betterstats.api.client.gui.util.StatsTabUtils
Some utility methods for initializing and handling
StatsTab
GUIs.-
Field Summary
Modifier and TypeFieldDescriptionstatic final net.minecraft.util.Identifier
TheIdentifier
of the "group by" filter.static final net.minecraft.util.Identifier
TheIdentifier
of the "search query" filter.static final net.minecraft.util.Identifier
TheIdentifier
of the "show empty stats" filter.static final net.minecraft.util.Identifier
TheIdentifier
of the "sort by" filter forSUGeneralStat
statistics.static final net.minecraft.util.Identifier
TheIdentifier
of the "sort by" filter forSUItemStat
statistics.static final net.minecraft.util.Identifier
TheIdentifier
of the "sort by" filter forSUMobStat
statistics.static final int
The default horizontal and vertical marginBetterStats
applies to various GUI elements on theBetterStatsScreen
. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
initDefaultFilters
(StatsTab.FiltersInitContext initContext) Initializes the GUI for the most basic filters such as theSelectStatsTabWidget
and the search bar.static <E extends Enum<E>>
voidinitEnumFilter
(StatsTab.FiltersInitContext initContext, @Nullable io.github.thecsdev.tcdcommons.api.client.gui.util.UITexture icon, net.minecraft.util.Identifier filterId, E defaultValue) Initializes the GUI for anEnum
-based filter.static void
initGroupByFilter
(StatsTab.FiltersInitContext initContext) Initializes the GUITSelectEnumWidget
for the "group by" filter.static io.github.thecsdev.tcdcommons.api.client.gui.other.TLabelElement
initGroupLabel
(io.github.thecsdev.tcdcommons.api.client.gui.panel.TPanelElement panel, net.minecraft.text.Text text) Initializes aTLabelElement
that represents a group of elements that come after it.static void
initShowEmptyStatsFilter
(StatsTab.FiltersInitContext initContext) Initializes the GUITCheckboxWidget
for the "show empty stats" filter.static void
initSortCustomsByFilter
(StatsTab.FiltersInitContext initContext) Initializes the GUITSelectEnumWidget
for the "sort by" filter forSUGeneralStat
s.static void
initSortItemsByFilter
(StatsTab.FiltersInitContext initContext) Initializes the GUITSelectEnumWidget
for the "sort by" filter forSUItemStat
s.static void
initSortMobsByFilter
(StatsTab.FiltersInitContext initContext) Initializes the GUITSelectEnumWidget
for the "sort by" filter forSUMobStat
s.
-
Field Details
-
GAP
public static final int GAPThe default horizontal and vertical marginBetterStats
applies to various GUI elements on theBetterStatsScreen
.- See Also:
-
FILTER_ID_SEARCH
public static final net.minecraft.util.Identifier FILTER_ID_SEARCHTheIdentifier
of the "search query" filter.Filter type:
String
- See Also:
-
FILTER_ID_SHOWEMPTY
public static final net.minecraft.util.Identifier FILTER_ID_SHOWEMPTYTheIdentifier
of the "show empty stats" filter.Filter type:
Boolean
- See Also:
-
FILTER_ID_GROUP
public static final net.minecraft.util.Identifier FILTER_ID_GROUPTheIdentifier
of the "group by" filter.Filter type:
Enum
<FilterGroupBy
>- See Also:
-
FILTER_ID_SORT_CUSTOMS
public static final net.minecraft.util.Identifier FILTER_ID_SORT_CUSTOMSTheIdentifier
of the "sort by" filter forSUGeneralStat
statistics.Filter type:
Enum
<FilterSortCustomsBy
>- See Also:
-
FILTER_ID_SORT_ITEMS
public static final net.minecraft.util.Identifier FILTER_ID_SORT_ITEMSTheIdentifier
of the "sort by" filter forSUItemStat
statistics.Filter type:
Enum
<FilterSortItemsBy
>- See Also:
-
FILTER_ID_SORT_MOBS
public static final net.minecraft.util.Identifier FILTER_ID_SORT_MOBSTheIdentifier
of the "sort by" filter forSUMobStat
statistics.Filter type:
Enum
<FilterSortMobsBy
>- See Also:
-
-
Method Details
-
initDefaultFilters
Initializes the GUI for the most basic filters such as theSelectStatsTabWidget
and the search bar.- Parameters:
initContext
- TheStatsTab.FiltersInitContext
.
-
initShowEmptyStatsFilter
Initializes the GUITCheckboxWidget
for the "show empty stats" filter.- Parameters:
initContext
- TheStatsTab.FiltersInitContext
.
-
initGroupByFilter
Initializes the GUITSelectEnumWidget
for the "group by" filter.- Parameters:
initContext
- TheStatsTab.FiltersInitContext
.
-
initSortCustomsByFilter
Initializes the GUITSelectEnumWidget
for the "sort by" filter forSUGeneralStat
s.- Parameters:
initContext
- TheStatsTab.FiltersInitContext
.
-
initSortItemsByFilter
Initializes the GUITSelectEnumWidget
for the "sort by" filter forSUItemStat
s.- Parameters:
initContext
- TheStatsTab.FiltersInitContext
.
-
initSortMobsByFilter
Initializes the GUITSelectEnumWidget
for the "sort by" filter forSUMobStat
s.- Parameters:
initContext
- TheStatsTab.FiltersInitContext
.
-
initEnumFilter
public static <E extends Enum<E>> void initEnumFilter(StatsTab.FiltersInitContext initContext, @Nullable @Nullable io.github.thecsdev.tcdcommons.api.client.gui.util.UITexture icon, net.minecraft.util.Identifier filterId, E defaultValue) throws NullPointerException Initializes the GUI for anEnum
-based filter.- Type Parameters:
E
- TheEnum
type.- Parameters:
initContext
- TheStatsTab.FiltersInitContext
.icon
- An optional icon that will be shown beside theTSelectEnumWidget
.filterId
- The filter's uniqueIdentifier
used for getting and setting the filter's value.defaultValue
- If the filter value is undefined, this will be used as the default one. Must not benull
.- Throws:
NullPointerException
- If an argument isnull
, except for theUITexture
.
-
initGroupLabel
public static io.github.thecsdev.tcdcommons.api.client.gui.other.TLabelElement initGroupLabel(io.github.thecsdev.tcdcommons.api.client.gui.panel.TPanelElement panel, net.minecraft.text.Text text) Initializes aTLabelElement
that represents a group of elements that come after it. For example, this is used to to display the "group labels" for mob and item stats.- Parameters:
panel
- The targetTPanelElement
.text
- TheTLabelElement
'sText
.
-