summaryrefslogtreecommitdiff
path: root/csgo-loader/csgo-client/UserExperience
diff options
context:
space:
mode:
Diffstat (limited to 'csgo-loader/csgo-client/UserExperience')
-rw-r--r--csgo-loader/csgo-client/UserExperience/MoneybotShared/ui.h3
-rw-r--r--csgo-loader/csgo-client/UserExperience/UserInterface.cpp98
2 files changed, 49 insertions, 52 deletions
diff --git a/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui.h b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui.h
index b061cd5..4d89936 100644
--- a/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui.h
+++ b/csgo-loader/csgo-client/UserExperience/MoneybotShared/ui.h
@@ -42,9 +42,6 @@ namespace ui {
auto error_form = menu->add_item(std::make_shared<ui::c_form>(120, 20, 190, 115, "error"));
{
- error_form->add_item(std::make_shared<ui::c_label>(25, 15, "contact an administrator."))->set_cond([] {
- return UserInterface->m_Data.m_Error == UserExperience::ERROR_SHADOW_BAN;
- });
error_form->add_item(std::make_shared<ui::c_label>(30, 15, "hardware id mismatch."))->set_cond([] {
return UserInterface->m_Data.m_Error == UserExperience::ERROR_INVALID_HWID;
});
diff --git a/csgo-loader/csgo-client/UserExperience/UserInterface.cpp b/csgo-loader/csgo-client/UserExperience/UserInterface.cpp
index af1b384..75b79b2 100644
--- a/csgo-loader/csgo-client/UserExperience/UserInterface.cpp
+++ b/csgo-loader/csgo-client/UserExperience/UserInterface.cpp
@@ -11,65 +11,65 @@ namespace UserExperience
{
void OnDirectXFrame()
{
- if(g_d3d.run_frame(g_window.m_d3d_device))
- {
- g_d3d.begin();
- for(auto& it : d3d::sprites)
- {
- it->begin(g_window.m_d3d_device);
- }
-
- static auto last_time = GetTickCount() * 0.001f;
- auto cur_time = GetTickCount() * 0.001f;
-
- auto deltatime = cur_time - last_time;
-
- last_time = cur_time;
-
- constexpr float anim_step = 1.0f / 15.f;
- static float anim_time = 0.f;
- static bool flip = false;
- if(anim_time == 1.0f)
- {
- flip = true;
- }
- if(anim_time == 0.f)
- {
- flip = false;
- }
-
- if(flip) anim_time = std::clamp(anim_time - anim_step * deltatime, 0.f, 1.0f);
- else anim_time = std::clamp(anim_time + anim_step * deltatime, 0.f, 1.0f);
-
- ui::set_animtime(anim_time);
- ui::render();
-
- RECT cur_rect{ };
- GetWindowRect(g_window.get_hwnd(), &cur_rect);
-
- g_d3d.end();
- for(auto& it : d3d::sprites)
- {
- it->end();
- }
+ if(g_d3d.run_frame(g_window.m_d3d_device))
+ {
+ g_d3d.begin();
+ for(auto& it : d3d::sprites)
+ {
+ it->begin(g_window.m_d3d_device);
+ }
+
+ static auto last_time = GetTickCount() * 0.001f;
+ auto cur_time = GetTickCount() * 0.001f;
+
+ auto deltatime = cur_time - last_time;
+
+ last_time = cur_time;
+
+ constexpr float anim_step = 1.0f / 15.f;
+ static float anim_time = 0.f;
+ static bool flip = false;
+ if(anim_time == 1.0f)
+ {
+ flip = true;
+ }
+ if(anim_time == 0.f)
+ {
+ flip = false;
+ }
+
+ if(flip) anim_time = std::clamp(anim_time - anim_step * deltatime, 0.f, 1.0f);
+ else anim_time = std::clamp(anim_time + anim_step * deltatime, 0.f, 1.0f);
+
+ ui::set_animtime(anim_time);
+ ui::render();
+
+ RECT cur_rect{ };
+ GetWindowRect(g_window.get_hwnd(), &cur_rect);
+
+ g_d3d.end();
+ for(auto& it : d3d::sprites)
+ {
+ it->end();
+ }
}
}
bool UserInterface::Start()
{
- bool result = g_window.create();
-
- if(result)
- {
- std::this_thread::sleep_for(std::chrono::milliseconds(100));
- g_window.add_on_frame(&OnDirectXFrame);
+ bool result = g_window.create();
+
+ if(result)
+ {
+ std::this_thread::sleep_for(std::chrono::milliseconds(100));
+ g_window.add_on_frame(&OnDirectXFrame);
}
return result;
}
- void UserInterface::RunUiFrame()
- {
+ void UserInterface::RunUiFrame()
+ {
g_window.on_frame();
}
} \ No newline at end of file