• R/O
  • SSH
  • HTTPS

marathon: コミット


コミットメタ情報

リビジョン354 (tree)
日時2007-06-30 01:13:41
作者hogepiyo

ログメッセージ

*** empty log message ***

変更サマリ

差分

--- marathon/trunk/MapEditorWX/src/MapEditorMainFrame.cpp (revision 353)
+++ marathon/trunk/MapEditorWX/src/MapEditorMainFrame.cpp (revision 354)
@@ -109,8 +109,9 @@
109109 //height
110110 this->heightDialog.Create(this, wxID_ANY);
111111 this->heightDialog.Show();
112-
112+
113113 //パレット
114+ this->ceilingHeightPaletteDialog.Create(this, wx_ID_ANY);
114115 this->heightPaletteDialog.Create(this, wxID_ANY);
115116 this->lightPaletteDialog.Create(this, wxID_ANY);
116117 this->mediaPaletteDialog.Create(this, wxID_ANY);
@@ -124,6 +125,10 @@
124125 this->polyTypeDialog.Create(this, wxID_ANY);
125126 this->polyPropDialog.Create(this, wxID_ANY);
126127 this->sidePropDialog.Create(this, wxID_ANY);
128+
129+ //初期化
130+ wxCommandEvent dummy;
131+ this->OnNew(dummy);
127132 }
128133 MapEditorMainFrame::~MapEditorMainFrame()
129134 {
--- marathon/trunk/MapEditorWX/src/LinePropDialog.cpp (revision 353)
+++ marathon/trunk/MapEditorWX/src/LinePropDialog.cpp (revision 354)
@@ -103,6 +103,8 @@
103103 Layout();
104104
105105 this->lineIndex = NONE;
106+
107+ setupDialog();
106108 return result;
107109 }
108110 void LinePropDialog::OnEndpoint1Edit(wxCommandEvent &event)
@@ -126,8 +128,76 @@
126128 //line->flags
127129 }
128130 }
131+void LinePropDialog::getLineIndex()
132+{
133+ return this->lineIndex;
134+}
135+void LinePropDialog::setLineIndex(int index)
136+{
137+ this->lineIndex = index;
138+}
139+void LinePropDialog::setupDialog()
140+{
141+ //チョイスのセットアップ
142+ choice_24->Clear();
143+ choice_25->Clear();
144+ for(int i = 0; i < (int)SideList.size(); i ++){
145+ choice_24->Insert(getString("%d", i), i);
146+ choice_25->Insert(getString("%d", i), i);
147+ }
148+ choice_24->Insert(_T("NONE"), (int)SideList.size());
149+ choice_25->Insert(_T("NONE"), (int)SideList.size());
129150
151+ choice_26->Clear();
152+ choice_27->Clear();
153+ for(int i = 0; i < (int)PolygonList.size(); i ++){
154+ choice_26->Insert(getString("%d", i), i);
155+ choice_27->Insert(getString("%d", i), i);
156+ }
157+ choice_26->Insert(_T("NONE"), (int)PolygonList.size());
158+ choice_27->Insert(_T("NONE"), (int)PolygonList.size());
130159
160+
161+ if(this->getLineIndex() == NONE){
162+ return;
163+ }
164+
165+ int index = getLineIndex();
166+ line_data* line = get_line_data(index);
167+
168+ text_ctrl_42->SetValue(getString("%d", line->endpoint_indexes[0]));
169+ text_ctrl_43->SetValue(getString("%d", line->endpoint_indexes[1]));
170+ text_ctrl_45->SetValue(getString("%d", line->length));
171+ text_ctrl_46->SetValue(getString("%d", line->highest_adjacent_floor));
172+ text_ctrl_47->SetValue(getString("%d", line->lowest_adjacent_ceiling));
173+ checkbox_45->SetValue(LINE_IS_LANDSCAPED(index));
174+ checkbox_52->SetValue(LINE_IS_ELEVATION(index));
175+ checkbox_53->SetValue(LINE_IS_VARIABLE_ELEVATION(index));
176+ checkbox_54->SetValue(LINE_HAS_TRANSPARENT_SIDE(index));
177+ int sel = LINE_IS_SOLID(index) ? 0: 1;
178+ radio_box_1->SetSelection(sel);
179+ index = line->clockwise_polygon_side_index;
180+ if(index == NONE){
181+ index = (int)SideList.size();
182+ }
183+ choice_24->SetSelection(index);
184+ index = line->counterclockwise_polygon_side_index;
185+ if(index == NONE){
186+ index = (int)SideList.size();
187+ }
188+ choice_25->SetSelection(index);
189+ index = line->clockwise_polygon_owner;
190+ if(index == NONE){
191+ index = (int)PolygonList.size();
192+ }
193+ choice_26->SetSelection(index);
194+ index = line->counterclockwise_polygon_owner;
195+ if(index == NONE){
196+ index = (int)PolygonList.size();
197+ }
198+ choice_27->SetSelection(index);
199+}
200+
131201 void LinePropDialog::OnElevation(wxCommandEvent &event)
132202 {
133203 event.Skip();
--- marathon/trunk/MapEditorWX/src/PolygonPropDialog.cpp (revision 353)
+++ marathon/trunk/MapEditorWX/src/PolygonPropDialog.cpp (revision 354)
@@ -1,4 +1,6 @@
11 #include "PolygonPropDialog.h"
2+#include "PlatformDialog.h"
3+
24 #include "MapEditorWX.h"
35 namespace PolyProp{
46 enum{
@@ -192,6 +194,14 @@
192194 SetSizer(grid_sizer_13);
193195 grid_sizer_13->Fit(this);
194196 Layout();
197+ this->setPolyIndex(NONE);
198+
199+ //Typeに追加
200+ for(int i = 0; i < NUMBER_OF_POLYGON_TYPE; i ++){
201+ choice_12->Insert(wxConvertMB2WX(wxGetApp().polyTypeInfo[i].jname.c_str()), i);
202+ }
203+
204+
195205 return result;
196206 }
197207
@@ -206,11 +216,117 @@
206216 }
207217 void PolygonPropDialog::setupDialog()
208218 {
219+ //CHOICEをセットアップしなおす
220+ //light floor/ceiling/media-light
221+ choice_13->Clear();
222+ choice_14->Clear();
223+ choice_16->Clear();
224+ for(int i = 0; i < (int)LightList.size(); i ++){
225+ choice_13->Insert(getString("%d", i), i);
226+ choice_14->Insert(getString("%d", i), i);
227+ choice_16->Insert(getString("%d", i), i);
228+ }
229+ choice_13->Insert(_T("NONE"), LightList.size());
230+ choice_14->Insert(_T("NONE"), LightList.size());
231+ choice_16->Insert(_T("NONE"), LightList.size());
209232
233+ //first object
234+ choice_19->Clear();
235+ for(int i = 0; i < (int)SavedObjectList.size(); i ++){
236+ choice_19->Insert(getString("%d", i), i);
237+ }
238+ choice_19->Insert(_T("NONE"), LightList.size());
239+
240+ //Media
241+ choice_15->Clear();
242+ for(int i = 0; i < (int)MediaList.size(); i ++){
243+ choice_15->Insert(getString("%d", i), i);
244+ }
245+ choice_15->Insert(_T("NONE"), MediaList.size());
246+
247+ //TODO snd src
248+ choice_20->Clear();
249+/* for(int i = 0; i < (int).size(); i ++){
250+ choice_20->Insert(getString("%d", i), i);
251+ }
252+ choice_20->Insert(_T("NONE"), .size());*/
253+ choice_17->Clear();
254+ for(int i = 0; i < (int)AmbientSoundImageList.size(); i ++){
255+ choice_17->Insert(getString("%d", i), i);
256+ }
257+ choice_17->Insert(_T("NONE"), AmbientSoundImageList.size());
258+ //random sound
259+ choice_18->Clear();
260+/* for(int i = 0; i < (int).size(); i ++){
261+ choice_18->Insert(getString("%d", i), i);
262+ }
263+ choice_18->Insert(_T("NONE"), .size());*/
264+
265+ if(this->getPolyIndex() == NONE){
266+ return;
267+ }
268+ //ポリゴン情報をダイアログに設定
269+ polygon_data* poly = get_polygon_data(this->getPolyIndex());
270+ text_ctrl_20->SetValue(getString("%d", this->getPolyIndex()));
271+ choice_12->SetSelection(poly->type);
272+ text_ctrl_25->SetValue(getString("%d", poly->permutation);
273+ choice_13->SetSelection(poly->floor_light);
274+ choice_14->SetSelection(poly->ceiling_light);
275+ text_ctrl_26->SetValue(getString("%d", poly->permutation);
276+ int index = poly->first_object;
277+ if(index == NONE){
278+ index = SavedObjectList.size();
279+ }
280+ choice_19->SetSelection(index);
281+ text_ctrl_28->SetValue(getString("%d", poly->first_exclusion_zone_index);
282+ text_ctrl_29->SetValue(getString("%d", poly->line_exclusion_zone_index);
283+ text_ctrl_30->SetValue(getString("%d", poly->floor_transfer_mode);
284+ text_ctrl_31->SetValue(getString("%d", poly->ceiling_transfer_mode);
285+
286+ text_ctrl_21->SetValue(getString("%d", poly->first_neighbor_index);
287+ text_ctrl_22->SetValue(getString("%d", poly->neighbor_count);
288+ text_ctrl_23->SetValue(getString("%d", poly->center.x);
289+ text_ctrl_24->SetValue(getString("%d", poly->center.y);
290+ text_ctrl_33->SetValue(getString("%d", poly->floor_origin.x);
291+ text_ctrl_35->SetValue(getString("%d", poly->floor_origin.y);
292+ text_ctrl_34->SetValue(getString("%d", poly->ceiling_origin.x);
293+ text_ctrl_36->SetValue(getString("%d", poly->ceiling_origin.y);
294+ index = poly->media_index;
295+ if(index == NONE){
296+ index = MediaList.size();
297+ }
298+ choice_15->SetSelection(index);
299+ index = poly->media_lightsource_index;
300+ if(index == NONE){
301+ index = LightList.size();
302+ }
303+ choice_16->SetSelection(index);
304+ /* TODO snd src
305+ index = poly->;
306+ if(index == NONE){
307+ index = .size();
308+ }
309+ choice_20->SetSelection(index);*/
310+ index = poly->ambient_sound_image_index;
311+ if(index == NONE){
312+ index = AmbientSoundImageList.size();
313+ }
314+ choice_17->SetSelection(index);
315+/*
316+ TODO rnd snd
317+ index = poly->;
318+ if(index == NONE){
319+ index = .size();
320+ }
321+ choice_18->SetSelection(index);
322+ */
323+
210324 }
211325 void PolygonPropDialog::OnIDEdit(wxCommandEvent &event)
212326 {
213- event.Skip();
327+ if(this->getPolyIndex() == NONE){
328+ return ;
329+ }
214330 std::cout<<"Event handler (PolygonPropDialog::OnIDEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
215331 }
216332
@@ -217,7 +333,9 @@
217333
218334 void PolygonPropDialog::OnFirstNeighborEdit(wxCommandEvent &event)
219335 {
220- event.Skip();
336+ if(this->getPolyIndex() == NONE){
337+ return ;
338+ }
221339 std::cout<<"Event handler (PolygonPropDialog::OnFirstNeighborEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
222340 }
223341
@@ -224,7 +342,9 @@
224342
225343 void PolygonPropDialog::OnTypeChoice(wxCommandEvent &event)
226344 {
227- event.Skip();
345+ if(this->getPolyIndex() == NONE){
346+ return ;
347+ }
228348 std::cout<<"Event handler (PolygonPropDialog::OnTypeChoice) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
229349 }
230350
@@ -231,7 +351,9 @@
231351
232352 void PolygonPropDialog::OnNearCountEdit(wxCommandEvent &event)
233353 {
234- event.Skip();
354+ if(this->getPolyIndex() == NONE){
355+ return ;
356+ }
235357 std::cout<<"Event handler (PolygonPropDialog::OnNearCountEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
236358 }
237359
@@ -238,7 +360,9 @@
238360
239361 void PolygonPropDialog::OnPermuEdit(wxCommandEvent &event)
240362 {
241- event.Skip();
363+ if(this->getPolyIndex() == NONE){
364+ return ;
365+ }
242366 std::cout<<"Event handler (PolygonPropDialog::OnPermuEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
243367 }
244368
@@ -245,7 +369,9 @@
245369
246370 void PolygonPropDialog::OnCenterXEdit(wxCommandEvent &event)
247371 {
248- event.Skip();
372+ if(this->getPolyIndex() == NONE){
373+ return ;
374+ }
249375 std::cout<<"Event handler (PolygonPropDialog::OnCenterXEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
250376 }
251377
@@ -252,7 +378,9 @@
252378
253379 void PolygonPropDialog::OnFloorLightEdit(wxCommandEvent &event)
254380 {
255- event.Skip();
381+ if(this->getPolyIndex() == NONE){
382+ return ;
383+ }
256384 std::cout<<"Event handler (PolygonPropDialog::OnFloorLightEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
257385 }
258386
@@ -259,7 +387,9 @@
259387
260388 void PolygonPropDialog::OnCenterYEdit(wxCommandEvent &event)
261389 {
262- event.Skip();
390+ if(this->getPolyIndex() == NONE){
391+ return ;
392+ }
263393 std::cout<<"Event handler (PolygonPropDialog::OnCenterYEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
264394 }
265395
@@ -266,7 +396,9 @@
266396
267397 void PolygonPropDialog::OnCeilingLightEdit(wxCommandEvent &event)
268398 {
269- event.Skip();
399+ if(this->getPolyIndex() == NONE){
400+ return ;
401+ }
270402 std::cout<<"Event handler (PolygonPropDialog::OnCeilingLightEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
271403 }
272404
@@ -273,27 +405,37 @@
273405
274406 void PolygonPropDialog::OnAreaEdit(wxCommandEvent &event)
275407 {
276- event.Skip();
408+ if(this->getPolyIndex() == NONE){
409+ return ;
410+ }
277411 std::cout<<"Event handler (PolygonPropDialog::OnAreaEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
278412 }
279413 void PolygonPropDialog::OnFloorOriginXEdit(wxCommandEvent &event)
280414 {
281- event.Skip();
415+ if(this->getPolyIndex() == NONE){
416+ return ;
417+ }
282418 std::cout<<"Event handler (PolygonPropDialog::OnFloorOriginXEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
283419 }
284420 void PolygonPropDialog::OnFloorOriginYEdit(wxCommandEvent &event)
285421 {
286- event.Skip();
422+ if(this->getPolyIndex() == NONE){
423+ return ;
424+ }
287425 std::cout<<"Event handler (PolygonPropDialog::OnFloorOriginYEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
288426 }
289427 void PolygonPropDialog::OnCeilingOriginXEdit(wxCommandEvent &event)
290428 {
291- event.Skip();
429+ if(this->getPolyIndex() == NONE){
430+ return ;
431+ }
292432 std::cout<<"Event handler (PolygonPropDialog::OnCeilingOriginXEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
293433 }
294434 void PolygonPropDialog::OnCeilingOriginYEdit(wxCommandEvent &event)
295435 {
296- event.Skip();
436+ if(this->getPolyIndex() == NONE){
437+ return ;
438+ }
297439 std::cout<<"Event handler (PolygonPropDialog::OnCeilingOriginYEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
298440 }
299441
@@ -300,7 +442,9 @@
300442
301443 void PolygonPropDialog::OnFirstObjChoice(wxCommandEvent &event)
302444 {
303- event.Skip();
445+ if(this->getPolyIndex() == NONE){
446+ return ;
447+ }
304448 std::cout<<"Event handler (PolygonPropDialog::OnFirstObjChoice) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
305449 }
306450
@@ -307,7 +451,9 @@
307451
308452 void PolygonPropDialog::OnMediaChoice(wxCommandEvent &event)
309453 {
310- event.Skip();
454+ if(this->getPolyIndex() == NONE){
455+ return ;
456+ }
311457 std::cout<<"Event handler (PolygonPropDialog::OnMediaChoice) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
312458 }
313459
@@ -314,7 +460,9 @@
314460
315461 void PolygonPropDialog::OnFirstExZoneEdit(wxCommandEvent &event)
316462 {
317- event.Skip();
463+ if(this->getPolyIndex() == NONE){
464+ return ;
465+ }
318466 std::cout<<"Event handler (PolygonPropDialog::OnFirstExZoneEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
319467 }
320468
@@ -321,7 +469,9 @@
321469
322470 void PolygonPropDialog::OnMediaLightChoice(wxCommandEvent &event)
323471 {
324- event.Skip();
472+ if(this->getPolyIndex() == NONE){
473+ return ;
474+ }
325475 std::cout<<"Event handler (PolygonPropDialog::OnMediaLightChoice) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
326476 }
327477
@@ -328,7 +478,9 @@
328478
329479 void PolygonPropDialog::OnLineExZoneEdit(wxCommandEvent &event)
330480 {
331- event.Skip();
481+ if(this->getPolyIndex() == NONE){
482+ return ;
483+ }
332484 std::cout<<"Event handler (PolygonPropDialog::OnLineExZoneEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
333485 }
334486
@@ -335,7 +487,9 @@
335487
336488 void PolygonPropDialog::OnSndSrcIndexChoice(wxCommandEvent &event)
337489 {
338- event.Skip();
490+ if(this->getPolyIndex() == NONE){
491+ return ;
492+ }
339493 std::cout<<"Event handler (PolygonPropDialog::OnSndSrcIndexChoice) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
340494 }
341495
@@ -342,7 +496,9 @@
342496
343497 void PolygonPropDialog::OnFloorTransEdit(wxCommandEvent &event)
344498 {
345- event.Skip();
499+ if(this->getPolyIndex() == NONE){
500+ return ;
501+ }
346502 std::cout<<"Event handler (PolygonPropDialog::OnFloorTransEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
347503 }
348504
@@ -349,7 +505,9 @@
349505
350506 void PolygonPropDialog::OnAmbSndChoice(wxCommandEvent &event)
351507 {
352- event.Skip();
508+ if(this->getPolyIndex() == NONE){
509+ return ;
510+ }
353511 std::cout<<"Event handler (PolygonPropDialog::OnAmbSndChoice) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
354512 }
355513
@@ -356,7 +514,9 @@
356514
357515 void PolygonPropDialog::OnCeilingTransEdit(wxCommandEvent &event)
358516 {
359- event.Skip();
517+ if(this->getPolyIndex() == NONE){
518+ return ;
519+ }
360520 std::cout<<"Event handler (PolygonPropDialog::OnCeilingTransEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
361521 }
362522
@@ -363,7 +523,9 @@
363523
364524 void PolygonPropDialog::OnRndSndChoice(wxCommandEvent &event)
365525 {
366- event.Skip();
526+ if(this->getPolyIndex() == NONE){
527+ return ;
528+ }
367529 std::cout<<"Event handler (PolygonPropDialog::OnRndSndChoice) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
368530 }
369531
@@ -370,6 +532,13 @@
370532
371533 void PolygonPropDialog::OnPlatformBtn(wxCommandEvent &event)
372534 {
373- event.Skip();
374- std::cout<<"Event handler (PolygonPropDialog::OnPlatformBtn) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
535+ if(this->getPolyIndex() == NONE){
536+ return ;
537+ }
538+ PlatformDialog dlg;
539+ dlg.Create(this, wxID_ANY);
540+ if(dlg.ShowModal() == wxID_OK){
541+ //TODO
542+ //設定変更
543+ }
375544 }
--- marathon/trunk/MapEditorWX/src/PlatformDialog.h (revision 353)
+++ marathon/trunk/MapEditorWX/src/PlatformDialog.h (revision 354)
@@ -5,9 +5,6 @@
55
66 class PlatformDialog: public wxDialog{
77 public:
8- PlatformDialog();
9- bool Create(wxWindow* parent, wxWindowID id);
10- virtual ~PlatformDialog();
118 wxStaticBox* sizer_31_staticbox;
129 wxStaticBox* sizer_27_staticbox;
1310 wxStaticBox* sizer_28_staticbox;
@@ -66,11 +63,17 @@
6663 wxCheckBox* checkbox_26;
6764 wxButton* button_1;
6865 wxButton* button_2;
66+
67+public:
68+ PlatformDialog();
69+ bool Create(wxWindow* parent, wxWindowID id);
70+ virtual ~PlatformDialog();
6971 DECLARE_EVENT_TABLE()
7072
7173 void OnOk(wxCommandEvent& ev);
7274 void OnCancel(wxCommandEvent& ev);
73-
75+
76+public:
7477 };
7578
7679 #endif
--- marathon/trunk/MapEditorWX/src/HeightPaletteDialog.h (revision 353)
+++ marathon/trunk/MapEditorWX/src/HeightPaletteDialog.h (revision 354)
@@ -7,6 +7,9 @@
77 wxButton* button_24;
88 wxButton* button_25;
99 wxListCtrl* list_ctrl_3;
10+
11+ bool isFloor_;
12+
1013 public:
1114 HeightPaletteDialog();
1215 bool Create(wxWindow* parent, wxWindowID id);
@@ -16,6 +19,21 @@
1619 void OnAdd(wxCommandEvent &event); // wxGlade: <event_handler>
1720 void OnDelete(wxCommandEvent &event); // wxGlade: <event_handler>
1821 void OnEdit(wxListEvent &event); // wxGlade: <event_handler>
22+
23+public:
24+ /**
25+ 現在のマップの高さ情報を代入します
26+ 今までのものは削除されます
27+ */
28+ void updateHeights();
29+
30+ /**
31+ 床なのか天井なのか
32+ <en>Floor or Ceiling
33+ */
34+ void setFloor(bool floor);
35+ bool isFloor();
36+ wxColor getColorFromHeight(double heightPerOne);
1937 };
2038
2139 #endif
--- marathon/trunk/MapEditorWX/src/MainFrameDraw.cpp (revision 353)
+++ marathon/trunk/MapEditorWX/src/MainFrameDraw.cpp (revision 354)
@@ -138,30 +138,32 @@
138138 height = OFFSET_Y_WORLD * 2 / DIV;
139139 dc->DrawRectangle(left, top, width, height);
140140
141- //グリッド
142- //TODO
143- //SHRT_MAXはgridの倍数ではない!
144- //中心から右、下の方向
145- for(int i = OFFSET_X_WORLD; i <= OFFSET_X_WORLD * 2; i += grid){
146- if(i == OFFSET_X_WORLD){
147- //中心=太線
148- dc->SetPen(this->gridLargePen);
149- }else{
150- dc->SetPen(this->gridPen);
151- }
152- int x0 = voffset[0] + i / DIV;
153- int y0 = voffset[1] + i / DIV;
141+ if(wxGetApp().setting.flags[IS_SHOW_GRID]){
142+ //グリッド
143+ //TODO
144+ //SHRT_MAXはgridの倍数ではない!
145+ //中心から右、下の方向
146+ for(int i = OFFSET_X_WORLD; i <= OFFSET_X_WORLD * 2; i += grid){
147+ if(i == OFFSET_X_WORLD){
148+ //中心=太線
149+ dc->SetPen(this->gridLargePen);
150+ }else{
151+ dc->SetPen(this->gridPen);
152+ }
153+ int x0 = voffset[0] + i / DIV;
154+ int y0 = voffset[1] + i / DIV;
154155
155- dc->DrawLine(x0, voffset[1], x0, voffset[1] + OFFSET_Y_WORLD * 2 / DIV);
156- dc->DrawLine(voffset[0], y0, voffset[0] + OFFSET_X_WORLD * 2 / DIV, y0);
156+ dc->DrawLine(x0, voffset[1], x0, voffset[1] + OFFSET_Y_WORLD * 2 / DIV);
157+ dc->DrawLine(voffset[0], y0, voffset[0] + OFFSET_X_WORLD * 2 / DIV, y0);
157158
158- //左&上
159- int j = OFFSET_X_WORLD * 2 - i;
160- int x1 = voffset[0] + j / DIV;
161- int y1 = voffset[1] + j / DIV;
162- dc->DrawLine(x1, voffset[1], x1, voffset[1] + OFFSET_Y_WORLD * 2 / DIV);
163- dc->DrawLine(voffset[0], y1, voffset[0] + OFFSET_X_WORLD * 2 / DIV, y1);
164-
159+ //左&上
160+ int j = OFFSET_X_WORLD * 2 - i;
161+ int x1 = voffset[0] + j / DIV;
162+ int y1 = voffset[1] + j / DIV;
163+ dc->DrawLine(x1, voffset[1], x1, voffset[1] + OFFSET_Y_WORLD * 2 / DIV);
164+ dc->DrawLine(voffset[0], y1, voffset[0] + OFFSET_X_WORLD * 2 / DIV, y1);
165+
166+ }
165167 }
166168
167169 }
@@ -170,6 +172,9 @@
170172 */
171173 void MapEditorMainFrame::drawPolygons(wxDC* dc)
172174 {
175+ if(!wxGetApp().setting.flags[IS_SHOW_POLYGONS]){
176+ return;
177+ }
173178 //ペン設定
174179 dc->SetPen(this->linePen);
175180 // dc->SetBrush(*wxLIGHT_GREY_BRUSH);
@@ -270,6 +275,9 @@
270275 */
271276 void MapEditorMainFrame::drawLines(wxDC* dc)
272277 {
278+ if(!wxGetApp().setting.flags[IS_SHOW_LINES]){
279+ return;
280+ }
273281 dc->SetPen(*wxBLACK_PEN);
274282 //高さ制限
275283 int zMin = wxGetApp().getViewGridManager()->getViewHeightMin();
@@ -340,6 +348,9 @@
340348 }
341349 void MapEditorMainFrame::drawPoints(wxDC* dc)
342350 {
351+ if(!wxGetApp().setting.flags[IS_SHOW_POINTS]){
352+ return;
353+ }
343354 //高さ制限
344355 int zMin = wxGetApp().getViewGridManager()->getViewHeightMin();
345356 int zMax = wxGetApp().getViewGridManager()->getViewHeightMax();
@@ -383,6 +394,30 @@
383394 map_object* obj = &(SavedObjectList[i]);
384395
385396 int type = obj->type;
397+ if(type == _saved_monster &&
398+ !wxGetApp().setting.flags[IS_SHOW_MONSTERS]){
399+ continue;
400+ }
401+ if(type == _saved_player &&
402+ !wxGetApp().setting.flags[IS_SHOW_PLAYER]){
403+ continue;
404+ }
405+ if(type == _saved_item &&
406+ !wxGetApp().setting.flags[IS_SHOW_ITEMS]){
407+ continue;
408+ }
409+ if(type == _saved_goal &&
410+ !wxGetApp().setting.flags[IS_SHOW_GLOALS]){
411+ continue;
412+ }
413+ if(type == _saved_sound_source &&
414+ !wxGetApp().setting.flags[IS_SHOW_SOUNDS]){
415+ continue;
416+ }
417+ if(type == _saved_object &&
418+ !wxGetApp().setting.flags[IS_SHOW_SCENERY]){
419+ continue;
420+ }
386421 int index = obj->index;
387422
388423 int facing = obj->facing;
@@ -506,6 +541,9 @@
506541 }
507542 void MapEditorMainFrame::drawAnnotations(wxDC* dc)
508543 {
544+ if(!wxGetApp().setting.flags[IS_SHOW_ANNOTATIONS]){
545+ return;
546+ }
509547 wxColor oldCol = dc->GetTextForeground();
510548 wxColor col(wxGetApp().setting.getColorSetting()->strings[0],
511549 wxGetApp().setting.getColorSetting()->strings[1],
--- marathon/trunk/MapEditorWX/src/TextureDialog.cpp (revision 353)
+++ marathon/trunk/MapEditorWX/src/TextureDialog.cpp (revision 354)
@@ -1,6 +1,13 @@
11 #include "TextureDialog.h"
22 #include "MapEditorWX.h"
3+enum{
4+ ID_TYPE,
5+};
6+
37 BEGIN_EVENT_TABLE(TextureDialog, wxDialog)
8+ // begin wxGlade: TextureDialog::event_table
9+ EVT_CHOICE(wxID_ANY, TextureDialog::OnType)
10+ // end wxGlade
411 END_EVENT_TABLE()
512 TextureDialog::TextureDialog()
613 {
@@ -12,5 +19,36 @@
1219 {
1320 bool result = wxDialog::Create(parent, id, _T("Texture"));
1421
22+ label_75 = new wxStaticText(this, wxID_ANY, wxT("type"));
23+ choice_30 = new wxChoice(this, wxID_ANY);
24+ panel_13 = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSTATIC_BORDER|wxTAB_TRAVERSAL);
25+
26+ panel_13->SetMinSize(wxSize(480, 120));
27+ panel_13->SetScrollRate(10, 10);
28+
29+ wxFlexGridSizer* grid_sizer_44 = new wxFlexGridSizer(2, 1, 0, 0);
30+ wxFlexGridSizer* grid_sizer_45 = new wxFlexGridSizer(1, 2, 0, 0);
31+ grid_sizer_45->Add(label_75, 0, 0, 0);
32+ grid_sizer_45->Add(choice_30, 0, 0, 0);
33+ grid_sizer_44->Add(grid_sizer_45, 1, wxEXPAND, 0);
34+ grid_sizer_44->Add(panel_13, 1, wxEXPAND, 0);
35+ SetSizer(grid_sizer_44);
36+ grid_sizer_44->Fit(this);
37+ Layout();
38+
39+ //TODO Shapesファイルが読み込まれていない場合は警告を出して閉じる
40+ if(false){
41+ hpl::error::caution("Shapes file not loaded");
42+ Destroy();
43+ }
1544 return result;
1645 }
46+void TextureDialog::OnType(wxCommandEvent &event)
47+{
48+ event.Skip();
49+ std::cout<<"Event handler (TextureDialog::OnType) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
50+}
51+void TextureDialog::setFloor(bool floor)
52+{
53+ this->isFloor_ = floor;
54+}
--- marathon/trunk/MapEditorWX/src/SoundPaletteDialog.cpp (revision 353)
+++ marathon/trunk/MapEditorWX/src/SoundPaletteDialog.cpp (revision 354)
@@ -1,6 +1,15 @@
11 #include "SoundPaletteDialog.h"
22 #include "MapEditorWX.h"
3+enum{
4+ ID_EDIT,
5+};
6+
37 BEGIN_EVENT_TABLE(SoundPaletteDialog, wxDialog)
8+ // begin wxGlade: SoundPaletteDialog::event_table
9+ EVT_BUTTON(wxID_ADD, SoundPaletteDialog::OnAdd)
10+ EVT_BUTTON(wxID_DELETE, SoundPaletteDialog::OnDelete)
11+ EVT_LIST_END_LABEL_EDIT(ID_EDIT, SoundPaletteDialog::OnEdit)
12+ // end wxGlade
413 END_EVENT_TABLE()
514 SoundPaletteDialog::SoundPaletteDialog()
615 {
@@ -10,7 +19,27 @@
1019 }
1120 bool SoundPaletteDialog::Create(wxWindow* parent, wxWindowID id)
1221 {
13- bool result = wxDialog::Create(parent, id, _T("Height Pallet"));
22+ bool result = wxDialog::Create(parent, id, _T("Sound Pallet"));
1423
24+ button_32 = new wxButton(this, wxID_ADD, wxEmptyString);
25+ button_33 = new wxButton(this, wxID_DELETE, wxEmptyString);
26+ list_ctrl_6 = new wxListCtrl(this, ID_EDIT, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER);
1527 return result;
1628 }
29+void SoundPaletteDialog::OnAdd(wxCommandEvent &event)
30+{
31+ event.Skip();
32+ std::cout<<"Event handler (SoundPaletteDialog::OnAdd) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
33+}
34+
35+
36+void SoundPaletteDialog::OnDelete(wxCommandEvent &event)
37+{
38+ event.Skip();
39+ std::cout<<"Event handler (SoundPaletteDialog::OnDelete) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
40+}
41+void SoundPaletteDialog::OnEdit(wxListEvent &event)
42+{
43+ event.Skip();
44+ std::cout<<"Event handler (SoundPaletteDialog::OnEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
45+}
--- marathon/trunk/MapEditorWX/src/PlacementDialog.cpp (revision 353)
+++ marathon/trunk/MapEditorWX/src/PlacementDialog.cpp (revision 354)
@@ -10,6 +10,7 @@
1010 ID_INF,
1111 ID_ALL_INF,
1212 ID_SET_INITIAL,
13+ ID_SEL,
1314 };
1415
1516 BEGIN_EVENT_TABLE(PlacementDialog, wxDialog)
@@ -18,10 +19,11 @@
1819 EVT_TEXT(ID_MAXIMUM, PlacementDialog::OnEditMaximum)
1920 EVT_TEXT(ID_RANDOM_COUNT, PlacementDialog::OnEditRandomCount)
2021 EVT_TEXT(ID_RANDOM_CHANCE, PlacementDialog::OnRandomChance)
21- EVT_BUTTON(ID_INF, PlacementDialog::OnOk)
22- EVT_BUTTON(ID_ALL_INF, PlacementDialog::OnOk)
23- EVT_BUTTON(ID_SET_INITIAL, PlacementDialog::OnOk)
22+ EVT_BUTTON(ID_INF, PlacementDialog::OnInf)
23+ EVT_BUTTON(ID_ALL_INF, PlacementDialog::OnAllInf)
24+ EVT_BUTTON(ID_SET_INITIAL, PlacementDialog::OnSetInitial)
2425 EVT_BUTTON(wxID_OK, PlacementDialog::OnOk)
26+ EVT_LIST_ITEM_SELECTED(ID_SEL,
2527 END_EVENT_TABLE()
2628
2729 PlacementDialog::PlacementDialog():wxDialog()
@@ -77,7 +79,7 @@
7779 button_18 = new wxButton(this, ID_ALL_INF, wxT("We cannot exterminate all monsters"));
7880 button_19 = new wxButton(this, ID_SET_INITIAL, wxT("Set the number of monster to initial"));
7981 checkbox_39 = new wxCheckBox(this, wxID_ANY, wxT("place at random location"));
80- list_ctrl_1 = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER);
82+ list_ctrl_1 = new wxListCtrl(this, ID_SEL, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER);
8183 button_16 = new wxButton(this, wxID_OK, wxT("OK"));
8284
8385 list_ctrl_1->SetMinSize(wxSize(600, 300));
@@ -181,3 +183,44 @@
181183 event.Skip();
182184 std::cout<<"Event handler (PlacementDialog::OnRandomChance) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
183185 }
186+void PlacementDialog::OnSel(wxCommandEvent &ev)
187+{
188+}
189+void PlacementDialog::OnRandomPlace(wxCommandEvent& ev)
190+{
191+}
192+void PlacementDialog::setPlacementText()
193+{
194+ int sel = this->list_ctrl_1->GetSelection();
195+ if(sel >= 0){
196+ object_frequency_definition* placement;
197+ //対象をデータで書き換える
198+ if(sel >= NUMBER_OF_DEFINED_ITEMS){
199+ placement =
200+ hpl::aleph::map::getPlacementData(_saved_item,
201+ sel - NUMBER_OF_DEFINED_ITEMS);
202+ }else{
203+ placement =
204+ hpl::aleph::map::getPlacementData(_saved_monster, sel);
205+ }
206+ assert(placement);
207+
208+ wxString str[COLUMN_NUM];
209+ str[0] = type;
210+ str[1] = getString("%d", placement->minimum_count);
211+ str[2] = getString("%d", placement->maximum_count);
212+ str[3] = getString("%d", placement->initial_count);
213+ str[4] = getString("%d", placement->random_count);
214+ str[5] = getString("%d", placement->random_chance);
215+ str[6] = getString("%d", placement->flags);
216+
217+ for(int j = 0; j < COLUMN_NUM; j ++){
218+ wxListItem item;
219+ item.SetId(sel);
220+ item.SetColumn(j);
221+ item.SetText(str[j]);
222+ lstctrl->SetItem(item);
223+ }
224+
225+ }
226+}
--- marathon/trunk/MapEditorWX/src/HeightPaletteDialog.cpp (revision 353)
+++ marathon/trunk/MapEditorWX/src/HeightPaletteDialog.cpp (revision 354)
@@ -54,3 +54,57 @@
5454 event.Skip();
5555 std::cout<<"Event handler (HeightPaletteDialog::OnEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
5656 }
57+
58+/**
59+ 高さから色を求めます
60+ @param heightPerOne 高さをWORLD_ONEで割ったもの
61+*/
62+wxColor HeightPaletteDialog::getColorFromHeight(double heightPerOne){
63+ wxColor col;
64+ double zMax = MAXIMUM_FLOOR_HEIGHT / WORLD_ONE;
65+ double zMin = MINIMUM_FLOOR_HEIGHT / WORLD_ONE;
66+ if(!this->isFloor()){
67+ //ceiling
68+ zMax = MAXIMUM_CEILING_HEIGHT / WORLD_ONE;
69+ zMin = MINIMUM_CEILING_HEIGHT / WORLD_ONE;
70+ }
71+ int r = heightPerOne / (zMax - zMin) * 255;
72+ col.Set(r, 0, 0);
73+ return col;
74+}
75+/**
76+ 現在のマップの高さ情報を代入します
77+ 今までのものは削除されます
78+*/
79+void HeightPaletteDialog::updateHeights()
80+{
81+ //初期化 <en> clear all items
82+ list_ctrl_3->ClearAll();
83+ //重複を除外するのでsetを用いる
84+ std::set<int> heights;
85+ for(int i = 0; i < (int)PolygonList.size(); i ++){
86+ polygon_data* poly = get_polygon_data(i);
87+ heights.insert(poly->floor_height);
88+ }
89+ //listctrlに追加していく
90+ std::set<int>::iterator it = heights.begin();
91+ for(; it != heights.end(); it ++){
92+ wxListItem item;
93+ double num = (double)(*it) / WORLD_ONE;
94+ item.SetText(getString("%f", num));
95+ //色に変換する
96+ //TODO
97+ //list_ctrl_3->
98+ }
99+}
100+/**
101+ 床なのか天井なのか
102+ <en>Floor or Ceiling
103+*/
104+void HeightPaletteDialog::setFloor(bool floor)
105+{
106+ this->isFloor_ = floor;
107+}
108+bool HeightPaletteDialog::isFloor(){
109+ return this->isFloor_;
110+}
--- marathon/trunk/MapEditorWX/src/res/Dialogues.h (revision 353)
+++ marathon/trunk/MapEditorWX/src/res/Dialogues.h (revision 354)
@@ -1,4 +1,4 @@
1-// -*- C++ -*- generated by wxGlade 0.5 on Fri Jun 29 15:39:41 2007 from C:\0save\marathon\MapEditorWX\src\res\MapEditorWX.wxg
1+// -*- C++ -*- generated by wxGlade 0.5 on Fri Jun 29 22:39:20 2007 from C:\0save\marathon\MapEditorWX\src\res\MapEditorWX.wxg
22
33 #include <wx/wx.h>
44 #include <wx/image.h>
@@ -823,45 +823,81 @@
823823 }; // wxGlade: end class
824824
825825
826-class TextureDialog: public wxDialog {
826+class LightPaletteDialog: public wxDialog {
827827 public:
828- // begin wxGlade: TextureDialog::ids
828+ // begin wxGlade: LightPaletteDialog::ids
829829 // end wxGlade
830830
831- TextureDialog(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE);
831+ LightPaletteDialog(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE);
832832
833833 private:
834- // begin wxGlade: TextureDialog::methods
834+ // begin wxGlade: LightPaletteDialog::methods
835835 void set_properties();
836836 void do_layout();
837837 // end wxGlade
838838
839839 protected:
840- // begin wxGlade: TextureDialog::attributes
840+ // begin wxGlade: LightPaletteDialog::attributes
841+ wxButton* button_31;
842+ wxButton* button_30;
843+ wxListCtrl* list_ctrl_5;
841844 // end wxGlade
842845 }; // wxGlade: end class
843846
844847
845-class LightPaletteDialog: public wxDialog {
848+class SoundPaletteDialog: public wxDialog {
846849 public:
847- // begin wxGlade: LightPaletteDialog::ids
850+ // begin wxGlade: SoundPaletteDialog::ids
848851 // end wxGlade
849852
850- LightPaletteDialog(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE);
853+ SoundPaletteDialog(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE);
851854
852855 private:
853- // begin wxGlade: LightPaletteDialog::methods
856+ // begin wxGlade: SoundPaletteDialog::methods
854857 void set_properties();
855858 void do_layout();
856859 // end wxGlade
857860
858861 protected:
859- // begin wxGlade: LightPaletteDialog::attributes
860- wxButton* button_31;
861- wxButton* button_30;
862- wxListCtrl* list_ctrl_5;
862+ // begin wxGlade: SoundPaletteDialog::attributes
863+ wxButton* button_32;
864+ wxButton* button_33;
865+ wxListCtrl* list_ctrl_6;
863866 // end wxGlade
867+
868+ DECLARE_EVENT_TABLE();
869+
870+public:
871+ void OnAdd(wxCommandEvent &event); // wxGlade: <event_handler>
872+ void OnDelete(wxCommandEvent &event); // wxGlade: <event_handler>
864873 }; // wxGlade: end class
865874
866875
876+class TextureDialog: public wxDialog {
877+public:
878+ // begin wxGlade: TextureDialog::ids
879+ // end wxGlade
880+
881+ TextureDialog(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE);
882+
883+private:
884+ // begin wxGlade: TextureDialog::methods
885+ void set_properties();
886+ void do_layout();
887+ // end wxGlade
888+
889+protected:
890+ // begin wxGlade: TextureDialog::attributes
891+ wxStaticText* label_75;
892+ wxChoice* choice_30;
893+ wxScrolledWindow* panel_13;
894+ // end wxGlade
895+
896+ DECLARE_EVENT_TABLE();
897+
898+public:
899+ void OnType(wxCommandEvent &event); // wxGlade: <event_handler>
900+}; // wxGlade: end class
901+
902+
867903 #endif // DIALOGUES_H
--- marathon/trunk/MapEditorWX/src/res/Dialogues.cpp (revision 353)
+++ marathon/trunk/MapEditorWX/src/res/Dialogues.cpp (revision 354)
@@ -1,4 +1,4 @@
1-// -*- C++ -*- generated by wxGlade 0.5 on Fri Jun 29 15:39:41 2007 from C:\0save\marathon\MapEditorWX\src\res\MapEditorWX.wxg
1+// -*- C++ -*- generated by wxGlade 0.5 on Fri Jun 29 22:39:20 2007 from C:\0save\marathon\MapEditorWX\src\res\MapEditorWX.wxg
22
33 #include "Dialogues.h"
44
@@ -2367,10 +2367,13 @@
23672367 }
23682368
23692369
2370-TextureDialog::TextureDialog(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
2370+LightPaletteDialog::LightPaletteDialog(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
23712371 wxDialog(parent, id, title, pos, size, wxDEFAULT_DIALOG_STYLE)
23722372 {
2373- // begin wxGlade: TextureDialog::TextureDialog
2373+ // begin wxGlade: LightPaletteDialog::LightPaletteDialog
2374+ button_31 = new wxButton(this, wxID_ADD, wxEmptyString);
2375+ button_30 = new wxButton(this, wxID_DELETE, wxEmptyString);
2376+ list_ctrl_5 = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER);
23742377
23752378 set_properties();
23762379 do_layout();
@@ -2378,29 +2381,38 @@
23782381 }
23792382
23802383
2381-void TextureDialog::set_properties()
2384+void LightPaletteDialog::set_properties()
23822385 {
2383- // begin wxGlade: TextureDialog::set_properties
2384- SetTitle(wxT("dialog_20"));
2386+ // begin wxGlade: LightPaletteDialog::set_properties
2387+ SetTitle(wxT("dialog_21"));
2388+ list_ctrl_5->SetMinSize(wxSize(150, 200));
23852389 // end wxGlade
23862390 }
23872391
23882392
2389-void TextureDialog::do_layout()
2393+void LightPaletteDialog::do_layout()
23902394 {
2391- // begin wxGlade: TextureDialog::do_layout
2395+ // begin wxGlade: LightPaletteDialog::do_layout
2396+ wxFlexGridSizer* grid_sizer_40 = new wxFlexGridSizer(2, 1, 0, 0);
2397+ wxFlexGridSizer* grid_sizer_41 = new wxFlexGridSizer(1, 2, 0, 0);
2398+ grid_sizer_41->Add(button_31, 0, 0, 0);
2399+ grid_sizer_41->Add(button_30, 0, 0, 0);
2400+ grid_sizer_40->Add(grid_sizer_41, 1, wxEXPAND, 0);
2401+ grid_sizer_40->Add(list_ctrl_5, 1, wxEXPAND, 0);
2402+ SetSizer(grid_sizer_40);
2403+ grid_sizer_40->Fit(this);
23922404 Layout();
23932405 // end wxGlade
23942406 }
23952407
23962408
2397-LightPaletteDialog::LightPaletteDialog(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
2409+SoundPaletteDialog::SoundPaletteDialog(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
23982410 wxDialog(parent, id, title, pos, size, wxDEFAULT_DIALOG_STYLE)
23992411 {
2400- // begin wxGlade: LightPaletteDialog::LightPaletteDialog
2401- button_31 = new wxButton(this, wxID_ADD, wxEmptyString);
2402- button_30 = new wxButton(this, wxID_DELETE, wxEmptyString);
2403- list_ctrl_5 = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER);
2412+ // begin wxGlade: SoundPaletteDialog::SoundPaletteDialog
2413+ button_32 = new wxButton(this, wxID_ADD, wxEmptyString);
2414+ button_33 = new wxButton(this, wxID_DELETE, wxEmptyString);
2415+ list_ctrl_6 = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER);
24042416
24052417 set_properties();
24062418 do_layout();
@@ -2408,27 +2420,112 @@
24082420 }
24092421
24102422
2411-void LightPaletteDialog::set_properties()
2423+BEGIN_EVENT_TABLE(SoundPaletteDialog, wxDialog)
2424+ // begin wxGlade: SoundPaletteDialog::event_table
2425+ EVT_BUTTON(wxID_ANY, SoundPaletteDialog::OnAdd)
2426+ EVT_BUTTON(wxID_ANY, SoundPaletteDialog::OnDelete)
2427+ // end wxGlade
2428+END_EVENT_TABLE();
2429+
2430+
2431+void SoundPaletteDialog::OnAdd(wxCommandEvent &event)
24122432 {
2413- // begin wxGlade: LightPaletteDialog::set_properties
2414- SetTitle(wxT("dialog_21"));
2415- list_ctrl_5->SetMinSize(wxSize(150, 200));
2433+ event.Skip();
2434+ std::cout<<"Event handler (SoundPaletteDialog::OnAdd) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
2435+}
2436+
2437+
2438+void SoundPaletteDialog::OnDelete(wxCommandEvent &event)
2439+{
2440+ event.Skip();
2441+ std::cout<<"Event handler (SoundPaletteDialog::OnDelete) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
2442+}
2443+
2444+
2445+// wxGlade: add SoundPaletteDialog event handlers
2446+
2447+
2448+void SoundPaletteDialog::set_properties()
2449+{
2450+ // begin wxGlade: SoundPaletteDialog::set_properties
2451+ SetTitle(wxT("dialog_22"));
2452+ list_ctrl_6->SetMinSize(wxSize(150,200));
24162453 // end wxGlade
24172454 }
24182455
24192456
2420-void LightPaletteDialog::do_layout()
2457+void SoundPaletteDialog::do_layout()
24212458 {
2422- // begin wxGlade: LightPaletteDialog::do_layout
2423- wxFlexGridSizer* grid_sizer_40 = new wxFlexGridSizer(2, 1, 0, 0);
2424- wxFlexGridSizer* grid_sizer_41 = new wxFlexGridSizer(1, 2, 0, 0);
2425- grid_sizer_41->Add(button_31, 0, 0, 0);
2426- grid_sizer_41->Add(button_30, 0, 0, 0);
2427- grid_sizer_40->Add(grid_sizer_41, 1, wxEXPAND, 0);
2428- grid_sizer_40->Add(list_ctrl_5, 1, wxEXPAND, 0);
2429- SetSizer(grid_sizer_40);
2430- grid_sizer_40->Fit(this);
2459+ // begin wxGlade: SoundPaletteDialog::do_layout
2460+ wxFlexGridSizer* grid_sizer_42 = new wxFlexGridSizer(2, 1, 0, 0);
2461+ wxFlexGridSizer* grid_sizer_43 = new wxFlexGridSizer(1, 2, 0, 0);
2462+ grid_sizer_43->Add(button_32, 0, 0, 0);
2463+ grid_sizer_43->Add(button_33, 0, 0, 0);
2464+ grid_sizer_42->Add(grid_sizer_43, 1, wxEXPAND, 0);
2465+ grid_sizer_42->Add(list_ctrl_6, 1, wxEXPAND, 0);
2466+ SetSizer(grid_sizer_42);
2467+ grid_sizer_42->Fit(this);
24312468 Layout();
24322469 // end wxGlade
24332470 }
24342471
2472+
2473+TextureDialog::TextureDialog(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
2474+ wxDialog(parent, id, title, pos, size, wxDEFAULT_DIALOG_STYLE)
2475+{
2476+ // begin wxGlade: TextureDialog::TextureDialog
2477+ label_75 = new wxStaticText(this, wxID_ANY, wxT("type"));
2478+ const wxString choice_30_choices[] = {
2479+
2480+ };
2481+ choice_30 = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, choice_30_choices, 0);
2482+ panel_13 = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSTATIC_BORDER|wxTAB_TRAVERSAL);
2483+
2484+ set_properties();
2485+ do_layout();
2486+ // end wxGlade
2487+}
2488+
2489+
2490+BEGIN_EVENT_TABLE(TextureDialog, wxDialog)
2491+ // begin wxGlade: TextureDialog::event_table
2492+ EVT_CHOICE(wxID_ANY, TextureDialog::OnType)
2493+ // end wxGlade
2494+END_EVENT_TABLE();
2495+
2496+
2497+void TextureDialog::OnType(wxCommandEvent &event)
2498+{
2499+ event.Skip();
2500+ std::cout<<"Event handler (TextureDialog::OnType) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
2501+}
2502+
2503+
2504+// wxGlade: add TextureDialog event handlers
2505+
2506+
2507+void TextureDialog::set_properties()
2508+{
2509+ // begin wxGlade: TextureDialog::set_properties
2510+ SetTitle(wxT("dialog_23"));
2511+ panel_13->SetMinSize(wxSize(480, 120));
2512+ panel_13->SetScrollRate(10, 10);
2513+ // end wxGlade
2514+}
2515+
2516+
2517+void TextureDialog::do_layout()
2518+{
2519+ // begin wxGlade: TextureDialog::do_layout
2520+ wxFlexGridSizer* grid_sizer_44 = new wxFlexGridSizer(2, 1, 0, 0);
2521+ wxFlexGridSizer* grid_sizer_45 = new wxFlexGridSizer(1, 2, 0, 0);
2522+ grid_sizer_45->Add(label_75, 0, 0, 0);
2523+ grid_sizer_45->Add(choice_30, 0, 0, 0);
2524+ grid_sizer_44->Add(grid_sizer_45, 1, wxEXPAND, 0);
2525+ grid_sizer_44->Add(panel_13, 1, wxEXPAND, 0);
2526+ SetSizer(grid_sizer_44);
2527+ grid_sizer_44->Fit(this);
2528+ Layout();
2529+ // end wxGlade
2530+}
2531+
--- marathon/trunk/MapEditorWX/src/MapEditorMainFrame.h (revision 353)
+++ marathon/trunk/MapEditorWX/src/MapEditorMainFrame.h (revision 354)
@@ -19,6 +19,7 @@
1919 //height
2020 #include "HeightDialog.h"
2121 //palettes
22+#include "CeilingHeightPaletteDialog.h"
2223 #include "HeightPaletteDialog.h"
2324 #include "LightPaletteDialog.h"
2425 #include "MediaPaletteDialog.h"
@@ -124,17 +125,16 @@
124125 //高さ <en> height
125126 HeightDialog heightDialog;
126127 //パレット類 <en> palettes
128+ CeilingHeightPaletteDialog ceilingHeightPaletteDialog;
127129 HeightPaletteDialog heightPaletteDialog;
128130 LightPaletteDialog lightPaletteDialog;
129131 MediaPaletteDialog mediaPaletteDialog;
130- SoundPaletteDialog soundPaletteDialog;
131132 TextureDialog textureDialog;
132133
133- //TODO サウンド・メディア・ライト
134- //TODO 以上のパレットダイアログをさくせいすること
134+ SoundPaletteDialog soundPaletteDialog;
135135
136136 //TODO モーダルだが、Side選択ダイアログも作ろう
137- //TODO JumpLevel, LevelInfo, Placements, TerminalViewer
137+ //TODO JumpLevel, LevelInfo
138138
139139 //起動時と、色設定変更時にこれらを変更すること
140140 //TODO 設定変更コード
@@ -391,4 +391,6 @@
391391 新しいモードに切り替えます
392392 */
393393 void changeEditMode(int mode);
394+
395+ void closeAllModelessDialogs();
394396 };
--- marathon/trunk/MapEditorWX/src/LinePropDialog.h (revision 353)
+++ marathon/trunk/MapEditorWX/src/LinePropDialog.h (revision 354)
@@ -34,6 +34,7 @@
3434 LinePropDialog();
3535 bool Create(wxWindow* parent, wxWindowID id);
3636 virtual ~LinePropDialog();
37+
3738 //イベントテーブル作成<en>declare
3839 DECLARE_EVENT_TABLE()
3940 void OnEndpoint1Edit(wxCommandEvent &event); // wxGlade: <event_handler>
@@ -50,6 +51,8 @@
5051 void OnClockwisePoly(wxCommandEvent &event); // wxGlade: <event_handler>
5152 void OnCClockwisePoly(wxCommandEvent &event); // wxGlade: <event_handler>
5253
54+ void setupDialog();
55+ int getLineIndex();
5356 public:
5457 void setLineIndex(int index);
5558
--- marathon/trunk/MapEditorWX/src/DlgCommon.h (revision 353)
+++ marathon/trunk/MapEditorWX/src/DlgCommon.h (revision 354)
@@ -22,6 +22,7 @@
2222 #include "HPLLib/HPLMapTool.h"
2323
2424 #include <string>
25+#include <set>
2526
2627 #include <iostream>
2728
--- marathon/trunk/MapEditorWX/src/TextureDialog.h (revision 353)
+++ marathon/trunk/MapEditorWX/src/TextureDialog.h (revision 354)
@@ -4,6 +4,10 @@
44 #include "DlgCommon.h"
55
66 class TextureDialog: public wxDialog{
7+ wxStaticText* label_75;
8+ wxChoice* choice_30;
9+ wxScrolledWindow* panel_13;
10+ bool isFloor_;
711 public:
812 TextureDialog();
913 bool Create(wxWindow* parent, wxWindowID id);
@@ -10,6 +14,11 @@
1014 virtual ~TextureDialog();
1115 //イベントテーブル作成<en>declare
1216 DECLARE_EVENT_TABLE()
17+ void OnType(wxCommandEvent &event); // wxGlade: <event_handler>
18+
19+public:
20+ void setFloor(bool floor);
21+// bool isFloor();
1322 };
1423
1524 #endif
--- marathon/trunk/MapEditorWX/src/MainFrameMenuEvent.cpp (revision 353)
+++ marathon/trunk/MapEditorWX/src/MainFrameMenuEvent.cpp (revision 354)
@@ -172,6 +172,9 @@
172172 if(!wxGetApp().setting.saveSetting()){
173173 hpl::error::caution("Fail to save setting as [%s]", wxGetApp().setting.getFilePath().c_str());
174174 }
175+ //ペンの作り直し
176+ setupPenAndBrush(wxGetApp().setting.getColorSetting());
177+ Refresh();
175178 }
176179 }
177180
@@ -203,7 +206,6 @@
203206 }
204207 void MapEditorMainFrame::OnHeightDialog(wxCommandEvent& ev)
205208 {
206- //TODO height dialog
207209 bool shown = this->heightDialog.IsShown();
208210 this->heightDialog.Show(!shown);
209211 if(shown){
@@ -216,6 +218,27 @@
216218 /////////////////////////////////////////////////////////////////////
217219 /////////////////////////////////////////////////////////////////////
218220 // mode menus
221+/*
222+ モードレスダイアログがいっぱいになるので、メニュー選択時に切り替える
223+ それぞれのモードで開いている可能性のあるモードレスダイアログは以下のとおり
224+ ・Draw(Polygon)Mode
225+ 点情報ダイアログ PointProp
226+ 線情報ダイアログ LineProp
227+ ポリゴン情報ダイアログ PolygonProp
228+ Side情報ダイアログ SideProp
229+ オブジェクト情報ダイアログ ObjectProp
230+ ・PolygonType
231+ PolygonType
232+ ・Floor/Ceiling HeightMode
233+ HeightPalette (setFloor(bool))
234+ ・Floor/CeilingTexture
235+ Texture
236+ ・Media
237+ MediaPalette
238+ ・Light
239+ LightPalette
240+*/
241+
219242 void MapEditorMainFrame::OnDrawPolygonMode(wxCommandEvent& ev)
220243 {
221244 //現在の状態を取得
@@ -230,9 +253,23 @@
230253 //ドローモードにします
231254 wxGetApp().getEventManager()->setEditModeType(EditModeType::EM_DRAW);
232255
233- //ポリゴンタイプダイアログを閉じます
256+ //全部のダイアログを閉じます
257+ this->closeAllModelessDialogs();
258+}
259+void MapEditorMainFrame::closeAllModelessDialogs()
260+{
261+ this->objectPropDialog.Show(false);
262+ this->pointPropDialog.Show(false);
263+ this->polygonPropDialog.Show(false);
264+ this->linPropDialog.Show(false);
265+ this->sidePropDialog.Show(false);
234266 this->polyTypeDialog.Show(false);
267+ this->mediaPaletteDialog.Show(false);
268+ this->heightPaletteDialog.Show(false);
269+ this->lightPaletteDialog.Show(false);
270+ this->textureDialog.Show(false);
235271 }
272+
236273 void MapEditorMainFrame::OnVisualMode(wxCommandEvent& ev)
237274 {
238275 //モーダル表示
--- marathon/trunk/MapEditorWX/src/SoundPaletteDialog.h (revision 353)
+++ marathon/trunk/MapEditorWX/src/SoundPaletteDialog.h (revision 354)
@@ -4,6 +4,9 @@
44 #include "DlgCommon.h"
55
66 class SoundPaletteDialog: public wxDialog{
7+ wxButton* button_32;
8+ wxButton* button_33;
9+ wxListCtrl* list_ctrl_6;
710 public:
811 SoundPaletteDialog();
912 bool Create(wxWindow* parent, wxWindowID id);
@@ -10,6 +13,9 @@
1013 virtual ~SoundPaletteDialog();
1114 //イベントテーブル作成<en>declare
1215 DECLARE_EVENT_TABLE()
16+ void OnAdd(wxCommandEvent &event); // wxGlade: <event_handler>
17+ void OnDelete(wxCommandEvent &event); // wxGlade: <event_handler>
18+ void OnEdit(wxListEvent &event); // wxGlade: <event_handler>
1319 };
1420
1521 #endif
--- marathon/trunk/MapEditorWX/src/PlacementDialog.h (revision 353)
+++ marathon/trunk/MapEditorWX/src/PlacementDialog.h (revision 354)
@@ -35,8 +35,12 @@
3535 void OnInf(wxCommandEvent &ev);
3636 void OnAllInf(wxCommandEvent &ev);
3737 void OnSetInitial(wxCommandEvent &ev);
38+ void OnSel(wxCommandEvent &ev);
39+ void OnRandomPlace(wxCommandEvent& ev);
3840 //イベントテーブル作成<en>declare
3941 DECLARE_EVENT_TABLE()
42+public:
43+ void setPlacementText();
4044 };
4145
4246 #endif
--- marathon/trunk/MapEditorWX/WXTODOリスト.txt (revision 353)
+++ marathon/trunk/MapEditorWX/WXTODOリスト.txt (revision 354)
@@ -5,7 +5,7 @@
55 ?E?}?E?X?C?x???g?̋L?q
66
77 -AlephOneSrc??DLL??肽???ȁc
8--XRC???߂????????????B?N???X?̃C???X?^???X???̂܂܍?????Ⴄ???ĉ????悗???????ǂ??g??????΂????񂾂?????
8+-XRC???߂??????B?N???X?̃C???X?^???X???̂܂܍?????Ⴄ???ĉ?????w?ǂ??g??????΂????񂾂?
99 -rad1??#define????Ă??B?l?[????
1010 -rad2?????I
1111
@@ -33,10 +33,12 @@
3333 ?T?F?f?o?b?O????
3434
3535 Annotation :?f?o?b?O?????i?I?????[?h?͖????j
36+CeilingHeightPaletteDialog
37+ :wx
3638 ColorCustomize :???o??
3739 EditPreferences :???o??
3840 Height :???o??
39-HeightPallet :wx
41+HeightPallet :?z?u
4042 LevelInfo :?z?u
4143 LineProp :?z?u
4244 ObjectProp :?z?u
@@ -49,7 +51,7 @@
4951 SelectLevel :?z?u
5052 SideProp :
5153 Terminal :???o??
52-Texture :
54+Texture :?z?u
5355 Tool :?z?u
5456 Visual :
5557
@@ -57,7 +59,7 @@
5759 SelectLevel :?z?u
5860 MediaPalette :?z?u
5961 LightPalette :?z?u
60-SoundPalette :wx
62+SoundPalette :?z?u
6163
6264 ???C?x???g?????̋L?q?͏I????Ă??邩?H?̃??X?g
6365 ?ETODO????Ȃ炻?̓??e??????
--- marathon/trunk/MapEditorCommonSrc/MapEditorOneSetting.cpp (revision 353)
+++ marathon/trunk/MapEditorCommonSrc/MapEditorOneSetting.cpp (revision 354)
@@ -214,9 +214,9 @@
214214 setting->background[0] = 0;
215215 setting->background[1] = 0;
216216 setting->background[2] = 0;
217- setting->gridLine[0] = 10;
218- setting->gridLine[1] = 10;
219- setting->gridLine[2] = 10;
217+ setting->gridLine[0] = 50;
218+ setting->gridLine[1] = 50;
219+ setting->gridLine[2] = 50;
220220 setting->lines[0] = 50;
221221 setting->lines[1] = 255;
222222 setting->lines[2] = 0;
旧リポジトリブラウザで表示