@@ -165,8 +165,6 @@ static void CustomizeFaceFeature(string key, float value)
165
165
}
166
166
}
167
167
168
-
169
-
170
168
static void CustomizeHeadOverlay ( string key , int value )
171
169
{
172
170
foreach ( var field in HeadOverlays . GetType ( ) . GetFields ( ) )
@@ -176,73 +174,41 @@ static void CustomizeHeadOverlay(string key, int value)
176
174
var headOverlay = ( Schemes . HeadOverlay ) field . GetValue ( HeadOverlays ) ;
177
175
178
176
headOverlay . Current = value ;
179
- RenderHeadOverlay ( headOverlay ) ;
177
+
178
+ Lobby . Service . RenderHeadOverlay ( new Shared . Schemes . HeadOverlay
179
+ {
180
+ Index = headOverlay . Index ,
181
+ Value = headOverlay . Values . ElementAt ( headOverlay . Current )
182
+ } ) ;
183
+
180
184
break ;
181
185
}
182
186
}
183
187
184
- static void RenderHeadOverlay ( Schemes . HeadOverlay headOverlay )
185
- {
186
- RAGE . Elements . Player . LocalPlayer . SetHeadOverlay ( headOverlay . Index , headOverlay . Values . ElementAt ( headOverlay . Current ) , 1 ) ;
187
- }
188
-
189
188
static void CustomizeSex ( string sex )
190
189
{
191
190
Sex . Current = sex ;
192
- RenderSex ( ) ;
191
+ Lobby . Service . RenderSex ( Sex . Current ) ;
193
192
Reset ( sex : false ) ;
194
193
SendInitialDataToUi ( sex : false ) ;
195
194
}
196
195
197
- static void RenderSex ( )
198
- {
199
- if ( Sex . Current == "male" )
200
- {
201
- RAGE . Elements . Player . LocalPlayer . Model = RAGE . Game . Misc . GetHashKey ( "mp_m_freemode_01" ) ;
202
- }
203
- else
204
- {
205
- RAGE . Elements . Player . LocalPlayer . Model = RAGE . Game . Misc . GetHashKey ( "mp_f_freemode_01" ) ;
206
- }
207
- }
208
-
209
196
static void CustomizeHair ( int value )
210
197
{
211
198
Hair . Current = value ;
212
- RenderHair ( ) ;
213
- }
214
-
215
- static void RenderHair ( )
216
- {
217
- RAGE . Elements . Player . LocalPlayer . SetComponentVariation ( Hair . Index , Hair . Values [ Hair . Current ] , 0 , 0 ) ;
199
+ Lobby . Service . RenderHair ( Hair . Values [ Hair . Current ] ) ;
218
200
}
219
201
220
202
static void CustomizeColor ( int value )
221
203
{
222
204
Color . Current = value ;
223
- RenderColor ( ) ;
224
- }
225
-
226
- static void RenderColor ( )
227
- {
228
- RAGE . Elements . Player . LocalPlayer . SetHairColor ( Color . Values [ Color . Current ] , 0 ) ;
229
-
230
- RAGE . Elements . Player . LocalPlayer . SetHeadOverlayColor ( HeadOverlays . FacialHair . Index , 1 , Color . Values [ Color . Current ] , 0 ) ;
231
-
232
- RAGE . Elements . Player . LocalPlayer . SetHeadOverlayColor ( HeadOverlays . ChestHair . Index , 1 , Color . Values [ Color . Current ] , 0 ) ;
233
-
234
- RAGE . Elements . Player . LocalPlayer . SetHeadOverlayColor ( HeadOverlays . Eyebrows . Index , 1 , Color . Values [ Color . Current ] , 0 ) ;
205
+ Lobby . Service . RenderColor ( Color . Values [ Color . Current ] ) ;
235
206
}
236
207
237
208
static void CustomizeEyeColor ( int value )
238
209
{
239
210
EyeColor . Current = value ;
240
- RenderEyeColor ( ) ;
241
- }
242
-
243
- static void RenderEyeColor ( )
244
- {
245
- RAGE . Elements . Player . LocalPlayer . SetEyeColor ( EyeColor . Values [ EyeColor . Current ] ) ;
211
+ Lobby . Service . RenderEyeColor ( EyeColor . Current ) ;
246
212
}
247
213
248
214
static void CustomizeBlendData ( string key , dynamic value )
@@ -251,12 +217,7 @@ static void CustomizeBlendData(string key, dynamic value)
251
217
if ( key == "mother" ) BlendData . SetMother ( ( int ) value ) ;
252
218
if ( key == "shape-mix" ) BlendData . SetShapeMix ( ( float ) value ) ;
253
219
if ( key == "skin-mix" ) BlendData . SetSkinMix ( ( float ) value ) ;
254
- RenderBlendData ( ) ;
255
- }
256
-
257
- static void RenderBlendData ( )
258
- {
259
- RAGE . Elements . Player . LocalPlayer . SetHeadBlendData ( BlendData . Current . Item1 , BlendData . Current . Item2 , BlendData . Current . Item3 , BlendData . Current . Item4 , BlendData . Current . Item5 , BlendData . Current . Item6 , BlendData . Current . Item7 , BlendData . Current . Item8 , BlendData . Current . Item9 , BlendData . Current . Item10 ) ;
220
+ Lobby . Service . RenderBlendData ( BlendData . Current ) ;
260
221
}
261
222
262
223
static void Reset ( bool sex = true )
@@ -270,7 +231,7 @@ static void Reset(bool sex = true)
270
231
if ( sex )
271
232
{
272
233
Sex = new Schemes . Sex { } ;
273
- RenderSex ( ) ;
234
+ Lobby . Service . RenderSex ( Sex . Current ) ;
274
235
}
275
236
276
237
Schemes . Hair TargetHair ;
@@ -285,7 +246,7 @@ static void Reset(bool sex = true)
285
246
Values = TargetHair . Values
286
247
} ;
287
248
288
- RenderBlendData ( ) ;
249
+ Lobby . Service . RenderBlendData ( BlendData . Current ) ;
289
250
290
251
foreach ( var item in FaceFeatures . GetType ( ) . GetFields ( ) )
291
252
{
@@ -302,11 +263,17 @@ static void Reset(bool sex = true)
302
263
{
303
264
var headOverlay = ( Schemes . HeadOverlay ) item . GetValue ( HeadOverlays ) ;
304
265
305
- RenderHeadOverlay ( headOverlay ) ;
266
+
267
+ Lobby . Service . RenderHeadOverlay ( new Shared . Schemes . HeadOverlay
268
+ {
269
+ Index = headOverlay . Index ,
270
+ Value = headOverlay . Values . ElementAt ( headOverlay . Current )
271
+ } ) ;
306
272
}
307
273
308
- RenderHair ( ) ;
309
- RenderColor ( ) ;
274
+ Lobby . Service . RenderHair ( Hair . Values [ Hair . Current ] ) ;
275
+ Lobby . Service . RenderColor ( Color . Values [ Color . Current ] ) ;
276
+ Lobby . Service . RenderEyeColor ( EyeColor . Current ) ;
310
277
}
311
278
}
312
279
}
0 commit comments