1 |
cycrow |
1 |
#pragma once
|
|
|
2 |
|
|
|
3 |
using namespace System;
|
|
|
4 |
using namespace System::ComponentModel;
|
|
|
5 |
using namespace System::Collections;
|
|
|
6 |
using namespace System::Windows::Forms;
|
|
|
7 |
using namespace System::Data;
|
|
|
8 |
using namespace System::Drawing;
|
|
|
9 |
|
|
|
10 |
|
|
|
11 |
namespace PluginManager {
|
|
|
12 |
|
|
|
13 |
/// <summary>
|
|
|
14 |
/// Summary for FakePatchAssign
|
|
|
15 |
///
|
|
|
16 |
/// WARNING: If you change the name of this class, you will need to change the
|
|
|
17 |
/// 'Resource File Name' property for the managed resource compiler tool
|
|
|
18 |
/// associated with all .resx files this class depends on. Otherwise,
|
|
|
19 |
/// the designers will not be able to interact properly with localized
|
|
|
20 |
/// resources associated with this form.
|
|
|
21 |
/// </summary>
|
|
|
22 |
public ref class FakePatchAssign : public System::Windows::Forms::Form
|
|
|
23 |
{
|
|
|
24 |
public:
|
|
|
25 |
FakePatchAssign(CPackages *p)
|
|
|
26 |
{
|
|
|
27 |
InitializeComponent();
|
|
|
28 |
|
|
|
29 |
m_pPackages = p;
|
|
|
30 |
|
|
|
31 |
UpdateDisplay();
|
|
|
32 |
}
|
|
|
33 |
|
|
|
34 |
void UpdateDisplay()
|
|
|
35 |
{
|
182 |
cycrow |
36 |
int patch = m_pPackages->findNextFakePatch();
|
1 |
cycrow |
37 |
for ( int i = 1; i < patch; i++ )
|
|
|
38 |
{
|
228 |
cycrow |
39 |
ListViewItem ^item = gcnew ListViewItem(_US(Utils::WString::PadNumber(i, 2) + ".cat"));
|
1 |
cycrow |
40 |
this->listView1->Items->Add(item);
|
|
|
41 |
|
|
|
42 |
// find the package that has the file
|
228 |
cycrow |
43 |
C_File *f = m_pPackages->findFile(FILETYPE_MOD, Utils::WString::PadNumber(i, 2) + ".cat");
|
1 |
cycrow |
44 |
if ( f )
|
|
|
45 |
{
|
|
|
46 |
item->ImageIndex = 1;
|
182 |
cycrow |
47 |
CBaseFile *p = m_pPackages->findFirstPackageWithFile(f);
|
1 |
cycrow |
48 |
if ( p )
|
170 |
cycrow |
49 |
item->SubItems->Add(_US(p->getFullPackageName(m_pPackages->GetLanguage())));
|
1 |
cycrow |
50 |
else
|
|
|
51 |
item->SubItems->Add("[Unknown]");
|
|
|
52 |
}
|
|
|
53 |
else
|
|
|
54 |
{
|
|
|
55 |
item->ImageIndex = 0;
|
|
|
56 |
item->SubItems->Add("[Not Controlled]");
|
|
|
57 |
}
|
|
|
58 |
}
|
|
|
59 |
this->listView1->AutoResizeColumns(Windows::Forms::ColumnHeaderAutoResizeStyle::HeaderSize);
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
private: System::Windows::Forms::ListView^ listView1;
|
|
|
63 |
public:
|
|
|
64 |
private: System::Windows::Forms::ColumnHeader^ columnHeader1;
|
|
|
65 |
private: System::Windows::Forms::ColumnHeader^ columnHeader2;
|
|
|
66 |
private: System::Windows::Forms::ImageList^ imageList1;
|
|
|
67 |
|
|
|
68 |
protected:
|
|
|
69 |
CPackages *m_pPackages;
|
|
|
70 |
/// <summary>
|
|
|
71 |
/// Clean up any resources being used.
|
|
|
72 |
/// </summary>
|
|
|
73 |
~FakePatchAssign()
|
|
|
74 |
{
|
|
|
75 |
if (components)
|
|
|
76 |
{
|
|
|
77 |
delete components;
|
|
|
78 |
}
|
|
|
79 |
}
|
|
|
80 |
private: System::ComponentModel::IContainer^ components;
|
|
|
81 |
protected:
|
|
|
82 |
|
|
|
83 |
private:
|
|
|
84 |
/// <summary>
|
|
|
85 |
/// Required designer variable.
|
|
|
86 |
/// </summary>
|
|
|
87 |
|
|
|
88 |
|
|
|
89 |
#pragma region Windows Form Designer generated code
|
|
|
90 |
/// <summary>
|
|
|
91 |
/// Required method for Designer support - do not modify
|
|
|
92 |
/// the contents of this method with the code editor.
|
|
|
93 |
/// </summary>
|
|
|
94 |
void InitializeComponent(void)
|
|
|
95 |
{
|
|
|
96 |
this->components = (gcnew System::ComponentModel::Container());
|
|
|
97 |
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(FakePatchAssign::typeid));
|
|
|
98 |
this->listView1 = (gcnew System::Windows::Forms::ListView());
|
|
|
99 |
this->columnHeader1 = (gcnew System::Windows::Forms::ColumnHeader());
|
|
|
100 |
this->columnHeader2 = (gcnew System::Windows::Forms::ColumnHeader());
|
|
|
101 |
this->imageList1 = (gcnew System::Windows::Forms::ImageList(this->components));
|
|
|
102 |
this->SuspendLayout();
|
|
|
103 |
//
|
|
|
104 |
// listView1
|
|
|
105 |
//
|
|
|
106 |
this->listView1->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^ >(2) {this->columnHeader1, this->columnHeader2});
|
|
|
107 |
this->listView1->Dock = System::Windows::Forms::DockStyle::Fill;
|
|
|
108 |
this->listView1->FullRowSelect = true;
|
|
|
109 |
this->listView1->LargeImageList = this->imageList1;
|
|
|
110 |
this->listView1->Location = System::Drawing::Point(0, 0);
|
|
|
111 |
this->listView1->Name = L"listView1";
|
|
|
112 |
this->listView1->Size = System::Drawing::Size(376, 379);
|
|
|
113 |
this->listView1->SmallImageList = this->imageList1;
|
|
|
114 |
this->listView1->TabIndex = 0;
|
|
|
115 |
this->listView1->UseCompatibleStateImageBehavior = false;
|
|
|
116 |
this->listView1->View = System::Windows::Forms::View::Details;
|
|
|
117 |
//
|
|
|
118 |
// columnHeader1
|
|
|
119 |
//
|
|
|
120 |
this->columnHeader1->Text = L"Patch";
|
|
|
121 |
//
|
|
|
122 |
// columnHeader2
|
|
|
123 |
//
|
|
|
124 |
this->columnHeader2->Text = L"Package";
|
|
|
125 |
//
|
|
|
126 |
// imageList1
|
|
|
127 |
//
|
|
|
128 |
this->imageList1->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^ >(resources->GetObject(L"imageList1.ImageStream")));
|
|
|
129 |
this->imageList1->TransparentColor = System::Drawing::Color::Transparent;
|
|
|
130 |
this->imageList1->Images->SetKeyName(0, L"X3.ico");
|
|
|
131 |
this->imageList1->Images->SetKeyName(1, L"X3TC.ico");
|
|
|
132 |
//
|
|
|
133 |
// FakePatchAssign
|
|
|
134 |
//
|
|
|
135 |
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
|
|
|
136 |
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
|
|
|
137 |
this->ClientSize = System::Drawing::Size(376, 379);
|
|
|
138 |
this->Controls->Add(this->listView1);
|
|
|
139 |
this->MinimizeBox = false;
|
|
|
140 |
this->Name = L"FakePatchAssign";
|
|
|
141 |
this->ShowIcon = false;
|
|
|
142 |
this->ShowInTaskbar = false;
|
|
|
143 |
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterParent;
|
|
|
144 |
this->Text = L"Fake Patch Assignment";
|
|
|
145 |
this->TopMost = true;
|
|
|
146 |
this->ResumeLayout(false);
|
|
|
147 |
|
|
|
148 |
}
|
|
|
149 |
#pragma endregion
|
|
|
150 |
};
|
|
|
151 |
}
|