From c0457fcb47f5f8681fec0e8e7ee730316a35e688 Mon Sep 17 00:00:00 2001 From: "code@koerner-de.net" Date: Tue, 22 Nov 2011 10:27:07 +0000 Subject: [PATCH] Improvements: Buttons and the menu entries related to the templates are now disabled if no game is running. Added a readme.txt with compilation notes. --- .gitattributes | 1 + README.txt | 55 +++++++++++++++++++++++++++++++++++++++++++ uMod_GUI/uMod_GUI.cpp | 34 ++++++++++++++++++++++++++ uMod_GUI/uMod_GUI.h | 2 ++ 4 files changed, 92 insertions(+) create mode 100644 README.txt diff --git a/.gitattributes b/.gitattributes index a25475f..c458c99 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,5 @@ * text=auto !eol +/README.txt -text uMod_DX9/makefile.gcc -text uMod_DX9/makefile.vc -text uMod_DX9/uMod_ArrayHandler.cpp -text diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..f3e04d4 --- /dev/null +++ b/README.txt @@ -0,0 +1,55 @@ +The licence is set for each file separately. + + +1) How to compile the GUI: + +1.1) You need: +- wxWidgets 2.9. (an earlier version won't work, cause I use wxString functions only available in 2.9., I use atm 2.9.2) + +In the package a makefile for the gcc (makefile.gcc) and a makefile for the MS Visual C Compiler (makefile.vc) is included, but you can generate your own makefile for the compiler of your choice. + +Compiling wxWidgets: +- Compile it with BUILD=release otherwise the executable will be very large. +- The vc compiler somehow generates a smaller executable. +- Set the linkage to static (in the config.gcc or config.vc) before you compile the wxWidgets, to ensure, that also on other PC's your executable will run. + +If you use my makefiles, you have to change the WX_DIR Variable to your wxWidgets directory. This Variable is nearly at the beginning of the makefiles. +note: I have set the linkage to static in the corresponding config.* files, if you have not compiled you wxWidgets with static linkage the compiler will fail, when linking the GUI. + +1.2) Using gcc: +change in the uMod_GUI Directory and type: +mingw32-make -f makefile.gcc BUILD=release +(note: with the options -j 4 you compile simultaneously with 4 threads) + +1.3) Using vc: +change in the uMod_GUI Directory and type: +nmake -f makefile.vc BUILD=release +(note: you need to use the special MS Visual prompt) + + +2) How to compile the dll: + +2.1) You need: +- The DirectX SDK (I use June 2010) +- MS Visual C Compiler (I use the free Express 2010 version) +- maybe the Microsoft Windows SDK + +There exist two makefiles, one for the mingw32-make.exe (makefile.gcc) which call the vc compiler and one for the nmake.exe (makefile.vc) which also calls the vc compiler. I have created the makefile.gcc only to use the -j 4 option of the gnu make. + +You have to compile the 3 dll's separately (one for each injection method). The dll will be copied after successful compilation in the uMod_GUI/bin directory. + +2.2) Using gcc (BUT you need the vc compiler!): +change in the uMod_DX9 Directory and type: +mingw32-make -f makefile.gcc +mingw32-make -f makefile.gcc DI=1 +mingw32-make -f makefile.gcc NI=1 +(note: you need to use the special MS Visual prompt) +(note: with the options -j 4 you compile simultaneously with 4 threads) + + +2.3) Using vc: +change in the uMod_DX9 Directory and type: +nmake -f makefile.vc +nmake -f makefile.vc DI=1 +nmake -f makefile.vc NI=1 +(note: you need to use the special MS Visual prompt) \ No newline at end of file diff --git a/uMod_GUI/uMod_GUI.cpp b/uMod_GUI/uMod_GUI.cpp index 38f7e62..1aa8d14 100644 --- a/uMod_GUI/uMod_GUI.cpp +++ b/uMod_GUI/uMod_GUI.cpp @@ -176,6 +176,7 @@ uMod_Frame::uMod_Frame(const wxString& title, uMod_Settings &set) } if (Settings.UseHook) InstallHook(); + DeactivateGamesControl(); } uMod_Frame::~uMod_Frame(void) @@ -266,6 +267,7 @@ void uMod_Frame::OnAddGame( wxCommandEvent &event) Clients[NumberOfGames] = client; NumberOfGames++; + if (NumberOfGames==1) ActivateGamesControl(); } void uMod_Frame::OnDeleteGame( wxCommandEvent &event) @@ -278,6 +280,8 @@ void uMod_Frame::OnDeleteGame( wxCommandEvent &event) delete Clients[i]; NumberOfGames--; for (int j=i; jEnable( ID_Menu_LoadTemplate, true); + MenuMain->Enable( ID_Menu_SaveTemplate, true); + MenuMain->Enable( ID_Menu_SaveTemplateAs, true); + MenuMain->Enable( ID_Menu_SetDefaultTemplate, true); + + + OpenButton->Enable( true); + DirectoryButton->Enable( true); + UpdateButton->Enable( true); + ReloadButton->Enable( true); + + return 0; +} + +int uMod_Frame::DeactivateGamesControl(void) +{ + MenuMain->Enable( ID_Menu_LoadTemplate, false); + MenuMain->Enable( ID_Menu_SaveTemplate, false); + MenuMain->Enable( ID_Menu_SaveTemplateAs, false); + MenuMain->Enable( ID_Menu_SetDefaultTemplate, false); + + + OpenButton->Enable( false); + DirectoryButton->Enable( false); + UpdateButton->Enable( false); + ReloadButton->Enable( false); + return 0; +} int uMod_Frame::GetHookedGames( wxArrayString &array) { diff --git a/uMod_GUI/uMod_GUI.h b/uMod_GUI/uMod_GUI.h index 24f6db4..3a47af1 100644 --- a/uMod_GUI/uMod_GUI.h +++ b/uMod_GUI/uMod_GUI.h @@ -63,6 +63,8 @@ public: private: + int ActivateGamesControl(void); + int DeactivateGamesControl(void); uMod_Settings Settings; int KillServer(void);