wxMASSManager/GUI/EvtMainFrame.h

105 lines
3.7 KiB
C
Raw Normal View History

2020-01-09 13:59:19 +01:00
#ifndef __EvtMainFrame__
#define __EvtMainFrame__
// wxMASSManager
// Copyright (C) 2020 Guillaume Jacquemin
//
// This program 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.
//
// This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
#include <string>
2020-09-30 16:27:26 +02:00
#include <Corrade/Containers/Pointer.h>
#include <wx/fswatcher.h>
#include <wx/imaglist.h>
#include "../MassManager/MassManager.h"
2020-09-30 16:27:26 +02:00
#include "../MassBuilderManager/MassBuilderManager.h"
#include "../Profile/Profile.h"
#include "../ProfileManager/ProfileManager.h"
2020-01-09 13:59:19 +01:00
#include "MainFrame.h"
2020-09-30 16:27:26 +02:00
using namespace Corrade;
2020-01-09 13:59:19 +01:00
class EvtMainFrame: public MainFrame {
public:
EvtMainFrame(wxWindow* parent);
~EvtMainFrame();
auto ready() -> bool;
2020-01-09 13:59:19 +01:00
protected:
2020-09-30 16:27:26 +02:00
// Profile-related events
2021-05-12 20:21:35 +02:00
void profileSelectionEvent(wxCommandEvent&) override;
void backupSelectedProfileEvent(wxCommandEvent&) override;
void companyRenameEvent(wxCommandEvent&) override;
void creditsEditEvent(wxCommandEvent&) override;
void storyProgressSelectionEvent(wxCommandEvent& event);
2021-05-12 20:21:35 +02:00
void openStoryProgressMenuEvent(wxCommandEvent&) override;
void inventoryChangeEvent(wxPropertyGridEvent& event) override;
2020-09-30 16:27:26 +02:00
// M.A.S.S.-related events
2021-05-12 20:21:35 +02:00
void importMassEvent(wxCommandEvent&) override;
void exportMassEvent(wxCommandEvent&) override;
void moveMassEvent(wxCommandEvent&) override;
void deleteMassEvent(wxCommandEvent&) override;
void renameMassEvent(wxCommandEvent&) override;
void openSaveDirEvent(wxCommandEvent&) override;
void stagingSelectionEvent(wxCommandEvent&) override;
void deleteStagedEvent(wxCommandEvent&) override;
void openStagingDirEvent(wxCommandEvent&) override;
2020-01-09 13:59:19 +01:00
void installedSelectionEvent(wxListEvent&);
void listColumnDragEvent(wxListEvent&);
2020-09-30 16:27:26 +02:00
// Screenshot-related events
2021-05-12 20:21:35 +02:00
void openScreenshotDirEvent(wxCommandEvent&) override;
// General events
void fileUpdateEvent(wxFileSystemWatcherEvent& event);
2021-05-12 20:21:35 +02:00
void gameCheckTimerEvent(wxTimerEvent&) override;
void unsafeCheckboxEvent(wxCommandEvent& event) override;
2020-01-09 13:59:19 +01:00
private:
2020-10-02 12:55:52 +02:00
void saveFileEventHandler(int event_type, const wxString& event_file, const wxFileSystemWatcherEvent& event);
void stagingFileEventHandler(int event_type, const wxString& event_file, const wxFileSystemWatcherEvent& event);
2020-09-30 16:27:26 +02:00
void updateProfileStats();
void initStoryProgressMenu();
2020-09-30 16:27:26 +02:00
2020-01-09 13:59:19 +01:00
void initialiseListView();
void isGameRunning();
2020-01-09 13:59:19 +01:00
void refreshListView();
void getActiveSlot();
2020-01-09 13:59:19 +01:00
void updateCommandsState();
void refreshHangar(int slot);
2020-01-09 13:59:19 +01:00
void infoMessage(const wxString& message);
void warningMessage(const wxString& message);
void errorMessage(const wxString& message);
bool _unsafeMode = false;
2020-09-30 16:27:26 +02:00
MassBuilderManager _mbManager;
ProfileManager _profileManager;
Containers::Pointer<MassManager> _massManager;
Containers::Pointer<wxMenu> _storyProgressSelectionMenu;
wxFileSystemWatcher _watcher;
int _lastWatcherEventType = 0;
2020-01-09 13:59:19 +01:00
};
#endif // __EvtMainFrame__