ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/AE/Installer/trunk/source/main_window.cpp
(Generate patch)

Comparing AE/Installer/trunk/source/main_window.cpp (file contents):
Revision 358 by gumby, Fri Jun 19 22:25:08 2009 UTC vs.
Revision 385 by gumby, Mon Jul 6 00:59:40 2009 UTC

# Line 1 | Line 1
1   /*
2 < AE/Mod Installer
3 < by Gumby and Iritscen
2 > AE/Mod Installer
3 > by Gumby and Iritscen
4   */
5  
6 < // To-do: -
6 > // To-do: - Load credits from text resource file
7   //                - Institute lots of checks into file-handling
8 < //                - Clear mod info fields when mod is de-selected ???
8 > //                - Clear mod info fields when mod is de-selected
9  
10   #define DEBUG
11   #include <stdio.h>
# Line 30 | Line 30 | by Gumby and Iritscen
30   #include <dirent.h>
31   #endif
32  
33 < const string strInstallerVersion = "1.0";
33 > //const string strInstallerVersion = "1.0";
34   const bool SPLIT = 1;
35   const bool NOT_SPLIT = 0;
36   bool splitInstances = SPLIT;
# Line 265 | Line 265 | int globalizeData(void)
265  
266                                                  }
267                                                  else {
268 <                                                        logfile << "\tMoved file: " << dir_itr->path().filename() << "\n";
268 >                                                        //logfile << "\tMoved file: " << dir_itr->path().filename() << "\n";
269                                                  }
270                                          }
271  
# Line 287 | Line 287 | int globalizeData(void)
287                          //printf(levels[i],"%d",levels[i]);
288                          //printf(Step_x_x,"Step %d/%d: reimporting level", parts_done + 1, 7 + 2 * num_levels); setStatusArea((string)Step_x_x + levels[i] + (string)"_Final.dat");
289                          setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + " reimporting level" + levels[i]+"_Final.oni");
290 <                        system( (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level"
291 <                                + levels[i] + "_Final/level" + levels[i] + "_Final.oni > Globalize.oni").c_str());
290 >                        logfile << (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level"
291 >                                + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize.log").c_str() << '\n';
292 >                        string sys_str = (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level"
293 >                                + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize2.log");
294 >                                system(sys_str.c_str() );
295                          setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) ));
296                          parts_done++;
297                  }
# Line 323 | Line 326 | int globalizeData(void)
326                  if (exists("../GameDataFolder/IGMD")) remove_all("../GameDataFolder/IGMD");
327                  */
328                  create_directory((path)"../GameDataFolder/IGMD");
329 <                copy((path)"packages/VanillaBSL/", (path)"../GameDataFolder");
330 <                setProgressBar( 1000 );
329 >                copy((path)"packages/VanillaBSL/IGMD", (path)"../GameDataFolder");
330 >                setProgressBar( 1000 );
331 >                
332 >                // CIP:last of all, set up the edition folder as a playable Oni installation by placing the latest application (+ Daodan DLL on Windows) in edition/
333 >                
334 >                // CIP:then copy persist.dat and keyconfig.txt into edition/ as well
335 >                
336 > #ifndef WIN32
337 >                /* On Mac only, set the current GDF to the AE GDF by writing to Oni's global preferences file (thankfully a standard OS X ".plist" XML file).
338 >                   If there are no Oni prefs (only possible if Oni has not been run even once), then the above line will fail silently, no harm done,
339 >                   and when the user does run Oni for the first time, using the copy of the app in the AE GDF, Oni will set the prefs to use that GDF at that point */
340 >                path fullAEpath = system_complete("."); // get full path for Installer
341 >                char prefsCommand[300] = "defaults write com.godgames.oni RetailInstallationPath -string '";
342 >                strcat(prefsCommand, fullAEpath.parent_path().parent_path().string().c_str()); // get path of edition/ folder (Oni wants the folder that *contains* the GDF)
343 >                strcat(prefsCommand, "'"); // path string is enclosed in single quotes to avoid the need to escape UNIX-unfriendly characters
344 >                system(prefsCommand);
345 >                
346 > #endif
347 >                
348                  setStatusArea((string)"Done! Now select your mod packages and click install.");
349                  //      while(1) Sleep(-1);
350  
# Line 618 | Line 638 | void recompileAll(vector<string> install
638                          {
639                                  if ( is_directory( dir_itr->status() ) )
640                                  {
641 <                                        importCommand = strOniSplit + " " + strImportOption + " " + vanilla_dir.string() + dir_itr->path().filename() + " " + "../GameDataFolder/" + dir_itr->path().filename()
622 <                                                + ".dat";
641 >                                        importCommand = strOniSplit + " " + strImportOption + " " + vanilla_dir.string() + dir_itr->path().filename() + " ";
642                                          for (int i = 0; i < installedMods.size(); ++i) {
643                                                  if (exists("packages/" + installedMods[i] + "/oni/" + dir_itr->path().filename()  ))
644                                                          importCommand += " packages/" + installedMods[i] + "/oni/" + dir_itr->path().filename();
# Line 780 | Line 799 | vector<ModPackage> globalPackages;
799   #endif
800  
801   ////@begin includes
802 < #include "about_window.h"
802 > #include "about.h"
803   ////@end includes
804  
805   #include "main_window.h"
806  
807   ////@begin XPM images
808 < #include "redo.xpm"
808 > #include "aelogosmall.xpm"
809 > #include "undo.xpm"
810   #include "fileopen.xpm"
811   #include "filesaveas.xpm"
812   #include "quit.xpm"
# Line 809 | Line 829 | IMPLEMENT_CLASS( MainWindow, wxFrame )
829   BEGIN_EVENT_TABLE( MainWindow, wxFrame )
830  
831   ////@begin MainWindow event table entries
832 < EVT_CHECKBOX( SelectAll_Checkbox, MainWindow::OnSelectAllCheckboxClick )
832 >    EVT_CHECKBOX( SelectAll_Checkbox, MainWindow::OnSelectAllCheckboxClick )
833  
834 < EVT_BUTTON( Refresh_Button, MainWindow::OnRefreshButtonClick )
834 >    EVT_BUTTON( Refresh_Button, MainWindow::OnRefreshButtonClick )
835  
836 < EVT_LISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Selected )
837 < EVT_CHECKLISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Toggled )
836 >    EVT_LISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Selected )
837 >    EVT_CHECKLISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Toggled )
838  
839 < EVT_UPDATE_UI( ID_STATUSBAR, MainWindow::OnStatusbarUpdate )
839 >    EVT_UPDATE_UI( ID_STATUSBAR, MainWindow::OnStatusbarUpdate )
840  
841 < EVT_BUTTON( Install_Button, MainWindow::OnInstallButtonClick )
841 >    EVT_BUTTON( Install_Button, MainWindow::OnInstallButtonClick )
842  
843 < EVT_RADIOBUTTON( Sep_RadioButton, MainWindow::OnSepRadioButtonSelected )
843 >    EVT_RADIOBUTTON( Sep_RadioButton, MainWindow::OnSepRadioButtonSelected )
844  
845 < EVT_RADIOBUTTON( NoSep_RadioButton, MainWindow::OnNoSepRadioButtonSelected )
845 >    EVT_RADIOBUTTON( NoSep_RadioButton, MainWindow::OnNoSepRadioButtonSelected )
846  
847 < EVT_RADIOBUTTON( Separated_RadioButton, MainWindow::OnSeparatedRadioButtonSelected )
847 >    EVT_RADIOBUTTON( Seperated_RadioButton, MainWindow::OnSeperatedRadioButtonSelected )
848  
849 < EVT_RADIOBUTTON( Complete_RadioButton, MainWindow::OnCompleteRadioButtonSelected )
849 >    EVT_RADIOBUTTON( Complete_RadioButton, MainWindow::OnCompleteRadioButtonSelected )
850  
851 < EVT_BUTTON( ReGlobalize_Button, MainWindow::OnReGlobalizeButtonClick )
851 >    EVT_BUTTON( ReGlobalize_Button, MainWindow::OnReGlobalizeButtonClick )
852  
853 < EVT_MENU( wxID_LOAD, MainWindow::OnLoadClick )
853 >    EVT_MENU( wxID_LOAD, MainWindow::OnLoadClick )
854  
855 < EVT_MENU( wxID_SAVE, MainWindow::OnSaveClick )
855 >    EVT_MENU( wxID_SAVE, MainWindow::OnSaveClick )
856  
857 < EVT_MENU( wxID_EXIT, MainWindow::OnExitClick )
857 >    EVT_MENU( wxID_EXIT, MainWindow::OnExitClick )
858  
859 < EVT_MENU( wxID_OPTIONS, MainWindow::OnOptionsClick )
859 >    EVT_MENU( wxID_OPTIONS, MainWindow::OnOptionsClick )
860  
861 < EVT_MENU( wxID_ABOUT, MainWindow::OnAboutClick )
861 >    EVT_MENU( wxID_ABOUT, MainWindow::OnAboutClick )
862  
863   ////@end MainWindow event table entries
864  
# Line 868 | Line 888 | MainWindow::MainWindow( wxWindow* parent
888   bool MainWindow::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
889   {
890          ////@begin MainWindow creation
891 <        wxFrame::Create( parent, id, caption, pos, size, style );
872 <
873 <        CreateControls();
874 <        SetIcon(GetIconResource(wxT("oni_special.ico")));
875 <        Centre();
876 <
891 >    wxFrame::Create( parent, id, caption, pos, size, style );
892  
893 +    CreateControls();
894 +    SetIcon(GetIconResource(wxT("aelogosmall.png")));
895 +    Centre();
896          ////@end MainWindow creation
897          return true;
898   }
# Line 898 | Line 916 | MainWindow::~MainWindow()
916   void MainWindow::Init()
917   {
918          ////@begin MainWindow member initialisation
919 <        MainSplitter = NULL;
920 <        SelectAll = NULL;
921 <        RefreshButton = NULL;
922 <        Mods_CheckboxList = NULL;
923 <        titleText = NULL;
924 <        creatorText = NULL;
925 <        descriptionText = NULL;
926 <        StatusArea = NULL;
927 <        ProgressBar = NULL;
928 <        InstallButton = NULL;
929 <        OptionsPanel = NULL;
930 <        SepRadio = NULL;
931 <        NoSepRadio = NULL;
932 <        SeparatedRadio = NULL;
933 <        CompleteRadio = NULL;
934 <        ReglobalizeButton = NULL;
919 >    MainSplitter = NULL;
920 >    SelectAll = NULL;
921 >    RefreshButton = NULL;
922 >    Mods_CheckboxList = NULL;
923 >    titleText = NULL;
924 >    creatorText = NULL;
925 >    descriptionText = NULL;
926 >    StatusArea = NULL;
927 >    ProgressBar = NULL;
928 >    InstallButton = NULL;
929 >    OptionsPanel = NULL;
930 >    SepRadio = NULL;
931 >    NoSepRadio = NULL;
932 >    SeperatedRadio = NULL;
933 >    CompleteRadio = NULL;
934 >    ReglobalizeButton = NULL;
935          ////@end MainWindow member initialisation
936  
937   }
# Line 928 | Line 946 | wxGauge* TheProgressBar;
946   void MainWindow::CreateControls()
947   {    
948          ////@begin MainWindow content construction
949 <        // Generated by DialogBlocks, 31/05/2009 19:03:55 (unregistered)
932 <
933 <        MainWindow* itemFrame1 = this;
934 <
935 <        wxMenuBar* menuBar = new wxMenuBar;
936 <        wxMenu* itemMenu37 = new wxMenu;
937 <        {
938 <                wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_LOAD, _("&Load Configuration..."), wxEmptyString, wxITEM_NORMAL);
939 <                wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("fileopen.xpm")));
940 <                menuItem->SetBitmap(bitmap);
941 <                itemMenu37->Append(menuItem);
942 <        }
943 <        {
944 <                wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_SAVE, _("&Save Configuration..."), wxEmptyString, wxITEM_NORMAL);
945 <                wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("filesaveas.xpm")));
946 <                menuItem->SetBitmap(bitmap);
947 <                itemMenu37->Append(menuItem);
948 <        }
949 <        itemMenu37->AppendSeparator();
950 <        {
951 <                wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_EXIT, _("Exit"), wxEmptyString, wxITEM_NORMAL);
952 <                wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("quit.xpm")));
953 <                menuItem->SetBitmap(bitmap);
954 <                itemMenu37->Append(menuItem);
955 <        }
956 <        menuBar->Append(itemMenu37, _("&File"));
957 <        wxMenu* itemMenu42 = new wxMenu;
958 <        itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK);
959 <        menuBar->Append(itemMenu42, _("Options"));
960 <        wxMenu* itemMenu44 = new wxMenu;
961 <        itemMenu44->Append(wxID_HELP, _("Help"), wxEmptyString, wxITEM_NORMAL);
962 <        itemMenu44->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
963 <        menuBar->Append(itemMenu44, _("Help"));
964 <        itemFrame1->SetMenuBar(menuBar);
965 <        
966 <        wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
967 <        itemFrame1->SetSizer(itemBoxSizer2);
949 >    MainWindow* itemFrame1 = this;
950  
951 <        MainSplitter = new wxSplitterWindow( itemFrame1, ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(100, 100), wxSP_LIVE_UPDATE|wxNO_BORDER );
952 <        MainSplitter->SetMinimumPaneSize(150);
953 <        MainSplitter->SetName(_T("MainSplitter"));
954 <
955 <        wxPanel* itemPanel4 = new wxPanel( MainSplitter, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
956 <        wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
957 <        itemPanel4->SetSizer(itemBoxSizer5);
958 <
959 <        wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
960 <        itemBoxSizer5->Add(itemBoxSizer6, 0, wxGROW|wxALL, 0);
961 <        SelectAll = new wxCheckBox( itemPanel4, SelectAll_Checkbox, _("Select All/None"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE );
962 <        SelectAll->SetValue(false);
963 <        SelectAll->SetName(_T("SelectAll_Checkbox"));
964 <        itemBoxSizer6->Add(SelectAll, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
965 <
966 <        RefreshButton = new wxBitmapButton( itemPanel4, Refresh_Button, itemFrame1->GetBitmapResource(wxT("redo.xpm")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
967 <        RefreshButton->SetName(_T("RefreshButton"));
968 <        itemBoxSizer6->Add(RefreshButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
969 <
970 <        wxArrayString Mods_CheckboxListStrings;
971 <        Mods_CheckboxList = new wxCheckListBox( itemPanel4, Mods_CheckboxList1, wxDefaultPosition, wxDefaultSize, Mods_CheckboxListStrings, wxLB_HSCROLL );
972 <        Mods_CheckboxList->SetName(_T("Mods_CheckboxList"));
973 <        itemBoxSizer5->Add(Mods_CheckboxList, 1, wxGROW|wxALL, 0);
974 <
975 <        wxPanel* itemPanel10 = new wxPanel( MainSplitter, DescriptionHolder_Panel, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
976 <        itemPanel10->SetName(_T("DescriptionHolder_Panel"));
977 <        wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL);
978 <        itemPanel10->SetSizer(itemBoxSizer11);
979 <
980 <        wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
981 <        itemBoxSizer11->Add(itemBoxSizer12, 0, wxGROW|wxALL, 0);
982 <        wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL);
983 <        itemBoxSizer12->Add(itemBoxSizer13, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
984 <        titleText = new wxTextCtrl( itemPanel10, Title_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
985 <        titleText->SetName(_T("Title_Text"));
986 <        titleText->SetBackgroundColour(wxColour(240, 240, 240));
987 <        itemBoxSizer13->Add(titleText, 1, wxGROW|wxLEFT, 5);
988 <
989 <        wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxVERTICAL);
990 <        itemBoxSizer12->Add(itemBoxSizer15, 1, wxGROW|wxALL, 0);
991 <        creatorText = new wxTextCtrl( itemPanel10, Author_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_RIGHT );
992 <        creatorText->SetName(_T("Author_Text"));
993 <        creatorText->SetBackgroundColour(wxColour(240, 240, 240));
994 <        itemBoxSizer15->Add(creatorText, 1, wxGROW|wxRIGHT, 5);
995 <
996 <        wxStaticLine* itemStaticLine17 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
997 <        itemStaticLine17->Show(false);
998 <        itemBoxSizer11->Add(itemStaticLine17, 0, wxGROW|wxALL, 5);
999 <
1000 <        descriptionText = new wxTextCtrl( itemPanel10, Description_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH|wxTE_AUTO_URL );
1001 <        descriptionText->SetName(_T("DescriptionName"));
1002 <        descriptionText->SetBackgroundColour(wxColour(240, 240, 240));
1003 <        itemBoxSizer11->Add(descriptionText, 1, wxGROW|wxLEFT|wxRIGHT, 5);
1004 <
1005 <        MainSplitter->SplitVertically(itemPanel4, itemPanel10, 150);
1006 <        itemBoxSizer2->Add(MainSplitter, 1, wxGROW|wxALL, 0);
1007 <
1008 <        StatusArea = new wxStatusBar( itemFrame1, ID_STATUSBAR, 0 );
1009 <        StatusArea->SetName(_T("StatusArea"));
1010 <        StatusArea->SetFieldsCount(1);
1011 <        StatusArea->SetStatusText(_("Status Area"), 0);
1012 <        itemBoxSizer2->Add(StatusArea, 0, wxGROW|wxALL, 0);
1013 <
1014 <        wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL);
1015 <        itemBoxSizer2->Add(itemBoxSizer20, 0, wxGROW|wxALL, 0);
1016 <
1017 <        ProgressBar = new wxGauge( itemFrame1, ProgressBar_Gauge, 1000, wxDefaultPosition, wxSize(-1, 30), wxGA_SMOOTH );
1018 <        ProgressBar->SetValue(0);
1019 <        itemBoxSizer20->Add(ProgressBar, 1, wxGROW|wxALL, 0);
1020 <
1021 <        InstallButton = new wxButton( itemFrame1, Install_Button, _("Install!"), wxDefaultPosition, wxSize(-1, 30), 0 );
1022 <        itemBoxSizer20->Add(InstallButton, 0, wxGROW|wxALL, 0);
1023 <
1024 <        wxBoxSizer* itemBoxSizer23 = new wxBoxSizer(wxVERTICAL);
1025 <        itemBoxSizer2->Add(itemBoxSizer23, 0, wxGROW|wxALL, 0);
1026 <
1027 <        OptionsPanel = new wxPanel( itemFrame1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1028 <        itemBoxSizer2->Add(OptionsPanel, 0, wxGROW, 0);
1029 <
1030 <        wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL);
1031 <        OptionsPanel->SetSizer(itemBoxSizer25);
1032 <
1033 <        wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxVERTICAL);
1034 <        itemBoxSizer25->Add(itemBoxSizer26, 0, wxGROW|wxALL, 5);
1035 <
1036 <        SepRadio = new wxRadioButton( OptionsPanel, Sep_RadioButton, _("Sep"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1037 <        SepRadio->SetValue(false);
1038 <        if (MainWindow::ShowToolTips())
1039 <                SepRadio->SetToolTip(_("For PC Demo and Mac"));
1040 <        itemBoxSizer26->Add(SepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1041 <
1042 <        NoSepRadio = new wxRadioButton( OptionsPanel, NoSep_RadioButton, _("NoSep"), wxDefaultPosition, wxDefaultSize, 0 );
1043 <        NoSepRadio->SetValue(false);
1044 <        if (MainWindow::ShowToolTips())
1045 <                NoSepRadio->SetToolTip(_("For PC Retail"));
1046 <        itemBoxSizer26->Add(NoSepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1047 <
1048 <        wxStaticLine* itemStaticLine29 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1049 <        itemBoxSizer25->Add(itemStaticLine29, 0, wxGROW|wxALL, 5);
1050 <
1051 <        wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxVERTICAL);
1052 <        itemBoxSizer25->Add(itemBoxSizer30, 0, wxGROW|wxALL, 5);
1053 <
1054 <        SeparatedRadio = new wxRadioButton( OptionsPanel, Separated_RadioButton, _("Separated Level0"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1055 <        SeparatedRadio->SetValue(false);
1056 <        SeparatedRadio->SetName(_T("Separated_RadioButton"));
1057 <        itemBoxSizer30->Add(SeparatedRadio, 0, wxALIGN_LEFT|wxALL, 5);
1058 <
1059 <        CompleteRadio = new wxRadioButton( OptionsPanel, Complete_RadioButton, _("Complete Level0"), wxDefaultPosition, wxDefaultSize, 0 );
1060 <        CompleteRadio->SetValue(false);
1061 <        CompleteRadio->SetName(_T("Complete_RadioButton"));
1062 <        itemBoxSizer30->Add(CompleteRadio, 0, wxALIGN_LEFT|wxALL, 5);
1063 <
1064 <        wxStaticLine* itemStaticLine33 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1065 <        itemBoxSizer25->Add(itemStaticLine33, 0, wxGROW|wxALL, 5);
1066 <
1067 <        wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL);
1068 <        itemBoxSizer25->Add(itemBoxSizer34, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1069 <
1070 <        ReglobalizeButton = new wxButton( OptionsPanel, ReGlobalize_Button, _("Reglobalize"), wxDefaultPosition, wxDefaultSize, 0 );
1071 <        ReglobalizeButton->SetName(_T("Reglobalize_Button"));
1072 <        itemBoxSizer34->Add(ReglobalizeButton, 0, wxGROW|wxALL, 5);
951 >    wxMenuBar* menuBar = new wxMenuBar;
952 >    wxMenu* itemMenu37 = new wxMenu;
953 >    {
954 >        wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_LOAD, _("&Load Configuration..."), wxEmptyString, wxITEM_NORMAL);
955 >        wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("fileopen.xpm")));
956 >        menuItem->SetBitmap(bitmap);
957 >        itemMenu37->Append(menuItem);
958 >    }
959 >    {
960 >        wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_SAVE, _("&Save Configuration..."), wxEmptyString, wxITEM_NORMAL);
961 >        wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("filesaveas.xpm")));
962 >        menuItem->SetBitmap(bitmap);
963 >        itemMenu37->Append(menuItem);
964 >    }
965 >    itemMenu37->AppendSeparator();
966 >    {
967 >        wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_EXIT, _("Exit"), wxEmptyString, wxITEM_NORMAL);
968 >        wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("quit.xpm")));
969 >        menuItem->SetBitmap(bitmap);
970 >        itemMenu37->Append(menuItem);
971 >    }
972 >    menuBar->Append(itemMenu37, _("&File"));
973 >    wxMenu* itemMenu42 = new wxMenu;
974 >    itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK);
975 >    menuBar->Append(itemMenu42, _("Options"));
976 >    wxMenu* itemMenu44 = new wxMenu;
977 >    itemMenu44->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
978 >    menuBar->Append(itemMenu44, _("Help"));
979 >    itemFrame1->SetMenuBar(menuBar);
980 >
981 >    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
982 >    itemFrame1->SetSizer(itemBoxSizer2);
983 >
984 >    MainSplitter = new wxSplitterWindow( itemFrame1, ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(100, 100), wxSP_LIVE_UPDATE|wxNO_BORDER );
985 >    MainSplitter->SetMinimumPaneSize(1);
986 >    MainSplitter->SetName(_T("MainSplitter"));
987 >
988 >    wxPanel* itemPanel4 = new wxPanel( MainSplitter, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
989 >    wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
990 >    itemPanel4->SetSizer(itemBoxSizer5);
991 >
992 >    wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
993 >    itemBoxSizer5->Add(itemBoxSizer6, 0, wxGROW|wxALL, 0);
994 >    SelectAll = new wxCheckBox( itemPanel4, SelectAll_Checkbox, _("Select All/None"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE );
995 >    SelectAll->SetValue(false);
996 >    SelectAll->SetName(_T("SelectAll_Checkbox"));
997 >    itemBoxSizer6->Add(SelectAll, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
998 >
999 >    RefreshButton = new wxBitmapButton( itemPanel4, Refresh_Button, itemFrame1->GetBitmapResource(wxT("undo.xpm")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
1000 >    RefreshButton->SetName(_T("RefreshButton"));
1001 >    itemBoxSizer6->Add(RefreshButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
1002 >
1003 >    wxArrayString Mods_CheckboxListStrings;
1004 >    Mods_CheckboxList = new wxCheckListBox( itemPanel4, Mods_CheckboxList1, wxDefaultPosition, wxDefaultSize, Mods_CheckboxListStrings, wxLB_HSCROLL );
1005 >    Mods_CheckboxList->SetName(_T("Mods_CheckboxList"));
1006 >    itemBoxSizer5->Add(Mods_CheckboxList, 1, wxGROW|wxALL, 0);
1007 >
1008 >    wxPanel* itemPanel10 = new wxPanel( MainSplitter, DescriptionHolder_Panel, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1009 >    itemPanel10->SetName(_T("DescriptionHolder_Panel"));
1010 >    wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL);
1011 >    itemPanel10->SetSizer(itemBoxSizer11);
1012 >
1013 >    wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
1014 >    itemBoxSizer11->Add(itemBoxSizer12, 0, wxGROW|wxALL, 0);
1015 >    wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL);
1016 >    itemBoxSizer12->Add(itemBoxSizer13, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
1017 >    titleText = new wxTextCtrl( itemPanel10, Title_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
1018 >    titleText->SetName(_T("Title_Text"));
1019 >    titleText->SetBackgroundColour(wxColour(240, 240, 240));
1020 >    itemBoxSizer13->Add(titleText, 1, wxGROW|wxLEFT, 5);
1021 >
1022 >    wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxVERTICAL);
1023 >    itemBoxSizer12->Add(itemBoxSizer15, 1, wxGROW|wxALL, 0);
1024 >    creatorText = new wxTextCtrl( itemPanel10, Author_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_RIGHT );
1025 >    creatorText->SetName(_T("Author_Text"));
1026 >    creatorText->SetBackgroundColour(wxColour(240, 240, 240));
1027 >    itemBoxSizer15->Add(creatorText, 1, wxGROW|wxRIGHT, 5);
1028 >
1029 >    wxStaticLine* itemStaticLine17 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
1030 >    itemStaticLine17->Show(false);
1031 >    itemBoxSizer11->Add(itemStaticLine17, 0, wxGROW|wxALL, 5);
1032 >
1033 >    descriptionText = new wxTextCtrl( itemPanel10, Description_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH|wxTE_RICH2 );
1034 >    descriptionText->SetName(_T("DescriptionName"));
1035 >    descriptionText->SetBackgroundColour(wxColour(240, 240, 240));
1036 >    itemBoxSizer11->Add(descriptionText, 1, wxGROW|wxLEFT|wxRIGHT, 5);
1037 >
1038 >    MainSplitter->SplitVertically(itemPanel4, itemPanel10, 200);
1039 >    itemBoxSizer2->Add(MainSplitter, 1, wxGROW|wxALL, 0);
1040 >
1041 >    StatusArea = new wxStatusBar( itemFrame1, ID_STATUSBAR, 0 );
1042 >    StatusArea->SetName(_T("StatusArea"));
1043 >    StatusArea->SetFieldsCount(1);
1044 >    StatusArea->SetStatusText(_("AE Installer v1.0"), 0);
1045 >    itemBoxSizer2->Add(StatusArea, 0, wxGROW|wxALL, 0);
1046 >
1047 >    wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL);
1048 >    itemBoxSizer2->Add(itemBoxSizer20, 0, wxGROW|wxALL, 0);
1049 >
1050 >    ProgressBar = new wxGauge( itemFrame1, ProgressBar_Gauge, 1000, wxDefaultPosition, wxDefaultSize, wxGA_SMOOTH );
1051 >    ProgressBar->SetValue(0);
1052 >    itemBoxSizer20->Add(ProgressBar, 1, wxGROW|wxALL, 0);
1053 >
1054 >    InstallButton = new wxButton( itemFrame1, Install_Button, _("Install!"), wxDefaultPosition, wxDefaultSize, 0 );
1055 >    itemBoxSizer20->Add(InstallButton, 0, wxGROW|wxALL, 0);
1056 >
1057 >    wxBoxSizer* itemBoxSizer23 = new wxBoxSizer(wxVERTICAL);
1058 >    itemBoxSizer2->Add(itemBoxSizer23, 0, wxGROW|wxALL, 0);
1059 >
1060 >    OptionsPanel = new wxPanel( itemFrame1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1061 >    itemBoxSizer2->Add(OptionsPanel, 0, wxGROW, 0);
1062 >
1063 >    wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL);
1064 >    OptionsPanel->SetSizer(itemBoxSizer25);
1065 >
1066 >    wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxVERTICAL);
1067 >    itemBoxSizer25->Add(itemBoxSizer26, 0, wxGROW|wxALL, 5);
1068 >
1069 >    SepRadio = new wxRadioButton( OptionsPanel, Sep_RadioButton, _("Sep"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1070 >    SepRadio->SetValue(false);
1071 >    if (MainWindow::ShowToolTips())
1072 >        SepRadio->SetToolTip(_("For PC Demo and Mac"));
1073 >    itemBoxSizer26->Add(SepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1074 >
1075 >    NoSepRadio = new wxRadioButton( OptionsPanel, NoSep_RadioButton, _("NoSep"), wxDefaultPosition, wxDefaultSize, 0 );
1076 >    NoSepRadio->SetValue(false);
1077 >    if (MainWindow::ShowToolTips())
1078 >        NoSepRadio->SetToolTip(_("For PC Retail"));
1079 >    itemBoxSizer26->Add(NoSepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1080 >
1081 >    wxStaticLine* itemStaticLine29 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1082 >    itemBoxSizer25->Add(itemStaticLine29, 0, wxGROW|wxALL, 5);
1083 >
1084 >    wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxVERTICAL);
1085 >    itemBoxSizer25->Add(itemBoxSizer30, 0, wxGROW|wxALL, 5);
1086 >
1087 >    SeperatedRadio = new wxRadioButton( OptionsPanel, Seperated_RadioButton, _("Separated Level0"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1088 >    SeperatedRadio->SetValue(false);
1089 >    SeperatedRadio->SetName(_T("Seperated_RadioButton"));
1090 >    itemBoxSizer30->Add(SeperatedRadio, 0, wxALIGN_LEFT|wxALL, 5);
1091 >
1092 >    CompleteRadio = new wxRadioButton( OptionsPanel, Complete_RadioButton, _("Complete Level0"), wxDefaultPosition, wxDefaultSize, 0 );
1093 >    CompleteRadio->SetValue(false);
1094 >    CompleteRadio->SetName(_T("Complete_RadioButton"));
1095 >    itemBoxSizer30->Add(CompleteRadio, 0, wxALIGN_LEFT|wxALL, 5);
1096 >
1097 >    wxStaticLine* itemStaticLine33 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1098 >    itemBoxSizer25->Add(itemStaticLine33, 0, wxGROW|wxALL, 5);
1099 >
1100 >    wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL);
1101 >    itemBoxSizer25->Add(itemBoxSizer34, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1102 >
1103 >    ReglobalizeButton = new wxButton( OptionsPanel, ReGlobalize_Button, _("Reglobalize"), wxDefaultPosition, wxDefaultSize, 0 );
1104 >    ReglobalizeButton->SetName(_T("Reglobalize_Button"));
1105 >    itemBoxSizer34->Add(ReglobalizeButton, 0, wxGROW|wxALL, 5);
1106  
1107 <        // Connect events and objects
1108 <        Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this);
1107 >    // Connect events and objects
1108 >    Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this);
1109          ////@end MainWindow content construction
1110  
1111          if ( exists( "../../GameDataFolder/level0_Final.sep" ) ) {
1112 <                static_cast<string>("-import:sep");
1112 >                strImportOption = "-import:sep";
1113                  splitInstances = NOT_SPLIT;
1114          }
1115          else {
1116 <                static_cast<string>("-import:nosep");
1116 >                strImportOption = "-import:nosep";
1117                  splitInstances = SPLIT;
1118          }
1119  
# Line 1113 | Line 1128 | void MainWindow::CreateControls()
1128          TheInstallButton = InstallButton;
1129          TheProgressBar = ProgressBar;
1130          OptionsPanel->Hide();
1131 <        if(splitInstances == SPLIT) SeparatedRadio->SetValue(true);
1131 >        if(splitInstances == SPLIT) SeperatedRadio->SetValue(true);
1132          else CompleteRadio->SetValue(true);
1133  
1134  
# Line 1185 | Line 1200 | wxBitmap MainWindow::GetBitmapResource(
1200   {
1201          // Bitmap retrieval
1202          ////@begin MainWindow bitmap retrieval
1203 <        wxUnusedVar(name);
1204 <        if (name == _T("redo.xpm"))
1205 <        {
1206 <                wxBitmap bitmap(redo_xpm);
1207 <                return bitmap;
1208 <        }
1209 <        else if (name == _T("fileopen.xpm"))
1210 <        {
1211 <                wxBitmap bitmap( fileopen_xpm);
1212 <                return bitmap;
1213 <        }
1214 <        else if (name == _T("filesaveas.xpm"))
1215 <        {
1216 <                wxBitmap bitmap( filesaveas_xpm);
1217 <                return bitmap;
1218 <        }
1219 <        else if (name == _T("quit.xpm"))
1220 <        {
1221 <                wxBitmap bitmap( quit_xpm);
1222 <                return bitmap;
1223 <        }
1224 <        return wxNullBitmap;
1203 >    wxUnusedVar(name);
1204 >    if (name == _T("undo.xpm"))
1205 >    {
1206 >        wxBitmap bitmap( undo_xpm);
1207 >        return bitmap;
1208 >    }
1209 >    else if (name == _T("fileopen.xpm"))
1210 >    {
1211 >        wxBitmap bitmap( fileopen_xpm);
1212 >        return bitmap;
1213 >    }
1214 >    else if (name == _T("filesaveas.xpm"))
1215 >    {
1216 >        wxBitmap bitmap( filesaveas_xpm);
1217 >        return bitmap;
1218 >    }
1219 >    else if (name == _T("quit.xpm"))
1220 >    {
1221 >        wxBitmap bitmap( quit_xpm);
1222 >        return bitmap;
1223 >    }
1224 >    return wxNullBitmap;
1225          ////@end MainWindow bitmap retrieval
1226   }
1227  
# Line 1219 | Line 1234 | wxIcon MainWindow::GetIconResource( cons
1234  
1235          // Icon retrieval
1236          ////@begin MainWindow icon retrieval
1237 <        wxUnusedVar(name);
1238 <        if (name == _T("oni_special.ico"))
1239 <        {
1240 <                //      wxIcon icon(_T("oni_special.ico"), wxBITMAP_TYPE_ICO);
1241 <                //      return icon;
1242 <        }
1243 <        return wxNullIcon;
1237 >    wxUnusedVar(name);
1238 >    if (name == _T("aelogosmall.png"))
1239 >    {
1240 >        wxIcon icon(aelogosmall_xpm);
1241 >        return icon;
1242 >    }
1243 >    return wxNullIcon;
1244          ////@end MainWindow icon retrieval
1245   }
1246  
# Line 1273 | Line 1288 | void MainWindow::OnModsCheckboxList1Togg
1288  
1289   void MainWindow::OnOptionsClick( wxCommandEvent& event )
1290   {
1276
1277
1278
1279
1291          if (!event.GetInt() ) {
1292                  OptionsPanel->Hide();
1293 +                
1294                  this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight());}
1295          else {
1296   //              Uncomment this when we release, it gets annoying if you are testing globalization a lot ;)
1297 <                wxMessageDialog* YesNoDialog = new wxMessageDialog(this,                        "WARNING: These options are for advanced users only, use with caution.", "AE Installer Alert",  wxOK | wxICON_EXCLAMATION       , wxDefaultPosition);
1297 >                wxMessageDialog* YesNoDialog = new wxMessageDialog(this,                        "WARNING: These options are for advanced users only, use with caution.",
1298 >                                                                                                                   "AE Installer Alert",  wxOK | wxICON_EXCLAMATION     , wxDefaultPosition);
1299                  YesNoDialog->ShowModal();
1300                  OptionsPanel->Show();
1301 <                this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()+OptionsPanel->GetRect().GetHeight());
1301 >                this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()+OptionsPanel->GetRect().GetHeight()+1);
1302 >                this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()-1);
1303          }
1290        
1304   }
1305  
1306  
# Line 1373 | Line 1386 | void setProgressBar( int i ) {
1386   void MainWindow::OnStatusbarUpdate( wxUpdateUIEvent& event )
1387   {
1388          ////@begin wxEVT_UPDATE_UI event handler for ID_STATUSBAR in MainWindow.
1389 <        // Before editing this code, remove the block markers.
1390 <        event.Skip();
1389 >    // Before editing this code, remove the block markers.
1390 >    event.Skip();
1391          ////@end wxEVT_UPDATE_UI event handler for ID_STATUSBAR in MainWindow.
1392   }
1393  
# Line 1386 | Line 1399 | void MainWindow::OnStatusbarUpdate( wxUp
1399   void MainWindow::OnAboutClick( wxCommandEvent& event )
1400   {
1401          ////@begin wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow.
1402 <        // Before editing this code, remove the block markers.
1403 <        About* window = new About(this);
1404 <        int returnValue = window->ShowModal();
1405 <        window->Destroy();
1402 >    // Before editing this code, remove the block markers.
1403 >    About* window = new About(this);
1404 >    int returnValue = window->ShowModal();
1405 >    window->Destroy();
1406          ////@end wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow.
1407   }
1408  
# Line 1418 | Line 1431 | void MainWindow::OnSepRadioButtonSelecte
1431   * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton
1432   */
1433  
1421 void MainWindow::OnSeparatedRadioButtonSelected( wxCommandEvent& event )
1422 {
1423        splitInstances = SPLIT;
1424
1425 }
1426
1427
1434   /*
1435   * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Complete_RadioButton
1436   */
# Line 1548 | Line 1554 | void MainWindow::OnSaveClick( wxCommandE
1554  
1555   void MainWindow::OnReGlobalizeButtonClick( wxCommandEvent& event )
1556   {
1557 <        wxMessageDialog* YesNoDialog = new wxMessageDialog(this,                        "WARNING: This will DELETE the Edition's GameDataFolder and reglobalize all of your data. \n Are you SURE you want to do this? ", "AE Installer Alert",  wxYES_NO | wxICON_EXCLAMATION  , wxDefaultPosition);
1557 >        wxMessageDialog* YesNoDialog = new wxMessageDialog(this,                        "WARNING: This will DELETE the Edition's GameDataFolder and recreate it from the vanilla Oni game data. \n Are you SURE you want to do this? ", "AE Installer Alert",  wxYES_NO | wxICON_EXCLAMATION    , wxDefaultPosition);
1558  
1559          if (YesNoDialog->ShowModal() == wxID_NO) { //if the user said no...
1560  
# Line 1567 | Line 1573 | void MainWindow::OnReGlobalizeButtonClic
1573                  // Tg.create_thread( &globalizeData(), this );
1574   #else
1575                  globalizeData();
1570                setProgressBar(1000);
1571                setStatusArea("Done!");
1576   #endif
1577                  
1578                  this->InstallButton->Enable();
# Line 1588 | Line 1592 | event.Skip();
1592   ////@end wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton in MainWindow.
1593   }*/
1594  
1595 +
1596 + /*
1597 + * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Seperated_RadioButton
1598 + */
1599 +
1600 + void MainWindow::OnSeperatedRadioButtonSelected( wxCommandEvent& event )
1601 + {
1602 + splitInstances = SPLIT;
1603 + }
1604 +

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)