@@ -13,8 +13,6 @@ class CharacterView
13
13
GuiDialogCharacterBase characterView ;
14
14
private GuiElementContainer levelContainer ;
15
15
16
- byte page = 0 ;
17
-
18
16
public void Init ( Instance _instance )
19
17
{
20
18
instance = _instance ;
@@ -27,7 +25,7 @@ public void Init(Instance _instance)
27
25
characterView = instance . api . Gui . LoadedGuis . Find ( ( GuiDialog dlg ) => dlg is GuiDialogCharacterBase ) as GuiDialogCharacterBase ;
28
26
characterView . Tabs . Add ( new GuiTab
29
27
{
30
- Name = "Level" ,
28
+ Name = Lang . Get ( "levelup:levels_tab" ) ,
31
29
DataInt = characterView . Tabs . Count
32
30
} ) ;
33
31
characterView . RenderTabHandlers . Add ( ComposeLevelTab ) ;
@@ -103,6 +101,11 @@ private void ComposeLevelTab(GuiComposer composer)
103
101
levelContainer . Add ( new GuiElementStaticText ( instance . api , $ "{ Lang . Get ( "levelup:shield" ) } : { GetLevelByLevelName ( "Shield" ) } ", EnumTextOrientation . Left , containerBounds . RightCopy ( ) . ForkChildOffseted ( 0 , 25 , 500 , 0 ) , CairoFont . WhiteSmallText ( ) ) ) ;
104
102
#endregion
105
103
104
+ #region hand
105
+ levelContainer . Add ( new GuiElementImage ( instance . api , containerBounds = containerBounds . BelowCopy ( ) , new AssetLocation ( "levelup:hand.png" ) ) ) ;
106
+ levelContainer . Add ( new GuiElementStaticText ( instance . api , $ "{ Lang . Get ( "levelup:hand" ) } : { GetLevelByLevelName ( "Hand" ) } ", EnumTextOrientation . Left , containerBounds . RightCopy ( ) . ForkChildOffseted ( 0 , 25 , 500 , 0 ) , CairoFont . WhiteSmallText ( ) ) ) ;
107
+ #endregion
108
+
106
109
#region farming
107
110
levelContainer . Add ( new GuiElementImage ( instance . api , containerBounds = containerBounds . BelowCopy ( ) , new AssetLocation ( "levelup:farming.png" ) ) ) ;
108
111
levelContainer . Add ( new GuiElementStaticText ( instance . api , $ "{ Lang . Get ( "levelup:farming" ) } : { GetLevelByLevelName ( "Farming" ) } ", EnumTextOrientation . Left , containerBounds . RightCopy ( ) . ForkChildOffseted ( 0 , 25 , 500 , 0 ) , CairoFont . WhiteSmallText ( ) ) ) ;
@@ -113,6 +116,11 @@ private void ComposeLevelTab(GuiComposer composer)
113
116
levelContainer . Add ( new GuiElementStaticText ( instance . api , $ "{ Lang . Get ( "levelup:cooking" ) } : { GetLevelByLevelName ( "Cooking" ) } ", EnumTextOrientation . Left , containerBounds . RightCopy ( ) . ForkChildOffseted ( 0 , 25 , 500 , 0 ) , CairoFont . WhiteSmallText ( ) ) ) ;
114
117
#endregion
115
118
119
+ #region panning
120
+ levelContainer . Add ( new GuiElementImage ( instance . api , containerBounds = containerBounds . BelowCopy ( ) , new AssetLocation ( "levelup:panning.png" ) ) ) ;
121
+ levelContainer . Add ( new GuiElementStaticText ( instance . api , $ "{ Lang . Get ( "levelup:panning" ) } : { GetLevelByLevelName ( "Panning" ) } ", EnumTextOrientation . Left , containerBounds . RightCopy ( ) . ForkChildOffseted ( 0 , 25 , 500 , 0 ) , CairoFont . WhiteSmallText ( ) ) ) ;
122
+ #endregion
123
+
116
124
#region vitality
117
125
levelContainer . Add ( new GuiElementImage ( instance . api , containerBounds = containerBounds . BelowCopy ( ) , new AssetLocation ( "levelup:vitality.png" ) ) ) ;
118
126
levelContainer . Add ( new GuiElementStaticText ( instance . api , $ "{ Lang . Get ( "levelup:vitality" ) } : { GetLevelByLevelName ( "Vitality" ) } ", EnumTextOrientation . Left , containerBounds . RightCopy ( ) . ForkChildOffseted ( 0 , 25 , 500 , 0 ) , CairoFont . WhiteSmallText ( ) ) ) ;
@@ -133,7 +141,7 @@ private void ComposeLevelTab(GuiComposer composer)
133
141
134
142
// Adding the size of scroll button
135
143
GuiElementScrollbar scrollBar = composer . GetScrollbar ( "LevelUP_Scrollbar" ) ;
136
- scrollBar . SetHeights ( ( float ) containerBounds . fixedHeight , ( float ) ( clippingBounds . fixedHeight * 3.5 ) ) ;
144
+ scrollBar . SetHeights ( ( float ) containerBounds . fixedHeight , ( float ) ( clippingBounds . fixedHeight * 3.7 ) ) ;
137
145
}
138
146
139
147
private void OnNewScrollbarValue ( float value )
@@ -143,39 +151,4 @@ private void OnNewScrollbarValue(float value)
143
151
}
144
152
145
153
private int GetLevelByLevelName ( string levelName ) => instance . api . World . Player . Entity . WatchedAttributes . GetInt ( $ "LevelUP_Level_{ levelName } ") ;
146
-
147
- private static void SetComposerLevel ( GuiComposer composer , ElementBounds position , int level )
148
- {
149
- // Single Digits
150
- if ( level < 10 )
151
- // Creating the imagem
152
- composer . AddImage ( position , new AssetLocation ( $ "levelup:{ level } .png") ) ;
153
- // Double Digits
154
- else if ( level < 100 )
155
- {
156
- string levelStr = level . ToString ( ) ;
157
- int firstDigit = int . Parse ( levelStr [ 0 ] . ToString ( ) ) ;
158
- int secondDigit = int . Parse ( levelStr [ 1 ] . ToString ( ) ) ;
159
-
160
- // First digit instanciation
161
- ElementBounds firstDigitPosition = ElementBounds . Fixed (
162
- position . fixedX - 15 ,
163
- position . fixedY ,
164
- position . fixedWidth ,
165
- position . fixedHeight
166
- ) ;
167
- composer . AddImage ( firstDigitPosition , new AssetLocation ( $ "levelup:{ firstDigit } .png") ) ;
168
-
169
- // Second digit instanciation
170
- ElementBounds secondDigitPosition = ElementBounds . Fixed (
171
- position . fixedX + 15 ,
172
- position . fixedY ,
173
- position . fixedWidth ,
174
- position . fixedHeight
175
- ) ;
176
- composer . AddImage ( secondDigitPosition , new AssetLocation ( $ "levelup:{ secondDigit } .png") ) ;
177
- }
178
-
179
- Debug . Log ( "Ops, you reached the gui limit :P " ) ;
180
- }
181
154
}
0 commit comments