diff options
| author | boris <wzn@moneybot.cc> | 2018-12-20 21:38:04 +1300 |
|---|---|---|
| committer | boris <wzn@moneybot.cc> | 2018-12-20 21:38:04 +1300 |
| commit | a5acd4c9a3b24c9d5af3a8f504e5af053fa7fa09 (patch) | |
| tree | 27bc30d3f35e5daaaa15ee6de066119df8d352c7 /csgo-loader/csgo-client/UserExperience | |
| parent | 77b52da44b263df4884be2f35f885d8edccbb6fa (diff) | |
yo is this loss
Diffstat (limited to 'csgo-loader/csgo-client/UserExperience')
| -rw-r--r-- | csgo-loader/csgo-client/UserExperience/UserInterface.cpp | 32 | ||||
| -rw-r--r-- | csgo-loader/csgo-client/UserExperience/UserInterface.hpp | 17 |
2 files changed, 32 insertions, 17 deletions
diff --git a/csgo-loader/csgo-client/UserExperience/UserInterface.cpp b/csgo-loader/csgo-client/UserExperience/UserInterface.cpp index f8f465f..af1b384 100644 --- a/csgo-loader/csgo-client/UserExperience/UserInterface.cpp +++ b/csgo-loader/csgo-client/UserExperience/UserInterface.cpp @@ -7,11 +7,15 @@ // Global accessor for the user interface.
UserExperience::UserInterfacePtr UserInterface = std::make_unique<UserExperience::UserInterface>();
-namespace UserExperience {
- void OnDirectXFrame() {
- if(g_d3d.run_frame(g_window.m_d3d_device)) { +namespace UserExperience
+{
+ void OnDirectXFrame()
+ {
+ if(g_d3d.run_frame(g_window.m_d3d_device)) + { g_d3d.begin(); - for(auto& it : d3d::sprites) { + for(auto& it : d3d::sprites) + { it->begin(g_window.m_d3d_device); } @@ -25,10 +29,12 @@ namespace UserExperience { constexpr float anim_step = 1.0f / 15.f; static float anim_time = 0.f; static bool flip = false; - if(anim_time == 1.0f) { + if(anim_time == 1.0f) + { flip = true; } - if(anim_time == 0.f) { + if(anim_time == 0.f) + { flip = false; } @@ -42,16 +48,19 @@ namespace UserExperience { GetWindowRect(g_window.get_hwnd(), &cur_rect); g_d3d.end(); - for(auto& it : d3d::sprites) { + for(auto& it : d3d::sprites) + { it->end(); } }
}
- bool UserInterface::Start() {
+ bool UserInterface::Start()
+ {
bool result = g_window.create(); - - if(result) { + + if(result) + { std::this_thread::sleep_for(std::chrono::milliseconds(100)); g_window.add_on_frame(&OnDirectXFrame); }
@@ -59,7 +68,8 @@ namespace UserExperience { return result;
}
- void UserInterface::RunUiFrame() { + void UserInterface::RunUiFrame() + { g_window.on_frame();
}
}
\ No newline at end of file diff --git a/csgo-loader/csgo-client/UserExperience/UserInterface.hpp b/csgo-loader/csgo-client/UserExperience/UserInterface.hpp index 332b042..bea8b45 100644 --- a/csgo-loader/csgo-client/UserExperience/UserInterface.hpp +++ b/csgo-loader/csgo-client/UserExperience/UserInterface.hpp @@ -5,24 +5,28 @@ #include <cstdint>
#include <cstdio>
-namespace UserExperience {
+namespace UserExperience
+{
// Execution states define a moment in the execution of the loader.
// These may be changed externally by other threads.
- enum ExecutionState : uint16_t {
+ enum ExecutionState : uint16_t
+ {
EXECUTION_WAITING, // Displays the message 'please wait...'.
EXECUTION_ERROR, // Displays an error.
EXECUTION_LOG_IN, // Displays the log-in dialog.
EXECUTION_CHOOSE // Displays the game selection dialog.
};
- enum ErrorReason : uint16_t {
+ enum ErrorReason : uint16_t
+ {
ERROR_GENERIC_ERROR,
ERROR_INVALID_HWID,
ERROR_SHADOW_BAN
};
// Structure that holds global data that will be used by the UI.
- struct UserExperienceData {
+ struct UserExperienceData
+ {
// Holds the current execution state of the loader.
ExecutionState m_ExecutionState = EXECUTION_WAITING;
@@ -41,7 +45,8 @@ namespace UserExperience { };
// User experience handler.
- class UserInterface {
+ class UserInterface
+ {
public:
UserExperienceData m_Data;
@@ -51,7 +56,7 @@ namespace UserExperience { // Creates an UI thread, call only once.
void RunUiFrame();
};
-
+
using UserInterfacePtr = std::unique_ptr<UserInterface>;
}
|
