summaryrefslogtreecommitdiffstats
path: root/src/gui.cpp
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-04 18:58:13 +0100
committersalmonik <salmonik@tuta.io>2026-11-04 18:58:13 +0100
commit5ddc9eb9d02ddc84e4c3a45bdcb2941513fb0346 (patch)
treec83aa673488b0628e0f63cdc8b82e45c7693be9d /src/gui.cpp
parentChams: apply model-safe styles to the viewmodel (diff)
downloadhl2h-5ddc9eb9d02ddc84e4c3a45bdcb2941513fb0346.tar.gz
hl2h-5ddc9eb9d02ddc84e4c3a45bdcb2941513fb0346.zip
Chams: per-relationship, visible/invisible styles and viewmodel
- Hostile/neutral/friendly each have independent visible and through-wall settings: enable, style and colour. Viewmodel has its own enable/style/colour. - Styles: Flat, Wireframe, Additive, Solid, White, Fullbright, Glow outline. Additive uses the model solid material + ADDITIVE flag (the VGUI additive was invisible on NPCs). White/fullbright are solid-based, so the viewmodel no longer disappears/checkerboards. Glow outline adds a wireframe contour pass for depth. - Config: [chams] active/bind, [chams_hostile|neutral|friendly] vis/inv settings, [chams_vm]. GUI sections for each group.
Diffstat (limited to '')
-rw-r--r--src/gui.cpp39
1 files changed, 29 insertions, 10 deletions
diff --git a/src/gui.cpp b/src/gui.cpp
index 9c09bec..3cbb40a 100644
--- a/src/gui.cpp
+++ b/src/gui.cpp
@@ -446,18 +446,37 @@ static void build_cards() {
446 "Draw the projectile's damage radius on the ground.", &g_proj_radius); 446 "Draw the projectile's damage radius on the ground.", &g_proj_radius);
447 447
448 int chams = add_card(2, &g_chams, "Chams", 448 int chams = add_card(2, &g_chams, "Chams",
449 "Flat-colour NPC models.", true); 449 "Per-relationship model colours.", true);
450 add_toggle(chams, "Through walls", 450 static const char *const chams_mat_names[] = {
451 "Draw a second pass with the depth test disabled.", 451 "Flat", "Wireframe", "Additive glow", "Solid", "White", "Fullbright",
452 &g_chams_walls); 452 "Glow outline"};
453 auto add_chams_group = [&](const char *title, ChamsGroup &g) {
454 add_section(chams, title);
455 add_toggle(chams, "Visible", "Draw the normal-depth pass.",
456 &g.vis_on);
457 add_dropdown(chams, "Visible material", "Material for the visible pass.",
458 chams_mat_names, 7, &g.vis_mat);
459 add_color(chams, "Visible colour", "Colour for the visible pass.",
460 g.vis_rgb);
461 add_toggle(chams, "Through walls", "Draw a pass with the depth test off.",
462 &g.inv_on);
463 add_dropdown(chams, "Invisible material",
464 "Material for the through-wall pass.", chams_mat_names, 7,
465 &g.inv_mat);
466 add_color(chams, "Invisible colour",
467 "Colour for the through-wall pass.", g.inv_rgb);
468 };
469 add_chams_group("Hostile", g_chams_hostile);
470 add_chams_group("Neutral", g_chams_neutral);
471 add_chams_group("Friendly", g_chams_friendly);
472 add_section(chams, "Viewmodel");
453 add_toggle(chams, "Viewmodel (hands/weapon)", 473 add_toggle(chams, "Viewmodel (hands/weapon)",
454 "Apply chams to the first-person hands and weapon too.", 474 "Apply chams to the first-person hands and weapon.",
455 &g_chams_viewmodel); 475 &g_chams_viewmodel);
456 static const char *const chams_mat_names[] = { 476 add_dropdown(chams, "Viewmodel material", "Material for the viewmodel.",
457 "Flat", "Wireframe", "Additive glow", "Solid", "White", "Fullbright"}; 477 chams_mat_names, 7, &g_chams_vm_mat);
458 add_dropdown(chams, "Material", "Chams material.", chams_mat_names, 6, 478 add_color(chams, "Viewmodel colour", "Colour for the viewmodel.",
459 &g_chams_mat_index); 479 g_chams_vm_rgb);
460 add_color(chams, "Colour", "Chams colour.", g_chams_rgb);
461 int view = add_card(2, nullptr, "Camera / display", 480 int view = add_card(2, nullptr, "Camera / display",
462 "Camera FOV, viewmodel FOV and HDR brightness.", true); 481 "Camera FOV, viewmodel FOV and HDR brightness.", true);
463 add_slider(view, "Camera FOV", 482 add_slider(view, "Camera FOV",