map editor
@@ -0,0 +1,3 @@ | ||
1 | +#include "stdafx.h" | |
2 | +#include "About.h" | |
3 | + |
@@ -0,0 +1,124 @@ | ||
1 | +#pragma once | |
2 | + | |
3 | +namespace Evigen2MapEditor { | |
4 | + | |
5 | + using namespace System; | |
6 | + using namespace System::ComponentModel; | |
7 | + using namespace System::Collections; | |
8 | + using namespace System::Windows::Forms; | |
9 | + using namespace System::Data; | |
10 | + using namespace System::Drawing; | |
11 | + | |
12 | + /// <summary> | |
13 | + /// About の概要 | |
14 | + /// </summary> | |
15 | + public ref class About : public System::Windows::Forms::Form | |
16 | + { | |
17 | + public: | |
18 | + About(void) | |
19 | + { | |
20 | + InitializeComponent(); | |
21 | + // | |
22 | + //TODO: ここにコンストラクター コードを追加します | |
23 | + // | |
24 | + } | |
25 | + | |
26 | + protected: | |
27 | + /// <summary> | |
28 | + /// 使用中のリソースをすべてクリーンアップします。 | |
29 | + /// </summary> | |
30 | + ~About() | |
31 | + { | |
32 | + if (components) | |
33 | + { | |
34 | + delete components; | |
35 | + } | |
36 | + } | |
37 | + private: System::Windows::Forms::Label^ label1; | |
38 | + protected: | |
39 | + private: System::Windows::Forms::TextBox^ textBox1; | |
40 | + private: System::Windows::Forms::Button^ button1; | |
41 | + | |
42 | + private: | |
43 | + /// <summary> | |
44 | + /// 必要なデザイナー変数です。 | |
45 | + /// </summary> | |
46 | + System::ComponentModel::Container ^components; | |
47 | + | |
48 | +#pragma region Windows Form Designer generated code | |
49 | + /// <summary> | |
50 | + /// デザイナー サポートに必要なメソッドです。このメソッドの内容を | |
51 | + /// コード エディターで変更しないでください。 | |
52 | + /// </summary> | |
53 | + void InitializeComponent(void) | |
54 | + { | |
55 | + this->label1 = (gcnew System::Windows::Forms::Label()); | |
56 | + this->textBox1 = (gcnew System::Windows::Forms::TextBox()); | |
57 | + this->button1 = (gcnew System::Windows::Forms::Button()); | |
58 | + this->SuspendLayout(); | |
59 | + // | |
60 | + // label1 | |
61 | + // | |
62 | + this->label1->AutoSize = true; | |
63 | + this->label1->Location = System::Drawing::Point(12, 57); | |
64 | + this->label1->Name = L"label1"; | |
65 | + this->label1->Size = System::Drawing::Size(46, 12); | |
66 | + this->label1->TabIndex = 0; | |
67 | + this->label1->Text = L"Version."; | |
68 | + // | |
69 | + // textBox1 | |
70 | + // | |
71 | + this->textBox1->Location = System::Drawing::Point(64, 54); | |
72 | + this->textBox1->Name = L"textBox1"; | |
73 | + this->textBox1->ReadOnly = true; | |
74 | + this->textBox1->Size = System::Drawing::Size(100, 19); | |
75 | + this->textBox1->TabIndex = 1; | |
76 | + // | |
77 | + // button1 | |
78 | + // | |
79 | + this->button1->DialogResult = System::Windows::Forms::DialogResult::OK; | |
80 | + this->button1->Location = System::Drawing::Point(197, 226); | |
81 | + this->button1->Name = L"button1"; | |
82 | + this->button1->Size = System::Drawing::Size(75, 23); | |
83 | + this->button1->TabIndex = 2; | |
84 | + this->button1->Text = L"OK"; | |
85 | + this->button1->UseVisualStyleBackColor = true; | |
86 | + // | |
87 | + // About | |
88 | + // | |
89 | + this->AutoScaleDimensions = System::Drawing::SizeF(6, 12); | |
90 | + this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; | |
91 | + this->ClientSize = System::Drawing::Size(284, 261); | |
92 | + this->Controls->Add(this->button1); | |
93 | + this->Controls->Add(this->textBox1); | |
94 | + this->Controls->Add(this->label1); | |
95 | + this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedDialog; | |
96 | + this->MaximizeBox = false; | |
97 | + this->MinimizeBox = false; | |
98 | + this->Name = L"About"; | |
99 | + this->ShowIcon = false; | |
100 | + this->ShowInTaskbar = false; | |
101 | + this->Text = L"About"; | |
102 | + this->Load += gcnew System::EventHandler(this, &About::About_Load); | |
103 | + this->ResumeLayout(false); | |
104 | + this->PerformLayout(); | |
105 | + | |
106 | + } | |
107 | +#pragma endregion | |
108 | + private: System::Void About_Load(System::Object^ sender, System::EventArgs^ e) { | |
109 | + System::Reflection::AssemblyVersionAttribute^ asmdc = | |
110 | + (System::Reflection::AssemblyVersionAttribute^) | |
111 | + Attribute::GetCustomAttribute( | |
112 | + System::Reflection::Assembly::GetExecutingAssembly(), | |
113 | + System::Reflection::AssemblyVersionAttribute::typeid); | |
114 | + if (!asmdc) { | |
115 | + return; | |
116 | + } | |
117 | + //System::Diagnostics::FileVersionInfo^ ver = | |
118 | + // System::Diagnostics::FileVersionInfo::GetVersionInfo( | |
119 | + // System::Reflection::Assembly::GetExecutingAssembly()->Location); | |
120 | + // load VERSION | |
121 | + this->textBox1->Text = asmdc->ToString(); | |
122 | + } | |
123 | + }; | |
124 | +} |
@@ -6,7 +6,7 @@ | ||
6 | 6 | using namespace Evigen2MapEditor; |
7 | 7 | |
8 | 8 | [STAThreadAttribute] |
9 | -int main(array<System::String ^> ^args) | |
9 | +int main()//array<System::String ^,10> ^args) | |
10 | 10 | { |
11 | 11 | // コントロールが作成される前に、Windows XP ビジュアル効果を有効にします |
12 | 12 | Application::EnableVisualStyles(); |
@@ -10,6 +10,7 @@ | ||
10 | 10 | #include "GroupEditor.h" |
11 | 11 | #include "EditorOption.h" |
12 | 12 | #include "ThumbViewer.h" |
13 | +#include "About.h" | |
13 | 14 | |
14 | 15 | |
15 | 16 | namespace Evigen2MapEditor { |
@@ -34,18 +35,18 @@ | ||
34 | 35 | public ref class Form1 : public System::Windows::Forms::Form |
35 | 36 | { |
36 | 37 | public: |
37 | - System::String^ CFG_BASE_DIR; | |
38 | - String^ CFG_COMMON_SPRITE_ID; | |
39 | - String^ CFG_TILE_SEQ_ID; | |
40 | - String^ CFG_PLAYER_SPRITE_ID; | |
41 | - String^ CFG_NEUTRAL_SPRITE_ID; | |
42 | - String^ CFG_ITEM_SPRITE_ID; | |
43 | - String^ CFG_CHESTS; | |
44 | - String^ CFG_DOORS; | |
45 | - String^ CFG_ZOOM_PERCENTAGE; | |
46 | - String^ CFG_PAL_ZOOM_PERCENTAGE; | |
47 | - String^ CFG_SETTING_BASE_DIR; | |
48 | - String^ CFG_DEFAULT_GROUP; | |
38 | + static System::String^ CFG_BASE_DIR; | |
39 | + static String^ CFG_COMMON_SPRITE_ID; | |
40 | + static String^ CFG_TILE_SEQ_ID; | |
41 | + static String^ CFG_PLAYER_SPRITE_ID; | |
42 | + static String^ CFG_NEUTRAL_SPRITE_ID; | |
43 | + static String^ CFG_ITEM_SPRITE_ID; | |
44 | + static String^ CFG_CHESTS; | |
45 | + static String^ CFG_DOORS; | |
46 | + static String^ CFG_ZOOM_PERCENTAGE; | |
47 | + static String^ CFG_PAL_ZOOM_PERCENTAGE; | |
48 | + static String^ CFG_SETTING_BASE_DIR; | |
49 | + //static String^ CFG_DEFAULT_GROUP; | |
49 | 50 | ThumbViewer^ m_ThumbViewer; |
50 | 51 | private: System::Windows::Forms::ToolStripMenuItem^ leftSelectToolStripMenuItem; |
51 | 52 | private: System::Windows::Forms::ToolStripMenuItem^ rightSelectToolStripMenuItem; |
@@ -58,7 +59,9 @@ | ||
58 | 59 | private: System::Windows::Forms::ToolStripMenuItem^ loadBGImageToolStripMenuItem; |
59 | 60 | private: System::Windows::Forms::ToolStripMenuItem^ groupEditorToolStripMenuItem; |
60 | 61 | private: System::Windows::Forms::ToolStripMenuItem^ thumbViewerToolStripMenuItem; |
61 | - public: | |
62 | + private: System::Windows::Forms::ToolStripMenuItem^ helpToolStripMenuItem; | |
63 | + private: System::Windows::Forms::ToolStripMenuItem^ aboutToolStripMenuItem; | |
64 | + public: | |
62 | 65 | String^ CFG_ENEMY_DIR; |
63 | 66 | Form1(void) |
64 | 67 | { |
@@ -74,7 +77,7 @@ | ||
74 | 77 | CFG_ZOOM_PERCENTAGE = gcnew String( "Zoom"); |
75 | 78 | CFG_PAL_ZOOM_PERCENTAGE = gcnew String( "PalZoom"); |
76 | 79 | CFG_SETTING_BASE_DIR = gcnew String("SettingBaseDir"); |
77 | - CFG_DEFAULT_GROUP = gcnew String("DefaultGroup"); | |
80 | + //CFG_DEFAULT_GROUP = gcnew String("DefaultGroup"); | |
78 | 81 | // |
79 | 82 | //TODO: ここにコンストラクタ コードを追加します |
80 | 83 | // |
@@ -163,7 +166,8 @@ | ||
163 | 166 | //this->m_GroupEditor->Show(); |
164 | 167 | AddOwnedForm(this->m_GroupEditor); |
165 | 168 | // 存在するファイルならロードする |
166 | - strSettingString = System::Configuration::ConfigurationManager::AppSettings[CFG_DEFAULT_GROUP]; | |
169 | + strSettingString = System::Configuration::ConfigurationManager::AppSettings[ | |
170 | + GStaticData::CFG_DEFAULT_GROUP]; | |
167 | 171 | if( strSettingString != nullptr && strSettingString != _T("")) { |
168 | 172 | if(System::IO::File::Exists(strSettingString)){ |
169 | 173 | GStaticData::staticData->m_GroupManager->load(strSettingString); |
@@ -332,6 +336,7 @@ | ||
332 | 336 | this->upSelectToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem()); |
333 | 337 | this->downSelectToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem()); |
334 | 338 | this->groupEditorToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem()); |
339 | + this->thumbViewerToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem()); | |
335 | 340 | this->statusStrip1 = (gcnew System::Windows::Forms::StatusStrip()); |
336 | 341 | this->toolStripStatusLabel1 = (gcnew System::Windows::Forms::ToolStripStatusLabel()); |
337 | 342 | this->toolStripProgressBar1 = (gcnew System::Windows::Forms::ToolStripProgressBar()); |
@@ -352,7 +357,8 @@ | ||
352 | 357 | this->openFileDialog1 = (gcnew System::Windows::Forms::OpenFileDialog()); |
353 | 358 | this->folderBrowserDialog1 = (gcnew System::Windows::Forms::FolderBrowserDialog()); |
354 | 359 | this->panelCenter = (gcnew System::Windows::Forms::Panel()); |
355 | - this->thumbViewerToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem()); | |
360 | + this->helpToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem()); | |
361 | + this->aboutToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem()); | |
356 | 362 | this->menuStrip1->SuspendLayout(); |
357 | 363 | this->statusStrip1->SuspendLayout(); |
358 | 364 | this->toolStrip1->SuspendLayout(); |
@@ -360,8 +366,10 @@ | ||
360 | 366 | // |
361 | 367 | // menuStrip1 |
362 | 368 | // |
363 | - this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(3) {this->fileToolStripMenuItem, | |
364 | - this->editToolStripMenuItem, this->viewToolStripMenuItem}); | |
369 | + this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(4) { | |
370 | + this->fileToolStripMenuItem, | |
371 | + this->editToolStripMenuItem, this->viewToolStripMenuItem, this->helpToolStripMenuItem | |
372 | + }); | |
365 | 373 | this->menuStrip1->Location = System::Drawing::Point(0, 0); |
366 | 374 | this->menuStrip1->Name = L"menuStrip1"; |
367 | 375 | this->menuStrip1->Size = System::Drawing::Size(564, 24); |
@@ -370,9 +378,11 @@ | ||
370 | 378 | // |
371 | 379 | // fileToolStripMenuItem |
372 | 380 | // |
373 | - this->fileToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(10) {this->toolStripMenuItem1, | |
374 | - this->openToolStripMenuItem, this->loadBGImageToolStripMenuItem, this->saveToolStripMenuItem, this->saveAsToolStripMenuItem, | |
375 | - this->toolStripMenuItem4, this->toolStripMenuItem2, this->toolStripMenuItem3, this->toolStripSeparator1, this->quitToolStripMenuItem}); | |
381 | + this->fileToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(10) { | |
382 | + this->toolStripMenuItem1, | |
383 | + this->openToolStripMenuItem, this->loadBGImageToolStripMenuItem, this->saveToolStripMenuItem, this->saveAsToolStripMenuItem, | |
384 | + this->toolStripMenuItem4, this->toolStripMenuItem2, this->toolStripMenuItem3, this->toolStripSeparator1, this->quitToolStripMenuItem | |
385 | + }); | |
376 | 386 | this->fileToolStripMenuItem->Name = L"fileToolStripMenuItem"; |
377 | 387 | this->fileToolStripMenuItem->Size = System::Drawing::Size(37, 20); |
378 | 388 | this->fileToolStripMenuItem->Text = L"File"; |
@@ -411,7 +421,7 @@ | ||
411 | 421 | // saveAsToolStripMenuItem |
412 | 422 | // |
413 | 423 | this->saveAsToolStripMenuItem->Name = L"saveAsToolStripMenuItem"; |
414 | - this->saveAsToolStripMenuItem->ShortcutKeys = static_cast<System::Windows::Forms::Keys>(((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::Shift) | |
424 | + this->saveAsToolStripMenuItem->ShortcutKeys = static_cast<System::Windows::Forms::Keys>(((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::Shift) | |
415 | 425 | | System::Windows::Forms::Keys::S)); |
416 | 426 | this->saveAsToolStripMenuItem->Size = System::Drawing::Size(194, 22); |
417 | 427 | this->saveAsToolStripMenuItem->Text = L"Save As..."; |
@@ -426,8 +436,10 @@ | ||
426 | 436 | // |
427 | 437 | // toolStripMenuItem2 |
428 | 438 | // |
429 | - this->toolStripMenuItem2->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(2) {this->terrainCSVToolStripMenuItem, | |
430 | - this->objectsCSVToolStripMenuItem}); | |
439 | + this->toolStripMenuItem2->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(2) { | |
440 | + this->terrainCSVToolStripMenuItem, | |
441 | + this->objectsCSVToolStripMenuItem | |
442 | + }); | |
431 | 443 | this->toolStripMenuItem2->Name = L"toolStripMenuItem2"; |
432 | 444 | this->toolStripMenuItem2->Size = System::Drawing::Size(194, 22); |
433 | 445 | this->toolStripMenuItem2->Text = L"Import"; |
@@ -448,8 +460,10 @@ | ||
448 | 460 | // |
449 | 461 | // toolStripMenuItem3 |
450 | 462 | // |
451 | - this->toolStripMenuItem3->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(2) {this->terrainToolStripMenuItem, | |
452 | - this->objectsToolStripMenuItem}); | |
463 | + this->toolStripMenuItem3->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(2) { | |
464 | + this->terrainToolStripMenuItem, | |
465 | + this->objectsToolStripMenuItem | |
466 | + }); | |
453 | 467 | this->toolStripMenuItem3->Name = L"toolStripMenuItem3"; |
454 | 468 | this->toolStripMenuItem3->Size = System::Drawing::Size(194, 22); |
455 | 469 | this->toolStripMenuItem3->Text = L"Export"; |
@@ -482,9 +496,11 @@ | ||
482 | 496 | // |
483 | 497 | // editToolStripMenuItem |
484 | 498 | // |
485 | - this->editToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(7) {this->copyToolStripMenuItem, | |
486 | - this->cutToolStripMenuItem, this->pasteToolStripMenuItem, this->undoToolStripMenuItem, this->toolStripSeparator2, this->projectPropertyToolStripMenuItem, | |
487 | - this->preferenceToolStripMenuItem}); | |
499 | + this->editToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(7) { | |
500 | + this->copyToolStripMenuItem, | |
501 | + this->cutToolStripMenuItem, this->pasteToolStripMenuItem, this->undoToolStripMenuItem, this->toolStripSeparator2, this->projectPropertyToolStripMenuItem, | |
502 | + this->preferenceToolStripMenuItem | |
503 | + }); | |
488 | 504 | this->editToolStripMenuItem->Name = L"editToolStripMenuItem"; |
489 | 505 | this->editToolStripMenuItem->Size = System::Drawing::Size(39, 20); |
490 | 506 | this->editToolStripMenuItem->Text = L"Edit"; |
@@ -538,10 +554,12 @@ | ||
538 | 554 | // |
539 | 555 | // viewToolStripMenuItem |
540 | 556 | // |
541 | - this->viewToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(10) {this->paletteToolStripMenuItem, | |
542 | - this->toolToolStripMenuItem, this->projectPropertyToolStripMenuItem1, this->scenarioEditorToolStripMenuItem, this->leftSelectToolStripMenuItem, | |
543 | - this->rightSelectToolStripMenuItem, this->upSelectToolStripMenuItem, this->downSelectToolStripMenuItem, this->groupEditorToolStripMenuItem, | |
544 | - this->thumbViewerToolStripMenuItem}); | |
557 | + this->viewToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(10) { | |
558 | + this->paletteToolStripMenuItem, | |
559 | + this->toolToolStripMenuItem, this->projectPropertyToolStripMenuItem1, this->scenarioEditorToolStripMenuItem, this->leftSelectToolStripMenuItem, | |
560 | + this->rightSelectToolStripMenuItem, this->upSelectToolStripMenuItem, this->downSelectToolStripMenuItem, this->groupEditorToolStripMenuItem, | |
561 | + this->thumbViewerToolStripMenuItem | |
562 | + }); | |
545 | 563 | this->viewToolStripMenuItem->Name = L"viewToolStripMenuItem"; |
546 | 564 | this->viewToolStripMenuItem->Size = System::Drawing::Size(44, 20); |
547 | 565 | this->viewToolStripMenuItem->Text = L"View"; |
@@ -609,10 +627,19 @@ | ||
609 | 627 | this->groupEditorToolStripMenuItem->Text = L"GroupEditor"; |
610 | 628 | this->groupEditorToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::groupEditorToolStripMenuItem_Click); |
611 | 629 | // |
630 | + // thumbViewerToolStripMenuItem | |
631 | + // | |
632 | + this->thumbViewerToolStripMenuItem->Name = L"thumbViewerToolStripMenuItem"; | |
633 | + this->thumbViewerToolStripMenuItem->Size = System::Drawing::Size(192, 22); | |
634 | + this->thumbViewerToolStripMenuItem->Text = L"ThumbViewer"; | |
635 | + this->thumbViewerToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::thumbViewerToolStripMenuItem_Click); | |
636 | + // | |
612 | 637 | // statusStrip1 |
613 | 638 | // |
614 | - this->statusStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(2) {this->toolStripStatusLabel1, | |
615 | - this->toolStripProgressBar1}); | |
639 | + this->statusStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(2) { | |
640 | + this->toolStripStatusLabel1, | |
641 | + this->toolStripProgressBar1 | |
642 | + }); | |
616 | 643 | this->statusStrip1->Location = System::Drawing::Point(0, 413); |
617 | 644 | this->statusStrip1->Name = L"statusStrip1"; |
618 | 645 | this->statusStrip1->Size = System::Drawing::Size(564, 23); |
@@ -634,9 +661,11 @@ | ||
634 | 661 | // |
635 | 662 | // toolStrip1 |
636 | 663 | // |
637 | - this->toolStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(11) {this->toolStripLabel4, | |
638 | - this->toolStripLabel1, this->toolStripLabel2, this->toolStripLabel3, this->toolStripButton1, this->toolStripButton2, this->toolStripButton3, | |
639 | - this->toolStripButton4, this->toolStripButton5, this->toolStripButton6, this->toolStripButton7}); | |
664 | + this->toolStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(11) { | |
665 | + this->toolStripLabel4, | |
666 | + this->toolStripLabel1, this->toolStripLabel2, this->toolStripLabel3, this->toolStripButton1, this->toolStripButton2, this->toolStripButton3, | |
667 | + this->toolStripButton4, this->toolStripButton5, this->toolStripButton6, this->toolStripButton7 | |
668 | + }); | |
640 | 669 | this->toolStrip1->Location = System::Drawing::Point(0, 24); |
641 | 670 | this->toolStrip1->Name = L"toolStrip1"; |
642 | 671 | this->toolStrip1->Size = System::Drawing::Size(564, 25); |
@@ -678,7 +707,7 @@ | ||
678 | 707 | // toolStripButton1 |
679 | 708 | // |
680 | 709 | this->toolStripButton1->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Text; |
681 | - this->toolStripButton1->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"toolStripButton1.Image"))); | |
710 | + this->toolStripButton1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"toolStripButton1.Image"))); | |
682 | 711 | this->toolStripButton1->ImageTransparentColor = System::Drawing::Color::Magenta; |
683 | 712 | this->toolStripButton1->Name = L"toolStripButton1"; |
684 | 713 | this->toolStripButton1->Size = System::Drawing::Size(23, 22); |
@@ -688,7 +717,7 @@ | ||
688 | 717 | // toolStripButton2 |
689 | 718 | // |
690 | 719 | this->toolStripButton2->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Text; |
691 | - this->toolStripButton2->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"toolStripButton2.Image"))); | |
720 | + this->toolStripButton2->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"toolStripButton2.Image"))); | |
692 | 721 | this->toolStripButton2->ImageTransparentColor = System::Drawing::Color::Magenta; |
693 | 722 | this->toolStripButton2->Name = L"toolStripButton2"; |
694 | 723 | this->toolStripButton2->Size = System::Drawing::Size(49, 22); |
@@ -698,7 +727,7 @@ | ||
698 | 727 | // toolStripButton3 |
699 | 728 | // |
700 | 729 | this->toolStripButton3->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Text; |
701 | - this->toolStripButton3->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"toolStripButton3.Image"))); | |
730 | + this->toolStripButton3->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"toolStripButton3.Image"))); | |
702 | 731 | this->toolStripButton3->ImageTransparentColor = System::Drawing::Color::Magenta; |
703 | 732 | this->toolStripButton3->Name = L"toolStripButton3"; |
704 | 733 | this->toolStripButton3->Size = System::Drawing::Size(23, 22); |
@@ -708,7 +737,7 @@ | ||
708 | 737 | // toolStripButton4 |
709 | 738 | // |
710 | 739 | this->toolStripButton4->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Text; |
711 | - this->toolStripButton4->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"toolStripButton4.Image"))); | |
740 | + this->toolStripButton4->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"toolStripButton4.Image"))); | |
712 | 741 | this->toolStripButton4->ImageTransparentColor = System::Drawing::Color::Magenta; |
713 | 742 | this->toolStripButton4->Name = L"toolStripButton4"; |
714 | 743 | this->toolStripButton4->Size = System::Drawing::Size(23, 22); |
@@ -718,7 +747,7 @@ | ||
718 | 747 | // toolStripButton5 |
719 | 748 | // |
720 | 749 | this->toolStripButton5->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Text; |
721 | - this->toolStripButton5->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"toolStripButton5.Image"))); | |
750 | + this->toolStripButton5->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"toolStripButton5.Image"))); | |
722 | 751 | this->toolStripButton5->ImageTransparentColor = System::Drawing::Color::Magenta; |
723 | 752 | this->toolStripButton5->Name = L"toolStripButton5"; |
724 | 753 | this->toolStripButton5->Size = System::Drawing::Size(23, 22); |
@@ -728,7 +757,7 @@ | ||
728 | 757 | // toolStripButton6 |
729 | 758 | // |
730 | 759 | this->toolStripButton6->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Text; |
731 | - this->toolStripButton6->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"toolStripButton6.Image"))); | |
760 | + this->toolStripButton6->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"toolStripButton6.Image"))); | |
732 | 761 | this->toolStripButton6->ImageTransparentColor = System::Drawing::Color::Magenta; |
733 | 762 | this->toolStripButton6->Name = L"toolStripButton6"; |
734 | 763 | this->toolStripButton6->Size = System::Drawing::Size(23, 22); |
@@ -738,7 +767,7 @@ | ||
738 | 767 | // toolStripButton7 |
739 | 768 | // |
740 | 769 | this->toolStripButton7->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Text; |
741 | - this->toolStripButton7->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"toolStripButton7.Image"))); | |
770 | + this->toolStripButton7->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"toolStripButton7.Image"))); | |
742 | 771 | this->toolStripButton7->ImageTransparentColor = System::Drawing::Color::Magenta; |
743 | 772 | this->toolStripButton7->Name = L"toolStripButton7"; |
744 | 773 | this->toolStripButton7->Size = System::Drawing::Size(23, 22); |
@@ -768,13 +797,20 @@ | ||
768 | 797 | this->panelCenter->Paint += gcnew System::Windows::Forms::PaintEventHandler(this, &Form1::panelCenter_Paint); |
769 | 798 | this->panelCenter->MouseMove += gcnew System::Windows::Forms::MouseEventHandler(this, &Form1::panelCenter_MouseMove); |
770 | 799 | // |
771 | - // thumbViewerToolStripMenuItem | |
800 | + // helpToolStripMenuItem | |
772 | 801 | // |
773 | - this->thumbViewerToolStripMenuItem->Name = L"thumbViewerToolStripMenuItem"; | |
774 | - this->thumbViewerToolStripMenuItem->Size = System::Drawing::Size(192, 22); | |
775 | - this->thumbViewerToolStripMenuItem->Text = L"ThumbViewer"; | |
776 | - this->thumbViewerToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::thumbViewerToolStripMenuItem_Click); | |
802 | + this->helpToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(1) { this->aboutToolStripMenuItem }); | |
803 | + this->helpToolStripMenuItem->Name = L"helpToolStripMenuItem"; | |
804 | + this->helpToolStripMenuItem->Size = System::Drawing::Size(44, 20); | |
805 | + this->helpToolStripMenuItem->Text = L"Help"; | |
777 | 806 | // |
807 | + // aboutToolStripMenuItem | |
808 | + // | |
809 | + this->aboutToolStripMenuItem->Name = L"aboutToolStripMenuItem"; | |
810 | + this->aboutToolStripMenuItem->Size = System::Drawing::Size(152, 22); | |
811 | + this->aboutToolStripMenuItem->Text = L"About..."; | |
812 | + this->aboutToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::aboutToolStripMenuItem_Click); | |
813 | + // | |
778 | 814 | // Form1 |
779 | 815 | // |
780 | 816 | this->AutoScaleDimensions = System::Drawing::SizeF(6, 12); |
@@ -787,12 +823,12 @@ | ||
787 | 823 | this->MainMenuStrip = this->menuStrip1; |
788 | 824 | this->Name = L"Form1"; |
789 | 825 | this->Text = L"Map Editor"; |
826 | + this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &Form1::Form1_FormClosing); | |
790 | 827 | this->Paint += gcnew System::Windows::Forms::PaintEventHandler(this, &Form1::Form1_Paint); |
828 | + this->KeyDown += gcnew System::Windows::Forms::KeyEventHandler(this, &Form1::Form1_KeyDown); | |
791 | 829 | this->KeyPress += gcnew System::Windows::Forms::KeyPressEventHandler(this, &Form1::Form1_KeyPress); |
792 | - this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &Form1::Form1_FormClosing); | |
793 | 830 | this->MouseMove += gcnew System::Windows::Forms::MouseEventHandler(this, &Form1::Form1_MouseMove); |
794 | 831 | this->PreviewKeyDown += gcnew System::Windows::Forms::PreviewKeyDownEventHandler(this, &Form1::Form1_PreviewKeyDown); |
795 | - this->KeyDown += gcnew System::Windows::Forms::KeyEventHandler(this, &Form1::Form1_KeyDown); | |
796 | 832 | this->menuStrip1->ResumeLayout(false); |
797 | 833 | this->menuStrip1->PerformLayout(); |
798 | 834 | this->statusStrip1->ResumeLayout(false); |
@@ -959,17 +995,20 @@ | ||
959 | 995 | // IO::Path::GetDirectoryName( this->openFileDialog1->FileName ); |
960 | 996 | |
961 | 997 | //// change "current directory" in config |
962 | - System::Configuration::Configuration^ lpConfig = System::Configuration::ConfigurationManager::OpenExeConfiguration( | |
963 | - System::Configuration::ConfigurationUserLevel::None ); | |
998 | + HPLNetLibTool::changeConfiguration( | |
999 | + CFG_BASE_DIR, this->openFileDialog1->InitialDirectory); | |
1000 | + | |
1001 | + //System::Configuration::Configuration^ lpConfig = System::Configuration::ConfigurationManager::OpenExeConfiguration( | |
1002 | + // System::Configuration::ConfigurationUserLevel::None); | |
964 | 1003 | // remove |
965 | - lpConfig->AppSettings->Settings->Remove( CFG_BASE_DIR); | |
1004 | + //lpConfig->AppSettings->Settings->Remove( CFG_BASE_DIR); | |
1005 | + | |
1006 | + //// add | |
1007 | + //lpConfig->AppSettings->Settings->Add( CFG_BASE_DIR, this->openFileDialog1->InitialDirectory); | |
1008 | + //lpConfig->Save(); | |
966 | 1009 | this->openFileDialog1->InitialDirectory = IO::Path::GetDirectoryName( this->openFileDialog1->FileName ); |
967 | 1010 | this->openFileDialog1->FileName = IO::Path::GetFileName( this->openFileDialog1->FileName ); |
968 | 1011 | |
969 | - // add | |
970 | - lpConfig->AppSettings->Settings->Add( CFG_BASE_DIR, this->openFileDialog1->InitialDirectory); | |
971 | - lpConfig->Save(); | |
972 | - | |
973 | 1012 | // set changed flag as off |
974 | 1013 | GStaticData::staticData->setChanged( false ); |
975 | 1014 |
@@ -1349,10 +1388,21 @@ | ||
1349 | 1388 | // un |
1350 | 1389 | |
1351 | 1390 | } |
1391 | + option->Close(); | |
1352 | 1392 | } |
1353 | 1393 | private: System::Void thumbViewerToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) { |
1354 | 1394 | this->m_ThumbViewer->Show(this); |
1355 | 1395 | } |
1396 | +private: System::Void aboutToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) { | |
1397 | + About^ ab = gcnew About(); | |
1398 | + ab->ShowDialog(); | |
1399 | + ab->Close(); | |
1400 | +} | |
1401 | + //public: void setGroupDefault(String^ strPath) { | |
1402 | + // // change pre-load | |
1403 | + // HPLNetLibTool::changeConfiguration( | |
1404 | + // Evigen2MapEditor::Form1::CFG_DEFAULT_GROUP, this->openFileDialog1->FileName); | |
1405 | + //} | |
1356 | 1406 | }; |
1357 | 1407 | } |
1358 | 1408 |
@@ -86,6 +86,8 @@ | ||
86 | 86 | } |
87 | 87 | } |
88 | 88 | } |
89 | + | |
90 | + | |
89 | 91 | } |
90 | 92 | |
91 | 93 |
@@ -130,7 +132,7 @@ | ||
130 | 132 | if(nCurMapItemID < 0 ) { |
131 | 133 | return-1; |
132 | 134 | } |
133 | - int nBlockType = blockTypeManager->getBlockType(nX,nY); | |
135 | + int nCurBlockType = blockTypeManager->getBlockType(nCurMapItemID); | |
134 | 136 | // get group |
135 | 137 | GGroupPanel^ gp = this->getGroupPanelByMapItemID(nCurMapItemID); |
136 | 138 | if(!gp){ |
@@ -154,13 +156,38 @@ | ||
154 | 156 | // block type |
155 | 157 | int nBlockType = blockTypeManager->getBlockType(nMapItemID); |
156 | 158 | int nTest = 0; |
159 | + GGroupPanel^ gpTarget = this->getGroupPanelByMapItemID(nMapItemID); | |
157 | 160 | switch(nBlockType){ |
158 | 161 | case TileType::EMPTY: |
159 | 162 | case TileType::EMPTY_DRAW_FRONT: |
160 | 163 | case TileType::THROUGH_UP: |
164 | + // 同族ならEmptyでも1とみなす | |
165 | + if (!gpTarget || !gp) { | |
166 | + } | |
167 | + else if (gpTarget->m_nGroupID == gp->m_nGroupID) { | |
168 | + nTest = 1; | |
169 | + } | |
161 | 170 | break; |
162 | 171 | default: |
163 | 172 | nTest = 1; |
173 | + if (gp && gpTarget && gpTarget->m_nGroupID == gp->m_nGroupID) { | |
174 | + } | |
175 | + else { | |
176 | + | |
177 | + // 違うグループ | |
178 | + switch (nCurBlockType) { | |
179 | + case TileType::EMPTY: | |
180 | + case TileType::EMPTY_DRAW_FRONT: | |
181 | + case TileType::THROUGH_UP: | |
182 | + // 自分がEmpty | |
183 | + // ... 違うグループのブロックがBLOCKでも、 | |
184 | + // 自分がEmptyGroupなら、他のグループを「ないものとして考える」 | |
185 | + nTest = 0; | |
186 | + | |
187 | + // Empty(背後タイル) | |
188 | + break; | |
189 | + } | |
190 | + } | |
164 | 191 | } |
165 | 192 | mat->set(dx+1,dy+1,nTest); |
166 | 193 | } |
@@ -176,6 +203,7 @@ | ||
176 | 203 | continue; |
177 | 204 | } |
178 | 205 | if(pair->Value->m_nGroupPanelType == nPanelType){ |
206 | + // 同じグループである | |
179 | 207 | |
180 | 208 | return pair->Value->m_nMapItemID; |
181 | 209 | } |
@@ -533,6 +533,13 @@ | ||
533 | 533 | Form1^ form = (Form1^)this->m_Form; |
534 | 534 | form->resizeMainFrameFitToSize(); |
535 | 535 | } |
536 | +void GStaticData::zoomPaletteCommon() { | |
537 | + Palette^ pal = (Palette^)this->m_PaletteFormHandle; | |
538 | + if (!pal) { | |
539 | + return; | |
540 | + } | |
541 | + pal->resizePaletteFitToSize(); | |
542 | +} | |
536 | 543 | |
537 | 544 | void GStaticData::zoomIn( ) { |
538 | 545 | this->m_nZoom += ZOOM_STEP; |
@@ -566,6 +573,7 @@ | ||
566 | 573 | if( this->m_nZoomPalette > ZOOM_MAX ) { |
567 | 574 | this->m_nZoomPalette = ZOOM_MAX; |
568 | 575 | } |
576 | + this->zoomPaletteCommon(); | |
569 | 577 | } |
570 | 578 | void GStaticData::zoomOutPalette( ) { |
571 | 579 | this->m_nZoomPalette -= ZOOM_STEP; |
@@ -572,11 +580,12 @@ | ||
572 | 580 | if( this->m_nZoomPalette < ZOOM_MIN ) { |
573 | 581 | this->m_nZoomPalette = ZOOM_MIN; |
574 | 582 | } |
575 | - | |
583 | + this->zoomPaletteCommon(); | |
576 | 584 | } |
577 | 585 | |
578 | 586 | void GStaticData::zoomResetPalette() { |
579 | 587 | this->m_nZoomPalette = ZOOM_RESET; |
588 | + this->zoomPaletteCommon(); | |
580 | 589 | } |
581 | 590 | |
582 | 591 | HPLNetMatrix^ GStaticData::loadCSV( String^ strFilePath ) { |
@@ -54,7 +54,7 @@ | ||
54 | 54 | |
55 | 55 | // zoom |
56 | 56 | static const int ZOOM_RESET = 100; |
57 | - static const int ZOOM_MAX = ZOOM_RESET * 2; | |
57 | + static const int ZOOM_MAX = ZOOM_RESET * 8; | |
58 | 58 | static const int ZOOM_STEP = ZOOM_RESET / 4; |
59 | 59 | static const int ZOOM_MIN = ZOOM_RESET / 4; |
60 | 60 | static const float ZOOM_RATE = 1.f / ZOOM_RESET; |
@@ -118,6 +118,7 @@ | ||
118 | 118 | String^ m_strCurrentFileName; |
119 | 119 | String^ m_strSettingDir; |
120 | 120 | public: |
121 | + static String^ CFG_DEFAULT_GROUP= gcnew String("DefaultGroup"); | |
121 | 122 | Form^ m_GroupEditorFormHandle; |
122 | 123 | GGroupManager^ m_GroupManager; |
123 | 124 | HPLNetBlockTypeManager^ m_BlockTypeManager; |
@@ -179,6 +180,9 @@ | ||
179 | 180 | this->m_Form->Refresh(); |
180 | 181 | } |
181 | 182 | } |
183 | + //void setGroupDefault(String^ strPath) { | |
184 | + // ((Form1^)this->m_Form)->setGroupDefault(strPath); | |
185 | + //} | |
182 | 186 | // palette form |
183 | 187 | void setPaletteForm( Form^ form ) { this->m_PaletteFormHandle = form; } |
184 | 188 | void refreshPaletteForm() { |
@@ -242,6 +246,7 @@ | ||
242 | 246 | void zoomIn( ); |
243 | 247 | void zoomOut( ); |
244 | 248 | void zoomCommon(); |
249 | + void zoomPaletteCommon(); | |
245 | 250 | void setZoomByInt( int nZoom ) { |
246 | 251 | this->m_nZoom = nZoom; |
247 | 252 | } |
@@ -9,6 +9,7 @@ | ||
9 | 9 | using namespace System::Data; |
10 | 10 | using namespace System::Drawing; |
11 | 11 | #include "GStaticData.h" |
12 | +//#include "Form1.h" | |
12 | 13 | |
13 | 14 | namespace Evigen2MapEditor { |
14 | 15 |
@@ -30,12 +31,12 @@ | ||
30 | 31 | // |
31 | 32 | //TODO: ここにコンストラクタ コードを追加します |
32 | 33 | // |
33 | - this->m_imgSelectFrame = Image::FromFile( _T("MapEditor/SelectFrame1.png") ); | |
34 | + this->m_imgSelectFrame = Image::FromFile(_T("MapEditor/SelectFrame1.png")); | |
34 | 35 | |
35 | - Image^ img = GStaticData::staticData->m_SpriteContainer->getImage( | |
36 | - GStaticData::staticData->getCommonSpriteID(), | |
37 | - GStaticData::staticData->getTileSeqID(), 0 ); | |
38 | - Drawing::Size s = Drawing::Size(img->Width, img->Height); | |
36 | + Image^ img = GStaticData::staticData->m_SpriteContainer->getImage( | |
37 | + GStaticData::staticData->getCommonSpriteID(), | |
38 | + GStaticData::staticData->getTileSeqID(), 0); | |
39 | + Drawing::Size s = Drawing::Size(img->Width, img->Height); | |
39 | 40 | this->pictureBox1->Size = s; |
40 | 41 | this->panel1->AutoScrollMinSize = s; |
41 | 42 | this->m_nMouseCoordX = 0; |
@@ -49,7 +50,7 @@ | ||
49 | 50 | int m_nMouseCoordX; |
50 | 51 | int m_nMouseCoordY; |
51 | 52 | private: System::Windows::Forms::OpenFileDialog^ openFileDialog1; |
52 | - | |
53 | + | |
53 | 54 | // 選択中のグループID |
54 | 55 | public: int m_nSelGroupID; |
55 | 56 | private: System::Windows::Forms::SaveFileDialog^ saveFileDialog1; |
@@ -65,7 +66,7 @@ | ||
65 | 66 | } |
66 | 67 | } |
67 | 68 | private: System::Windows::Forms::PictureBox^ pictureBox1; |
68 | - protected: | |
69 | + protected: | |
69 | 70 | private: System::Windows::Forms::Panel^ panel1; |
70 | 71 | private: System::Windows::Forms::SplitContainer^ splitContainer1; |
71 | 72 | private: System::Windows::Forms::Label^ label1; |
@@ -196,9 +197,11 @@ | ||
196 | 197 | // |
197 | 198 | this->listBoxPanelType->FormattingEnabled = true; |
198 | 199 | this->listBoxPanelType->ItemHeight = 12; |
199 | - this->listBoxPanelType->Items->AddRange(gcnew cli::array< System::Object^ >(19) {L"None", L"凸-LeftTop", L"凸-Top", L"凸-RightTop", | |
200 | - L"凸-Left", L"凸-Center", L"凸-Right", L"凸-LeftBottom", L"凸-Bottom", L"凸-RightBottom", L"凹-LeftTop", L"凹-Top", L"凹-RightTop", L"凹-Left", | |
201 | - L"凹-Center", L"凹-Right", L"凹-LeftBottom", L"凹-Bottom", L"凹-RightBottom"}); | |
200 | + this->listBoxPanelType->Items->AddRange(gcnew cli::array< System::Object^ >(19) { | |
201 | + L"None", L"凸-LeftTop", L"凸-Top", L"凸-RightTop", | |
202 | + L"凸-Left", L"凸-Center", L"凸-Right", L"凸-LeftBottom", L"凸-Bottom", L"凸-RightBottom", L"凹-LeftTop", L"凹-Top", L"凹-RightTop", L"凹-Left", | |
203 | + L"凹-Center", L"凹-Right", L"凹-LeftBottom", L"凹-Bottom", L"凹-RightBottom" | |
204 | + }); | |
202 | 205 | this->listBoxPanelType->Location = System::Drawing::Point(12, 27); |
203 | 206 | this->listBoxPanelType->Name = L"listBoxPanelType"; |
204 | 207 | this->listBoxPanelType->ScrollAlwaysVisible = true; |
@@ -228,7 +231,7 @@ | ||
228 | 231 | // |
229 | 232 | // menuStrip1 |
230 | 233 | // |
231 | - this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(1) {this->fileToolStripMenuItem}); | |
234 | + this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(1) { this->fileToolStripMenuItem }); | |
232 | 235 | this->menuStrip1->Location = System::Drawing::Point(0, 0); |
233 | 236 | this->menuStrip1->Name = L"menuStrip1"; |
234 | 237 | this->menuStrip1->Size = System::Drawing::Size(659, 24); |
@@ -237,8 +240,10 @@ | ||
237 | 240 | // |
238 | 241 | // fileToolStripMenuItem |
239 | 242 | // |
240 | - this->fileToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(4) {this->newToolStripMenuItem, | |
241 | - this->openToolStripMenuItem, this->saveToolStripMenuItem, this->saveAsToolStripMenuItem}); | |
243 | + this->fileToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(4) { | |
244 | + this->newToolStripMenuItem, | |
245 | + this->openToolStripMenuItem, this->saveToolStripMenuItem, this->saveAsToolStripMenuItem | |
246 | + }); | |
242 | 247 | this->fileToolStripMenuItem->Name = L"fileToolStripMenuItem"; |
243 | 248 | this->fileToolStripMenuItem->Size = System::Drawing::Size(37, 20); |
244 | 249 | this->fileToolStripMenuItem->Text = L"File"; |
@@ -298,69 +303,70 @@ | ||
298 | 303 | } |
299 | 304 | #pragma endregion |
300 | 305 | private: System::Void pictureBox1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) { |
301 | - const int TILE_SIZE = GStaticData::staticData->m_nTileSize; | |
302 | - // src rect | |
303 | - RectangleF rect = Rectangle(0,0,TILE_SIZE,TILE_SIZE ); | |
306 | + const int TILE_SIZE = GStaticData::staticData->m_nTileSize; | |
307 | + // src rect | |
308 | + RectangleF rect = Rectangle(0, 0, TILE_SIZE, TILE_SIZE); | |
304 | 309 | |
305 | - Image^ imgSelect = m_imgSelectFrame; | |
306 | -// GStaticData::staticData->m_SpriteContainer->getImage( | |
307 | -// SpriteType::COMMON, Sequence::Common::MENU_SELECT_FRAME, 0 ); | |
310 | + Image^ imgSelect = m_imgSelectFrame; | |
311 | + // GStaticData::staticData->m_SpriteContainer->getImage( | |
312 | + // SpriteType::COMMON, Sequence::Common::MENU_SELECT_FRAME, 0 ); | |
308 | 313 | |
309 | - | |
310 | - // ズーム | |
311 | - float fZoom = GStaticData::staticData->getZoomPalette(); | |
312 | 314 | |
313 | - // パレット画像 | |
314 | - Image^ img = GStaticData::staticData->m_SpriteContainer->getImage( | |
315 | - GStaticData::staticData->getCommonSpriteID(), | |
316 | - GStaticData::staticData->getTileSeqID(), 0 ); | |
317 | - // パレット画像描画 | |
318 | - e->Graphics->DrawImage(img, | |
319 | - 0,0,(int)(img->Width * fZoom),(int)(img->Height * fZoom) ); | |
320 | - int nIndex = 0; | |
321 | - int nColumnPerRow = GStaticData::staticData->getColumnPerRow(); | |
322 | - int nColumnNum = img->Width / TILE_SIZE; | |
323 | - int nRowNum = img->Height / TILE_SIZE; | |
324 | - RectangleF destRect = Rectangle(0,0,(int)(TILE_SIZE * fZoom),(int)(TILE_SIZE*fZoom) ); | |
325 | - System::Drawing::Font^ fnt = gcnew System::Drawing::Font( _T("MS UI Gothic"), 10); | |
326 | - Pen^ pmPen = gcnew Pen( Color::Blue ); | |
327 | - Drawing::Brush^ brush = Drawing::Brushes::White; | |
315 | + // ズーム | |
316 | + float fZoom = GStaticData::staticData->getZoomPalette(); | |
328 | 317 | |
329 | - // 範囲選択用情報 | |
330 | - //SelectData^ sel = GStaticData::staticData->m_PaletteSelData; | |
318 | + // パレット画像 | |
319 | + Image^ img = GStaticData::staticData->m_SpriteContainer->getImage( | |
320 | + GStaticData::staticData->getCommonSpriteID(), | |
321 | + GStaticData::staticData->getTileSeqID(), 0); | |
322 | + // パレット画像描画 | |
323 | + e->Graphics->DrawImage(img, | |
324 | + 0, 0, (int)(img->Width * fZoom), (int)(img->Height * fZoom)); | |
325 | + int nIndex = 0; | |
326 | + int nColumnPerRow = GStaticData::staticData->getColumnPerRow(); | |
327 | + int nColumnNum = img->Width / TILE_SIZE; | |
328 | + int nRowNum = img->Height / TILE_SIZE; | |
329 | + RectangleF destRect = Rectangle(0, 0, (int)(TILE_SIZE * fZoom), (int)(TILE_SIZE*fZoom)); | |
330 | + System::Drawing::Font^ fnt = gcnew System::Drawing::Font(_T("MS UI Gothic"), 10); | |
331 | + Pen^ pmPen = gcnew Pen(Color::Blue); | |
332 | + Drawing::Brush^ brush = Drawing::Brushes::White; | |
331 | 333 | |
332 | - // GroupIDとPanelIDを表示(選択しているグループのみ | |
333 | - // 何も選択していない場合、全グループの設定を表示 | |
334 | - | |
335 | - // groupを全部表示? | |
336 | - // 選択しているグループのみ表示 | |
337 | - | |
338 | - for each( Generic::KeyValuePair<int,GGroupPanel^>^ p in GStaticData::staticData->m_GroupManager->m_mapGroupPanels){ | |
339 | - int nMapItemID = p->Key; | |
340 | - if(this->m_nSelGroupID < 0 ){ | |
341 | - } else if(this->m_nSelGroupID != p->Value->m_nGroupID){ | |
342 | - continue; | |
343 | - } | |
344 | - // 位置を特定 | |
345 | - int nX = nMapItemID % nColumnPerRow; | |
346 | - int nY = nMapItemID / nColumnPerRow; | |
347 | - e->Graphics->DrawString( | |
348 | - String::Format("G:{0},PT:{1}", p->Value->m_nGroupID, | |
349 | - p->Value->m_nGroupPanelType), | |
350 | - fnt,brush,nX*TILE_SIZE*fZoom,nY*TILE_SIZE*fZoom); | |
334 | + // 範囲選択用情報 | |
335 | + //SelectData^ sel = GStaticData::staticData->m_PaletteSelData; | |
351 | 336 | |
352 | - } | |
337 | + // GroupIDとPanelIDを表示(選択しているグループのみ | |
338 | + // 何も選択していない場合、全グループの設定を表示 | |
353 | 339 | |
354 | - // sel | |
355 | - if(this->m_nMouseCoordX >= 0 && this->m_nMouseCoordX < nColumnNum&& | |
356 | - this->m_nMouseCoordY >= 0 && this->m_nMouseCoordY < nRowNum ) | |
357 | - { | |
358 | - e->Graphics->DrawImage(imgSelect, | |
359 | - this->m_nMouseCoordX* TILE_SIZE * fZoom, | |
360 | - this->m_nMouseCoordY* TILE_SIZE * fZoom, | |
361 | - TILE_SIZE * fZoom, TILE_SIZE * fZoom); | |
362 | - } | |
363 | - //bool bIsDrawSelectedRange = false; | |
340 | + // groupを全部表示? | |
341 | + // 選択しているグループのみ表示 | |
342 | + | |
343 | + for each(Generic::KeyValuePair<int, GGroupPanel^>^ p in GStaticData::staticData->m_GroupManager->m_mapGroupPanels) { | |
344 | + int nMapItemID = p->Key; | |
345 | + if (this->m_nSelGroupID < 0) { | |
346 | + } | |
347 | + else if (this->m_nSelGroupID != p->Value->m_nGroupID) { | |
348 | + continue; | |
349 | + } | |
350 | + // 位置を特定 | |
351 | + int nX = nMapItemID % nColumnPerRow; | |
352 | + int nY = nMapItemID / nColumnPerRow; | |
353 | + e->Graphics->DrawString( | |
354 | + String::Format("G:{0},PT:{1}", p->Value->m_nGroupID, | |
355 | + p->Value->m_nGroupPanelType), | |
356 | + fnt, brush, nX*TILE_SIZE*fZoom, nY*TILE_SIZE*fZoom); | |
357 | + | |
358 | + } | |
359 | + | |
360 | + // sel | |
361 | + if (this->m_nMouseCoordX >= 0 && this->m_nMouseCoordX < nColumnNum&& | |
362 | + this->m_nMouseCoordY >= 0 && this->m_nMouseCoordY < nRowNum) | |
363 | + { | |
364 | + e->Graphics->DrawImage(imgSelect, | |
365 | + this->m_nMouseCoordX* TILE_SIZE * fZoom, | |
366 | + this->m_nMouseCoordY* TILE_SIZE * fZoom, | |
367 | + TILE_SIZE * fZoom, TILE_SIZE * fZoom); | |
368 | + } | |
369 | + //bool bIsDrawSelectedRange = false; | |
364 | 370 | // switch( GStaticData::staticData->getToolType()) { |
365 | 371 | // case ToolType::PENCIL: |
366 | 372 | // case ToolType::RECT: |
@@ -424,184 +430,193 @@ | ||
424 | 430 | // break; |
425 | 431 | // } // switch tool type |
426 | 432 | |
427 | - // GRID | |
428 | - if( GStaticData::staticData->m_bIsShowGridPalette ) { | |
429 | - // draw grid! | |
433 | + // GRID | |
434 | + if (GStaticData::staticData->m_bIsShowGridPalette) { | |
435 | + // draw grid! | |
430 | 436 | |
431 | - // horizontal | |
432 | - for( int y = 0; y < nRowNum; y ++ ) { | |
433 | - e->Graphics->FillRectangle( | |
434 | - Brushes::White, | |
435 | - 0, (int)(y * TILE_SIZE * fZoom), | |
436 | - (int)(nColumnNum * TILE_SIZE * fZoom), 1 ); | |
437 | + // horizontal | |
438 | + for (int y = 0; y < nRowNum; y++) { | |
439 | + e->Graphics->FillRectangle( | |
440 | + Brushes::White, | |
441 | + 0, (int)(y * TILE_SIZE * fZoom), | |
442 | + (int)(nColumnNum * TILE_SIZE * fZoom), 1); | |
437 | 443 | |
438 | - } | |
444 | + } | |
439 | 445 | |
440 | - // vertical | |
441 | - for( int x = 0; x < nColumnNum; x ++ ) { | |
442 | - e->Graphics->FillRectangle( | |
443 | - Brushes::White, | |
444 | - (int)(x * TILE_SIZE * fZoom), 0, | |
445 | - 1, (int)(nRowNum * TILE_SIZE * fZoom )); | |
446 | + // vertical | |
447 | + for (int x = 0; x < nColumnNum; x++) { | |
448 | + e->Graphics->FillRectangle( | |
449 | + Brushes::White, | |
450 | + (int)(x * TILE_SIZE * fZoom), 0, | |
451 | + 1, (int)(nRowNum * TILE_SIZE * fZoom)); | |
446 | 452 | |
447 | - } | |
448 | - } | |
449 | - } | |
450 | -private: System::Void listBoxPanelType_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) { | |
451 | - this->m_nSelPanelType = this->listBoxPanelType->SelectedIndex-1; | |
452 | - this->Refresh(); | |
453 | - } | |
454 | -private: System::Void listBoxGroupID_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) { | |
455 | - this->m_nSelGroupID = this->listBoxGroupID->SelectedIndex; | |
456 | - // repaint | |
457 | - this->Refresh(); | |
458 | - } | |
459 | -private: System::Void pictureBox1_Click(System::Object^ sender, System::EventArgs^ e) { | |
453 | + } | |
454 | + } | |
455 | + } | |
456 | + private: System::Void listBoxPanelType_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) { | |
457 | + this->m_nSelPanelType = this->listBoxPanelType->SelectedIndex - 1; | |
458 | + this->Refresh(); | |
459 | + } | |
460 | + private: System::Void listBoxGroupID_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) { | |
461 | + this->m_nSelGroupID = this->listBoxGroupID->SelectedIndex; | |
462 | + // repaint | |
463 | + this->Refresh(); | |
464 | + } | |
465 | + private: System::Void pictureBox1_Click(System::Object^ sender, System::EventArgs^ e) { | |
460 | 466 | |
461 | 467 | |
462 | - } | |
463 | - public: | |
464 | - void selectGroupID(int nGroupID){ | |
465 | - if(nGroupID < 0 || nGroupID >= this->listBoxGroupID->Items->Count){ | |
466 | - return; | |
468 | + } | |
469 | + public: | |
470 | + void selectGroupID(int nGroupID) { | |
471 | + if (nGroupID < 0 || nGroupID >= this->listBoxGroupID->Items->Count) { | |
472 | + return; | |
473 | + } | |
474 | + this->listBoxGroupID->SelectedIndex = nGroupID; | |
475 | + } | |
476 | + void selectPanelType(int nPanelType) { | |
477 | + if (nPanelType < -1 || nPanelType >= this->listBoxPanelType->Items->Count) { | |
478 | + return; | |
479 | + } | |
480 | + this->listBoxPanelType->SelectedIndex = nPanelType + 1; | |
481 | + this->m_nSelPanelType = nPanelType; | |
482 | + } | |
483 | + private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { | |
484 | + int nNewGroupID = this->listBoxGroupID->Items->Count; | |
485 | + this->listBoxGroupID->Items->Add("" + nNewGroupID); | |
486 | + //// group listを追加 | |
487 | + //GGroup^ g = gcnew GGroup(); | |
488 | + //g->m_nGroupID = nNewGroupID; | |
489 | + //GStaticData::staticData->m_GroupManager->m_mapGroups[nNewGroupID] = g; | |
490 | + //// listに追加 | |
491 | + } | |
492 | + private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) { | |
493 | + // ラストを削除する | |
494 | + //if(this->listBoxGroupID->Items->Count <= 0){ | |
495 | + // return; | |
496 | + //} | |
497 | + //this->listBoxGroupID->Items->RemoveAt(this->listBoxGroupID->Items->Count-1); | |
498 | + //// group dataも削除 | |
499 | + | |
500 | + } | |
501 | + private: System::Void openToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) { | |
502 | + this->openFileDialog1->Filter = "Text file(*.txt)|*.txt|All file(*.*)|*.*"; | |
503 | + if (this->openFileDialog1->ShowDialog() == Windows::Forms::DialogResult::OK) { | |
504 | + GStaticData::staticData->m_GroupManager->load( | |
505 | + this->openFileDialog1->FileName); | |
506 | + // 登録 | |
507 | + this->setupGroupByStaticData(); | |
508 | + // change pre-load | |
509 | + // change pre-load | |
510 | + HPLNetLibTool::changeConfiguration( | |
511 | + GStaticData::CFG_DEFAULT_GROUP, this->openFileDialog1->FileName); | |
512 | + } | |
513 | + this->Refresh(); | |
514 | + } | |
515 | + private: System::Void saveAsToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) { | |
516 | + this->saveFileDialog1->Filter = "Text file(*.txt)|*.txt|All File(*.*)|*.*"; | |
517 | + if (this->saveFileDialog1->ShowDialog() == Windows::Forms::DialogResult::OK) { | |
518 | + // save groups | |
519 | + GStaticData::staticData->m_GroupManager->save( | |
520 | + this->saveFileDialog1->FileName); | |
521 | + // change pre-load | |
522 | + // change pre-load | |
523 | + HPLNetLibTool::changeConfiguration( | |
524 | + GStaticData::CFG_DEFAULT_GROUP, this->openFileDialog1->FileName); | |
525 | + } | |
526 | + } | |
527 | + | |
528 | + public: | |
529 | + void setupGroupByStaticData() { | |
530 | + this->listBoxGroupID->Items->Clear(); | |
531 | + int nMaxGroupID = -1; | |
532 | + // 最大のグループID→その数だけ用意する | |
533 | + for each(Generic::KeyValuePair<int, GGroupPanel^>^ gp in GStaticData::staticData->m_GroupManager->m_mapGroupPanels) { | |
534 | + if (gp->Value->m_nGroupID > nMaxGroupID) { | |
535 | + nMaxGroupID = gp->Value->m_nGroupID; | |
467 | 536 | } |
468 | - this->listBoxGroupID->SelectedIndex = nGroupID; | |
469 | - } | |
470 | - void selectPanelType(int nPanelType){ | |
471 | - if(nPanelType < -1 || nPanelType>=this->listBoxPanelType->Items->Count){ | |
472 | - return; | |
473 | - } | |
474 | - this->listBoxPanelType->SelectedIndex = nPanelType+1; | |
475 | - this->m_nSelPanelType = nPanelType; | |
476 | - } | |
477 | -private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { | |
478 | - int nNewGroupID = this->listBoxGroupID->Items->Count; | |
479 | - this->listBoxGroupID->Items->Add(""+nNewGroupID); | |
480 | - //// group listを追加 | |
481 | - //GGroup^ g = gcnew GGroup(); | |
482 | - //g->m_nGroupID = nNewGroupID; | |
483 | - //GStaticData::staticData->m_GroupManager->m_mapGroups[nNewGroupID] = g; | |
484 | - //// listに追加 | |
485 | - } | |
486 | -private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) { | |
487 | - // ラストを削除する | |
488 | - //if(this->listBoxGroupID->Items->Count <= 0){ | |
489 | - // return; | |
490 | - //} | |
491 | - //this->listBoxGroupID->Items->RemoveAt(this->listBoxGroupID->Items->Count-1); | |
492 | - //// group dataも削除 | |
493 | - | |
494 | - } | |
495 | -private: System::Void openToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) { | |
496 | - this->openFileDialog1->Filter = "Text file(*.txt)|*.txt|All file(*.*)|*.*"; | |
497 | - if( this->openFileDialog1->ShowDialog() == Windows::Forms::DialogResult::OK ) { | |
498 | - GStaticData::staticData->m_GroupManager->load( | |
499 | - this->openFileDialog1->FileName); | |
500 | - // 登録 | |
501 | - this->setupGroupByStaticData(); | |
502 | - } | |
503 | - this->Refresh(); | |
504 | - } | |
505 | -private: System::Void saveAsToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) { | |
506 | - this->saveFileDialog1->Filter = "Text file(*.txt)|*.txt|All File(*.*)|*.*"; | |
507 | - if( this->saveFileDialog1->ShowDialog() == Windows::Forms::DialogResult::OK ) { | |
508 | - // save groups | |
509 | - GStaticData::staticData->m_GroupManager->save( | |
510 | - this->saveFileDialog1->FileName); | |
511 | - } | |
512 | - } | |
513 | - | |
514 | - public: | |
515 | - void setupGroupByStaticData(){ | |
516 | - this->listBoxGroupID->Items->Clear(); | |
517 | - int nMaxGroupID = -1; | |
518 | - // 最大のグループID→その数だけ用意する | |
519 | - for each( Generic::KeyValuePair<int,GGroupPanel^>^ gp in GStaticData::staticData->m_GroupManager->m_mapGroupPanels){ | |
520 | - if(gp->Value->m_nGroupID > nMaxGroupID){ | |
521 | - nMaxGroupID = gp->Value->m_nGroupID; | |
522 | - } | |
523 | - } | |
524 | - if( nMaxGroupID >= 0) | |
537 | + } | |
538 | + if (nMaxGroupID >= 0) | |
539 | + { | |
540 | + for (int i = 0; i < nMaxGroupID + 1; i++) | |
525 | 541 | { |
526 | - for( int i = 0; i < nMaxGroupID + 1; i ++ ) | |
527 | - { | |
528 | - this->listBoxGroupID->Items->Add(""+i); | |
529 | - } | |
542 | + this->listBoxGroupID->Items->Add("" + i); | |
530 | 543 | } |
531 | - } | |
544 | + } | |
545 | + } | |
532 | 546 | |
533 | -private: System::Void pictureBox1_MouseMove(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { | |
534 | - this->updateMousePos(e->X,e->Y); | |
535 | - } | |
547 | + private: System::Void pictureBox1_MouseMove(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { | |
548 | + this->updateMousePos(e->X, e->Y); | |
549 | + } | |
536 | 550 | |
537 | - private: | |
538 | - void updateMousePos(int nMouseX,int nMouseY){ | |
539 | - const int TILE_SIZE = GStaticData::staticData->m_nTileSize; | |
540 | - float fZoom = GStaticData::staticData->getZoomPalette(); | |
541 | - this->m_nMouseCoordX = (int)(nMouseX / (TILE_SIZE * fZoom)); | |
542 | - this->m_nMouseCoordY = (int)(nMouseY / (TILE_SIZE * fZoom)); | |
543 | - } | |
551 | + private: | |
552 | + void updateMousePos(int nMouseX, int nMouseY) { | |
553 | + const int TILE_SIZE = GStaticData::staticData->m_nTileSize; | |
554 | + float fZoom = GStaticData::staticData->getZoomPalette(); | |
555 | + this->m_nMouseCoordX = (int)(nMouseX / (TILE_SIZE * fZoom)); | |
556 | + this->m_nMouseCoordY = (int)(nMouseY / (TILE_SIZE * fZoom)); | |
557 | + } | |
544 | 558 | |
545 | -private: System::Void pictureBox1_MouseClick(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { | |
546 | - // 右クリック→読み取り(GroupID) | |
547 | - // 左クリック→選択したGourpID、PanelTypeで指定。重複したものは…とりあえず虫 | |
548 | - switch( e->Button ) { | |
549 | - case Forms::MouseButtons::Left: // left press | |
550 | - { | |
551 | - // 範囲外なら何もしない | |
552 | - // apply selected group and paneltype | |
553 | - int nMapItemID = GStaticData::staticData->m_BlockTypeManager->getIDFromColRow( | |
554 | - this->m_nMouseCoordX,this->m_nMouseCoordY); | |
555 | - // find if exists | |
556 | - GGroupPanel^ p = GStaticData::staticData->m_GroupManager->getGroupPanelByMapItemID( | |
557 | - nMapItemID); | |
558 | - // remove if exists | |
559 | - if(p){ | |
560 | - GStaticData::staticData->m_GroupManager->removeGroupPanel( | |
561 | - p->m_nGroupID, nMapItemID); | |
562 | - } | |
563 | - if(this->m_nSelPanelType < 0 ){ | |
564 | - // NONEにする | |
565 | - | |
566 | - break; | |
567 | - } else{ | |
568 | - } | |
569 | - if(this->m_nSelGroupID < 0){ | |
570 | - break; | |
571 | - } | |
572 | - // セット | |
573 | - // 既存のセットがあったら消す | |
574 | - GStaticData::staticData->m_GroupManager->removeGroupPanel( | |
575 | - this->m_nSelGroupID, this->m_nSelPanelType); | |
576 | - | |
577 | - // 追加 | |
578 | - GStaticData::staticData->m_GroupManager->addGroupPanel( | |
579 | - this->m_nSelGroupID, | |
580 | - this->m_nSelPanelType, | |
581 | - nMapItemID); | |
582 | - this->Refresh(); | |
583 | - } | |
559 | + private: System::Void pictureBox1_MouseClick(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { | |
560 | + // 右クリック→読み取り(GroupID) | |
561 | + // 左クリック→選択したGourpID、PanelTypeで指定。重複したものは…とりあえず虫 | |
562 | + switch (e->Button) { | |
563 | + case Forms::MouseButtons::Left: // left press | |
564 | + { | |
565 | + // 範囲外なら何もしない | |
566 | + // apply selected group and paneltype | |
567 | + int nMapItemID = GStaticData::staticData->m_BlockTypeManager->getIDFromColRow( | |
568 | + this->m_nMouseCoordX, this->m_nMouseCoordY); | |
569 | + // find if exists | |
570 | + GGroupPanel^ p = GStaticData::staticData->m_GroupManager->getGroupPanelByMapItemID( | |
571 | + nMapItemID); | |
572 | + // remove if exists | |
573 | + if (p) { | |
574 | + GStaticData::staticData->m_GroupManager->removeGroupPanel( | |
575 | + p->m_nGroupID, nMapItemID); | |
576 | + } | |
577 | + if (this->m_nSelPanelType < 0) { | |
578 | + // NONEにする | |
579 | + | |
584 | 580 | break; |
585 | - case Forms::MouseButtons::Right: // right click | |
586 | - // refer its panel type and group | |
587 | - { | |
588 | - int nMapItemID = GStaticData::staticData->m_BlockTypeManager->getIDFromColRow( | |
589 | - this->m_nMouseCoordX,this->m_nMouseCoordY); | |
590 | - GGroupPanel^ gp = GStaticData::staticData->m_GroupManager->getGroupPanelByMapItemID( | |
591 | - nMapItemID); | |
592 | - if(!gp){ | |
593 | - break; | |
594 | - } | |
595 | - this->selectGroupID(gp->m_nGroupID); | |
596 | - this->selectPanelType(gp->m_nGroupPanelType); | |
581 | + } | |
582 | + else { | |
583 | + } | |
584 | + if (this->m_nSelGroupID < 0) { | |
585 | + break; | |
586 | + } | |
587 | + // セット | |
588 | + // 既存のセットがあったら消す | |
589 | + GStaticData::staticData->m_GroupManager->removeGroupPanel( | |
590 | + this->m_nSelGroupID, this->m_nSelPanelType); | |
597 | 591 | |
598 | - } | |
592 | + // 追加 | |
593 | + GStaticData::staticData->m_GroupManager->addGroupPanel( | |
594 | + this->m_nSelGroupID, | |
595 | + this->m_nSelPanelType, | |
596 | + nMapItemID); | |
597 | + this->Refresh(); | |
598 | + } | |
599 | + break; | |
600 | + case Forms::MouseButtons::Right: // right click | |
601 | + // refer its panel type and group | |
602 | + { | |
603 | + int nMapItemID = GStaticData::staticData->m_BlockTypeManager->getIDFromColRow( | |
604 | + this->m_nMouseCoordX, this->m_nMouseCoordY); | |
605 | + GGroupPanel^ gp = GStaticData::staticData->m_GroupManager->getGroupPanelByMapItemID( | |
606 | + nMapItemID); | |
607 | + if (!gp) { | |
599 | 608 | break; |
600 | 609 | } |
601 | - } | |
602 | -private: System::Void GroupEditor_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e) { | |
603 | - e->Cancel = true; | |
604 | - this->Hide(); | |
605 | - } | |
606 | -}; | |
610 | + this->selectGroupID(gp->m_nGroupID); | |
611 | + this->selectPanelType(gp->m_nGroupPanelType); | |
612 | + | |
613 | + } | |
614 | + break; | |
615 | + } | |
616 | + } | |
617 | + private: System::Void GroupEditor_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e) { | |
618 | + e->Cancel = true; | |
619 | + this->Hide(); | |
620 | + } | |
621 | + }; | |
607 | 622 | } |
@@ -70,7 +70,8 @@ | ||
70 | 70 | // block000.txtをデフォルトでロードしておく |
71 | 71 | GStaticData::staticData->m_BlockTypeManager->loadBlockFile("data\\maps\\Block000.txt", |
72 | 72 | GStaticData::staticData->m_PortableLogger, |
73 | - img); | |
73 | + img, | |
74 | + GStaticData::staticData->m_nTileSize); | |
74 | 75 | |
75 | 76 | GStaticData::staticData->m_PaletteSelData->unselect(true); |
76 | 77 |
@@ -2520,6 +2521,21 @@ | ||
2520 | 2521 | } |
2521 | 2522 | |
2522 | 2523 | } |
2524 | +public: void resizePaletteFitToSize() { | |
2525 | + //const int TILE_SIZE = GStaticData::staticData->m_nTileSize; | |
2526 | + float fZoom = GStaticData::staticData->getZoomPalette(); | |
2527 | + Image^ img = GStaticData::staticData->m_SpriteContainer->getImage( | |
2528 | + GStaticData::staticData->getCommonSpriteID(), | |
2529 | + GStaticData::staticData->getTileSeqID(), 0); | |
2530 | + Drawing::Size s = Drawing::Size(img->Width*fZoom, img->Height*fZoom); | |
2531 | + this->pictureBox1->Size = s; | |
2532 | + this->panel1->AutoScrollMinSize = s; | |
2533 | + //this->m_MainFrame->getPict()->Size = Drawing::Size( | |
2534 | + // GStaticData::staticData->m_Project->m_Size.Width * TILE_SIZE * fZoom, | |
2535 | + // GStaticData::staticData->m_Project->m_Size.Height * TILE_SIZE * fZoom); | |
2536 | + | |
2537 | + | |
2538 | +} | |
2523 | 2539 | }; |
2524 | 2540 | } |
2525 | 2541 |
@@ -61,6 +61,8 @@ | ||
61 | 61 | int m_nSelectedIndex; |
62 | 62 | int m_nButtonIndex; |
63 | 63 | int m_nDefaultIndex; |
64 | + // なんのDialogか指定したい場合に。 | |
65 | + int m_nDialogType; | |
64 | 66 | private: |
65 | 67 | bool m_bIsEnable; |
66 | 68 | public: |
@@ -68,6 +70,10 @@ | ||
68 | 70 | public: |
69 | 71 | MinervaDialog() { |
70 | 72 | this->m_bIsEnable = false; |
73 | + this->m_nDialogType = 0; | |
74 | + this->m_nSelectedIndex = 0; | |
75 | + this->m_nDefaultIndex = 0; | |
76 | + this->m_strMessage = _T("ダイアログ"); | |
71 | 77 | } |
72 | 78 | |
73 | 79 | void setup(int nDefaultButtonIndex) { |
@@ -117,8 +117,9 @@ | ||
117 | 117 | namespace MenuReturnType { |
118 | 118 | enum MenuReturnType { |
119 | 119 | SYSTEM_MENU, // システムメニューに戻る |
120 | - CLOSE_MENU, | |
120 | + CLOSE_MENU, // そのままメニューを閉じる | |
121 | 121 | SA, // SAに戻る |
122 | + CLOSE_MENU_CHECK_CONFIRM, // メニューを閉じるが、その前に確認を取る | |
122 | 123 | MAX_NUM |
123 | 124 | }; |
124 | 125 | } |
@@ -5,7 +5,7 @@ | ||
5 | 5 | //using namespace HPL; |
6 | 6 | |
7 | 7 | void HPLNetBlockTypeManager::loadBlockFile( String^ strBlockFilePath, HPLNetPortableLogger^ portableLogger, |
8 | - Image^ imgTile) | |
8 | + Image^ imgTile, int nTileSize) | |
9 | 9 | { |
10 | 10 | List<String^>^ aryResult = gcnew List<String^>(); |
11 | 11 | // encoding |
@@ -49,6 +49,7 @@ | ||
49 | 49 | } else { |
50 | 50 | } |
51 | 51 | } |
52 | + this->m_nTileSize = nTileSize; | |
52 | 53 | // calculate size |
53 | 54 | this->m_matIDs = gcnew HPLNetMatrix( this->m_nColumnPerRow, imgTile->Height / this->m_nTileSize ); |
54 | 55 | this->m_matIDs->fill(TileType::BLOCK); |
@@ -25,7 +25,7 @@ | ||
25 | 25 | int getBlockType(int nMapItemID); |
26 | 26 | int getBlockType(int nCol, int nRow); |
27 | 27 | void loadBlockFile( String^ strBlockFilePath, HPLNetPortableLogger^ portableLogger, |
28 | - Image^ imgTile); | |
28 | + Image^ imgTile, int nTileSize); | |
29 | 29 | |
30 | 30 | int getIDFromColRow( int nCol, int nRow); |
31 | 31 | void getColRowFromID( int nID, int& nCol, int& nRow ); |
@@ -130,4 +130,19 @@ | ||
130 | 130 | } |
131 | 131 | return strResult; |
132 | 132 | } |
133 | + | |
134 | + /** change configuration item | |
135 | + */ | |
136 | + static void changeConfiguration(//System::Configuration::Configuration^ lpConfig, | |
137 | + String^ CFG_LABEL, String^ strConfigData) | |
138 | + { | |
139 | + System::Configuration::Configuration^ lpConfig = System::Configuration::ConfigurationManager::OpenExeConfiguration( | |
140 | + System::Configuration::ConfigurationUserLevel::None); | |
141 | + // remove | |
142 | + lpConfig->AppSettings->Settings->Remove(CFG_LABEL); | |
143 | + | |
144 | + // add | |
145 | + lpConfig->AppSettings->Settings->Add(CFG_LABEL, strConfigData); | |
146 | + lpConfig->Save(); | |
147 | + } | |
133 | 148 | }; |