-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainForm.cs
753 lines (656 loc) · 30.6 KB
/
MainForm.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace POExileDirection
{
public partial class MainForm : Form
{
bool bSeedFound = false;
private bool bIsMinimized = false;
private bool partTwo = false;
int nMoving = 0;
int nMovePosX = 0;
int nMovePosY = 0;
UI_LANG nUILang;
string g_strUILang = null;
Regex RegExZoneEntered;
Regex RegExMonsterRemains; // ENG : 3 monsters remain. KOR : 몬스터 3개체가 남아있습니다.
Regex RegExMonsterRemainsKORMore; // : 몬스터가 (.*)개체 이상 남아있습니다.
Regex RegExMonsterRemainsENGMore; // : More than 50 monsters remain.
OverlayData[] jsonData;
string currentDirectory = null;
FileStream fileStream;
StreamReader logStream;
string zoneName = null;
string actString = null;
string btnLangText = null;
string[] separatingStrings = { "Act " };
Common commonClass = new Common();
bool bShowSettingButtons = false;
public string strMainFromKAKAOUSER = "YES";
public MainForm()
{
InitializeComponent();
this.Text = "POExileDirection";
btnLang.DoubleClick += BtnLang_DoubleClick;
Init_Controls();
commonClass.InitActZoneDictionary();
}
private void BtnSettings_DoubleClick(object sender, EventArgs e)
{
SettingsForm frmSettings = new SettingsForm();
frmSettings.Show();
}
#region ⨌⨌ Init. Controls. ⨌⨌
private void Init_Controls()
{
// btnClose
btnLang.FlatStyle = FlatStyle.Flat;
btnLang.BackColor = Color.Transparent;
btnLang.FlatAppearance.MouseDownBackColor = Color.Transparent;
btnLang.FlatAppearance.MouseOverBackColor = Color.Transparent;
btnLang.FlatAppearance.BorderColor = Color.FromArgb(0, 255, 255, 255);
btnLang.FlatAppearance.BorderSize = 0;
btnLang.TabStop = false;
}
#endregion
private void MainForm_Load(object sender, EventArgs e)
{
// On Working Monitor
this.Location = Screen.AllScreens[0].WorkingArea.Location;
CenterToScreen();
this.TopMost = true;
zoneName = "?";
actString = "?";
currentDirectory = Application.StartupPath;
bool bRet = ReadDirectionHelperData();
if (bRet == false)
{
this.Close();
Environment.Exit(0);
}
/*
[DIRECTIONHELPER]
POELOGPATH="SET"
*/
string strINIPath = String.Format("{0}\\{1}", currentDirectory, "ConfigPath.ini");
IniParser parser = new IniParser(strINIPath);
string strPath = "";
try
{
strPath = parser.GetSetting("DIRECTIONHELPER", "POELOGPATH");
zoneName = parser.GetSetting("INITPART", "zoneName");
actString = parser.GetSetting("INITPART", "actString");
this.noteLabel.Text = "";
string strLastPart = parser.GetSetting("INITPART", "LASTPART");
if (strLastPart == "1")
partTwo = false;
else if (strLastPart == "2")
partTwo = true;
/*
[LOCATION]
LEFT=1385
TOP=941
ISMIN=N
*/
string sLeft = parser.GetSetting("LOCATION", "LEFT");
string sTop = parser.GetSetting("LOCATION", "TOP");
string sMin = parser.GetSetting("LOCATION", "ISMIN");
if (sLeft != "CENTER" && sTop != "CENTER")
{
this.StartPosition = FormStartPosition.Manual;
this.Left = Int32.Parse(sLeft);
this.Top = Int32.Parse(sTop);
}
}
catch
{
MSGForm frmMSG = new MSGForm();
frmMSG.lbMsg.Text = "환경 파일을 읽을 수 없습니다.\r\n\r\nini 파일이 손상되었거나 삭제되었습니다.";
frmMSG.ShowDialog();
this.Close();
Environment.Exit(0);
}
if (File.Exists(strPath))
{
try
{
fileStream = File.Open(strPath, mode: FileMode.Open, access: FileAccess.Read, share: FileShare.ReadWrite);
logStream = new StreamReader(fileStream);
}
catch
{
MSGForm frmMSG = new MSGForm();
frmMSG.lbMsg.Text = "패스 오브 엑자일 로그파일을 읽는 도중 오류가 발생했습니다. ‼‼‼";
frmMSG.ShowDialog();
this.Close();
Environment.Exit(0);
}
if (actString == "?")
actString = commonClass.GetActROMAbyZoneName(zoneName, partTwo);
if (actString == "I" || actString == "II" || actString == "III" || actString == "IV" || actString == "V")
{
parser.AddSetting("INITPART", "LASTPART", "1");
noteLabel.Text = "마을입니다.";
}
else if (actString == "VI" || actString == "VII" || actString == "VIII" || actString == "IX" || actString == "X")
{
parser.AddSetting("INITPART", "LASTPART", "2");
noteLabel.Text = "마을입니다.";
}
else if (actString == "O")
{
parser.AddSetting("INITPART", "LASTPART", "2");
noteLabel.Text = "액트 클리어를 축하드립니다.";
}
else if (actString == "Z")
{
parser.AddSetting("INITPART", "LASTPART", "2");
noteLabel.Text = "지도의 대가 자나를 만나보세요.";
}
else if (actString == "H")
{
parser.AddSetting("INITPART", "LASTPART", "2");
noteLabel.Text = "멋진 은신처군요~!";
}
else
{
parser.AddSetting("INITPART", "LASTPART", "3");
noteLabel.Text = "정보가 없습니다. (더블클릭시에도 나타나지 않으면 지역 정보가 충분히 파악되지 않았거나, 정보가 없어도 진행이 가능한 지역입니다.)";
}
parser.AddSetting("INITPART", "zoneName", zoneName);
parser.AddSetting("INITPART", "actString", actString);
parser.SaveSettings();
btnLangText = String.Format("{0} [ Act {1} ] {2}", g_strUILang, actString, zoneName);
btnLang.Text = btnLangText;
Check_UILanguageWrapping();
// Move to the end of the file
fileStream.Seek(-512, SeekOrigin.End);
// Start watching client log file
zoneWatcher.Enabled = true;
}
else
{
MSGForm frmMSG = new MSGForm();
frmMSG.lbMsg.Text = "패스 오브 엑자일 경로가 맞지 않습니다.\r\n경로를 설정해주세요.";
frmMSG.ShowDialog();
FolderBrowserDialog dlgFolder = new FolderBrowserDialog();
DialogResult dr = dlgFolder.ShowDialog();
if(dr == DialogResult.OK)
{
if (strMainFromKAKAOUSER == "YES")
strPath = String.Format("{0}\\{1}", dlgFolder.SelectedPath, "logs\\KakaoClient.txt");
else
strPath = String.Format("{0}\\{1}", dlgFolder.SelectedPath, "logs\\Client.txt");
}
else
{
this.Close();
Environment.Exit(0);
}
// Set Ini.
parser.AddSetting("DIRECTIONHELPER", "POELOGPATH", strPath);
parser.SaveSettings();
try
{
fileStream = File.Open(strPath, mode: FileMode.Open, access: FileAccess.Read, share: FileShare.ReadWrite);
logStream = new StreamReader(fileStream);
}
catch
{
MSGForm frmMSG2 = new MSGForm();
frmMSG2.lbMsg.Text = "패스 오브 엑자일 로그파일을 읽는 도중 오류가 발생했습니다. ‼‼‼";
frmMSG2.ShowDialog();
this.Close();
Environment.Exit(0);
}
if (actString == "?")
actString = commonClass.GetActROMAbyZoneName(zoneName, partTwo);
if (actString == "I" || actString == "II" || actString == "III" || actString == "IV" || actString == "V")
{
parser.AddSetting("INITPART", "LASTPART", "1");
noteLabel.Text = "마을입니다.";
}
else if (actString == "VI" || actString == "VII" || actString == "VIII" || actString == "IX" || actString == "X")
{
parser.AddSetting("INITPART", "LASTPART", "2");
noteLabel.Text = "마을입니다.";
}
else if (actString == "O")
{
parser.AddSetting("INITPART", "LASTPART", "2");
noteLabel.Text = "액트 클리어를 축하드립니다.";
}
else if (actString == "Z")
{
parser.AddSetting("INITPART", "LASTPART", "2");
noteLabel.Text = "지도의 대가 자나를 만나보세요.";
}
else if (actString == "H")
{
parser.AddSetting("INITPART", "LASTPART", "2");
noteLabel.Text = "멋진 은신처군요~!";
}
else
{
parser.AddSetting("INITPART", "LASTPART", "3");
noteLabel.Text = "정보가 없습니다. (더블클릭시에도 나타나지 않으면 지역 정보가 충분히 파악되지 않았거나, 정보가 없어도 진행이 가능한 지역입니다.)";
}
parser.AddSetting("INITPART", "zoneName", zoneName);
parser.AddSetting("INITPART", "actString", actString);
parser.SaveSettings();
btnLangText = String.Format("{0} [ Act {1} ] {2}", g_strUILang, actString, zoneName);
btnLang.Text = btnLangText;
Check_UILanguageWrapping();
// Move to the end of the file
fileStream.Seek(-512, SeekOrigin.End);
// Start watching client log file
zoneWatcher.Enabled = true;
}
}
public void Check_UILanguageWrapping()
{
nUILang = CheckPOEUILanguage();
if (nUILang == UI_LANG.UI_ERROR) // Can't Read UI Language from POE Config File
{
this.Close();
Environment.Exit(0);
}
else if (nUILang == UI_LANG.UI_KOREAN)
{
RegExZoneEntered = new Regex(@": (.*)에 진입했습니다.", RegexOptions.IgnoreCase); // for Korean Client. ex) [INFO Client 14932] : 오아시스에 진입했습니다.
RegExMonsterRemains = new Regex(@": 몬스터 (.*)개체가 남아있습니다."); // : 몬스터 0개체가 남아있습니다.
RegExMonsterRemainsKORMore = new Regex(@": 몬스터가 (.*)개체 이상 남아있습니다."); // : 몬스터가 50개체 이상 남아있습니다.
}
else if (nUILang == UI_LANG.UI_ENGLISH)
{
RegExZoneEntered = new Regex(@"You have entered (.*)\.", RegexOptions.IgnoreCase);
RegExMonsterRemains = new Regex(@": (.*) monsters remain."); // : 3 monsters remain.
RegExMonsterRemainsENGMore = new Regex(@": More than (.*) monsters remain."); // : More than 50 monsters remain.
}
}
public bool ReadDirectionHelperData()
{
try
{
jsonData = OverlayData.FromJson(File.ReadAllText(String.Format("{0}\\{1}", currentDirectory, "configuration.json")));
return true;
}
catch
{
MSGForm frmMSG3 = new MSGForm();
frmMSG3.lbMsg.Text = "POE Direction Helper를 실행하신 디렉토리의\r\n환경설정 파일(configuration.json)을 읽을 수 없습니다.\r\n\r\nDirectionHelper가 설치한 json 형식이 아닙니다.\r\n파일이 손상되었거나 임의로 수정되었을 수 있습니다.";
frmMSG3.ShowDialog();
return false;
}
}
public UI_LANG CheckPOEUILanguage()
{
String strPathPOEConifg = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
strPathPOEConifg = strPathPOEConifg + "\\My Games\\Path of Exile\\production_Config.ini";
IniParser parser = new IniParser(strPathPOEConifg);
/*
[LANGUAGE]
language=en
language=ko-KR
*/
string strLanguage = "";
try
{
strLanguage = parser.GetSetting("LANGUAGE", "language");
if (strLanguage.Equals("ko-KR", StringComparison.OrdinalIgnoreCase))
{
g_strUILang = "KOR";
return UI_LANG.UI_KOREAN;
}
else if (strLanguage.Equals("en", StringComparison.OrdinalIgnoreCase))
{
g_strUILang = "ENG";
return UI_LANG.UI_ENGLISH;
}
else
{
// 언어 환경 설정 콤보박스를 한번도 건드리지 않은 사용자는 [LANGUAGE] 섹션이 없음
MSGForm frmMSG3 = new MSGForm();
frmMSG3.lbMsg.Text = "언어 설정을 확인할 수 없어서 한글로 인식합니다.\r\n옵션-UI-언어를 확인해주세요.\r\n\r\n게임 옵션에서 언어 변경 후 저장하시면\r\nPOE의 설정 파일에 기록됩니다.";
frmMSG3.ShowDialog();
g_strUILang = "KOR";
return UI_LANG.UI_KOREAN;
}
}
catch
{
/*MSGForm frmMSG4 = new MSGForm();
frmMSG4.lbMsg.Text = "패스오브엑자일 환경 파일을 읽을 수 없습니다.\r\n\r\n패스오브엑자일을 한번이라도 실행하신 후\r\n\r\n다시 POE COMPASS를 실행해주세요.";
frmMSG4.ShowDialog();
return UI_LANG.UI_ERROR;*/
// 언어 환경 설정 콤보박스를 한번도 건드리지 않은 사용자는 [LANGUAGE] 섹션이 없음 || 또는, PC방 사용자가 꺼져있는 컴을 켜고 처음 실행시켰을 때.
MSGForm frmMSG3 = new MSGForm();
frmMSG3.lbMsg.Text = "언어 설정을 확인할 수 없어서 한글로 인식합니다.\r\n옵션-UI-언어를 확인해주세요.\r\n\r\n게임 옵션에서 언어 변경 후 저장하시면\r\nPOE의 설정 파일에 기록됩니다.";
frmMSG3.ShowDialog();
g_strUILang = "KOR";
return UI_LANG.UI_KOREAN;
}
}
private void PanelTop_MouseDown(object sender, MouseEventArgs e)
{
nMoving = 1;
nMovePosX = e.X;
nMovePosY = e.Y;
}
private void PanelTop_MouseMove(object sender, MouseEventArgs e)
{
if(nMoving == 1)
{
this.SetDesktopLocation(MousePosition.X - nMovePosX, MousePosition.Y - nMovePosY);
}
}
private void PanelTop_MouseUp(object sender, MouseEventArgs e)
{
nMoving = 0;
string strINIPath = String.Format("{0}\\{1}", currentDirectory, "ConfigPath.ini");
IniParser parser = new IniParser(strINIPath);
parser.AddSetting("LOCATION", "LEFT", this.Left.ToString());
parser.AddSetting("LOCATION", "TOP", this.Top.ToString());
parser.SaveSettings();
}
private void BtnClose_Click_1(object sender, EventArgs e)
{
// Dispose.
this.Close();
Environment.Exit(0);
}
private void DrawMap(string image, string note, int nCount)
{
pictureBox1.Load(image);
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
}
private void ReadNewLines_Timer(object sender, EventArgs e)
{
// Read new line every 100 ms and detect zone...
string line = logStream.ReadToEnd();
string image = null;
Match mRemains = RegExMonsterRemains.Match(line);
if (mRemains.Success)
{
string strRemains = "?";
strRemains = mRemains.Groups[1].ToString();
if (strRemains.Contains("More")) strRemains = "50+";
RemainingForm formMonster = new RemainingForm();
formMonster.lbRemain.Text = strRemains;
formMonster.Show();
}
Match mRemainsKORMore = null;
if (g_strUILang=="KOR")
mRemainsKORMore = RegExMonsterRemainsKORMore.Match(line);
else if (g_strUILang == "ENG")
mRemainsKORMore = RegExMonsterRemainsENGMore.Match(line);
if (mRemainsKORMore.Success)
{
string strRemainsMore = "50+";
RemainingForm formMonster = new RemainingForm();
formMonster.lbRemain.Text = strRemainsMore;
formMonster.Show();
}
Match m = RegExZoneEntered.Match(line);
if (m.Success)
{
// New zone has been entered - update graphics.
zoneName = m.Groups[1].ToString();
actString = "?";
bSeedFound = false;
PictureBox[] picBox = { pictureBox1, pictureBox2, pictureBox3, pictureBox4 };
image = String.Format("{0}\\Overlays\\{1}.png", currentDirectory, "no_overlay");
InitMapImage(); // Clear Map Image
// Attempt to find a corresponding zoneName
var seedList = FindZoneName(zoneName);
int nIndex = 0;
if (seedList.Item2.Length > 0)
{
foreach (var seed in seedList.Item2) // region.Region (ACT), zone.ZoneSeed (Image), zone.Note (Explain Text)
{
actString = seedList.Item1;
string[] actROMA = actString.Split(separatingStrings, System.StringSplitOptions.RemoveEmptyEntries);
actString = actROMA[0];
image = String.Format("{0}\\Overlays\\{1}\\{2}.png", currentDirectory, seedList.Item1, seed);
// IMAGE
picBox[nIndex].Load(image);
picBox[nIndex].SizeMode = PictureBoxSizeMode.StretchImage;
// TEXT
noteLabel.Text = seedList.Item3;
bSeedFound = true;
nIndex++;
}
}
string strINIPath = String.Format("{0}\\{1}", currentDirectory, "ConfigPath.ini");
IniParser parser = new IniParser(strINIPath);
if (actString == "?")
{
actString = commonClass.GetActROMAbyZoneName(zoneName, partTwo);
}
if (actString == "I" || actString == "II" || actString == "III" || actString == "IV" || actString == "V")
{
parser.AddSetting("INITPART", "LASTPART", "1");
if(!bSeedFound) noteLabel.Text = "마을입니다.";
}
else if (actString == "VI" || actString == "VII" || actString == "VIII" || actString == "IX" || actString == "X")
{
parser.AddSetting("INITPART", "LASTPART", "2");
if (!bSeedFound) noteLabel.Text = "마을입니다.";
}
else if (actString == "O")
{
parser.AddSetting("INITPART", "LASTPART", "2");
noteLabel.Text = "액트 클리어를 축하드립니다.";
}
else if (actString == "Z")
{
parser.AddSetting("INITPART", "LASTPART", "2");
noteLabel.Text = "지도의 대가 자나를 만나보세요.";
}
else if (actString == "H")
{
parser.AddSetting("INITPART", "LASTPART", "2");
noteLabel.Text = "멋진 은신처군요~!";
}
else
{
parser.AddSetting("INITPART", "LASTPART", "3");
noteLabel.Text = "정보가 없습니다. (더블클릭시에도 나타나지 않으면 지역 정보가 충분히 파악되지 않았거나, 정보가 없어도 진행이 가능한 지역입니다.)";
}
parser.AddSetting("INITPART", "zoneName", zoneName);
parser.AddSetting("INITPART", "actString", actString);
parser.SaveSettings();
btnLangText = String.Format("{0} [ Act {1} ] {2}", g_strUILang, actString, zoneName);
btnLang.Text = btnLangText;
}
}
public void InitMapImage()
{
PictureBox[] picBox = { pictureBox1, pictureBox2, pictureBox3, pictureBox4 };
string image = String.Format("{0}\\Overlays\\{1}.png", currentDirectory, "no_overlay_empty");
// Clear
/*for (int i = 0; i < 3; i++)
{
picBox[i].Load(image);
picBox[i].SizeMode = PictureBoxSizeMode.StretchImage;
}
image = String.Format("{0}\\Overlays\\{1}.png", currentDirectory, "no_overlay");
picBox[3].Load(image);
picBox[3].SizeMode = PictureBoxSizeMode.StretchImage;*/
// All Clean
for (int i = 0; i < 4; i++)
{
picBox[i].Load(image);
picBox[i].SizeMode = PictureBoxSizeMode.StretchImage;
}
image = String.Format("{0}\\Overlays\\{1}.png", currentDirectory, "no_overlay");
}
private Tuple<string, object[], string> FindZoneName(string zoneName)
{
bool firstHit = false;
foreach (var region in jsonData)
if (region.clientLogFile != null)
{
continue;
}
else
{
foreach (var zone in region.Zone)
{
if (nUILang == UI_LANG.UI_KOREAN)
{
// if PartTwo is enabled, skip first entry...
if (zone.ZoneName.Equals(zoneName))
{
if (partTwo && !firstHit)
{
firstHit = true;
}
else
{
return Tuple.Create(region.Region, zone.ZoneSeed, zone.Note);
}
}
}
else
{
// Added by DeadlyCursh for support all UI : KOR and ENG
if (zone.zoneNameENG.Equals(zoneName))
{
if (partTwo && !firstHit)
{
firstHit = true;
}
else
{
return Tuple.Create(region.Region, zone.ZoneSeed, zone.Note);
}
}
}
}
}
return Tuple.Create("", new object[0], "");
}
public void DrawPartTwoImage()
{
bSeedFound = false;
string image = null;
PictureBox[] picBox = { pictureBox1, pictureBox2, pictureBox3, pictureBox4 };
image = String.Format("{0}\\Overlays\\{1}.png", currentDirectory, "no_overlay");
var seedList = FindZoneName(zoneName);
int nIndex = 0;
if (seedList.Item2.Length > 0)
{
foreach (var seed in seedList.Item2) // region.Region (ACT), zone.ZoneSeed (Image), zone.Note (Explain Text)
{
actString = seedList.Item1;
string[] actROMA = actString.Split(separatingStrings, System.StringSplitOptions.RemoveEmptyEntries);
actString = actROMA[0];
image = String.Format("{0}\\Overlays\\{1}\\{2}.png", currentDirectory, seedList.Item1, seed);
// IMAGE
picBox[nIndex].Load(image);
picBox[nIndex].SizeMode = PictureBoxSizeMode.StretchImage;
// TEXT
noteLabel.Text = seedList.Item3;
bSeedFound = true;
nIndex++;
}
}
string strINIPath = String.Format("{0}\\{1}", currentDirectory, "ConfigPath.ini");
IniParser parser = new IniParser(strINIPath);
if (actString == "?")
actString = commonClass.GetActROMAbyZoneName(zoneName, partTwo);
if (actString == "I" || actString == "II" || actString == "III" || actString == "IV" || actString == "V")
{
parser.AddSetting("INITPART", "LASTPART", "1");
if (!bSeedFound) noteLabel.Text = "마을입니다.";
}
else if (actString == "VI" || actString == "VII" || actString == "VIII" || actString == "IX" || actString == "X")
{
parser.AddSetting("INITPART", "LASTPART", "2");
if (!bSeedFound) noteLabel.Text = "마을입니다.";
}
else if (actString == "O")
{
parser.AddSetting("INITPART", "LASTPART", "2");
noteLabel.Text = "액트 클리어를 축하드립니다.";
}
else if (actString == "Z")
{
parser.AddSetting("INITPART", "LASTPART", "2");
noteLabel.Text = "지도의 대가 자나를 만나보세요.";
}
else if (actString == "H")
{
parser.AddSetting("INITPART", "LASTPART", "2");
noteLabel.Text = "멋진 은신처군요~!";
}
else
{
parser.AddSetting("INITPART", "LASTPART", "3");
noteLabel.Text = "정보가 없습니다. (더블클릭시에도 나타나지 않으면 지역 정보가 충분히 파악되지 않았거나, 정보가 없어도 진행이 가능한 지역입니다.)";
}
parser.AddSetting("INITPART", "zoneName", zoneName);
parser.AddSetting("INITPART", "actString", actString);
parser.SaveSettings();
btnLangText = String.Format("{0} [ Act {1} ] {2}", g_strUILang, actString, zoneName);
btnLang.Text = btnLangText;
}
private void BtnLang_MouseDown(object sender, MouseEventArgs e)
{
if (e.Clicks > 1)
{
if (bIsMinimized == false)
BtnLang_DoubleClick(sender, e);
}
else
{
nMoving = 1;
nMovePosX = e.X;
nMovePosY = e.Y;
}
}
private void BtnLang_MouseMove(object sender, MouseEventArgs e)
{
if (nMoving == 1)
{
this.SetDesktopLocation(MousePosition.X - nMovePosX, MousePosition.Y - nMovePosY);
}
}
private void BtnLang_MouseUp(object sender, MouseEventArgs e)
{
nMoving = 0;
string strINIPath = String.Format("{0}\\{1}", currentDirectory, "ConfigPath.ini");
IniParser parser = new IniParser(strINIPath);
parser.AddSetting("LOCATION", "LEFT", this.Left.ToString());
parser.AddSetting("LOCATION", "TOP", this.Top.ToString());
parser.SaveSettings();
}
private void BtnLang_DoubleClick(object sender, EventArgs e)
{
partTwo = !partTwo;
InitMapImage(); // Clear Map Image
DrawPartTwoImage();
}
private void BtnSettings_MouseDown(object sender, MouseEventArgs e)
{
if (e.Clicks > 1)
BtnSettings_DoubleClick(sender, e);
else
{
bShowSettingButtons = !bShowSettingButtons;
}
}
}
}