update client visuals, performance and diagnostics

This commit is contained in:
st committed 2026-10-14 23:30:29 -05:00
1 parent 361892bf0b
commit 875bab0310
155 files changed
+40855 -421

No files matched your search

+59
View File
@@ -12,6 +12,12 @@
#include "../src/modules/trade_profile.h"
#include "../src/gui/notifications.h"
#include "../src/input.h"
#include "window_branding_tests.h"
#include "menu_input_tests.h"
#include "lowercase_font_tests.h"
#include "startup_intro_tests.h"
#include "style_widget_tests.h"
#include "sigscan_tests.h"
#pragma section(".fvtest", read, execute)
#pragma comment(linker, "/SECTION:.fvtest,ER")
__declspec(allocate(".fvtest")) unsigned char fixture[] = {0x56, 0x57, 0x53, 0x48, 0x83, 0xec, 0x60, 0x44, 0x0f, 0x29, 0x44, 0x24, 0x50, 0x0f, 0x29, 0x7c, 0x24, 0x40, 0x0f, 0x29, 0x74, 0x24, 0x30, 0x44, 0x89, 0xc3, 0x0f, 0x28, 0xf1, 0x48, 0x89, 0xce, 0x45, 0x84, 0xc0, 0x0f, 0x84, 0x23, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x86, 0x88, 0x11, 0x00, 0x00, 0x48, 0x8b, 0x88, 0xf8, 0x03, 0x00, 0x00, 0x48, 0x8b, 0x01, 0x48, 0x8b, 0x80, 0xd8, 0x00, 0x00, 0x00, 0x48, 0x8d, 0x54, 0x24, 0x28, 0x41, 0xb8, 0x2f, 0x00, 0x00, 0x00, 0xf3, 0x0f, 0x10, 0x05, 0x18, 0x00, 0x00, 0x00, 0x0f, 0x28, 0x74, 0x24, 0x30, 0x0f, 0x28, 0x7c, 0x24, 0x40, 0x44, 0x0f, 0x28, 0x44, 0x24, 0x50, 0x48, 0x83, 0xc4, 0x60, 0x5b, 0x5f, 0x5e, 0xc3, 0x00, 0x00, 0x8c, 0x42};
@@ -271,6 +277,24 @@ static void test_crosshair_render() {
cross.set_enabled(false);draw_native();assert(native_crosshair_draws==3+i);
}
notifications::items.clear();
// Entry/exit match the reference's half-second eased slide; timers count down.
notifications::toast timed;timed.born=10;timed.duration=3;
auto motion=notifications::animate(timed,10);
assert(motion.slide==1 && motion.alpha==1 && motion.remaining==1);
motion=notifications::animate(timed,10.25);
assert(close_float(motion.slide,.25f));
motion=notifications::animate(timed,11.5);
assert(motion.slide==0 && close_float(motion.remaining,.5f));
motion=notifications::animate(timed,13.25);
assert(close_float(motion.slide,.75f) && close_float(motion.alpha,.25f) && motion.remaining==0);
motion=notifications::animate(timed,13.5);
assert(motion.slide==1 && motion.alpha==0);
timed.title="macro";timed.body="running";
assert(notifications::message(timed)=="macro: running");
timed.title.clear();assert(notifications::message(timed)=="running");
timed.body.clear();assert(notifications::message(timed).empty());
timed.duration=0;motion=notifications::animate(timed,100);
assert(motion.slide==0 && motion.alpha==1);
notifications::push("Trading","1 / 500 trade attempts",notifications::kind::info,0,"trade",0.1f);
notifications::push("Trading","2 / 500 trade attempts",notifications::kind::info,0,"trade",0.2f);
assert(notifications::items.size()==1 && notifications::items[0].progress==0.2f);
@@ -281,9 +305,32 @@ static void test_crosshair_render() {
assert(ImGui::GetForegroundDrawList()->VtxBuffer.Size>0);
for(const auto& vertex:ImGui::GetForegroundDrawList()->VtxBuffer) assert(std::isfinite(vertex.pos.x) && std::isfinite(vertex.pos.y));
ImGui::Render();
assert(close_float(notifications::items.front().y,5.f));
assert(notifications::items[1].y>notifications::items[0].y);
assert(notifications::items[2].y>notifications::items[1].y);
notifications::dismiss("trade");assert(notifications::items[0].duration>0);
const double dismissed_duration=notifications::items[0].duration;
notifications::dismiss("trade");assert(notifications::items[0].duration==dismissed_duration);
for(auto& item:notifications::items) item.born-=20;
ImGui::NewFrame();notifications::draw();assert(notifications::items.empty());ImGui::Render();
// All four types, wrapped text, and keyed progress updates render without restarting entry.
notifications::push("Working","A long notification body that should wrap across more than one line in the card.",notifications::kind::info,0,"live",.3f);
const double live_born=notifications::items[0].born;
notifications::push("Working","Updated progress",notifications::kind::info,0,"live",.7f);
assert(notifications::items[0].born==live_born);
notifications::dismiss("live");
notifications::push("Working","Resumed",notifications::kind::info,0,"live",.8f);
assert(!notifications::items[0].dismissed && notifications::items[0].duration==0);
for(auto type:{notifications::kind::info,notifications::kind::success,notifications::kind::warning,notifications::kind::error}) {
notifications::items.clear();
notifications::push("Status","Multiple lines\nwith a timer",type,3);
notifications::items[0].born-=1;
ImGui::NewFrame();notifications::draw();ImGui::Render();
assert(ImGui::GetDrawData()->TotalVtxCount>0);
for(const auto& vertex:ImGui::GetForegroundDrawList()->VtxBuffer)
assert(std::isfinite(vertex.pos.x) && std::isfinite(vertex.pos.y));
}
notifications::items.clear();
ImGui::DestroyContext();
}
@@ -344,8 +391,20 @@ static void write_code(unsigned char* target, const unsigned char* bytes, size_t
#include "anti_afk_tests.h"
#include "server_hud_tests.h"
#include "hud_grid_tests.h"
#include "qol_tests.h"
#include "performance_tests.h"
#include "world_weather_tests.h"
#include "debug_metrics_tests.h"
int main() {
test_debug_metrics();
test_sigscan_ranges();
test_lowercase_fonts();
test_startup_intro();
test_style_widgets();
menu_input_test::run();
test_window_branding();
test_qol_readers();test_qol_state();test_qol_event_forwarding();test_qol_modules();test_performance();test_world_weather();test_world_weather(D3D_DRIVER_TYPE_HARDWARE);
test_profiles();
test_world_math_and_hooks();
test_world_filter();