Skip to content

Commit 5767d80

Browse files
committed
finish no smoke and smoke color
1 parent d03ee25 commit 5767d80

File tree

6 files changed

+38
-13
lines changed

6 files changed

+38
-13
lines changed

include/config.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ struct WeaponConfig {
6060
bool visibility_check = true;
6161
bool multibone = true;
6262
bool flash_check = true;
63-
63+
6464
bool rcs = false;
6565

6666
toml::table to_toml() const;
@@ -221,7 +221,7 @@ struct VisualsConfig {
221221
};
222222

223223
struct MiscConfig {
224-
ImVec4 smoke_color;
224+
ImVec4 smoke_color = Colors::BLUE;
225225
f32 max_flash_alpha = 0.0f;
226226
i32 desired_fov = DEFAULT_FOV;
227227

lib/sdl

src/config.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,18 +221,26 @@ VisualsConfig VisualsConfig::from_toml(const toml::table &table) {
221221

222222
toml::table MiscConfig::to_toml() const {
223223
return toml::table {
224+
{"smoke_color", imvec4_to_array(smoke_color)},
224225
{"max_flash_alpha", max_flash_alpha},
225226
{"desired_fov", desired_fov},
226227
{"no_flash", no_flash},
227-
{"fov_changer", fov_changer}};
228+
{"fov_changer", fov_changer},
229+
{"no_smoke", no_smoke},
230+
{"change_smoke_color", change_smoke_color}};
228231
}
229232

230233
MiscConfig MiscConfig::from_toml(const toml::table &table) {
231234
MiscConfig cfg;
235+
if (const auto arr = table["smoke_color"].as_array()) {
236+
cfg.smoke_color = array_to_imvec4(*arr);
237+
}
232238
cfg.max_flash_alpha = table["max_flash_alpha"].value_or(cfg.max_flash_alpha);
233239
cfg.desired_fov = table["desired_fov"].value_or(cfg.desired_fov);
234240
cfg.no_flash = table["no_flash"].value_or(cfg.no_flash);
235241
cfg.fov_changer = table["fov_changer"].value_or(cfg.fov_changer);
242+
cfg.no_smoke = table["no_smoke"].value_or(cfg.no_smoke);
243+
cfg.change_smoke_color = table["change_smoke_color"].value_or(cfg.change_smoke_color);
236244
return cfg;
237245
}
238246

src/cs2/cs2.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,10 @@ std::optional<std::string> GetEntityType(const u64 entity) {
690690

691691
std::string entity_name = process.ReadString(name_pointer);
692692

693+
if (entity_name.compare(0, 5, "smoke") == 0) {
694+
return entity_name;
695+
}
696+
693697
if (entity_name.compare(0, 7, "weapon_") == 0) {
694698
return entity_name.erase(0, 7);
695699
}
@@ -909,11 +913,6 @@ void VisualInfo() {
909913
continue;
910914
}
911915

912-
// is a held weapon
913-
if (EntityHasOwner(*entity)) {
914-
continue;
915-
}
916-
917916
const std::optional<std::string> name = GetEntityType(*entity);
918917
if (!name) {
919918
continue;
@@ -924,6 +923,12 @@ void VisualInfo() {
924923
if (smoke) {
925924
smokes.push_back(*smoke);
926925
}
926+
continue;
927+
}
928+
929+
// is held weapon
930+
if (EntityHasOwner(*entity)) {
931+
continue;
927932
}
928933

929934
const u64 gs_node = process.Read<u64>(*entity + offsets.pawn.game_scene_node);
@@ -965,7 +970,7 @@ void Run() {
965970
NoFlash();
966971
Rcs();
967972
// todo: smokes
968-
// Smokes(smokes);
973+
Smokes(smokes);
969974

970975
Aimbot();
971976
Triggerbot();

src/cs2/smoke.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ void Smoke::Disable() const {
2525

2626
void Smoke::SetColor() const {
2727
if (config.misc.change_smoke_color) {
28-
process.Write(controller + offsets.smoke.smoke_color, config.misc.smoke_color.x);
29-
process.Write(controller + offsets.smoke.smoke_color, config.misc.smoke_color.y);
30-
process.Write(controller + offsets.smoke.smoke_color, config.misc.smoke_color.z);
28+
process.Write(controller + offsets.smoke.smoke_color, config.misc.smoke_color.x * 255.0f);
29+
process.Write(
30+
controller + offsets.smoke.smoke_color + 4, config.misc.smoke_color.y * 255.0f);
31+
process.Write(
32+
controller + offsets.smoke.smoke_color + 8, config.misc.smoke_color.z * 255.0f);
3133
}
3234
}
3335

src/gui.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,18 +649,28 @@ void Gui() {
649649

650650
ImGui::Checkbox("No Flash", &config.misc.no_flash);
651651
if (config.misc.no_flash) {
652+
ImGui::SetNextItemWidth(sizes.drag_width);
652653
ImGui::DragFloat(
653654
"Max Flash Alpha", &config.misc.max_flash_alpha, 0.2f, 0.0f, 255.0f, "%.0f");
654655
}
655656

657+
ImGui::Checkbox("No Smoke", &config.misc.no_smoke);
658+
656659
ImGui::Checkbox("FOV Changer", &config.misc.fov_changer);
657660
if (config.misc.fov_changer) {
661+
ImGui::SetNextItemWidth(sizes.drag_width);
658662
ImGui::DragInt("Desired FOV", &config.misc.desired_fov, 0.2f, 1, 179);
659663
if (ImGui::Button("Reset FOV")) {
660664
config.misc.desired_fov = DEFAULT_FOV;
661665
}
662666
}
663667

668+
ImGui::Checkbox("Smoke Color Override", &config.misc.change_smoke_color);
669+
if (config.misc.change_smoke_color) {
670+
ImGui::ColorEdit3(
671+
"Smoke Color", &config.misc.smoke_color.x, ImGuiColorEditFlags_NoInputs);
672+
}
673+
664674
ImGui::EndChild();
665675
} else if (active_tab == Tab::Misc) {
666676
ImGui::BeginChild(

0 commit comments

Comments
 (0)