From f94aaad6c31d63161ad64c0fc1a641a027308101 Mon Sep 17 00:00:00 2001 From: aixxe Date: Wed, 21 Dec 2016 16:24:35 +0000 Subject: [PATCH] Add ASUS walls via AlphaModulate and ColorModulate. * Again, should really call this somewhere else. Signed-off-by: aixxe --- src/GUI/Components.cpp | 4 ++++ src/GUI/GUI.cpp | 3 +++ src/GUI/GUI.h | 5 +++++ src/Hooks/FrameStageNotify.cpp | 11 +++++++++++ 4 files changed, 23 insertions(+) diff --git a/src/GUI/Components.cpp b/src/GUI/Components.cpp index 5d14611..f7933a8 100644 --- a/src/GUI/Components.cpp +++ b/src/GUI/Components.cpp @@ -17,6 +17,10 @@ void GUI::DrawConfigurationWindow() { ImGui::Checkbox("No sky", &GUI::NoSky::Enabled); ImGui::ColorEdit3("##No sky color", GUI::NoSky::Color); ImGui::Spacing(); + + ImGui::Checkbox("ASUS walls", &GUI::ASUS::Enabled); + ImGui::ColorEdit4("##ASUS walls color", GUI::ASUS::Color, true); + ImGui::Spacing(); ImGui::PopItemWidth(); ImGui::End(); diff --git a/src/GUI/GUI.cpp b/src/GUI/GUI.cpp index 1cf9c13..6e0235a 100644 --- a/src/GUI/GUI.cpp +++ b/src/GUI/GUI.cpp @@ -7,6 +7,9 @@ bool GUI::BunnyHop::Enabled = true; bool GUI::NoSky::Enabled = true; float GUI::NoSky::Color[3] = {0, 0, 0.275}; +bool GUI::ASUS::Enabled = true; +float GUI::ASUS::Color[4] = {1, 1, 1, 0.75}; + void GUI::Render() { // Draw various global components. GUI::DrawFramerateCounter(); diff --git a/src/GUI/GUI.h b/src/GUI/GUI.h index 16d9dc0..73a690f 100644 --- a/src/GUI/GUI.h +++ b/src/GUI/GUI.h @@ -15,6 +15,11 @@ namespace GUI { extern float Color[3]; } + namespace ASUS { + extern bool Enabled; + extern float Color[4]; + } + void DrawFramerateCounter(); void DrawConfigurationWindow(); diff --git a/src/Hooks/FrameStageNotify.cpp b/src/Hooks/FrameStageNotify.cpp index 568304d..832cfbe 100644 --- a/src/Hooks/FrameStageNotify.cpp +++ b/src/Hooks/FrameStageNotify.cpp @@ -21,6 +21,17 @@ void Hooks::FrameStageNotify(IBaseClientDLL* thisptr, ClientFrameStage_t stage) continue; } + + if (!strcmp(material->GetTextureGroupName(), TEXTURE_GROUP_WORLD)) { + // ASUS walls. + if (GUI::ASUS::Enabled) { + material->ColorModulate(GUI::ASUS::Color[0], GUI::ASUS::Color[1], GUI::ASUS::Color[2]); + material->AlphaModulate(GUI::ASUS::Color[3]); + } else { + material->ColorModulate(1, 1, 1); + material->AlphaModulate(1); + } + } } }