Remove joke features (#1405)
This commit is contained in:
parent
b4678bd210
commit
f25a532e96
@ -9,8 +9,6 @@
|
|||||||
<AutoVariable width="fill" target="misc.engine-prediction" label="Engine prediction"/>
|
<AutoVariable width="fill" target="misc.engine-prediction" label="Engine prediction"/>
|
||||||
<AutoVariable width="fill" target="misc.flashlight-spam" label="Flashlight spam" tooltip="Used in Half Life Death Match."/>
|
<AutoVariable width="fill" target="misc.flashlight-spam" label="Flashlight spam" tooltip="Used in Half Life Death Match."/>
|
||||||
<AutoVariable width="fill" target="misc.force-halloween" label="Force halloween"/>
|
<AutoVariable width="fill" target="misc.force-halloween" label="Force halloween"/>
|
||||||
<AutoVariable width="fill" target="misc.god-mode" label="xd"/>
|
|
||||||
<AutoVariable width="fill" target="misc.no-homo" label="#nohomo"/>
|
|
||||||
<AutoVariable width="fill" target="misc.no-lerp" label="Nolerp"/>
|
<AutoVariable width="fill" target="misc.no-lerp" label="Nolerp"/>
|
||||||
<AutoVariable width="fill" target="misc.full-auto" label="Fully automated firing"/>
|
<AutoVariable width="fill" target="misc.full-auto" label="Fully automated firing"/>
|
||||||
<AutoVariable width="fill" target="misc.show-spectators" label="Show spectators"/>
|
<AutoVariable width="fill" target="misc.show-spectators" label="Show spectators"/>
|
||||||
|
@ -21,4 +21,3 @@ constexpr int c_strcmp(char const *lhs, char const *rhs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//#define FEATURE_RADAR_DISABLED
|
//#define FEATURE_RADAR_DISABLED
|
||||||
#define FEATURE_FIDGET_SPINNER_DISABLED
|
|
||||||
|
@ -41,9 +41,7 @@ static settings::Boolean force_wait{ "misc.force-enable-wait", "true" };
|
|||||||
static settings::Boolean scc{ "misc.scoreboard.match-custom-team-colors", "false" };
|
static settings::Boolean scc{ "misc.scoreboard.match-custom-team-colors", "false" };
|
||||||
|
|
||||||
#if ENABLE_VISUALS
|
#if ENABLE_VISUALS
|
||||||
static settings::Boolean god_mode{ "misc.god-mode", "false" };
|
|
||||||
static settings::Boolean debug_info{ "misc.debug-info", "false" };
|
static settings::Boolean debug_info{ "misc.debug-info", "false" };
|
||||||
static settings::Boolean no_homo{ "misc.no-homo", "true" };
|
|
||||||
static settings::Boolean show_spectators{ "misc.show-spectators", "false" };
|
static settings::Boolean show_spectators{ "misc.show-spectators", "false" };
|
||||||
static settings::Boolean misc_drawhitboxes{ "misc.draw-hitboxes", "false" };
|
static settings::Boolean misc_drawhitboxes{ "misc.draw-hitboxes", "false" };
|
||||||
// Useful for debugging with showlagcompensation
|
// Useful for debugging with showlagcompensation
|
||||||
@ -347,35 +345,6 @@ void Draw()
|
|||||||
{
|
{
|
||||||
g_ISurface->PlaySound()
|
g_ISurface->PlaySound()
|
||||||
}*/
|
}*/
|
||||||
if (god_mode)
|
|
||||||
for (int i = 0; i < 40000; i++)
|
|
||||||
{
|
|
||||||
g_ISurface->PlaySound("vo/demoman_cloakedspy03.mp3");
|
|
||||||
god_mode = 0;
|
|
||||||
}
|
|
||||||
if (!no_homo)
|
|
||||||
{
|
|
||||||
int width, height;
|
|
||||||
g_IEngine->GetScreenSize(width, height);
|
|
||||||
|
|
||||||
// Create steps from screen size
|
|
||||||
int step = (height / 7);
|
|
||||||
|
|
||||||
// Go through steps creating a rainbow screen
|
|
||||||
for (int i = 1; i < 8; i++)
|
|
||||||
{
|
|
||||||
// Get Color and set opacity to %50
|
|
||||||
colors::rgba_t gaybow = colors::FromHSL(fabs(sin((g_GlobalVars->curtime / 2.0f) + (i / 1.41241f))) * 360.0f, 0.85f, 0.9f);
|
|
||||||
gaybow.a = .5;
|
|
||||||
// Draw next step
|
|
||||||
draw::Rectangle(0, step * (i - 1), width, (step * i) - (step * (i - 1)), gaybow);
|
|
||||||
}
|
|
||||||
|
|
||||||
// int size_x;
|
|
||||||
// FTGL_StringLength(string.data, fonts::font_main, &size_x);
|
|
||||||
// FTGL_Draw(string.data, draw_point.x - size_x / 2,
|
|
||||||
// draw_point.y,fonts::font_main, color);
|
|
||||||
}
|
|
||||||
if (show_spectators)
|
if (show_spectators)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < PLAYER_ARRAY_SIZE; i++)
|
for (int i = 0; i < PLAYER_ARRAY_SIZE; i++)
|
||||||
|
@ -4,7 +4,6 @@ set(files "${CMAKE_CURRENT_LIST_DIR}/atlas.cpp"
|
|||||||
"${CMAKE_CURRENT_LIST_DIR}/drawmgr.cpp"
|
"${CMAKE_CURRENT_LIST_DIR}/drawmgr.cpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/EffectGlow.cpp"
|
"${CMAKE_CURRENT_LIST_DIR}/EffectGlow.cpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/EventLogging.cpp"
|
"${CMAKE_CURRENT_LIST_DIR}/EventLogging.cpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/fidgetspinner.cpp"
|
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/picopng.cpp"
|
"${CMAKE_CURRENT_LIST_DIR}/picopng.cpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/SDLHooks.cpp")
|
"${CMAKE_CURRENT_LIST_DIR}/SDLHooks.cpp")
|
||||||
|
|
||||||
|
@ -1,94 +0,0 @@
|
|||||||
/*
|
|
||||||
* fidgetspinner.cpp
|
|
||||||
*
|
|
||||||
* Created on: Jul 4, 2017
|
|
||||||
* Author: nullifiedcat
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "common.hpp"
|
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
#include <settings/Bool.hpp>
|
|
||||||
|
|
||||||
#ifndef FEATURE_FIDGET_SPINNER_ENABLED
|
|
||||||
|
|
||||||
static settings::Boolean enable_spinner{ "visual.fidget-spinner.enable", "false" };
|
|
||||||
static settings::Float spinner_speed_cap{ "visual.fidget-spinner.speed-cap", "30" };
|
|
||||||
static settings::Float spinner_speed_scale{ "visual.fidget-spinner.speed-scale", "0.03" };
|
|
||||||
static settings::Float spinner_decay_speed{ "visual.fidget-spinner.decay-speed", "0.1" };
|
|
||||||
static settings::Float spinner_scale{ "visual.fidget-spinner.scale", "32" };
|
|
||||||
static settings::Float spinner_min_speed{ "visual.fidget-spinner.min-speed", "2" };
|
|
||||||
|
|
||||||
static float spinning_speed = 0.0f;
|
|
||||||
static float angle = 0;
|
|
||||||
|
|
||||||
// DEBUG
|
|
||||||
/*CatCommand add_spinner_speed("fidgetspinner_debug_speedup", "Add speed", []()
|
|
||||||
{ spinning_speed += 100.0f;
|
|
||||||
});*/
|
|
||||||
|
|
||||||
class SpinnerListener : public IGameEventListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void FireGameEvent(KeyValues *event) override
|
|
||||||
{
|
|
||||||
std::string name(event->GetName());
|
|
||||||
if (name == "player_death")
|
|
||||||
{
|
|
||||||
int attacker = event->GetInt("attacker");
|
|
||||||
int eid = g_IEngine->GetPlayerForUserID(attacker);
|
|
||||||
if (eid == g_IEngine->GetLocalPlayer())
|
|
||||||
{
|
|
||||||
spinning_speed += 300.0f;
|
|
||||||
// logging::Info("Spinning %.2f", spinning_speed);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static SpinnerListener spinner_listener;
|
|
||||||
|
|
||||||
void InitSpinner()
|
|
||||||
{
|
|
||||||
g_IGameEventManager->AddListener(&spinner_listener, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
static Timer retrytimer{};
|
|
||||||
|
|
||||||
void DrawSpinner()
|
|
||||||
{
|
|
||||||
if (not enable_spinner)
|
|
||||||
return;
|
|
||||||
spinning_speed -= (spinning_speed > 150.0f) ? float(spinner_decay_speed) : float(spinner_decay_speed) / 2.0f;
|
|
||||||
if (spinning_speed < float(spinner_min_speed))
|
|
||||||
spinning_speed = float(spinner_min_speed);
|
|
||||||
if (spinning_speed > 1000)
|
|
||||||
spinning_speed = 1000;
|
|
||||||
float real_speed = 0;
|
|
||||||
const float speed_cap(spinner_speed_cap);
|
|
||||||
if (spinning_speed < 250)
|
|
||||||
real_speed = speed_cap * (spinning_speed / 250.0f);
|
|
||||||
else if (spinning_speed < 500)
|
|
||||||
real_speed = speed_cap - (speed_cap - 10) * ((spinning_speed - 250.0f) / 250.0f);
|
|
||||||
else if (spinning_speed < 750)
|
|
||||||
real_speed = 10 + (speed_cap - 20) * ((spinning_speed - 500.0f) / 250.0f);
|
|
||||||
else
|
|
||||||
real_speed = (speed_cap - 10) + 10 * ((spinning_speed - 750.0f) / 250.0f);
|
|
||||||
const float speed_scale(spinner_speed_scale);
|
|
||||||
const float size(spinner_scale);
|
|
||||||
angle += speed_scale * real_speed;
|
|
||||||
int state = min(3, int(spinning_speed / 250));
|
|
||||||
|
|
||||||
draw::RectangleTextured(draw::width / 2 - size * 0.5f, draw::height / 2 - size * 0.5f, size, size, colors::white, textures::atlas().texture, 64 * state, 4 * 64, 64, 64, angle);
|
|
||||||
if (angle > PI * 4)
|
|
||||||
angle -= PI * 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
static InitRoutine init([]() {
|
|
||||||
InitSpinner();
|
|
||||||
EC::Register(EC::Draw, DrawSpinner, "spinner");
|
|
||||||
EC::Register(
|
|
||||||
EC::Shutdown, []() { g_IGameEventManager->RemoveListener(&spinner_listener); }, "shutdown_spinner");
|
|
||||||
});
|
|
||||||
|
|
||||||
#endif
|
|
Reference in New Issue
Block a user