From: ColdSpirit Date: Sat, 25 Dec 2021 14:35:12 +0000 (+0400) Subject: Change indentation from spaces to tabs X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4aa29e204495aa03aa90a82956acc7712c19b837;p=xonotic%2Fxonotic-data.pk3dir.git Change indentation from spaces to tabs --- diff --git a/qcsrc/menu/xonotic/colorpicker.qc b/qcsrc/menu/xonotic/colorpicker.qc index f01ab6fcc..583a4cb25 100644 --- a/qcsrc/menu/xonotic/colorpicker.qc +++ b/qcsrc/menu/xonotic/colorpicker.qc @@ -20,10 +20,10 @@ METHOD(XonoticColorpicker, mousePress, bool(XonoticColorpicker this, vector pos) { this.mouseDrag(this, pos); - if(this.controlledTextbox.applyButton) - { - this.controlledTextbox.applyButton.disabled = false; - } + if(this.controlledTextbox.applyButton) + { + this.controlledTextbox.applyButton.disabled = false; + } return true; } @@ -31,16 +31,16 @@ METHOD(XonoticColorpicker, mousePress, bool(XonoticColorpicker this, vector pos) // must match hslimage.c vector hslimage_color(vector v, vector margin) { - v_x = (v.x - margin.x) / (1 - 2 * margin.x); - v_y = (v.y - margin.y) / (1 - 2 * margin.y); - if(v.x < 0) v_x = 0; - if(v.y < 0) v_y = 0; - if(v.x > 1) v_x = 1; - if(v.y > 1) v_y = 1; - if(v.y > 0.875) // grey bar - return hsl_to_rgb(eZ * v.x); - else - return hsl_to_rgb(v.x * 6 * eX + eY + v.y / 0.875 * eZ); + v_x = (v.x - margin.x) / (1 - 2 * margin.x); + v_y = (v.y - margin.y) / (1 - 2 * margin.y); + if(v.x < 0) v_x = 0; + if(v.y < 0) v_y = 0; + if(v.x > 1) v_x = 1; + if(v.y > 1) v_y = 1; + if(v.y > 0.875) // grey bar + return hsl_to_rgb(eZ * v.x); + else + return hsl_to_rgb(v.x * 6 * eX + eY + v.y / 0.875 * eZ); } vector color_hslimage(vector v, vector margin) diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_profile.qc b/qcsrc/menu/xonotic/dialog_multiplayer_profile.qc index b5c94c1ed..330514f82 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_profile.qc +++ b/qcsrc/menu/xonotic/dialog_multiplayer_profile.qc @@ -18,75 +18,75 @@ entity makeXonoticProfileTab() me = NEW(XonoticProfileTab); me.configureDialog(me); - // profile menu specific cvars - string name = cvar_string("_cl_name"); - registercvar("_menu_profile_name", name, 0); + // profile menu specific cvars + string name = cvar_string("_cl_name"); + registercvar("_menu_profile_name", name, 0); - string color = cvar_string("_cl_color"); - // if color unset, set random color + string color = cvar_string("_cl_color"); + // if color unset, set random color if(color == cvar_defstring("_cl_color")) - { - // idk what meaning of 16, maybe just COLOR_BUTTONS_COUNT+1 - float randomColor = 16 * floor(random() * COLOR_BUTTONS_COUNT) + floor(random() * COLOR_BUTTONS_COUNT); + { + // idk what meaning of 16, maybe just COLOR_BUTTONS_COUNT+1 + float randomColor = 16 * floor(random() * COLOR_BUTTONS_COUNT) + floor(random() * COLOR_BUTTONS_COUNT); cvar_set("_cl_color", ftos(randomColor)); - } - registercvar("_menu_profile_color", color, 0); + } + registercvar("_menu_profile_color", color, 0); - string skin = cvar_string("_cl_playerskin"); - registercvar("_menu_profile_skin", skin, 0); + string skin = cvar_string("_cl_playerskin"); + registercvar("_menu_profile_skin", skin, 0); - string model = cvar_string("_cl_playermodel"); - registercvar("_menu_profile_model", model, 0); + string model = cvar_string("_cl_playermodel"); + registercvar("_menu_profile_model", model, 0); return me; } void XonoticProfileTab_draw(entity me) { - string name = cvar_string("_cl_name"); + string name = cvar_string("_cl_name"); if(name == "Player") me.playerNameLabel.alpha = ((mod(time * 2, 2) < 1) ? 1 : 0); else me.playerNameLabel.alpha = me.playerNameLabelAlpha; - - // if values changed from console, update it in menu - if (me.applyButton.disabled) - { - // name field - string inputName = cvar_string("_menu_profile_name"); - if (name != inputName) - { - cvar_set("_menu_profile_name", name); - me.nameInput.loadCvars(me.nameInput); - } - - // color buttons - string color = cvar_string("_cl_color"); - string inputColor = cvar_string("_menu_profile_color"); - if (color != inputColor) - { - cvar_set("_menu_profile_color", color); - for (int i = 0; i < COLOR_BUTTONS_COUNT; i++) - { - me.colorButtonGroup1[i].loadCvars(me.colorButtonGroup1[i]); - me.colorButtonGroup2[i].loadCvars(me.colorButtonGroup2[i]); - } - } - - // player model - string skin = cvar_string("_cl_playerskin"); - string skinInput = cvar_string("_menu_profile_skin"); - string model = cvar_string("_cl_playermodel"); - string modelInput = cvar_string("_menu_profile_model"); - if (skin != skinInput || model != modelInput) - { - cvar_set("_menu_profile_skin", skin); - cvar_set("_menu_profile_model", model); - me.playerModelSelector.loadCvars(me.playerModelSelector); - me.playerModelSelector.go(me.playerModelSelector, 0); - } - } + + // if values changed from console, update it in menu + if (me.applyButton.disabled) + { + // name field + string inputName = cvar_string("_menu_profile_name"); + if (name != inputName) + { + cvar_set("_menu_profile_name", name); + me.nameInput.loadCvars(me.nameInput); + } + + // color buttons + string color = cvar_string("_cl_color"); + string inputColor = cvar_string("_menu_profile_color"); + if (color != inputColor) + { + cvar_set("_menu_profile_color", color); + for (int i = 0; i < COLOR_BUTTONS_COUNT; i++) + { + me.colorButtonGroup1[i].loadCvars(me.colorButtonGroup1[i]); + me.colorButtonGroup2[i].loadCvars(me.colorButtonGroup2[i]); + } + } + + // player model + string skin = cvar_string("_cl_playerskin"); + string skinInput = cvar_string("_menu_profile_skin"); + string model = cvar_string("_cl_playermodel"); + string modelInput = cvar_string("_menu_profile_model"); + if (skin != skinInput || model != modelInput) + { + cvar_set("_menu_profile_skin", skin); + cvar_set("_menu_profile_model", model); + me.playerModelSelector.loadCvars(me.playerModelSelector); + me.playerModelSelector.go(me.playerModelSelector, 0); + } + } SUPER(XonoticProfileTab).draw(me); } @@ -99,7 +99,7 @@ void XonoticProfileTab_fill(entity me) entity e, label; float i; me.applyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0', - "_cl_color \"$_menu_profile_color\"" + "_cl_color \"$_menu_profile_color\"" "color -1 -1;" // apply colors contained in _cl_color "name \"$_menu_profile_name\";" "playermodel $_menu_profile_model;" diff --git a/qcsrc/menu/xonotic/playermodel.qc b/qcsrc/menu/xonotic/playermodel.qc index a40e2aa9d..d53369b44 100644 --- a/qcsrc/menu/xonotic/playermodel.qc +++ b/qcsrc/menu/xonotic/playermodel.qc @@ -19,8 +19,8 @@ const float BUFMODELS_COUNT = 5; void XonoticPlayerModelSelector_configureXonoticPlayerModelSelector(entity me, string theSkinCvar, string theModelCvar) { - me.skinCvar = theSkinCvar; - me.modelCvar = theModelCvar; + me.skinCvar = theSkinCvar; + me.modelCvar = theModelCvar; me.configureXonoticImage(me, string_null, -1); } @@ -103,8 +103,8 @@ void XonoticPlayerModelSelector_loadCvars(entity me) for(i = 0; i < me.numModels; ++i) { if(bufstr_get(me.bufModels, BUFMODELS_COUNT*i+BUFMODELS_MODEL) == modelname) - if(bufstr_get(me.bufModels, BUFMODELS_COUNT*i+BUFMODELS_SKIN) == skin) - break; + if(bufstr_get(me.bufModels, BUFMODELS_COUNT*i+BUFMODELS_SKIN) == skin) + break; } if(i >= me.numModels) // fail i = 0;