| Line 1... |
Line 1... |
| 1 |
#pragma once
|
1 |
#pragma once
|
| - |
|
2 |
|
| - |
|
3 |
#include "GameDirectories.h"
|
| 2 |
|
4 |
|
| 3 |
using namespace System;
|
5 |
using namespace System;
|
| 4 |
using namespace System::ComponentModel;
|
6 |
using namespace System::ComponentModel;
|
| 5 |
using namespace System::Collections;
|
7 |
using namespace System::Collections;
|
| 6 |
using namespace System::Windows::Forms;
|
8 |
using namespace System::Windows::Forms;
|
| 7 |
using namespace System::Data;
|
9 |
using namespace System::Data;
|
| 8 |
using namespace System::Drawing;
|
10 |
using namespace System::Drawing;
|
| 9 |
|
- |
|
| 10 |
typedef struct SGameDir {
|
- |
|
| 11 |
bool bLoad;
|
- |
|
| 12 |
Utils::String dir;
|
- |
|
| 13 |
Utils::String name;
|
- |
|
| 14 |
int iGame;
|
- |
|
| 15 |
CVirtualFileSystem *pVfs;
|
- |
|
| 16 |
} SGameDir;
|
- |
|
| 17 |
|
11 |
|
| 18 |
namespace Creator {
|
12 |
namespace Creator {
|
| 19 |
typedef struct SSettings {
|
13 |
typedef struct SSettings {
|
| 20 |
bool bGenerateUpdate;
|
14 |
bool bGenerateUpdate;
|
| 21 |
} SSettings;
|
15 |
} SSettings;
|
| Line 30... |
Line 24... |
| 30 |
/// resources associated with this form.
|
24 |
/// resources associated with this form.
|
| 31 |
/// </summary>
|
25 |
/// </summary>
|
| 32 |
public ref class Options : public System::Windows::Forms::Form
|
26 |
public ref class Options : public System::Windows::Forms::Form
|
| 33 |
{
|
27 |
{
|
| 34 |
public:
|
28 |
public:
|
| 35 |
Options(ImageList ^gameImages, CLinkList<SGameDir> *gameDir, CPackages *p, SSettings *set)
|
29 |
Options(ImageList ^gameImages, CGameDirectories *gameDir, CPackages *p, SSettings *set)
|
| 36 |
{
|
30 |
{
|
| 37 |
InitializeComponent();
|
31 |
InitializeComponent();
|
| 38 |
|
32 |
|
| 39 |
m_bLoadText = false;
|
33 |
m_bLoadText = false;
|
| 40 |
m_pGameImages = gameImages;
|
34 |
m_pGameImages = gameImages;
|
| 41 |
m_pGameDir = gameDir;
|
35 |
_pGameDir = gameDir;
|
| 42 |
m_pP = p;
|
36 |
m_pP = p;
|
| 43 |
|
37 |
|
| 44 |
|
38 |
|
| 45 |
this->Init();
|
39 |
this->Init();
|
| 46 |
|
40 |
|
| 47 |
this->ListGameDir->LargeImageList = this->m_pGameImages;
|
41 |
this->ListGameDir->LargeImageList = this->m_pGameImages;
|
| 48 |
this->ListGameDir->SmallImageList = this->m_pGameImages;
|
42 |
this->ListGameDir->SmallImageList = this->m_pGameImages;
|
| 49 |
|
43 |
|
| Line 83... |
Line 77... |
| 83 |
}
|
77 |
}
|
| 84 |
}
|
78 |
}
|
| 85 |
|
79 |
|
| 86 |
delete lines;
|
80 |
delete lines;
|
| 87 |
}
|
81 |
}
|
| 88 |
}
|
82 |
}
|
| 89 |
}
|
83 |
}
|
| 90 |
|
84 |
|
| 91 |
void UpdateGameDirs()
|
85 |
void UpdateGameDirs()
|
| 92 |
{
|
86 |
{
|
| 93 |
this->ListGameDir->Items->Clear();
|
87 |
this->ListGameDir->Items->Clear();
|
| 94 |
for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() )
|
88 |
for ( Utils::String dir = _pGameDir->first(); !dir.empty(); dir = _pGameDir->next() ) {
|
| 95 |
{
|
- |
|
| 96 |
ListViewItem ^item = gcnew ListViewItem(_US(gd->dir));
|
89 |
ListViewItem ^item = gcnew ListViewItem(_US(dir));
|
| 97 |
item->ImageIndex = gd->iGame;
|
90 |
item->ImageIndex = _pGameDir->currentGame();
|
| 98 |
item->SubItems->Add(_US(gd->name));
|
91 |
item->SubItems->Add(_US(_pGameDir->currentName()));
|
| 99 |
if ( gd->bLoad )
|
92 |
if ( _pGameDir->currentLoad() )
|
| 100 |
item->SubItems->Add("Yes");
|
93 |
item->SubItems->Add("Yes");
|
| 101 |
else
|
94 |
else
|
| 102 |
item->SubItems->Add("No");
|
95 |
item->SubItems->Add("No");
|
| 103 |
this->ListGameDir->Items->Add(item);
|
96 |
this->ListGameDir->Items->Add(item);
|
| 104 |
}
|
97 |
}
|
| 105 |
|
98 |
|
| 106 |
this->ListGameDir->AutoResizeColumns(ColumnHeaderAutoResizeStyle::HeaderSize);
|
99 |
this->ListGameDir->AutoResizeColumns(ColumnHeaderAutoResizeStyle::HeaderSize);
|
| 107 |
this->columnHeader3->Width = 100;
|
100 |
this->columnHeader3->Width = 100;
|
| 108 |
this->columnHeader1->Width += 50;
|
101 |
this->columnHeader1->Width += 50;
|
| 109 |
|
102 |
|
| 110 |
this->ButClear->Enabled = (this->ListGameDir->Items->Count) ? true : false;
|
103 |
this->ButClear->Enabled = (this->ListGameDir->Items->Count) ? true : false;
|
| Line 112... |
Line 105... |
| 112 |
}
|
105 |
}
|
| 113 |
|
106 |
|
| 114 |
void AddDir(String ^sDir, bool ask, bool load)
|
107 |
void AddDir(String ^sDir, bool ask, bool load)
|
| 115 |
{
|
108 |
{
|
| 116 |
Utils::String dir = _S(sDir);
|
109 |
Utils::String dir = _S(sDir);
|
| 117 |
CyString exe;
|
- |
|
| 118 |
|
110 |
|
| 119 |
CyString game = m_pP->GetGameName(dir);
|
111 |
Utils::String game = m_pP->GetGameName(dir).ToString();
|
| 120 |
int iGame = m_pP->GetGameExe()->GetGameType(dir);
|
112 |
int iGame = m_pP->GetGameExe()->GetGameType(dir);
|
| 121 |
|
113 |
|
| 122 |
dir = m_pP->GetGameExe()->GetProperDir(dir);
|
114 |
dir = m_pP->GetGameExe()->GetProperDir(dir);
|
| 123 |
|
115 |
|
| 124 |
dir = dir.findReplace("\\", "/");
|
116 |
dir = dir.findReplace("\\", "/");
|
| 125 |
dir = dir.findReplace("//", "/");
|
117 |
dir = dir.findReplace("//", "/");
|
| 126 |
bool found = false;
|
- |
|
| 127 |
for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() )
|
- |
|
| 128 |
{
|
- |
|
| 129 |
if ( gd->dir == dir )
|
- |
|
| 130 |
{
|
- |
|
| 131 |
found = true;
|
- |
|
| 132 |
break;
|
- |
|
| 133 |
}
|
- |
|
| 134 |
}
|
- |
|
| 135 |
|
- |
|
| 136 |
if ( !found )
|
- |
|
| 137 |
{
|
- |
|
| 138 |
SGameDir *gd = new SGameDir;
|
- |
|
| 139 |
gd->dir = dir;
|
- |
|
| 140 |
gd->name = game.ToString();
|
- |
|
| 141 |
gd->iGame = iGame;
|
- |
|
| 142 |
gd->pVfs = new CVirtualFileSystem();
|
- |
|
| 143 |
gd->pVfs->setLanguage(44);
|
- |
|
| 144 |
gd->pVfs->LoadFilesystem(gd->dir);
|
- |
|
| 145 |
|
- |
|
| 146 |
SGameExe *exe = m_pP->GetGameExe()->GetGame(gd->iGame);
|
- |
|
| 147 |
if ( exe ) gd->pVfs->SetAddon(exe->sAddon);
|
- |
|
| 148 |
|
118 |
|
| 149 |
gd->bLoad = (ask) ? false : load;
|
- |
|
| 150 |
m_pGameDir->push_back(gd);
|
119 |
SGameExe *exe = m_pP->GetGameExe()->GetGame(iGame);
|
| 151 |
|
120 |
|
| 152 |
if ( ask )
|
121 |
if ( !_pGameDir->isDir(dir) && ask ) {
|
| - |
|
122 |
if ( MessageBox::Show(this, "Do you want to load text from this directory\n" + _US(dir), "Load Game Text", MessageBoxButtons::YesNo, MessageBoxIcon::Question) == System::Windows::Forms::DialogResult::Yes )
|
| 153 |
{
|
123 |
{
|
| 154 |
if ( MessageBox::Show(this, "Do you want to load text from this directory\n" + _US(dir), "Load Game Text", MessageBoxButtons::YesNo, MessageBoxIcon::Question) == System::Windows::Forms::DialogResult::Yes )
|
- |
|
| 155 |
{
|
- |
|
| 156 |
gd->bLoad = true;
|
124 |
load = true;
|
| 157 |
m_bLoadText = true;
|
125 |
m_bLoadText = true;
|
| 158 |
}
|
- |
|
| 159 |
}
|
126 |
}
|
| - |
|
127 |
}
|
| - |
|
128 |
|
| - |
|
129 |
if ( _pGameDir->add(dir, game, iGame, (exe) ? exe->sAddon : Utils::String::Null(), load) ) {
|
| 160 |
this->UpdateGameDirs();
|
130 |
this->UpdateGameDirs();
|
| 161 |
}
|
131 |
}
|
| 162 |
}
|
132 |
}
|
| 163 |
|
133 |
|
| 164 |
void AddNewDir()
|
134 |
void AddNewDir()
|
| Line 218... |
Line 188... |
| 218 |
private: System::Windows::Forms::ColumnHeader^ columnHeader2;
|
188 |
private: System::Windows::Forms::ColumnHeader^ columnHeader2;
|
| 219 |
private: System::Windows::Forms::ColumnHeader^ columnHeader3;
|
189 |
private: System::Windows::Forms::ColumnHeader^ columnHeader3;
|
| 220 |
private: System::Windows::Forms::Panel^ panel3;
|
190 |
private: System::Windows::Forms::Panel^ panel3;
|
| 221 |
private: System::Windows::Forms::Button^ button3;
|
191 |
private: System::Windows::Forms::Button^ button3;
|
| 222 |
private: System::Windows::Forms::Button^ button2;
|
192 |
private: System::Windows::Forms::Button^ button2;
|
| 223 |
|
193 |
|
| 224 |
private: System::Windows::Forms::Label^ label1;
|
194 |
private: System::Windows::Forms::Label^ label1;
|
| 225 |
|
195 |
|
| 226 |
private: System::ComponentModel::IContainer^ components;
|
196 |
private: System::ComponentModel::IContainer^ components;
|
| 227 |
|
197 |
|
| 228 |
protected:
|
198 |
protected:
|
| Line 230... |
Line 200... |
| 230 |
private:
|
200 |
private:
|
| 231 |
/// <summary>
|
201 |
/// <summary>
|
| 232 |
/// Required designer variable.
|
202 |
/// Required designer variable.
|
| 233 |
/// </summary>
|
203 |
/// </summary>
|
| 234 |
ImageList ^m_pGameImages;
|
204 |
ImageList ^m_pGameImages;
|
| 235 |
CLinkList<SGameDir> *m_pGameDir;
|
205 |
CGameDirectories *_pGameDir;
|
| 236 |
ListViewItem ^m_pSelectedItem;
|
206 |
ListViewItem ^m_pSelectedItem;
|
| 237 |
CyStringList *m_sDirs;
|
207 |
CyStringList *m_sDirs;
|
| 238 |
|
208 |
|
| 239 |
private: System::Windows::Forms::ToolTip^ toolTip1;
|
209 |
private: System::Windows::Forms::ToolTip^ toolTip1;
|
| 240 |
private: System::Windows::Forms::ContextMenuStrip^ contextMenuStrip1;
|
210 |
private: System::Windows::Forms::ContextMenuStrip^ contextMenuStrip1;
|
| Line 649... |
Line 619... |
| 649 |
#pragma endregion
|
619 |
#pragma endregion
|
| 650 |
private: System::Void listView1_MouseDoubleClick(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) {
|
620 |
private: System::Void listView1_MouseDoubleClick(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) {
|
| 651 |
for ( int i = 0; i < this->ListGameDir->SelectedItems->Count; i++ )
|
621 |
for ( int i = 0; i < this->ListGameDir->SelectedItems->Count; i++ )
|
| 652 |
{
|
622 |
{
|
| 653 |
Utils::String dir = _S(this->ListGameDir->SelectedItems[i]->Text);
|
623 |
Utils::String dir = _S(this->ListGameDir->SelectedItems[i]->Text);
|
| 654 |
for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() )
|
- |
|
| 655 |
{
|
- |
|
| 656 |
if ( gd->dir.Compare(dir) )
|
624 |
if ( _pGameDir->findDir(dir) ) {
|
| 657 |
{
|
- |
|
| 658 |
gd->bLoad = !gd->bLoad;
|
625 |
_pGameDir->setLoad(!_pGameDir->currentLoad());
|
| 659 |
if ( gd->bLoad )
|
626 |
if ( _pGameDir->currentLoad() )
|
| 660 |
this->ListGameDir->SelectedItems[i]->SubItems[2]->Text = "Yes";
|
627 |
this->ListGameDir->SelectedItems[i]->SubItems[2]->Text = "Yes";
|
| 661 |
else
|
628 |
else
|
| 662 |
this->ListGameDir->SelectedItems[i]->SubItems[2]->Text = "No";
|
629 |
this->ListGameDir->SelectedItems[i]->SubItems[2]->Text = "No";
|
| 663 |
break;
|
- |
|
| 664 |
}
|
630 |
}
|
| 665 |
}
|
- |
|
| 666 |
}
|
631 |
}
|
| 667 |
}
|
632 |
}
|
| 668 |
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
|
633 |
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
|
| 669 |
this->contextMenuStrip2->Show(this->button1, this->button1->PointToClient(this->button1->MousePosition));
|
634 |
this->contextMenuStrip2->Show(this->button1, this->button1->PointToClient(this->button1->MousePosition));
|
| 670 |
}
|
635 |
}
|
| 671 |
private: System::Void ListGameDir_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {
|
636 |
private: System::Void ListGameDir_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {
|
| 672 |
this->ButDel->Enabled = (this->ListGameDir->SelectedItems->Count) ? true : false;
|
637 |
this->ButDel->Enabled = (this->ListGameDir->SelectedItems->Count) ? true : false;
|
| 673 |
}
|
638 |
}
|
| 674 |
private: System::Void ButClear_Click(System::Object^ sender, System::EventArgs^ e) {
|
639 |
private: System::Void ButClear_Click(System::Object^ sender, System::EventArgs^ e) {
|
| 675 |
m_pGameDir->MemoryClear();
|
640 |
_pGameDir->clear();
|
| 676 |
this->UpdateGameDirs();
|
641 |
this->UpdateGameDirs();
|
| 677 |
}
|
642 |
}
|
| 678 |
private: System::Void ButDel_Click(System::Object^ sender, System::EventArgs^ e) {
|
643 |
private: System::Void ButDel_Click(System::Object^ sender, System::EventArgs^ e) {
|
| 679 |
for ( int i = 0; i < this->ListGameDir->SelectedItems->Count; i++ )
|
644 |
for ( int i = 0; i < this->ListGameDir->SelectedItems->Count; i++ )
|
| 680 |
{
|
645 |
{
|
| 681 |
Utils::String dir = _S(this->ListGameDir->SelectedItems[i]->Text);
|
646 |
Utils::String dir = _S(this->ListGameDir->SelectedItems[i]->Text);
|
| 682 |
for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() )
|
- |
|
| 683 |
{
|
- |
|
| 684 |
if ( gd->dir.Compare(dir) )
|
- |
|
| 685 |
{
|
- |
|
| 686 |
m_pGameDir->RemoveCurrent();
|
647 |
_pGameDir->remove(dir);
|
| 687 |
break;
|
- |
|
| 688 |
}
|
- |
|
| 689 |
}
|
- |
|
| 690 |
}
|
648 |
}
|
| 691 |
this->UpdateGameDirs();
|
649 |
this->UpdateGameDirs();
|
| 692 |
}
|
650 |
}
|
| 693 |
private: System::Void toolTip1_Popup(System::Object^ sender, System::Windows::Forms::PopupEventArgs^ e) {
|
651 |
private: System::Void toolTip1_Popup(System::Object^ sender, System::Windows::Forms::PopupEventArgs^ e) {
|
| 694 |
}
|
652 |
}
|
| Line 703... |
Line 661... |
| 703 |
this->clearAllToolStripMenuItem->Visible = (this->ListGameDir->Items->Count) ? true : false;
|
661 |
this->clearAllToolStripMenuItem->Visible = (this->ListGameDir->Items->Count) ? true : false;
|
| 704 |
this->toolStripSeparator1->Visible = (this->ListGameDir->Items->Count) ? true : false;
|
662 |
this->toolStripSeparator1->Visible = (this->ListGameDir->Items->Count) ? true : false;
|
| 705 |
|
663 |
|
| 706 |
for ( int i = (this->addDirectoryToolStripMenuItem->DropDownItems->Count - 1); i >= 2; --i )
|
664 |
for ( int i = (this->addDirectoryToolStripMenuItem->DropDownItems->Count - 1); i >= 2; --i )
|
| 707 |
this->addDirectoryToolStripMenuItem->DropDownItems->RemoveAt(i);
|
665 |
this->addDirectoryToolStripMenuItem->DropDownItems->RemoveAt(i);
|
| 708 |
|
666 |
|
| 709 |
// add any unadded directories
|
667 |
// add any unadded directories
|
| 710 |
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Options::typeid));
|
668 |
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Options::typeid));
|
| 711 |
for ( SStringList *str = m_sDirs->Head(); str; str = str->next )
|
669 |
for ( SStringList *str = m_sDirs->Head(); str; str = str->next )
|
| 712 |
{
|
670 |
{
|
| 713 |
bool found = false;
|
- |
|
| 714 |
for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() )
|
- |
|
| 715 |
{
|
- |
|
| 716 |
if ( gd->dir.Compare(str->str.ToString()) )
|
671 |
if ( !_pGameDir->isDir(str->str.ToString()) ) {
|
| 717 |
{
|
- |
|
| 718 |
found = true;
|
- |
|
| 719 |
break;
|
- |
|
| 720 |
}
|
- |
|
| 721 |
}
|
- |
|
| 722 |
|
- |
|
| 723 |
if ( !found )
|
- |
|
| 724 |
{
|
- |
|
| 725 |
ToolStripMenuItem ^newItem = gcnew ToolStripMenuItem();
|
672 |
ToolStripMenuItem ^newItem = gcnew ToolStripMenuItem();
|
| 726 |
newItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"testDirToolStripMenuItem.Image")));
|
673 |
newItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"testDirToolStripMenuItem.Image")));
|
| 727 |
newItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
|
674 |
newItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
|
| 728 |
newItem->Text = SystemStringFromCyString(str->str) + " (" + SystemStringFromCyString(str->data) + ")";
|
675 |
newItem->Text = SystemStringFromCyString(str->str) + " (" + SystemStringFromCyString(str->data) + ")";
|
| 729 |
newItem->Tag = SystemStringFromCyString(str->str);
|
676 |
newItem->Tag = SystemStringFromCyString(str->str);
|
| 730 |
newItem->Click += gcnew System::EventHandler(this, &Options::testDirToolStripMenuItem_Click);
|
677 |
newItem->Click += gcnew System::EventHandler(this, &Options::testDirToolStripMenuItem_Click);
|
| 731 |
this->addDirectoryToolStripMenuItem->DropDownItems->Add(newItem);
|
678 |
this->addDirectoryToolStripMenuItem->DropDownItems->Add(newItem);
|
| 732 |
}
|
679 |
}
|
| 733 |
}
|
680 |
}
|
| 734 |
|
681 |
|
| 735 |
this->toolStripSeparator4->Visible = true;
|
682 |
this->toolStripSeparator4->Visible = true;
|
| 736 |
if ( this->addDirectoryToolStripMenuItem->DropDownItems->Count == 2 )
|
683 |
if ( this->addDirectoryToolStripMenuItem->DropDownItems->Count == 2 )
|
| 737 |
this->toolStripSeparator4->Visible = false;
|
684 |
this->toolStripSeparator4->Visible = false;
|
| Line 751... |
Line 698... |
| 751 |
}
|
698 |
}
|
| 752 |
private: System::Void addDirectoryToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
|
699 |
private: System::Void addDirectoryToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
|
| 753 |
this->AddNewDir();
|
700 |
this->AddNewDir();
|
| 754 |
}
|
701 |
}
|
| 755 |
private: System::Void clearAllToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
|
702 |
private: System::Void clearAllToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
|
| 756 |
m_pGameDir->MemoryClear();
|
703 |
_pGameDir->clear();
|
| 757 |
this->UpdateGameDirs();
|
704 |
this->UpdateGameDirs();
|
| 758 |
}
|
705 |
}
|
| 759 |
private: System::Void removeSelectedToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
|
706 |
private: System::Void removeSelectedToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
|
| 760 |
for ( int i = 0; i < this->ListGameDir->SelectedItems->Count; i++ )
|
707 |
for ( int i = 0; i < this->ListGameDir->SelectedItems->Count; i++ )
|
| 761 |
{
|
708 |
{
|
| 762 |
Utils::String dir = _S(this->ListGameDir->SelectedItems[i]->Text);
|
709 |
Utils::String dir = _S(this->ListGameDir->SelectedItems[i]->Text);
|
| 763 |
for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() )
|
- |
|
| 764 |
{
|
- |
|
| 765 |
if ( gd->dir.Compare(dir) )
|
- |
|
| 766 |
{
|
- |
|
| 767 |
m_pGameDir->RemoveCurrent();
|
710 |
_pGameDir->remove(dir);
|
| 768 |
break;
|
- |
|
| 769 |
}
|
- |
|
| 770 |
}
|
- |
|
| 771 |
}
|
711 |
}
|
| 772 |
this->UpdateGameDirs();
|
712 |
this->UpdateGameDirs();
|
| 773 |
}
|
713 |
}
|
| 774 |
private: System::Void yesToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
|
714 |
private: System::Void yesToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
|
| 775 |
for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() )
|
- |
|
| 776 |
{
|
- |
|
| 777 |
if ( gd->dir.Compare(_S(m_pSelectedItem->Text)) )
|
715 |
if ( _pGameDir->findDir(_S(m_pSelectedItem->Text)) ) {
|
| 778 |
{
|
- |
|
| 779 |
gd->bLoad = true;
|
716 |
_pGameDir->setLoad(true);
|
| 780 |
m_pSelectedItem->SubItems[2]->Text = "Yes";
|
717 |
m_pSelectedItem->SubItems[2]->Text = "Yes";
|
| 781 |
break;
|
- |
|
| 782 |
}
|
- |
|
| 783 |
}
|
718 |
}
|
| 784 |
}
|
719 |
}
|
| 785 |
private: System::Void noToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
|
720 |
private: System::Void noToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
|
| 786 |
for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() )
|
- |
|
| 787 |
{
|
- |
|
| 788 |
if ( gd->dir.Compare(_S(m_pSelectedItem->Text)) )
|
721 |
if ( _pGameDir->findDir(_S(m_pSelectedItem->Text)) ) {
|
| 789 |
{
|
- |
|
| 790 |
gd->bLoad = false;
|
722 |
_pGameDir->setLoad(false);
|
| 791 |
m_pSelectedItem->SubItems[2]->Text = "No";
|
723 |
m_pSelectedItem->SubItems[2]->Text = "No";
|
| 792 |
break;
|
- |
|
| 793 |
}
|
- |
|
| 794 |
}
|
724 |
}
|
| 795 |
}
|
725 |
}
|
| 796 |
private: System::Void addDirectoryToolStripMenuItem1_Click(System::Object^ sender, System::EventArgs^ e) {
|
726 |
private: System::Void addDirectoryToolStripMenuItem1_Click(System::Object^ sender, System::EventArgs^ e) {
|
| 797 |
this->AddNewDir();
|
727 |
this->AddNewDir();
|
| 798 |
}
|
728 |
}
|
| 799 |
private: System::Void contextMenuStrip2_Opening(System::Object^ sender, System::ComponentModel::CancelEventArgs^ e) {
|
729 |
private: System::Void contextMenuStrip2_Opening(System::Object^ sender, System::ComponentModel::CancelEventArgs^ e) {
|
| Line 803... |
Line 733... |
| 803 |
|
733 |
|
| 804 |
// add any unadded directories
|
734 |
// add any unadded directories
|
| 805 |
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Options::typeid));
|
735 |
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Options::typeid));
|
| 806 |
for ( SStringList *str = m_sDirs->Head(); str; str = str->next )
|
736 |
for ( SStringList *str = m_sDirs->Head(); str; str = str->next )
|
| 807 |
{
|
737 |
{
|
| 808 |
bool found = false;
|
- |
|
| 809 |
for ( SGameDir *gd = m_pGameDir->First(); gd; gd = m_pGameDir->Next() )
|
- |
|
| 810 |
{
|
- |
|
| 811 |
if ( gd->dir.Compare(str->str.ToString()) )
|
738 |
if ( !_pGameDir->isDir(m_pP->GetGameExe()->GetProperDir(str->str.ToString())) ) {
|
| 812 |
{
|
- |
|
| 813 |
found = true;
|
- |
|
| 814 |
break;
|
- |
|
| 815 |
}
|
- |
|
| 816 |
}
|
- |
|
| 817 |
|
- |
|
| 818 |
if ( !found )
|
- |
|
| 819 |
{
|
- |
|
| 820 |
ToolStripMenuItem ^newItem = gcnew ToolStripMenuItem();
|
739 |
ToolStripMenuItem ^newItem = gcnew ToolStripMenuItem();
|
| 821 |
newItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"testDirToolStripMenuItem.Image")));
|
740 |
newItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"testDirToolStripMenuItem.Image")));
|
| 822 |
newItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
|
741 |
newItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;
|
| 823 |
newItem->Text = SystemStringFromCyString(str->str) + " (" + SystemStringFromCyString(str->data) + ")";
|
742 |
newItem->Text = SystemStringFromCyString(str->str) + " (" + SystemStringFromCyString(str->data) + ")";
|
| 824 |
newItem->Tag = SystemStringFromCyString(str->str);
|
743 |
newItem->Tag = SystemStringFromCyString(str->str);
|