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 373 by iritscen, Tue Jun 23 21:41:34 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: - Load credits from text resource file
7 //                - Version number in credits should be universalized
7   //                - Institute lots of checks into file-handling
8   //                - Clear mod info fields when mod is de-selected
9  
# Line 31 | 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 288 | 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.log").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 325 | Line 327 | int globalizeData(void)
327                  */
328                  create_directory((path)"../GameDataFolder/IGMD");
329                  copy((path)"packages/VanillaBSL/IGMD", (path)"../GameDataFolder");
330 <                setProgressBar( 1000 );
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 619 | 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()
623 <                                                + ".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 781 | 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 810 | 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 869 | 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 );
873 <
874 <        CreateControls();
875 <        SetIcon(GetIconResource(wxT("oni_special.ico")));
876 <        Centre();
877 <
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 899 | 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 929 | 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)
949 >    MainWindow* itemFrame1 = this;
950  
951 <        MainWindow* itemFrame1 = this;
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 <        wxMenuBar* menuBar = new wxMenuBar;
1108 <        wxMenu* itemMenu37 = new wxMenu;
938 <        {
939 <                wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_LOAD, _("&Load Configuration..."), wxEmptyString, wxITEM_NORMAL);
940 <                wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("fileopen.xpm")));
941 <                menuItem->SetBitmap(bitmap);
942 <                itemMenu37->Append(menuItem);
943 <        }
944 <        {
945 <                wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_SAVE, _("&Save Configuration..."), wxEmptyString, wxITEM_NORMAL);
946 <                wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("filesaveas.xpm")));
947 <                menuItem->SetBitmap(bitmap);
948 <                itemMenu37->Append(menuItem);
949 <        }
950 <        itemMenu37->AppendSeparator();
951 <        {
952 <                wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_EXIT, _("Exit"), wxEmptyString, wxITEM_NORMAL);
953 <                wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("quit.xpm")));
954 <                menuItem->SetBitmap(bitmap);
955 <                itemMenu37->Append(menuItem);
956 <        }
957 <        menuBar->Append(itemMenu37, _("&File"));
958 <        wxMenu* itemMenu42 = new wxMenu;
959 <        itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK);
960 <        menuBar->Append(itemMenu42, _("Options"));
961 <        wxMenu* itemMenu44 = new wxMenu;
962 <        itemMenu44->Append(wxID_HELP, _("Help"), wxEmptyString, wxITEM_NORMAL);
963 <        itemMenu44->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
964 <        menuBar->Append(itemMenu44, _("Help"));
965 <        itemFrame1->SetMenuBar(menuBar);
966 <        
967 <        wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
968 <        itemFrame1->SetSizer(itemBoxSizer2);
969 <
970 <        MainSplitter = new wxSplitterWindow( itemFrame1, ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(100, 100), wxSP_LIVE_UPDATE|wxNO_BORDER );
971 <        MainSplitter->SetMinimumPaneSize(150);
972 <        MainSplitter->SetName(_T("MainSplitter"));
973 <
974 <        wxPanel* itemPanel4 = new wxPanel( MainSplitter, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
975 <        wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
976 <        itemPanel4->SetSizer(itemBoxSizer5);
977 <
978 <        wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
979 <        itemBoxSizer5->Add(itemBoxSizer6, 0, wxGROW|wxALL, 0);
980 <        SelectAll = new wxCheckBox( itemPanel4, SelectAll_Checkbox, _("Select All/None"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE );
981 <        SelectAll->SetValue(false);
982 <        SelectAll->SetName(_T("SelectAll_Checkbox"));
983 <        itemBoxSizer6->Add(SelectAll, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
984 <
985 <        RefreshButton = new wxBitmapButton( itemPanel4, Refresh_Button, itemFrame1->GetBitmapResource(wxT("redo.xpm")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
986 <        RefreshButton->SetName(_T("RefreshButton"));
987 <        itemBoxSizer6->Add(RefreshButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
988 <
989 <        wxArrayString Mods_CheckboxListStrings;
990 <        Mods_CheckboxList = new wxCheckListBox( itemPanel4, Mods_CheckboxList1, wxDefaultPosition, wxDefaultSize, Mods_CheckboxListStrings, wxLB_HSCROLL );
991 <        Mods_CheckboxList->SetName(_T("Mods_CheckboxList"));
992 <        itemBoxSizer5->Add(Mods_CheckboxList, 1, wxGROW|wxALL, 0);
993 <
994 <        wxPanel* itemPanel10 = new wxPanel( MainSplitter, DescriptionHolder_Panel, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
995 <        itemPanel10->SetName(_T("DescriptionHolder_Panel"));
996 <        wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL);
997 <        itemPanel10->SetSizer(itemBoxSizer11);
998 <
999 <        wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
1000 <        itemBoxSizer11->Add(itemBoxSizer12, 0, wxGROW|wxALL, 0);
1001 <        wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL);
1002 <        itemBoxSizer12->Add(itemBoxSizer13, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
1003 <        titleText = new wxTextCtrl( itemPanel10, Title_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
1004 <        titleText->SetName(_T("Title_Text"));
1005 <        titleText->SetBackgroundColour(wxColour(240, 240, 240));
1006 <        itemBoxSizer13->Add(titleText, 1, wxGROW|wxLEFT, 5);
1007 <
1008 <        wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxVERTICAL);
1009 <        itemBoxSizer12->Add(itemBoxSizer15, 1, wxGROW|wxALL, 0);
1010 <        creatorText = new wxTextCtrl( itemPanel10, Author_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_RIGHT );
1011 <        creatorText->SetName(_T("Author_Text"));
1012 <        creatorText->SetBackgroundColour(wxColour(240, 240, 240));
1013 <        itemBoxSizer15->Add(creatorText, 1, wxGROW|wxRIGHT, 5);
1014 <
1015 <        wxStaticLine* itemStaticLine17 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
1016 <        itemStaticLine17->Show(false);
1017 <        itemBoxSizer11->Add(itemStaticLine17, 0, wxGROW|wxALL, 5);
1018 <
1019 <        descriptionText = new wxTextCtrl( itemPanel10, Description_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH|wxTE_AUTO_URL );
1020 <        descriptionText->SetName(_T("DescriptionName"));
1021 <        descriptionText->SetBackgroundColour(wxColour(240, 240, 240));
1022 <        itemBoxSizer11->Add(descriptionText, 1, wxGROW|wxLEFT|wxRIGHT, 5);
1023 <
1024 <        MainSplitter->SplitVertically(itemPanel4, itemPanel10, 150);
1025 <        itemBoxSizer2->Add(MainSplitter, 1, wxGROW|wxALL, 0);
1026 <
1027 <        StatusArea = new wxStatusBar( itemFrame1, ID_STATUSBAR, 0 );
1028 <        StatusArea->SetName(_T("StatusArea"));
1029 <        StatusArea->SetFieldsCount(1);
1030 <        StatusArea->SetStatusText(_("Status Area"), 0);
1031 <        itemBoxSizer2->Add(StatusArea, 0, wxGROW|wxALL, 0);
1032 <
1033 <        wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL);
1034 <        itemBoxSizer2->Add(itemBoxSizer20, 0, wxGROW|wxALL, 0);
1035 <
1036 <        ProgressBar = new wxGauge( itemFrame1, ProgressBar_Gauge, 1000, wxDefaultPosition, wxSize(-1, 30), wxGA_SMOOTH );
1037 <        ProgressBar->SetValue(0);
1038 <        itemBoxSizer20->Add(ProgressBar, 1, wxGROW|wxALL, 0);
1039 <
1040 <        InstallButton = new wxButton( itemFrame1, Install_Button, _("Install!"), wxDefaultPosition, wxSize(-1, 30), 0 );
1041 <        itemBoxSizer20->Add(InstallButton, 0, wxGROW|wxALL, 0);
1042 <
1043 <        wxBoxSizer* itemBoxSizer23 = new wxBoxSizer(wxVERTICAL);
1044 <        itemBoxSizer2->Add(itemBoxSizer23, 0, wxGROW|wxALL, 0);
1045 <
1046 <        OptionsPanel = new wxPanel( itemFrame1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1047 <        itemBoxSizer2->Add(OptionsPanel, 0, wxGROW, 0);
1048 <
1049 <        wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL);
1050 <        OptionsPanel->SetSizer(itemBoxSizer25);
1051 <
1052 <        wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxVERTICAL);
1053 <        itemBoxSizer25->Add(itemBoxSizer26, 0, wxGROW|wxALL, 5);
1054 <
1055 <        SepRadio = new wxRadioButton( OptionsPanel, Sep_RadioButton, _("Sep"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1056 <        SepRadio->SetValue(false);
1057 <        if (MainWindow::ShowToolTips())
1058 <                SepRadio->SetToolTip(_("For PC Demo and Mac"));
1059 <        itemBoxSizer26->Add(SepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1060 <
1061 <        NoSepRadio = new wxRadioButton( OptionsPanel, NoSep_RadioButton, _("NoSep"), wxDefaultPosition, wxDefaultSize, 0 );
1062 <        NoSepRadio->SetValue(false);
1063 <        if (MainWindow::ShowToolTips())
1064 <                NoSepRadio->SetToolTip(_("For PC Retail"));
1065 <        itemBoxSizer26->Add(NoSepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1066 <
1067 <        wxStaticLine* itemStaticLine29 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1068 <        itemBoxSizer25->Add(itemStaticLine29, 0, wxGROW|wxALL, 5);
1069 <
1070 <        wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxVERTICAL);
1071 <        itemBoxSizer25->Add(itemBoxSizer30, 0, wxGROW|wxALL, 5);
1072 <
1073 <        SeparatedRadio = new wxRadioButton( OptionsPanel, Separated_RadioButton, _("Separated Level0"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1074 <        SeparatedRadio->SetValue(false);
1075 <        SeparatedRadio->SetName(_T("Separated_RadioButton"));
1076 <        itemBoxSizer30->Add(SeparatedRadio, 0, wxALIGN_LEFT|wxALL, 5);
1077 <
1078 <        CompleteRadio = new wxRadioButton( OptionsPanel, Complete_RadioButton, _("Complete Level0"), wxDefaultPosition, wxDefaultSize, 0 );
1079 <        CompleteRadio->SetValue(false);
1080 <        CompleteRadio->SetName(_T("Complete_RadioButton"));
1081 <        itemBoxSizer30->Add(CompleteRadio, 0, wxALIGN_LEFT|wxALL, 5);
1082 <
1083 <        wxStaticLine* itemStaticLine33 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1084 <        itemBoxSizer25->Add(itemStaticLine33, 0, wxGROW|wxALL, 5);
1085 <
1086 <        wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL);
1087 <        itemBoxSizer25->Add(itemBoxSizer34, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1088 <
1089 <        ReglobalizeButton = new wxButton( OptionsPanel, ReGlobalize_Button, _("Reglobalize"), wxDefaultPosition, wxDefaultSize, 0 );
1090 <        ReglobalizeButton->SetName(_T("Reglobalize_Button"));
1091 <        itemBoxSizer34->Add(ReglobalizeButton, 0, wxGROW|wxALL, 5);
1092 <
1093 <        // Connect events and objects
1094 <        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 1114 | 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 1186 | 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 1220 | 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 1276 | Line 1290 | void MainWindow::OnOptionsClick( wxComma
1290   {
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 ;)
# Line 1283 | Line 1298 | void MainWindow::OnOptionsClick( wxComma
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()+2);
1301 >                this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()+OptionsPanel->GetRect().GetHeight()+1);
1302 >                this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()-1);
1303          }
1304   }
1305  
# Line 1370 | 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 1383 | 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 1415 | Line 1431 | void MainWindow::OnSepRadioButtonSelecte
1431   * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton
1432   */
1433  
1418 void MainWindow::OnSeparatedRadioButtonSelected( wxCommandEvent& event )
1419 {
1420        splitInstances = SPLIT;
1421
1422 }
1423
1424
1434   /*
1435   * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Complete_RadioButton
1436   */
# Line 1545 | 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 1583 | 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)