mirror of
https://github.com/gwdevhub/gMod.git
synced 2026-07-16 07:29:30 +00:00
601c8c1504
* The hash of textures is now computed the first time they are used. The hash is recomputed if the content might have changed. * In some games, textures are used as rendering targets (e.g. a mirror or a portal in Portal). The hash calculation of these textures might slow down the game. -> there is an option to disable the computation of hashes for rendering targets. * Enable or Disable the support of tpf mods affect now the game immediately. * Little rearrangements in the GUI. * uMod can now extract the content of mods to disk and the game loads the textures from there. This solves the huge memory problem of uMod.
281 lines
6.4 KiB
C++
281 lines
6.4 KiB
C++
/*
|
|
This file is part of Universal Modding Engine.
|
|
|
|
|
|
Universal Modding Engine is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
Universal Modding Engine is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with Universal Modding Engine. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
|
|
|
|
#ifndef uMod_GAMEPAGE_H_
|
|
#define uMod_GAMEPAGE_H_
|
|
#include "uMod_Main.h"
|
|
|
|
// this page is opened if a game is started.
|
|
class uMod_GamePage : public wxPanel
|
|
{
|
|
public:
|
|
uMod_GamePage( wxNotebook *parent, const wxString &exe, int injection_method, const wxString &save, PipeStruct &pipe);
|
|
virtual ~uMod_GamePage(void);
|
|
|
|
int UpdateGame(void);
|
|
int ReloadGame(void);
|
|
|
|
int SaveTemplate( const wxString &file_name);
|
|
int SaveTemplateToString( wxString &content);
|
|
|
|
int LoadTemplate( const wxString &file_name);
|
|
int LoadTemplateFromString( const wxString &content);
|
|
int LoadGameData(const uMod_GameInfo &game);
|
|
|
|
wxString GetExeName(void) {return ExeName;}
|
|
wxString GetTemplateName(void) {return TemplateName;}
|
|
|
|
int SetOpenPath(const wxString &path) {return Game.SetOpenPath(path);}
|
|
wxString GetOpenPath(void) {return Game.GetOpenPath();}
|
|
|
|
int SetSavePath(const wxString &path);
|
|
wxString GetSavePath(void) {return Game.GetSavePath();}
|
|
|
|
/**
|
|
* User started drag
|
|
* @param event
|
|
*/
|
|
void OnBeginDrag( wxDataViewEvent &event);
|
|
/**
|
|
* Ask if drop position is valid
|
|
* @param event
|
|
*/
|
|
void OnDropPossible( wxDataViewEvent &event);
|
|
/**
|
|
* User dropped the item
|
|
* @param event
|
|
*/
|
|
void OnDrop( wxDataViewEvent &event);
|
|
|
|
void OnDropFile(wxDropFilesEvent& event);
|
|
|
|
/**
|
|
* Gets called, when the capture texture panel is shown/hidden
|
|
* @param WXUNUSED
|
|
*/
|
|
void OnCollPane(wxCollapsiblePaneEvent& WXUNUSED(event));
|
|
|
|
/**
|
|
* Gets called, when the colour buttons are pressed
|
|
* @param event
|
|
*/
|
|
void OnButtonColour(wxCommandEvent& event);
|
|
|
|
/**
|
|
* Gets called, when one of the check boxes gets checked/unchecked
|
|
* @param event
|
|
*/
|
|
void OnCheckBox(wxCommandEvent& event);
|
|
|
|
/**
|
|
* Gets called, press the button to select the filtered texture formats.
|
|
* @param event
|
|
*/
|
|
void OnButtonFormatFilter(wxCommandEvent& event);
|
|
|
|
/**
|
|
* Gets called, when the save-path button is pressed
|
|
* @param event
|
|
*/
|
|
void OnButtonSavePath(wxCommandEvent& event);
|
|
|
|
/**
|
|
* Gets called, when the Extract-path button is pressed
|
|
* @param event
|
|
*/
|
|
void OnButtonExtractPath(wxCommandEvent& event);
|
|
|
|
/**
|
|
* Gets called, when the update-path button is pressed
|
|
* @param event
|
|
*/
|
|
void OnButtonUpdate(wxCommandEvent& event);
|
|
|
|
|
|
/**
|
|
* Gets called by a rigth click in the ViewCtrl
|
|
* @param event
|
|
*/
|
|
void OnContextMenu( wxDataViewEvent &event );
|
|
int OpenPackage(void);
|
|
|
|
|
|
/**
|
|
* call to change the labels of all items to the actual language
|
|
* @return
|
|
*/
|
|
int UpdateLanguage(void);
|
|
|
|
/**
|
|
* get the actual name of the page (displayed in the tab of the notebook window)
|
|
* @return
|
|
*/
|
|
wxString GetPageName(void);
|
|
|
|
/**
|
|
* The game has created a DirectX device.
|
|
* @param version device version (e.g. DX9, DX9Ex, DX10 DX10.1
|
|
* @return
|
|
*/
|
|
int AddDXDevice(int version);
|
|
/**
|
|
* The game hast destroyed a DirectX device.
|
|
* @param version
|
|
* @return
|
|
*/
|
|
int RemoveDXDevice(int version);
|
|
|
|
|
|
wxString LastError;
|
|
|
|
private:
|
|
|
|
/**
|
|
* Set the info text (which injection method is used and which kind of DirectX device is connected)
|
|
* @return
|
|
*/
|
|
int SetInfo(void);
|
|
|
|
const int InjectionMethod;
|
|
int CounterDX9, CounterDX9EX;
|
|
int CounterDX10, CounterDX101;
|
|
|
|
/**
|
|
* add a single package (or file)
|
|
* @param file_name
|
|
* @return
|
|
*/
|
|
int AddPackage( const wxString &file_name);
|
|
|
|
/**
|
|
* adds multiple packages (or files)
|
|
* @param files
|
|
* @param num
|
|
* @return
|
|
*/
|
|
int AddPackages(const wxString *files, int num);
|
|
|
|
/**
|
|
* adds multiple packages (or files)
|
|
* @param files
|
|
* @return
|
|
*/
|
|
int AddPackages(const wxArrayString &files);
|
|
|
|
/**
|
|
* ask for all values from the various control elements of this panel and updates \a Game
|
|
* @return
|
|
*/
|
|
int GetSettings(void);
|
|
|
|
/**
|
|
* returns the file name to a given template name
|
|
* @param template_name
|
|
* @param file_name
|
|
* @return 0 on success
|
|
*/
|
|
int GetTemplateFileName( const wxString &template_name, wxString &file_name);
|
|
|
|
wxString ExeName;
|
|
wxString TemplateName;
|
|
|
|
|
|
wxButton *UpdateButton;
|
|
|
|
wxBoxSizer *MainSizer;
|
|
wxTextCtrl *DX_DLL_Info;
|
|
wxTextCtrl *TemplateFile;
|
|
|
|
wxCollapsiblePane *CollCapturePane;
|
|
wxBoxSizer *CollCaptureSizer;
|
|
|
|
wxBoxSizer *TextureSizer;
|
|
|
|
wxPanel *SingleTexturePanel;
|
|
wxBoxSizer *SingleTextureSizer;
|
|
wxCheckBox *SaveSingleTexture;
|
|
wxCheckBox *ShowSingleTextureString;
|
|
wxCheckBox *ShowSingleTexture;
|
|
|
|
|
|
uMod_KeyPanel *KeyBack;
|
|
uMod_KeyPanel *KeySave;
|
|
uMod_KeyPanel *KeyNext;
|
|
|
|
wxButton *FontColour;
|
|
wxButton *TextureColour;
|
|
|
|
|
|
wxPanel *AllTexturePanel;
|
|
wxBoxSizer *AllTextureSizer;
|
|
wxCheckBox *SaveAllTextures;
|
|
|
|
wxCheckBox *UseSizeFilter;
|
|
|
|
uMod_SpinPanel *SpinWidth;
|
|
uMod_SpinPanel *SpinHeight;
|
|
uMod_SpinPanel *SpinDepth;
|
|
|
|
|
|
wxCheckBox *UseFormatFilter;
|
|
wxButton *FormatFilter;
|
|
|
|
|
|
uMod_CheckBoxArray *FileFormats;
|
|
|
|
wxButton *SavePathButton;
|
|
wxTextCtrl *SavePath;
|
|
|
|
|
|
|
|
wxCollapsiblePane *CollSettingsPane;
|
|
wxBoxSizer *CollSettingsSizer;
|
|
wxPanel *CollSettingsPanel;
|
|
|
|
|
|
wxCheckBox *SupportTPF;
|
|
wxCheckBox *ComputeRenderTargets;
|
|
wxCheckBox *ExtractTexturesToDisk;
|
|
wxCheckBox *DeleteExtractedTexturesOnDisk;
|
|
|
|
wxButton *ExtractPathButton;
|
|
wxTextCtrl *ExtractPath;
|
|
|
|
|
|
wxDataViewCtrl *ViewCtrl;
|
|
uMod_TreeViewModel *ViewModel;
|
|
wxDataViewItem *LastDataViewItem;
|
|
|
|
int NumberOfEntry;
|
|
int MaxNumberOfEntry;
|
|
|
|
|
|
wxArrayString Files;
|
|
uMod_GameInfo Game;
|
|
uMod_GameInfo GameOld;
|
|
|
|
uMod_Sender Sender;
|
|
|
|
|
|
DECLARE_EVENT_TABLE();
|
|
};
|
|
|
|
#endif /* uMod_GAMEPAGE_H_ */
|