#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS 1 #include "main.h" #include "config.h" void CALLBACK cmd_menu ( ) { Config :: g_MenuActive = ! Config :: g_MenuActive ; } ; bool CALLBACK Present ( CONST RECT * pSourceRect , CONST RECT * pDestRect , HWND hDestWindowOverride , CONST RGNDATA * pDirtyRegion ) { if ( SUCCEEDED ( SF -> getRender ( ) -> BeginRender ( ) ) && init ) { if ( ! Config :: g_MenuActive ) return true ; // kill me pls newFrame ( ) ; // because 'less' code ImGuiIO IO = ImGui :: GetIO ( ) ; UpdateImGui ( ) ; //ImGui::ShowStyleEditor(); // need imgui_demo ImGui :: Begin ( "test" , & Config :: g_MenuActive , ImVec2 ( 250 , 250 ) , 0.8f , ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize ) ; ImGui :: Text ( "Hello world!" ) ; ImGui :: Checkbox ( "test_boolean" , & Config :: test_boolean ) ; ImGui :: SliderInt ( "test int" , & Config :: test_int , - 1337 , 228 ) ; ImGui :: SliderFloat ( "test float" , & Config :: test_float , - 1337.0f , 228.228f ) ; if ( ImGui :: Button ( "beep" ) ) Beep ( 1500 , 200 ) ; ImGui :: End ( ) ; endFrame ( ) ; // because 'less' code } return true ; } void CALLBACK mainloop ( ) { if ( ! init ) init = startinit ( ) ; // because 'less' code SF -> getSAMP ( ) -> registerChatCommand ( "menu" , cmd_menu ) ; if ( SF -> getGame ( ) -> isKeyPressed ( VK_F5 ) ) Config :: g_MenuActive = ! Config :: g_MenuActive ; if ( menustate != Config :: g_MenuActive ) { SF -> getSAMP ( ) -> getMisc ( ) -> ToggleCursor ( Config :: g_MenuActive ) ; menustate = Config :: g_MenuActive ; } } BOOL APIENTRY DllMain ( HMODULE hModule , DWORD dwReasonForCall , LPVOID lpReserved ) { if ( dwReasonForCall == DLL_PROCESS_ATTACH ) SF -> initPlugin ( mainloop , hModule ) ; return TRUE ; }