From f96031587dc3e41cca61428e530b0c56694d3d23 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 31 Aug 2016 01:23:07 +1000 Subject: [PATCH] Add a 'hidden' option to playermodel info files, hide mega erebus from the menu (fullbright model among dim models is silly, model will remain for forcemodels and servers that use it) --- models/player/megaerebus.iqm_0.txt | 1 + models/player/pyria.iqm_0.skin | 2 +- models/player/pyria_lod1.iqm_0.skin | 2 +- models/player/pyria_lod2.iqm_0.skin | 2 +- models/player/seraphinamasked.iqm_0.skin | 2 +- models/player/seraphinamasked_lod1.iqm_0.skin | 2 +- models/player/seraphinamasked_lod2.iqm_0.skin | 2 +- qcsrc/common/util.qc | 3 +++ qcsrc/common/util.qh | 1 + qcsrc/menu/xonotic/playermodel.qc | 4 ++++ 10 files changed, 15 insertions(+), 6 deletions(-) diff --git a/models/player/megaerebus.iqm_0.txt b/models/player/megaerebus.iqm_0.txt index f75a15fb8..f4b62dea7 100644 --- a/models/player/megaerebus.iqm_0.txt +++ b/models/player/megaerebus.iqm_0.txt @@ -11,3 +11,4 @@ bone_aim2 0.2 upperarm_L bone_aim3 0.35 bip01 r hand bone_weapon bip01 r hand fixbone 1 +hidden 1 diff --git a/models/player/pyria.iqm_0.skin b/models/player/pyria.iqm_0.skin index 1932354e8..7533a4c53 100644 --- a/models/player/pyria.iqm_0.skin +++ b/models/player/pyria.iqm_0.skin @@ -1,2 +1,2 @@ pyria_obj.001,pyriahair -pyria_obj,pyriafullbright +pyria_obj,pyria diff --git a/models/player/pyria_lod1.iqm_0.skin b/models/player/pyria_lod1.iqm_0.skin index 1932354e8..7533a4c53 100644 --- a/models/player/pyria_lod1.iqm_0.skin +++ b/models/player/pyria_lod1.iqm_0.skin @@ -1,2 +1,2 @@ pyria_obj.001,pyriahair -pyria_obj,pyriafullbright +pyria_obj,pyria diff --git a/models/player/pyria_lod2.iqm_0.skin b/models/player/pyria_lod2.iqm_0.skin index 1932354e8..7533a4c53 100644 --- a/models/player/pyria_lod2.iqm_0.skin +++ b/models/player/pyria_lod2.iqm_0.skin @@ -1,2 +1,2 @@ pyria_obj.001,pyriahair -pyria_obj,pyriafullbright +pyria_obj,pyria diff --git a/models/player/seraphinamasked.iqm_0.skin b/models/player/seraphinamasked.iqm_0.skin index 7b94ebe4a..7138ad587 100644 --- a/models/player/seraphinamasked.iqm_0.skin +++ b/models/player/seraphinamasked.iqm_0.skin @@ -1,2 +1,2 @@ -ignis42,ignisfullbright +ignis42,ignis ignis42.002,ignishead diff --git a/models/player/seraphinamasked_lod1.iqm_0.skin b/models/player/seraphinamasked_lod1.iqm_0.skin index 7b94ebe4a..7138ad587 100644 --- a/models/player/seraphinamasked_lod1.iqm_0.skin +++ b/models/player/seraphinamasked_lod1.iqm_0.skin @@ -1,2 +1,2 @@ -ignis42,ignisfullbright +ignis42,ignis ignis42.002,ignishead diff --git a/models/player/seraphinamasked_lod2.iqm_0.skin b/models/player/seraphinamasked_lod2.iqm_0.skin index 7b94ebe4a..7138ad587 100644 --- a/models/player/seraphinamasked_lod2.iqm_0.skin +++ b/models/player/seraphinamasked_lod2.iqm_0.skin @@ -1,2 +1,2 @@ -ignis42,ignisfullbright +ignis42,ignis ignis42.002,ignishead diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 22ee95ae3..962c58070 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -1229,6 +1229,7 @@ float get_model_parameters(string m, float sk) get_model_parameters_bone_aimweight[i] = 0; } get_model_parameters_fixbone = 0; + get_model_parameters_hidden = false; #ifdef GAMEQC MUTATOR_CALLHOOK(ClearModelParams); @@ -1306,6 +1307,8 @@ float get_model_parameters(string m, float sk) } if(c == "fixbone") get_model_parameters_fixbone = stof(s); + if(c == "hidden") + get_model_parameters_hidden = stob(s); } while((s = fgets(fh))) diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index 90e2152d0..57f9a2217 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -181,6 +181,7 @@ float get_model_parameters_species; string get_model_parameters_sex; float get_model_parameters_weight; float get_model_parameters_age; +bool get_model_parameters_hidden; string get_model_parameters_description; string get_model_parameters_bone_upperbody; string get_model_parameters_bone_weapon; diff --git a/qcsrc/menu/xonotic/playermodel.qc b/qcsrc/menu/xonotic/playermodel.qc index 1a90fa737..c679d4449 100644 --- a/qcsrc/menu/xonotic/playermodel.qc +++ b/qcsrc/menu/xonotic/playermodel.qc @@ -38,6 +38,8 @@ void XonoticPlayerModelSelector_loadModels(entity me) fn = search_getfilename(glob, i); if(!get_model_parameters(fn, -1)) continue; + if(get_model_parameters_hidden) + continue; bufstr_add(sortbuf, sprintf("%-128s%s", get_model_parameters_name, fn), 1); } search_end(glob); @@ -49,6 +51,8 @@ void XonoticPlayerModelSelector_loadModels(entity me) fn = substring(bufstr_get(sortbuf, i), 128, -1); if(!get_model_parameters(fn, -1)) error("But it JUST worked!"); + if(get_model_parameters_hidden) + continue; bufstr_set(me.bufModels, BUFMODELS_COUNT*i+BUFMODELS_TITLE, get_model_parameters_name); bufstr_set(me.bufModels, BUFMODELS_COUNT*i+BUFMODELS_IMAGE, strcat("/", substring(get_model_datafilename(get_model_parameters_modelname, get_model_parameters_modelskin, "tga"), 0, -5))); bufstr_set(me.bufModels, BUFMODELS_COUNT*i+BUFMODELS_MODEL, get_model_parameters_modelname); -- 2.39.2