• R/O
  • SSH
  • HTTPS

marathon: コミット


コミットメタ情報

リビジョン377 (tree)
日時2007-07-11 21:19:31
作者hogepiyo

ログメッセージ

*** empty log message ***

変更サマリ

差分

--- marathon/trunk/MapEditorWX/src/TextureDialog.cpp (revision 376)
+++ marathon/trunk/MapEditorWX/src/TextureDialog.cpp (revision 377)
@@ -1,5 +1,6 @@
11 #include "TextureDialog.h"
22 #include "MapEditorWX.h"
3+#include "MapEditorMainFrame.h"
34
45 const int TEX_ICON_SIZE = 32;
56 const int INTERVAL_X = 10;
@@ -8,6 +9,8 @@
89 const int TEX_LEFT = 10;
910
1011 enum{
12+ ID_COLLECTION,
13+ ID_CLUT,
1114 ID_TYPE,
1215 };
1316
@@ -14,6 +17,8 @@
1417 BEGIN_EVENT_TABLE(TextureDialog, wxDialog)
1518 // begin wxGlade: TextureDialog::event_table
1619 EVT_CHOICE(wxID_ANY, TextureDialog::OnType)
20+ EVT_CHOICE(wxID_ANY, TextureDialog::OnCollection)
21+ EVT_CHOICE(ID_TYPE, TextureDialog::OnCLUT)
1722 // end wxGlade
1823 END_EVENT_TABLE()
1924 TextureDialog::TextureDialog()
@@ -27,14 +32,22 @@
2732 bool result = wxDialog::Create(parent, id, _T("Texture"));
2833
2934 label_75 = new wxStaticText(this, wxID_ANY, wxT("type"));
30- choice_30 = new wxChoice(this, wxID_ANY);
35+ choice_30 = new wxChoice(this, ID_TYPE);
3136 panel_13 = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSTATIC_BORDER|wxTAB_TRAVERSAL);
37+ wxStaticText* label_collection = new wxStaticText(this, wxID_ANY, wxT("Collection"));
38+ choice_collection = new wxChoice(this, ID_COLLECTION);
39+ wxStaticText* label_clut = new wxStaticText(this, wxID_ANY, wxT("CLUT"));
40+ choice_clut = new wxChoice(this, ID_CLUT);
3241
3342 panel_13->SetMinSize(wxSize(480, 120));
3443 panel_13->SetScrollRate(10, 10);
3544
3645 wxFlexGridSizer* grid_sizer_44 = new wxFlexGridSizer(2, 1, 0, 0);
37- wxFlexGridSizer* grid_sizer_45 = new wxFlexGridSizer(1, 2, 0, 0);
46+ wxFlexGridSizer* grid_sizer_45 = new wxFlexGridSizer(1, 6, 0, 0);
47+ grid_sizer_45->Add(label_collection, 0, 0, 0);
48+ grid_sizer_45->Add(choice_collection, 0, 0, 0);
49+ grid_sizer_45->Add(label_clut, 0, 0, 0);
50+ grid_sizer_45->Add(choice_clut, 0, 0, 0);
3851 grid_sizer_45->Add(label_75, 0, 0, 0);
3952 grid_sizer_45->Add(choice_30, 0, 0, 0);
4053 grid_sizer_44->Add(grid_sizer_45, 1, wxEXPAND, 0);
@@ -44,7 +57,7 @@
4457 Layout();
4558
4659 //TODO Shapesファイルが読み込まれていない場合は警告を出して閉じる
47- if(false){
60+ if(wxGetApp().getShapesManager()->isLoadedShapesFile()){
4861 hpl::error::caution("Shapes file not loaded");
4962 Destroy();
5063 return false;
@@ -51,7 +64,25 @@
5164 }
5265
5366 //Shapesデータからサイズを計算します
67+ std::map<int, std::map<int, std::map<int, wxImage> > >* tmap = &((MapEditorMainFrame*)GetParent())->textureMap;
5468
69+ //コレクションチョイスのセットアップ
70+ std::map<int, std::map<int, std::map<int, wxImage> > >::iterator it;
71+ int counter = 0;
72+ int collection = 0;
73+ for(it = tmap->begin(); it != tmap->end(); it ++){
74+ if(counter == 0){
75+ collection = it->first;
76+ }
77+ choice_collection->Insert(counter, getString("%d", it->first));
78+ counter ++;
79+ }
80+
81+ //タイプ
82+ //TODO
83+
84+ //セットアップ
85+ setupDialog(collection);
5586 return result;
5687 }
5788 void TextureDialog::OnType(wxCommandEvent &event)
@@ -59,7 +90,48 @@
5990 event.Skip();
6091 std::cout<<"Event handler (TextureDialog::OnType) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
6192 }
93+void TextureDialog::OnCollection(wxCommandEvent &event)
94+{
95+ int collection = event.GetSelection();
96+ //TODO
97+}
98+void TextureDialog::OnCLUT(wxCommandEvent &event)
99+{
100+ int clut = event.GetSelection();
101+ //TODO
102+}
62103 void TextureDialog::setFloor(bool floor)
63104 {
64105 this->isFloor_ = floor;
65106 }
107+void TextureDialog::drawPanel(int collection, int clut, std::map<int, wxImage>* imgMap)
108+{
109+ wxPaintDC dc(panel_13);
110+ wxSize size = panel_13->GetSize();
111+ dc.SetPen(*wxWHITE_PEN);
112+ dc.SetBrush(*wxWHITE_BRUSH);
113+ dc.DrawRectangle(0,0,size.GetWidth(), size.GetHeight());
114+
115+ //パレット表示
116+ const int MERGIN_X = 10;
117+ const int MERGIN_Y = 10;
118+ const int ITEM_W = 100;
119+ const int ITEM_H = ITEM_W;
120+ const int ITEM_INTERVAL_X = 10;
121+ const int ITEM_INTERVAL_Y = 10;
122+ const int PITCH = 10;
123+}
124+void TextureDialog::setupDialog(int collection)
125+{
126+ std::map<int, std::map<int, std::map<int, wxImage> > >* tmap = &((MapEditorMainFrame*)GetParent())->textureMap;
127+ //setup clut choice
128+ choice_clut->Clear();
129+ std::map<int, std::map<int, wxImage> >::iterator it1;
130+ int clutCounter = 0;
131+ for(it1 = tmap->begin(); it1 != tmap->end(); it1 ++){
132+ choice_clut->Insert(clutCounter, getString("%d", it1->second));
133+ clutCounter ++;
134+ }
135+ //TODO
136+ drawPanel(collection, clut, &tmap->get(collection)[clut]);
137+}
--- marathon/trunk/MapEditorWX/src/ObjectPropDialog.cpp (revision 376)
+++ marathon/trunk/MapEditorWX/src/ObjectPropDialog.cpp (revision 377)
@@ -28,7 +28,6 @@
2828 EVT_TEXT(ID_X, ObjectPropDialog::OnXEdit)
2929 EVT_TEXT(ID_Y, ObjectPropDialog::OnYEdit)
3030 EVT_TEXT(ID_Z, ObjectPropDialog::OnZEdit)
31-// EVT_PAINT(ObjectPropDialog::OnPaint)
3231 END_EVENT_TABLE()
3332 ObjectPropDialog::ObjectPropDialog()
3433 {
@@ -332,11 +331,7 @@
332331 obj.location.x = atoi(wxConvertWX2MB(text_ctrl_41->GetValue()));
333332 return obj;
334333 }
335-
336-void ObjectPropDialog::OnPaint(wxPaintEvent &event)
334+void ObjectPropDialog::drawFacing(wxWindow* panel)
337335 {
338- wxDialog::OnPaint(event);
339-
340- //panel_16にfacing方向を描く
341- //TODO
336+ //TODO
342337 }
--- marathon/trunk/MapEditorWX/src/MainFrameLeftDown.cpp (revision 376)
+++ marathon/trunk/MapEditorWX/src/MainFrameLeftDown.cpp (revision 377)
@@ -139,7 +139,10 @@
139139
140140 //一つを選択できるか試してみます
141141 if(this->tryToSelectOneItem(ev)){
142- //選択範囲は解除します
142+ this->unselect();
143+
144+ //選択できたので
145+ //範囲選択は解除します
143146 wxGetApp().getEventManager()->setSelectingGroup(false);
144147 }else{
145148 //選択されなかった
@@ -147,9 +150,26 @@
147150 wxGetApp().getEventManager()->setSelectGroupStartPoint(mx, my);
148151 //選択情報の解除
149152 sel->clear();
153+
154+ //選択&編集中だったアイテムを初期化
155+ //TODO 遅くなる可能性があるので、修正が必要かも
156+ this->unselect();
150157 }
151158 }
152159
160+void MapEditorMainFrame::unselect()
161+{
162+ if(pointPropDialog.getPointIndex() != NONE)
163+ this->pointPropDialog.setPointIndex(NONE);
164+ if(objPropDialog.getObjectIndex() != NONE)
165+ this->objPropDialog.setObjectIndex(NONE);
166+ if(linePropDialog.getLineIndex() != NONE)
167+ this->pointLineDialog.setLineIndex(NONE);
168+ if(sidePropDialog.getSideIndex() != NONE)
169+ this->pointSideDialog.setSideIndex(NONE);
170+ if(polygonPropDialog.getPolygonIndex() != NONE)
171+ this->pointPolygonDialog.setPolygonIndex(NONE);
172+}
153173
154174 /**
155175 @param ev
--- marathon/trunk/MapEditorWX/src/MapEditorMainFrame.h (revision 376)
+++ marathon/trunk/MapEditorWX/src/MapEditorMainFrame.h (revision 377)
@@ -417,4 +417,6 @@
417417 また、編集されてなければ真が返る
418418 */
419419 bool askDestructMap();
420+
421+ void unselect();
420422 };
--- marathon/trunk/MapEditorWX/src/TextureDialog.h (revision 376)
+++ marathon/trunk/MapEditorWX/src/TextureDialog.h (revision 377)
@@ -7,6 +7,10 @@
77 wxStaticText* label_75;
88 wxChoice* choice_30;
99 wxScrolledWindow* panel_13;
10+
11+ wxChoice* choice_collection;
12+ wxChoice* choice_clut;
13+
1014 bool isFloor_;
1115 public:
1216 TextureDialog();
@@ -15,9 +19,13 @@
1519 //イベントテーブル作成<en>declare
1620 DECLARE_EVENT_TABLE()
1721 void OnType(wxCommandEvent &event); // wxGlade: <event_handler>
22+ void OnCollection(wxCommandEvent &event); // wxGlade: <event_handler>
23+ void OnCLUT(wxCommandEvent &event); // wxGlade: <event_handler>
1824
1925 public:
2026 void setFloor(bool floor);
27+ void drawPanel(int collection, int clut, std::map<int, wxImage>* imgMap);
28+ void setupDialog(int collection);
2129 // bool isFloor();
2230 };
2331
--- marathon/trunk/MapEditorWX/src/ObjectPropDialog.h (revision 376)
+++ marathon/trunk/MapEditorWX/src/ObjectPropDialog.h (revision 377)
@@ -31,6 +31,8 @@
3131 wxStaticText* label_62;
3232 wxTextCtrl* text_ctrl_40;
3333 wxPanel* panel_18;
34+
35+ //編集しているオブジェクトインデックス
3436 int objIndex;
3537 public:
3638 ObjectPropDialog();
@@ -59,6 +61,8 @@
5961 void OnZEdit(wxCommandEvent &event); // wxGlade: <event_handler>
6062
6163 void OnPaint(wxPaintEvent &event);
64+
65+ void drawFacing(wxWindow* panel);
6266 };
6367
6468 #endif
--- marathon/trunk/MapEditorWX/WXTODOリスト.txt (revision 376)
+++ marathon/trunk/MapEditorWX/WXTODOリスト.txt (revision 377)
@@ -227,4 +227,10 @@
227227
228228 TODO ?????ʕ\??
229229 TODO ?e?N?X?`???Ń|???S???\??
230-TODO ?R?s?y
\ No newline at end of file
230+TODO ?R?s?y
231+
232+TODO ?Z???N?g?????E?????Z???N?g?????ꍇ?Ƀ_?C?A???O?̐ݒ??NONE?ɂ??镔??
233+ ???????x???Ȃ肪???Ȃ̂ŁA?d?????????s??Ȃ??悤?ɒ???
234+TODO ObjPropDialog??Facing?`??B
235+ ?A?N?V???????N???????ꍇ?݂̂ɕ`?悷??Ηǂ?
236+
\ No newline at end of file
旧リポジトリブラウザで表示