1 |
cycrow |
1 |
#pragma once
|
|
|
2 |
|
|
|
3 |
using namespace System;
|
|
|
4 |
using namespace System::Xml;
|
|
|
5 |
using namespace System::ComponentModel;
|
|
|
6 |
using namespace System::Collections;
|
|
|
7 |
using namespace System::Windows::Forms;
|
|
|
8 |
using namespace System::Data;
|
|
|
9 |
using namespace System::Drawing;
|
|
|
10 |
|
|
|
11 |
|
|
|
12 |
namespace Creator {
|
|
|
13 |
|
|
|
14 |
/// <summary>
|
|
|
15 |
/// Summary for LoadText
|
|
|
16 |
///
|
|
|
17 |
/// WARNING: If you change the name of this class, you will need to change the
|
|
|
18 |
/// 'Resource File Name' property for the managed resource compiler tool
|
|
|
19 |
/// associated with all .resx files this class depends on. Otherwise,
|
|
|
20 |
/// the designers will not be able to interact properly with localized
|
|
|
21 |
/// resources associated with this form.
|
|
|
22 |
/// </summary>
|
|
|
23 |
public ref class LoadText : public System::Windows::Forms::Form
|
|
|
24 |
{
|
|
|
25 |
public:
|
36 |
cycrow |
26 |
LoadText(CLinkList<SGameDir> *dirs, CPackages *p)
|
1 |
cycrow |
27 |
{
|
|
|
28 |
InitializeComponent();
|
|
|
29 |
|
|
|
30 |
m_pCurrentDir = NULL;
|
|
|
31 |
m_pPackages = p;
|
|
|
32 |
m_lDirs = dirs;
|
|
|
33 |
}
|
|
|
34 |
|
|
|
35 |
void Start()
|
|
|
36 |
{
|
68 |
cycrow |
37 |
if ( m_pCurrentDir ) this->label2->Text = _US(m_pCurrentDir->dir);
|
1 |
cycrow |
38 |
this->backgroundWorker1->RunWorkerAsync();
|
|
|
39 |
}
|
|
|
40 |
|
|
|
41 |
void DoWork()
|
|
|
42 |
{
|
|
|
43 |
if ( !m_pCurrentDir ) return;
|
36 |
cycrow |
44 |
m_pCurrentDir->pVfs->updateTexts(0);
|
1 |
cycrow |
45 |
}
|
|
|
46 |
|
|
|
47 |
void Next()
|
|
|
48 |
{
|
|
|
49 |
m_pCurrentDir = m_lDirs->Next();
|
|
|
50 |
if ( m_pCurrentDir )
|
|
|
51 |
this->Start();
|
|
|
52 |
else
|
|
|
53 |
this->Close();
|
|
|
54 |
}
|
|
|
55 |
|
|
|
56 |
protected:
|
|
|
57 |
/// <summary>
|
|
|
58 |
/// Clean up any resources being used.
|
|
|
59 |
/// </summary>
|
|
|
60 |
~LoadText()
|
|
|
61 |
{
|
|
|
62 |
if (components)
|
|
|
63 |
{
|
|
|
64 |
delete components;
|
|
|
65 |
}
|
|
|
66 |
}
|
|
|
67 |
private: System::Windows::Forms::Label^ label1;
|
|
|
68 |
protected:
|
|
|
69 |
private: System::Windows::Forms::Label^ label2;
|
|
|
70 |
private: System::ComponentModel::BackgroundWorker^ backgroundWorker1;
|
|
|
71 |
|
|
|
72 |
private:
|
|
|
73 |
Collections::Hashtable ^m_pTextList;
|
|
|
74 |
CPackages *m_pPackages;
|
|
|
75 |
SGameDir *m_pCurrentDir;
|
|
|
76 |
CLinkList<SGameDir> *m_lDirs;
|
|
|
77 |
/// <summary>
|
|
|
78 |
/// Required designer variable.
|
|
|
79 |
/// </summary>
|
|
|
80 |
System::ComponentModel::Container ^components;
|
|
|
81 |
|
|
|
82 |
#pragma region Windows Form Designer generated code
|
|
|
83 |
/// <summary>
|
|
|
84 |
/// Required method for Designer support - do not modify
|
|
|
85 |
/// the contents of this method with the code editor.
|
|
|
86 |
/// </summary>
|
|
|
87 |
void InitializeComponent(void)
|
|
|
88 |
{
|
|
|
89 |
this->label1 = (gcnew System::Windows::Forms::Label());
|
|
|
90 |
this->label2 = (gcnew System::Windows::Forms::Label());
|
|
|
91 |
this->backgroundWorker1 = (gcnew System::ComponentModel::BackgroundWorker());
|
|
|
92 |
this->SuspendLayout();
|
|
|
93 |
//
|
|
|
94 |
// label1
|
|
|
95 |
//
|
|
|
96 |
this->label1->Dock = System::Windows::Forms::DockStyle::Top;
|
|
|
97 |
this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
|
|
|
98 |
static_cast<System::Byte>(0)));
|
|
|
99 |
this->label1->Location = System::Drawing::Point(10, 10);
|
|
|
100 |
this->label1->Name = L"label1";
|
|
|
101 |
this->label1->Size = System::Drawing::Size(231, 32);
|
|
|
102 |
this->label1->TabIndex = 0;
|
|
|
103 |
this->label1->Text = L"Loading Text";
|
|
|
104 |
this->label1->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
|
|
|
105 |
this->label1->UseWaitCursor = true;
|
|
|
106 |
//
|
|
|
107 |
// label2
|
|
|
108 |
//
|
|
|
109 |
this->label2->Dock = System::Windows::Forms::DockStyle::Fill;
|
|
|
110 |
this->label2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Italic, System::Drawing::GraphicsUnit::Point,
|
|
|
111 |
static_cast<System::Byte>(0)));
|
|
|
112 |
this->label2->Location = System::Drawing::Point(10, 42);
|
|
|
113 |
this->label2->Name = L"label2";
|
|
|
114 |
this->label2->Size = System::Drawing::Size(231, 23);
|
|
|
115 |
this->label2->TabIndex = 1;
|
|
|
116 |
this->label2->TextAlign = System::Drawing::ContentAlignment::TopCenter;
|
|
|
117 |
this->label2->UseWaitCursor = true;
|
|
|
118 |
//
|
|
|
119 |
// backgroundWorker1
|
|
|
120 |
//
|
|
|
121 |
this->backgroundWorker1->DoWork += gcnew System::ComponentModel::DoWorkEventHandler(this, &LoadText::backgroundWorker1_DoWork);
|
|
|
122 |
this->backgroundWorker1->RunWorkerCompleted += gcnew System::ComponentModel::RunWorkerCompletedEventHandler(this, &LoadText::backgroundWorker1_RunWorkerCompleted);
|
|
|
123 |
//
|
|
|
124 |
// LoadText
|
|
|
125 |
//
|
|
|
126 |
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
|
|
|
127 |
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
|
|
|
128 |
this->BackColor = System::Drawing::Color::Gray;
|
|
|
129 |
this->ClientSize = System::Drawing::Size(251, 75);
|
|
|
130 |
this->ControlBox = false;
|
|
|
131 |
this->Controls->Add(this->label2);
|
|
|
132 |
this->Controls->Add(this->label1);
|
|
|
133 |
this->Cursor = System::Windows::Forms::Cursors::WaitCursor;
|
|
|
134 |
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::None;
|
|
|
135 |
this->Name = L"LoadText";
|
|
|
136 |
this->Padding = System::Windows::Forms::Padding(10);
|
|
|
137 |
this->ShowInTaskbar = false;
|
|
|
138 |
this->SizeGripStyle = System::Windows::Forms::SizeGripStyle::Hide;
|
|
|
139 |
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterParent;
|
|
|
140 |
this->Text = L"LoadText";
|
|
|
141 |
this->TopMost = true;
|
|
|
142 |
this->UseWaitCursor = true;
|
|
|
143 |
this->Load += gcnew System::EventHandler(this, &LoadText::LoadText_Load);
|
|
|
144 |
this->ResumeLayout(false);
|
|
|
145 |
|
|
|
146 |
}
|
|
|
147 |
#pragma endregion
|
|
|
148 |
private: System::Void backgroundWorker1_DoWork(System::Object^ sender, System::ComponentModel::DoWorkEventArgs^ e) {
|
|
|
149 |
this->DoWork();
|
|
|
150 |
}
|
|
|
151 |
private: System::Void LoadText_Load(System::Object^ sender, System::EventArgs^ e) {
|
|
|
152 |
m_pCurrentDir = m_lDirs->First();
|
|
|
153 |
this->Start();
|
|
|
154 |
}
|
|
|
155 |
private: System::Void backgroundWorker1_RunWorkerCompleted(System::Object^ sender, System::ComponentModel::RunWorkerCompletedEventArgs^ e) {
|
|
|
156 |
this->Next();
|
|
|
157 |
}
|
|
|
158 |
};
|
|
|
159 |
}
|