From 1fc179609e1392285e7f3fd01289895c6e5de66c Mon Sep 17 00:00:00 2001 From: boris Date: Wed, 28 Nov 2018 16:01:44 +1300 Subject: oopsie >w< it appears i've made a fucky wucky ;w;www --- loader/ui.h | 123 ------------------------------------------------------------ 1 file changed, 123 deletions(-) delete mode 100644 loader/ui.h (limited to 'loader/ui.h') diff --git a/loader/ui.h b/loader/ui.h deleted file mode 100644 index a6874f5..0000000 --- a/loader/ui.h +++ /dev/null @@ -1,123 +0,0 @@ -#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; - } - } - } -} \ No newline at end of file -- cgit v1.2.3