MCPcopy Create free account
hub / github.com/JACoders/OpenJK / UI_UpdateCharacter

Function UI_UpdateCharacter

code/ui/ui_main.cpp:6270–6304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6268}
6269
6270static void UI_UpdateCharacter( qboolean changedModel )
6271{
6272 menuDef_t *menu;
6273 itemDef_t *item;
6274 char modelPath[MAX_QPATH];
6275
6276 menu = Menu_GetFocused(); // Get current menu
6277
6278 if (!menu)
6279 {
6280 return;
6281 }
6282
6283 item = (itemDef_s *) Menu_FindItemByName(menu, "character");
6284
6285 if (!item)
6286 {
6287 Com_Error( ERR_FATAL, "UI_UpdateCharacter: Could not find item (character) in menu (%s)", menu->window.name);
6288 }
6289
6290 ItemParse_model_g2anim_go( item, ui_char_anim.string );
6291
6292 Com_sprintf( modelPath, sizeof( modelPath ), "models/players/%s/model.glm", Cvar_VariableString ( "ui_char_model" ) );
6293 ItemParse_asset_model_go( item, modelPath );
6294
6295 if ( changedModel )
6296 {//set all skins to first skin since we don't know you always have all skins
6297 //FIXME: could try to keep the same spot in each list as you swtich models
6298 UI_FeederSelection(FEEDER_PLAYER_SKIN_HEAD, 0, item); //fixme, this is not really the right item!!
6299 UI_FeederSelection(FEEDER_PLAYER_SKIN_TORSO, 0, item);
6300 UI_FeederSelection(FEEDER_PLAYER_SKIN_LEGS, 0, item);
6301 UI_FeederSelection(FEEDER_COLORCHOICES, 0, item);
6302 }
6303 UI_UpdateCharacterSkin();
6304}
6305
6306void UI_UpdateSaberType( void )
6307{

Callers 1

UI_RunMenuScriptFunction · 0.70

Calls 9

Menu_GetFocusedFunction · 0.70
Menu_FindItemByNameFunction · 0.70
ItemParse_asset_model_goFunction · 0.70
UI_FeederSelectionFunction · 0.70
UI_UpdateCharacterSkinFunction · 0.70
Com_ErrorFunction · 0.50
Com_sprintfFunction · 0.50
Cvar_VariableStringFunction · 0.50

Tested by

no test coverage detected