1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
#pragma once
#include "ui_base_item.h"
#include "ui_menu.h"
#include "ui_form.h"
#include "ui_render.h"
#include "ui_checkbox.h"
#include "ui_tab_manager.h"
#include "ui_slider.h"
#include "ui_dropdown.h"
#include "ui_key_picker.h"
#include "ui_button.h"
#include "ui_color_picker.h"
#include "ui_label.h"
#include "ui_text_input.h"
#include "ui_progressbar.h"
char g_login[ 32 ];
int g_game = 1;
float g_progress = 0.f;
enum {
STATUS_LOGIN,
STATUS_LOGGING_IN,
STATUS_LOGGED_IN,
STATUS_LOADING,
};
int g_status = STATUS_LOGIN;
extern void execute_login( );
enum {
GAME_UNSAFE = 0,
GAME_SAFE = 1,
};
struct game_t {
int status;
char name[ 32 ];
bool valid_sub;
};
std::vector< game_t > games = {
{ GAME_SAFE, xors( "csgo" ), true },
{ GAME_UNSAFE, xors( "csgo ( beta )" ), false }
};
//fill this vector when receiving game data based on the one above (this is just a test sample one)
std::vector< ui::dropdowns::dropdown_item_t< int > > game_list = {
{ xors( "csgo" ), 1 },
{ xors( "csgo ( beta )" ), 2 },
};
namespace ui
{
auto menu = std::make_shared< ui::c_menu >( 0, 0, 500, 400, xors( "moneybot" ), "" );
static void render( ) {
static bool was_setup = false;
if( !was_setup ) {
menu = std::make_shared< ui::c_menu >( 0, 0, 450, 375, xors( "moneybot" ), "" );
auto login_form = menu->add_item( std::make_shared< ui::c_form >( 120, 20, 190,
115, xors( "login" ) ) ); {
login_form->add_item( std::make_shared< ui::c_text_input >( 15, 0, 140, xors( "username" ), 32, g_login, true ) );
login_form->add_item( std::make_shared< ui::base_item >( 0, 0, 0, 3 ) );
login_form->add_item( std::make_shared< ui::c_button >( 15, 0, 140, 18, xors( "submit" ), [ ]( ) {
g_status = STATUS_LOGGING_IN;
/*
execute your code to log in here
*/
} ) );
}
login_form->set_cond( [ ]( ) { return g_status == STATUS_LOGIN; } );
auto logging_in_form = menu->add_item( std::make_shared< ui::c_form >( 120, 20, 190, 115, xors( "logging in" ) ) ); {
logging_in_form->add_item( std::make_shared< ui::c_label >( 54, 39, xors( "please wait." ) ) );
}
logging_in_form->set_cond( [ ]( ) { return g_status == STATUS_LOGGING_IN; } );
auto games_form = menu->add_item( std::make_shared< ui::c_form >( 120, 20, 190, 115, xors( "inject" ) ) ); {
games_form->add_item( std::make_shared< ui::c_dropdown< > >( 15, 0, 140, xors( "game" ), &g_game, &game_list ) );
games_form->add_item( std::make_shared< ui::c_button >( 15, 0, 140, 18, xors( "inject" ), [ ]( ) {
g_status = STATUS_LOADING;
/*
execute your code to inject here
*/
} ) );
games_form->add_item( std::make_shared< ui::c_label >( 15, 0, xors( "subscription: active" ) ) )->set_cond( [ ]( ) { return games.at( g_game - 1 ).valid_sub; } );
games_form->add_item( std::make_shared< ui::c_label >( 15, 0, xors( "subscription: inactive" ) ) )->set_cond( [ ]( ) { return !games.at( g_game - 1 ).valid_sub; } );
games_form->add_item( std::make_shared< ui::c_label >( 15, 0, xors( "status: safe" ) ) )->set_cond( [ ]( ) { return games.at( g_game - 1 ).status == GAME_SAFE; } );
games_form->add_item( std::make_shared< ui::c_label >( 15, 0, xors( "status: unsafe" ) ) )->set_cond( [ ]( ) { return games.at( g_game - 1 ).status == GAME_UNSAFE; } );
}
games_form->set_cond( [ ]( ) { return g_status == STATUS_LOGGED_IN; } );
auto loading_form = menu->add_item( std::make_shared< ui::c_form >( 120, 20, 190, 115, xors( "loading" ) ) ); {
loading_form->add_item( std::make_shared< ui::c_label >( 54, 39, xors( "please wait." ) ) );
}
loading_form->set_cond( [ ]( ) { return g_status == STATUS_LOADING; } );
menu->add_item( std::make_shared< ui::c_button >( 393, 208, 50, 18, xors( "exit" ), [ ]( ) { exit( 0 ); } ) );
was_setup = true;
}
else {
render_item( menu.get( ) );
static float loading_time;
if( g_status == STATUS_LOGGING_IN && !loading_time ) {
loading_time = GetTickCount( ) * 0.001f + 2.f;
}
else if( g_status == STATUS_LOGGING_IN && GetTickCount( ) * 0.001f > loading_time ) {
g_status = STATUS_LOGGED_IN;
}
}
}
}
|