MCPcopy Create free account
hub / github.com/demoth/jake2 / PlayerConfig_MenuInit

Method PlayerConfig_MenuInit

client/src/main/java/jake2/client/Menu.java:3752–3924  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3750 private static String handedness[] = { "right", "left", "center" };
3751
3752 private static boolean PlayerConfig_MenuInit() {
3753 /*
3754 * extern cvar_t * name; extern cvar_t * team; extern cvar_t * skin;
3755 */
3756 //har currentdirectory[1024];
3757 String currentdirectory;
3758 //char currentskin[1024];
3759 String currentskin;
3760
3761 int i = 0;
3762
3763 int currentdirectoryindex = 0;
3764 int currentskinindex = 0;
3765
3766 cvar_t hand = Cvar.getInstance().Get("hand", "0", CVAR_USERINFO | CVAR_ARCHIVE);
3767
3768 PlayerConfig_ScanDirectories();
3769
3770 if (s_numplayermodels == 0)
3771 return false;
3772
3773 if (hand.value < 0 || hand.value > 2)
3774 Cvar.getInstance().SetValue("hand", 0);
3775
3776 currentdirectory = ClientGlobals.skin.string;
3777
3778 if (currentdirectory.lastIndexOf('/') != -1) {
3779 currentskin = Lib.rightFrom(currentdirectory, '/');
3780 currentdirectory = Lib.leftFrom(currentdirectory, '/');
3781 } else if (currentdirectory.lastIndexOf('\\') != -1) {
3782 currentskin = Lib.rightFrom(currentdirectory, '\\');
3783 currentdirectory = Lib.leftFrom(currentdirectory, '\\');
3784 } else {
3785 currentdirectory = "male";
3786 currentskin = "grunt";
3787 }
3788
3789 //qsort(s_pmi, s_numplayermodels, sizeof(s_pmi[0]), pmicmpfnc);
3790 Arrays.sort(s_pmi, 0, s_numplayermodels, (Comparator) Menu::pmicmpfnc);
3791
3792 //memset(s_pmnames, 0, sizeof(s_pmnames));
3793 s_pmnames = new String[MAX_PLAYERMODELS];
3794
3795 for (i = 0; i < s_numplayermodels; i++) {
3796 s_pmnames[i] = s_pmi[i].displayname;
3797 if (Lib.Q_stricmp(s_pmi[i].directory, currentdirectory) == 0) {
3798 int j;
3799
3800 currentdirectoryindex = i;
3801
3802 for (j = 0; j < s_pmi[i].nskins; j++) {
3803 if (Lib
3804 .Q_stricmp(s_pmi[i].skindisplaynames[j],
3805 currentskin) == 0) {
3806 currentskinindex = j;
3807 break;
3808 }
3809 }

Callers 1

Menu_PlayerConfig_fMethod · 0.95

Calls 11

getInstanceMethod · 0.95
rightFromMethod · 0.95
leftFromMethod · 0.95
Q_stricmpMethod · 0.95
Menu_AddItemMethod · 0.95
GetMethod · 0.80
SetValueMethod · 0.80
getWidthMethod · 0.80
getHeightMethod · 0.80
VariableValueMethod · 0.80

Tested by

no test coverage detected