Skip to content

Commit

Permalink
tidy: visuals
Browse files Browse the repository at this point in the history
  • Loading branch information
stowmyy committed Aug 29, 2024
1 parent 642791f commit d62a633
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
2 changes: 2 additions & 0 deletions dropship/src/AppManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ void AppManager::RenderInline()
//this->downloadState.status = "NEWEST VERSION";
//this->downloadState.status = __default__appStore.dashboard.community;

this->downloadState.appVersion = _this_hash.substr(0, 9);

}

// std::filesystem::hash_value();
Expand Down
28 changes: 15 additions & 13 deletions dropship/src/DashboardManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,32 +369,34 @@ void DashboardManager::RenderInline()
this->loadAssets();

{

// move the numbers around slightly in between pings >:p
// tricky tricky
if (this->pinging && (ImGui::GetFrameCount() % 200) == 0)
{
static const int max = 1;
static const int min = -2;
static const int range = max - min + 1;

for (auto& endpoint : endpoints)
if (!((endpoint.display_ping != endpoint.ping) || endpoint.ping < 0))
endpoint.display_ping = std::max(0, endpoint.display_ping + (rand() % range + min));
}
//if (this->pinging && (ImGui::GetFrameCount() % 900) == 0)
//{
// static const int max = 1;
// static const int min = -2;
// static const int range = max - min + 1;

// for (auto& endpoint : endpoints)
// if (rand() % 2 > 0)
// //if (!((endpoint.display_ping != endpoint.ping) || endpoint.ping < 0))
// endpoint.display_ping = std::max(0, endpoint.display_ping + (rand() % range + min));
//}

for (auto& endpoint : endpoints)
if (endpoint.display_ping != endpoint.ping)
{
static const float min_delay = 1.0f;
static const float max_delay = 15.0f;
static const float min_delay = 9.0f;
static const float max_delay = 90.0f;

if (endpoint.ping > 0 && endpoint.display_ping <= 0)
{
endpoint.display_ping = endpoint.ping;
continue;
}

float param = fmin((float) std::abs(endpoint.ping - endpoint.display_ping) / 64.0f, 1.0f);
float param = fmin((float) std::abs(endpoint.ping - endpoint.display_ping) / 24.0f, 1.0f);

if (ImGui::GetFrameCount() % (int)fmax(min_delay, max_delay - (max_delay * param * half_pi)) != 0)
continue;
Expand Down

0 comments on commit d62a633

Please sign in to comment.