From b3003583a1a66f5ae2eae63763f285635b43d58f Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 18:08:07 +0100 Subject: Chams: material styles and viewmodel support - Material selector 0..4: debugwhite, debug wireframe (ignorez), vgui white_additive, debugtranslucentsinglecolor, vgui/white; cached per index with a debugwhite fallback. - Add "Viewmodel (hands/weapon)" toggle; viewmodel entities (class contains viewmodel or model path /v_...) get a normal-depth chams pass. - [chams] gains viewmodel= and material=. --- src/menu.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src/menu.cpp') diff --git a/src/menu.cpp b/src/menu.cpp index 77eb35f..4f22d39 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -65,6 +65,8 @@ bool g_proj_fuse = true; bool g_proj_radius = true; FeatureState g_chams{false, 0}; // flat model material, optional through walls bool g_chams_walls = true; +bool g_chams_viewmodel = false; +int g_chams_mat_index = 0; int g_chams_rgb[3] = {255, 60, 60}; bool g_item_health = true; bool g_item_ammo = true; @@ -237,8 +239,10 @@ void config_save() { fprintf(f, "[projectiles]\nactive=%d\nbind=%d\nfuse=%d\nradius=%d\n", g_projectiles.active, g_projectiles.bind, (int)g_proj_fuse, (int)g_proj_radius); - fprintf(f, "[chams]\nactive=%d\nbind=%d\nwalls=%d\nr=%d\ng=%d\nb=%d\n", - g_chams.active, g_chams.bind, (int)g_chams_walls, g_chams_rgb[0], + fprintf(f, "[chams]\nactive=%d\nbind=%d\nwalls=%d\nviewmodel=%d\n" + "material=%d\nr=%d\ng=%d\nb=%d\n", + g_chams.active, g_chams.bind, (int)g_chams_walls, + (int)g_chams_viewmodel, g_chams_mat_index, g_chams_rgb[0], g_chams_rgb[1], g_chams_rgb[2]); fprintf(f, "[items]\nactive=%d\nbind=%d\nhealth=%d\nammo=%d\n" "armor=%d\nweapons=%d\ncrates=%d\ndistance=%d\nmax_dist=%d\n" @@ -393,8 +397,15 @@ static bool config_load() { if (in_chams) { if (strcmp(key, "walls") == 0) g_chams_walls = atoi(val) != 0; - else if (strcmp(key, "r") == 0 || strcmp(key, "g") == 0 || - strcmp(key, "b") == 0) { + else if (strcmp(key, "viewmodel") == 0) + g_chams_viewmodel = atoi(val) != 0; + else if (strcmp(key, "material") == 0) { + int v = atoi(val); + if (v < 0) v = 0; + if (v > 4) v = 4; + g_chams_mat_index = v; + } else if (strcmp(key, "r") == 0 || strcmp(key, "g") == 0 || + strcmp(key, "b") == 0) { int v = atoi(val); if (v < 0) v = 0; if (v > 255) v = 255; @@ -627,6 +638,8 @@ void config_reset_defaults() { g_proj_radius = true; g_chams = {false, 0}; g_chams_walls = true; + g_chams_viewmodel = false; + g_chams_mat_index = 0; g_chams_rgb[0] = 255; g_chams_rgb[1] = 60; g_chams_rgb[2] = 60; -- cgit v1.2.3