diff --git a/config_data/startup_sounds.txt b/config_data/startup_sounds.txt new file mode 100644 index 00000000..38b47670 --- /dev/null +++ b/config_data/startup_sounds.txt @@ -0,0 +1,9 @@ +vo/heavy_mvm_get_upgrade03.mp3 +vo/items/wheatley_sapper/wheatley_sapper_attached14.mp3 +vo/sniper_laughevil02.mp3 +vo/compmode/cm_engie_pregamefirst_rare_06.mp3 +vo/compmode/cm_engie_pregamelostlast_07.mp3 +vo/soldier_mvm_loot_godlike03.mp3 +vo/soldier_robot15.mp3 +vo/soldier_mvm_get_upgrade01.mp3 +vo/medic_mvm_loot_godlike02.mp3 diff --git a/src/visual/drawing.cpp b/src/visual/drawing.cpp index c1de6982..b12e3c20 100644 --- a/src/visual/drawing.cpp +++ b/src/visual/drawing.cpp @@ -165,30 +165,36 @@ std::unique_ptr esp{ nullptr }; std::unique_ptr center_screen{ nullptr }; } // namespace fonts -static InitRoutine font_size([]() { - esp_font_size.installChangeCallback([](settings::VariableBase &var, int after) { - if (after > 0 && after < 100) - { +static InitRoutine font_size( + []() + { + esp_font_size.installChangeCallback( + [](settings::VariableBase &var, int after) + { + if (after > 0 && after < 100) + { #if ENABLE_GLEZ_DRAWING - fonts::esp->unload(); - fonts::esp.reset(new fonts::font(paths::getDataPath("/menu/Verdana.ttf"), after)); + fonts::esp->unload(); + fonts::esp.reset(new fonts::font(paths::getDataPath("/menu/Verdana.ttf"), after)); #else - fonts::esp->changeSize(after); + fonts::esp->changeSize(after); #endif - } - }); - center_font_size.installChangeCallback([](settings::VariableBase &var, int after) { - if (after > 0 && after < 100) - { + } + }); + center_font_size.installChangeCallback( + [](settings::VariableBase &var, int after) + { + if (after > 0 && after < 100) + { #if ENABLE_GLEZ_DRAWING - fonts::center_screen->unload(); - fonts::center_screen.reset(new fonts::font(paths::getDataPath("/menu/Verdana.ttf"), after)); + fonts::center_screen->unload(); + fonts::center_screen.reset(new fonts::font(paths::getDataPath("/menu/Verdana.ttf"), after)); #else - fonts::center_screen->changeSize(after); + fonts::center_screen->changeSize(after); #endif - } + } + }); }); -}); namespace draw { @@ -421,7 +427,8 @@ void RectangleTextured(float x, float y, float w, float h, rgba_t color, Texture float cx = x + float(w) / 2.0f; float cy = y + float(h) / 2.0f; - auto f = [&](Vector2D &v) { + auto f = [&](Vector2D &v) + { v.x = cx + cosf(angle) * (v.x - cx) - sinf(angle) * (v.y - cy); v.y = cy + sinf(angle) * (v.x - cx) + cosf(angle) * (v.y - cy); }; @@ -475,10 +482,10 @@ VMatrix wts{}; void UpdateWTS() { - CViewSetup gay; + CViewSetup view; VMatrix _, __, ___; - g_IBaseClient->GetPlayerView(gay); - g_IVRenderView->GetMatricesForView(gay, &_, &__, &wts, &___); + g_IBaseClient->GetPlayerView(view); + g_IVRenderView->GetMatricesForView(view, &_, &__, &wts, &___); } bool WorldToScreen(const Vector &origin, Vector &screen) @@ -493,6 +500,23 @@ bool WorldToScreen(const Vector &origin, Vector &screen) return true; return false; } + +void StartupSound() +{ + // 100% based unique meowhook only feature do not steal + std::string cur_line; + std::vector line_count; + std::ifstream sfile(paths::getDataPath("/startup_sounds.txt")); + int total_lines = 0; + while (getline(sfile, cur_line)) + { + total_lines++; + line_count.push_back(cur_line); + } + int random_number = rand() % total_lines; + g_ISurface->PlaySound(line_count[random_number].c_str()); +} + #if ENABLE_ENGINE_DRAWING bool Texture::load() { @@ -583,6 +607,7 @@ void InitGL() #if ENABLE_GUI gui::init(); + StartupSound(); #endif }