• R/O
  • SSH
  • HTTPS

marathon: コミット


コミットメタ情報

リビジョン464 (tree)
日時2007-09-01 23:02:59
作者hogepiyo

ログメッセージ

*** empty log message ***

変更サマリ

差分

--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/MonsterAttackPanel.cpp (revision 463)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/MonsterAttackPanel.cpp (revision 464)
@@ -1,10 +1,282 @@
11 #include "MonsterAttackPanel.h"
22 #include "../PhysicsEditorOneWX.h"
33
4+enum{
5+ ID_FREQUENCY,
6+
7+ ID_MELEE_TYPE,
8+ ID_MELEE_REP,
9+ ID_MELEE_ERROR,
10+ ID_MELEE_RANGE,
11+ ID_MELEE_SEQUENCE,
12+ ID_MELEE_DX,
13+ ID_MELEE_DY,
14+ ID_MELEE_DZ,
15+ ID_MELEE_COPY_FROM,
16+
17+ ID_RANGED_TYPE,
18+ ID_RANGED_REP,
19+ ID_RANGED_ERROR,
20+ ID_RANGED_RANGE,
21+ ID_RANGED_SEQUENCE,
22+ ID_RANGED_DX,
23+ ID_RANGED_DY,
24+ ID_RANGED_DZ,
25+ ID_RANGED_COPY_FROM,
26+};
27+
28+BEGIN_EVENT_TABLE(MonsterAttackPanel, wxPanel)
29+ EVT_TEXT(ID_FREQUENCY, MonsterAttackPanel::OnFrequency)
30+
31+ EVT_CHOICE(ID_MELEE_TYPE, MonsterAttackPanel::OnMeleeType)
32+ EVT_TEXT(ID_MELEE_REP, MonsterAttackPanel::OnMeleeRep)
33+ EVT_TEXT(ID_MELEE_ERROR, MonsterAttackPanel::OnMeleeError)
34+ EVT_TEXT(ID_MELEE_RANGE, MonsterAttackPanel::OnMeleeRange)
35+ EVT_TEXT(ID_MELEE_SEQUENCE, MonsterAttackPanel::OnMeleeSequence)
36+ EVT_TEXT(ID_MELEE_DX, MonsterAttackPanel::OnMeleeDX)
37+ EVT_TEXT(ID_MELEE_DY, MonsterAttackPanel::OnMeleeDZ)
38+ EVT_TEXT(ID_MELEE_DZ, MonsterAttackPanel::OnMeleeDZ)
39+ EVT_BUTTON(ID_MELEE_COPY_FROM, MonsterAttackPanel::OnMeleeCopyFrom)
40+
41+ EVT_CHOICE(ID_RANGED_TYPE, MonsterAttackPanel::OnRangedType)
42+ EVT_TEXT(ID_RANGED_REP, MonsterAttackPanel::OnRangedRep)
43+ EVT_TEXT(ID_RANGED_ERROR, MonsterAttackPanel::OnRangedError)
44+ EVT_TEXT(ID_RANGED_RANGE, MonsterAttackPanel::OnRangedRange)
45+ EVT_TEXT(ID_RANGED_SEQUENCE, MonsterAttackPanel::OnRangedSequence)
46+ EVT_TEXT(ID_RANGED_DX, MonsterAttackPanel::OnRangedDX)
47+ EVT_TEXT(ID_RANGED_DY, MonsterAttackPanel::OnRangedDZ)
48+ EVT_TEXT(ID_RANGED_DZ, MonsterAttackPanel::OnRangedDZ)
49+ EVT_BUTTON(ID_RANGED_COPY_FROM, MonsterAttackPanel::OnRangedCopyFrom)
50+END_EVENT_TABLE()
451 MonsterAttackPanel::MonsterAttackPanel(wxWindow* parent, wxWindowID id)
552 :wxPanel(parent, id)
653 {
54+ //create
55+ this->frequencyText = new wxTextCtrl(this, ID_FREQUENCY);
56+ this->meleeTypeChoice = new wxChoice(this, ID_MELEE_TYPE);
57+ this->meleeRepetitionsText = new wxTextCtrl(this, ID_MELEE_REP);
58+ this->meleeErrorText = new wxTextCtrl(this, ID_MELEE_ERROR);
59+ this->meleeRangeText = new wxTextCtrl(this, ID_MELEE_RANGE);
60+ this->meleeSequenceText = new wxTextCtrl(this, ID_MELEE_SEQUENCE);
61+ this->meleeDXText = new wxTextCtrl(this, ID_MELEE_DX);
62+ this->meleeDYText = new wxTextCtrl(this, ID_MELEE_DY);
63+ this->meleeDZText = new wxTextCtrl(this, ID_MELEE_DZ);
64+ this->meleeCopyFromButton = new wxButton(this, ID_MELEE_COPY_FROM,
65+ _T("Copy from ..."));
66+
67+ this->rangedTypeChoice = new wxChoice(this, ID_MELEE_TYPE);
68+ this->rangedRepetitionsText = new wxTextCtrl(this, ID_MELEE_REP);
69+ this->rangedErrorText = new wxTextCtrl(this, ID_MELEE_ERROR);
70+ this->rangedRangeText = new wxTextCtrl(this, ID_MELEE_RANGE);
71+ this->rangedSequenceText = new wxTextCtrl(this, ID_MELEE_SEQUENCE);
72+ this->rangedDXText = new wxTextCtrl(this, ID_MELEE_DX);
73+ this->rangedDYText = new wxTextCtrl(this, ID_MELEE_DY);
74+ this->rangedDZText = new wxTextCtrl(this, ID_MELEE_DZ);
75+ this->rangedCopyFromButton = new wxButton(this, ID_MELEE_COPY_FROM,
76+ _T("Copy from ..."));
77+
78+ //set
79+ // type
80+ for(int i = 0; i < NUMBER_OF_PROJECTILE_TYPES; i ++){
81+ meleeTypeChoice->Insert(wxConvertMB2WX(
82+ wxGetApp().projectileInfo[i].jname.c_str()), i);
83+ rangedTypeChoice->Insert(wxConvertMB2WX(
84+ wxGetApp().projectileInfo[i].jname.c_str()), i);
85+ }
86+ meleeTypeChoice->Insert(_T("NONE"), NUMBER_OF_PROJECTILE_TYPES);
87+ rangedTypeChoice->Insert(_T("NONE"), NUMBER_OF_PROJECTILE_TYPES);
88+
89+ //layout
90+ wxFlexGridSizer* allSizer = new wxFlexGridSizer(2,2, 0,0);
91+
92+ //frequency
93+ wxFlexGridSizer* fleqFlexSizer = new wxFlexGridSizer(1,2,0,0);
94+ fleqFlexSizer->Add(new wxStaticText(this, wxID_ANY,
95+ _T("Frequency")));
96+ fleqFlexSizer->Add(this->frequencyText, 0, wxEXPAND, 0, 0);
97+ allSizer->Add(fleqFlexSizer);
98+ allSizer->Add(new wxPanel(this, wxID_ANY));
99+
100+ //melee
101+ wxStaticBox* meleeStaticBox = new wxStaticBox(this, wxID_ANY,
102+ _T("Ranged"));
103+ wxStaticBoxSizer* meleeStaticSizer = new wxStaticBoxSizer(meleeStaticBox, wxVERTICAL);
104+ wxFlexGridSizer* meleeFlexSizer = new wxFlexGridSizer(2,1,0,0);
105+ wxFlexGridSizer* meleeAboveSizer = new wxFlexGridSizer(8,2,0,0);
106+ meleeAboveSizer->Add(new wxStaticText(this, wxID_ANY,
107+ _T("Type")));
108+ meleeAboveSizer->Add(meleeTypeChoice);
109+ meleeAboveSizer->Add(new wxStaticText(this, wxID_ANY,
110+ _T("Repetitions")));
111+ meleeAboveSizer->Add(meleeRepetitionsText);
112+ meleeAboveSizer->Add(new wxStaticText(this, wxID_ANY,
113+ _T("Error")));
114+ meleeAboveSizer->Add(meleeErrorText);
115+ meleeAboveSizer->Add(new wxStaticText(this, wxID_ANY,
116+ _T("Range")));
117+ meleeAboveSizer->Add(meleeRangeText);
118+ meleeAboveSizer->Add(new wxStaticText(this, wxID_ANY,
119+ _T("Sequence")));
120+ meleeAboveSizer->Add(meleeSequenceText);
121+ meleeAboveSizer->Add(new wxStaticText(this, wxID_ANY,
122+ _T("Delta X")));
123+ meleeAboveSizer->Add(meleeDXText);
124+ meleeAboveSizer->Add(new wxStaticText(this, wxID_ANY,
125+ _T("Delta Y")));
126+ meleeAboveSizer->Add(meleeDYText);
127+ meleeAboveSizer->Add(new wxStaticText(this, wxID_ANY,
128+ _T("Delta Z")));
129+ meleeAboveSizer->Add(meleeDZText);
130+ meleeFlexSizer->Add(meleeAboveSizer);
131+ meleeFlexSizer->Add(meleeCopyFromButton);
132+ meleeStaticSizer->Add(meleeFlexSizer);
133+ allSizer->Add(meleeStaticSizer);
134+
135+ //ranged
136+ wxStaticBox* rangedStaticBox = new wxStaticBox(this, wxID_ANY,
137+ _T("Melee"));
138+ wxStaticBoxSizer* rangedStaticSizer = new wxStaticBoxSizer(rangedStaticBox, wxVERTICAL);
139+ wxFlexGridSizer* rangedFlexSizer = new wxFlexGridSizer(2,1,0,0);
140+ wxFlexGridSizer* rangedAboveSizer = new wxFlexGridSizer(8,2,0,0);
141+ rangedAboveSizer->Add(new wxStaticText(this, wxID_ANY,
142+ _T("Type")));
143+ rangedAboveSizer->Add(rangedTypeChoice);
144+ rangedAboveSizer->Add(new wxStaticText(this, wxID_ANY,
145+ _T("Repetitions")));
146+ rangedAboveSizer->Add(rangedRepetitionsText);
147+ rangedAboveSizer->Add(new wxStaticText(this, wxID_ANY,
148+ _T("Error")));
149+ rangedAboveSizer->Add(rangedErrorText);
150+ rangedAboveSizer->Add(new wxStaticText(this, wxID_ANY,
151+ _T("Range")));
152+ rangedAboveSizer->Add(rangedRangeText);
153+ rangedAboveSizer->Add(new wxStaticText(this, wxID_ANY,
154+ _T("Sequence")));
155+ rangedAboveSizer->Add(rangedSequenceText);
156+ rangedAboveSizer->Add(new wxStaticText(this, wxID_ANY,
157+ _T("Delta X")));
158+ rangedAboveSizer->Add(rangedDXText);
159+ rangedAboveSizer->Add(new wxStaticText(this, wxID_ANY,
160+ _T("Delta Y")));
161+ rangedAboveSizer->Add(rangedDYText);
162+ rangedAboveSizer->Add(new wxStaticText(this, wxID_ANY,
163+ _T("Delta Z")));
164+ rangedAboveSizer->Add(rangedDZText);
165+ rangedFlexSizer->Add(rangedAboveSizer);
166+ rangedFlexSizer->Add(rangedCopyFromButton);
167+ rangedStaticSizer->Add(rangedFlexSizer);
168+ allSizer->Add(rangedStaticSizer);
169+
170+ this->SetSizer(allSizer);
171+ allSizer->Fit(this);
172+ Layout();
173+
7174 }
8175 MonsterAttackPanel::~MonsterAttackPanel()
9176 {
10177 }
178+void MonsterAttackPanel::OnFrequency(wxCommandEvent& ev)
179+{
180+}
181+
182+void MonsterAttackPanel::OnMeleeType(wxCommandEvent& ev)
183+{
184+}
185+void MonsterAttackPanel::OnMeleeRep(wxCommandEvent& ev)
186+{
187+}
188+void MonsterAttackPanel::OnMeleeError(wxCommandEvent& ev)
189+{
190+}
191+void MonsterAttackPanel::OnMeleeRange(wxCommandEvent& ev)
192+{
193+}
194+void MonsterAttackPanel::OnMeleeSequence(wxCommandEvent& ev)
195+{
196+}
197+void MonsterAttackPanel::OnMeleeDX(wxCommandEvent& ev)
198+{
199+}
200+void MonsterAttackPanel::OnMeleeDY(wxCommandEvent& ev)
201+{
202+}
203+void MonsterAttackPanel::OnMeleeDZ(wxCommandEvent& ev)
204+{
205+}
206+void MonsterAttackPanel::OnMeleeCopyFrom(wxCommandEvent& ev)
207+{
208+}
209+
210+void MonsterAttackPanel::OnRangedType(wxCommandEvent& ev)
211+{
212+}
213+void MonsterAttackPanel::OnRangedRep(wxCommandEvent& ev)
214+{
215+}
216+void MonsterAttackPanel::OnRangedError(wxCommandEvent& ev)
217+{
218+}
219+void MonsterAttackPanel::OnRangedRange(wxCommandEvent& ev)
220+{
221+}
222+void MonsterAttackPanel::OnRangedSequence(wxCommandEvent& ev)
223+{
224+}
225+void MonsterAttackPanel::OnRangedDX(wxCommandEvent& ev)
226+{
227+}
228+void MonsterAttackPanel::OnRangedDY(wxCommandEvent& ev)
229+{
230+}
231+void MonsterAttackPanel::OnRangedDZ(wxCommandEvent& ev)
232+{
233+}
234+void MonsterAttackPanel::OnRangedCopyFrom(wxCommandEvent& ev)
235+{
236+}
237+
238+void MonsterAttackPanel::setup()
239+{
240+ int type = wxGetApp().getEditingMonsterIndex();
241+
242+ //frequency
243+ frequencyText->SetValue(wx::string::getString("%d",
244+ monster_definitions[type].attack_frequency));
245+
246+ //melee
247+ setChoice(meleeTypeChoice, monster_definitions[type].melee_attack.type,
248+ NUMBER_OF_PROJECTILE_TYPES);
249+ meleeRepetitionsText->SetValue(wx::string::getString("%d",
250+ monster_definitions[type].melee_attack.repetitions));
251+ meleeErrorText->SetValue(wx::string::getString("%d",
252+ monster_definitions[type].melee_attack.error));
253+ meleeRangeText->SetValue(wx::string::getString("%d",
254+ monster_definitions[type].melee_attack.range));
255+ meleeSequenceText->SetValue(wx::string::getString("%d",
256+ monster_definitions[type].melee_attack.attack_shape));
257+ meleeDXText->SetValue(wx::string::getString("%d",
258+ monster_definitions[type].melee_attack.dx));
259+ meleeDYText->SetValue(wx::string::getString("%d",
260+ monster_definitions[type].melee_attack.dy));
261+ meleeDZText->SetValue(wx::string::getString("%d",
262+ monster_definitions[type].melee_attack.dz));
263+
264+ //ranged
265+ setChoice(rangedTypeChoice, monster_definitions[type].ranged_attack.type,
266+ NUMBER_OF_PROJECTILE_TYPES);
267+ rangedRepetitionsText->SetValue(wx::string::getString("%d",
268+ monster_definitions[type].ranged_attack.repetitions));
269+ rangedErrorText->SetValue(wx::string::getString("%d",
270+ monster_definitions[type].ranged_attack.error));
271+ rangedRangeText->SetValue(wx::string::getString("%d",
272+ monster_definitions[type].ranged_attack.range));
273+ rangedSequenceText->SetValue(wx::string::getString("%d",
274+ monster_definitions[type].ranged_attack.attack_shape));
275+ rangedDXText->SetValue(wx::string::getString("%d",
276+ monster_definitions[type].ranged_attack.dx));
277+ rangedDYText->SetValue(wx::string::getString("%d",
278+ monster_definitions[type].ranged_attack.dy));
279+ rangedDZText->SetValue(wx::string::getString("%d",
280+ monster_definitions[type].ranged_attack.dz));
281+
282+}
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/MonsterAttackPanel.h (revision 463)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/MonsterAttackPanel.h (revision 464)
@@ -36,6 +36,31 @@
3636 public:
3737 MonsterAttackPanel(wxWindow* parent, wxWindowID id);
3838 virtual ~MonsterAttackPanel();
39+ DECLARE_EVENT_TABLE()
40+ void OnFrequency(wxCommandEvent& ev);
41+
42+ void OnMeleeType(wxCommandEvent& ev);
43+ void OnMeleeRep(wxCommandEvent& ev);
44+ void OnMeleeError(wxCommandEvent& ev);
45+ void OnMeleeRange(wxCommandEvent& ev);
46+ void OnMeleeSequence(wxCommandEvent& ev);
47+ void OnMeleeDX(wxCommandEvent& ev);
48+ void OnMeleeDY(wxCommandEvent& ev);
49+ void OnMeleeDZ(wxCommandEvent& ev);
50+ void OnMeleeCopyFrom(wxCommandEvent& ev);
51+
52+ void OnRangedType(wxCommandEvent& ev);
53+ void OnRangedRep(wxCommandEvent& ev);
54+ void OnRangedError(wxCommandEvent& ev);
55+ void OnRangedRange(wxCommandEvent& ev);
56+ void OnRangedSequence(wxCommandEvent& ev);
57+ void OnRangedDX(wxCommandEvent& ev);
58+ void OnRangedDY(wxCommandEvent& ev);
59+ void OnRangedDZ(wxCommandEvent& ev);
60+ void OnRangedCopyFrom(wxCommandEvent& ev);
61+public:
62+
63+ void setup();
3964 };
4065
4166 #endif
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/MonsterPanel.cpp (revision 463)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/MonsterPanel.cpp (revision 464)
@@ -65,5 +65,5 @@
6565 this->flagsPanel->setup();
6666
6767 //attackの更新
68-
68+ this->attackPanel->setup();
6969 }
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/MonsterAppearancePanel.cpp (revision 463)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/MonsterAppearancePanel.cpp (revision 464)
@@ -36,9 +36,10 @@
3636 ID_SHRAPNEL_SCALE,
3737 ID_SHRAPNEL_TYPE,
3838 ID_SHRAPNEL_IS_ALIEN,
39-
39+
4040 ID_COPY_FROM,
4141
42+
4243 ID_PITCH,
4344 ID_ACTIVATION,
4445 ID_FRIEND_ACT,
@@ -54,82 +55,69 @@
5455 ID_EFFECT_MELEE,
5556 ID_EFFECT_CONTRAIL,
5657
58+ ID_DOOR_RETRY_MASK,
59+
5760 ID_RESET,
5861 };
5962
6063 BEGIN_EVENT_TABLE(MonsterAppearancePanel, wxPanel)
61- EVT_CHOICE(ID_COLLECTION, MonsterAppearancePanel::OnCollection)
62- EVT_CHOICE(ID_PALETTE, MonsterAppearancePanel::OnPalette)
63- EVT_TEXT(ID_VITALITY, MonsterAppearancePanel::OnVitality)
64- EVT_CHOICE(ID_CLASS, MonsterAppearancePanel::OnClass)
65- EVT_TEXT(ID_RADIUS, MonsterAppearancePanel::OnRadius)
66- EVT_TEXT(ID_HEIGHT, MonsterAppearancePanel::OnHeight)
67- EVT_TEXT(ID_HOVER, MonsterAppearancePanel::OnHover)
68- EVT_TEXT(ID_MIN_LEDGE, MonsterAppearancePanel::OnMinLedge)
69- EVT_TEXT(ID_MAX_LEDGE, MonsterAppearancePanel::OnMaxLedge)
70- EVT_TEXT(ID_EXT_VEL_SCALE, MonsterAppearancePanel::OnExtVelScale)
71- EVT_CHOICE(ID_CARRY_ITEM, MonsterAppearancePanel::OnCarryItem)
72- EVT_TEXT(ID_HALF_VISUAL_ARC, MonsterAppearancePanel::OnHalfVisualArc)
73- EVT_TEXT(ID_VERT_VISUAL_ARC, MonsterAppearancePanel::OnVertVisualArc)
74- EVT_CHOICE(ID_INTELLIGENCE, MonsterAppearancePanel::OnIntelligence)
75- EVT_TEXT(ID_SPEED_TEXT, MonsterAppearancePanel::OnSpeedText)
76- EVT_CHOICE(ID_SPEED_CHOICE, MonsterAppearancePanel::OnSpeedChoice)
77- EVT_TEXT(ID_GRAVITY, MonsterAppearancePanel::OnGravity)
64+ EVT_CHOICE(ID_COLLECTION, MonsterAppearancePanel::OnItem)
65+ EVT_CHOICE(ID_PALETTE, MonsterAppearancePanel::OnItem)
66+ EVT_TEXT(ID_VITALITY, MonsterAppearancePanel::OnItem)
67+ EVT_CHOICE(ID_CLASS, MonsterAppearancePanel::OnItem)
68+ EVT_TEXT(ID_RADIUS, MonsterAppearancePanel::OnItem)
69+ EVT_TEXT(ID_HEIGHT, MonsterAppearancePanel::OnItem)
70+ EVT_TEXT(ID_HOVER, MonsterAppearancePanel::OnItem)
71+ EVT_TEXT(ID_MIN_LEDGE, MonsterAppearancePanel::OnItem)
72+ EVT_TEXT(ID_MAX_LEDGE, MonsterAppearancePanel::OnItem)
73+ EVT_TEXT(ID_EXT_VEL_SCALE, MonsterAppearancePanel::OnItem)
74+ EVT_CHOICE(ID_CARRY_ITEM, MonsterAppearancePanel::OnItem)
75+ EVT_TEXT(ID_HALF_VISUAL_ARC, MonsterAppearancePanel::OnItem)
76+ EVT_TEXT(ID_VERT_VISUAL_ARC, MonsterAppearancePanel::OnItem)
77+ EVT_CHOICE(ID_INTELLIGENCE, MonsterAppearancePanel::OnItem)
78+ EVT_TEXT(ID_SPEED_TEXT, MonsterAppearancePanel::OnItem)
79+ EVT_CHOICE(ID_SPEED_CHOICE, MonsterAppearancePanel::OnItem)
80+ EVT_TEXT(ID_GRAVITY, MonsterAppearancePanel::OnItem)
7881
79- EVT_TEXT(ID_STATIONALY, MonsterAppearancePanel::OnStationaly)
80- EVT_TEXT(ID_MOVING, MonsterAppearancePanel::OnMoving)
81- EVT_TEXT(ID_HITTING, MonsterAppearancePanel::OnHitting)
82- EVT_TEXT(ID_SOFT_DYING, MonsterAppearancePanel::OnSoftDying)
83- EVT_TEXT(ID_SOFT_DEAD, MonsterAppearancePanel::OnSoftDead)
84- EVT_TEXT(ID_HARD_DYING, MonsterAppearancePanel::OnHardDying)
85- EVT_TEXT(ID_HARD_DEAD, MonsterAppearancePanel::OnHardDead)
86- EVT_TEXT(ID_TELEPORT_IN, MonsterAppearancePanel::OnTeleportIn)
87- EVT_TEXT(ID_TELEPORT_OUT, MonsterAppearancePanel::OnTeleportOut)
82+ EVT_TEXT(ID_STATIONALY, MonsterAppearancePanel::OnItem)
83+ EVT_TEXT(ID_MOVING, MonsterAppearancePanel::OnItem)
84+ EVT_TEXT(ID_HITTING, MonsterAppearancePanel::OnItem)
85+ EVT_TEXT(ID_SOFT_DYING, MonsterAppearancePanel::OnItem)
86+ EVT_TEXT(ID_SOFT_DEAD, MonsterAppearancePanel::OnItem)
87+ EVT_TEXT(ID_HARD_DYING, MonsterAppearancePanel::OnItem)
88+ EVT_TEXT(ID_HARD_DEAD, MonsterAppearancePanel::OnItem)
89+ EVT_TEXT(ID_TELEPORT_IN, MonsterAppearancePanel::OnItem)
90+ EVT_TEXT(ID_TELEPORT_OUT, MonsterAppearancePanel::OnItem)
8891
89- EVT_TEXT(ID_SHRAPNEL_RADIUS, MonsterAppearancePanel::OnShrapnelRadius)
90- EVT_TEXT(ID_SHRAPNEL_BASE, MonsterAppearancePanel::OnShrapnelBase)
91- EVT_TEXT(ID_SHRAPNEL_RND, MonsterAppearancePanel::OnShrapnelRnd)
92- EVT_TEXT(ID_SHRAPNEL_SCALE, MonsterAppearancePanel::OnShrapnelScale)
93- EVT_CHOICE(ID_SHRAPNEL_TYPE, MonsterAppearancePanel::OnShrapnelType)
94- EVT_CHECKBOX(ID_SHRAPNEL_IS_ALIEN, MonsterAppearancePanel::OnShrapnelIsAlien)
92+ EVT_TEXT(ID_SHRAPNEL_RADIUS, MonsterAppearancePanel::OnItem)
93+ EVT_TEXT(ID_SHRAPNEL_BASE, MonsterAppearancePanel::OnItem)
94+ EVT_TEXT(ID_SHRAPNEL_RND, MonsterAppearancePanel::OnItem)
95+ EVT_TEXT(ID_SHRAPNEL_SCALE, MonsterAppearancePanel::OnItem)
96+ EVT_CHOICE(ID_SHRAPNEL_TYPE, MonsterAppearancePanel::OnItem)
97+ EVT_CHECKBOX(ID_SHRAPNEL_IS_ALIEN, MonsterAppearancePanel::OnItem)
9598
9699 EVT_BUTTON(ID_COPY_FROM, MonsterAppearancePanel::OnCopyFrom)
97100
98- EVT_TEXT(ID_PITCH, MonsterAppearancePanel::OnSoundPitch)
99- EVT_CHOICE(ID_ACTIVATION, MonsterAppearancePanel::OnSoundActivation)
100- EVT_CHOICE(ID_FRIEND_ACT, MonsterAppearancePanel::OnSoundFriendAct)
101- EVT_CHOICE(ID_CLEAR, MonsterAppearancePanel::OnSoundClear)
102- EVT_CHOICE(ID_KILL, MonsterAppearancePanel::OnSoundKill)
103- EVT_CHOICE(ID_APOLYGY, MonsterAppearancePanel::OnSoundApology)
104- EVT_CHOICE(ID_FRIEND_FIRE, MonsterAppearancePanel::OnSoundFriendFire)
105- EVT_CHOICE(ID_FLAMING, MonsterAppearancePanel::OnSoundFlaming)
106- EVT_CHOICE(ID_RANDOM, MonsterAppearancePanel::OnSoundRandom)
107- EVT_TEXT(ID_RANDOM_MASK, MonsterAppearancePanel::OnSoundRandomMask)
101+ EVT_TEXT(ID_PITCH, MonsterAppearancePanel::OnItem)
102+ EVT_CHOICE(ID_ACTIVATION, MonsterAppearancePanel::OnItem)
103+ EVT_CHOICE(ID_FRIEND_ACT, MonsterAppearancePanel::OnItem)
104+ EVT_CHOICE(ID_CLEAR, MonsterAppearancePanel::OnItem)
105+ EVT_CHOICE(ID_KILL, MonsterAppearancePanel::OnItem)
106+ EVT_CHOICE(ID_APOLYGY, MonsterAppearancePanel::OnItem)
107+ EVT_CHOICE(ID_FRIEND_FIRE, MonsterAppearancePanel::OnItem)
108+ EVT_CHOICE(ID_FLAMING, MonsterAppearancePanel::OnItem)
109+ EVT_CHOICE(ID_RANDOM, MonsterAppearancePanel::OnItem)
110+ EVT_TEXT(ID_RANDOM_MASK, MonsterAppearancePanel::OnItem)
108111
109- EVT_CHOICE(ID_RANDOM, MonsterAppearancePanel::OnSoundRandom)
110- EVT_CHOICE(ID_RANDOM, MonsterAppearancePanel::OnSoundRandom)
111- EVT_CHOICE(ID_RANDOM, MonsterAppearancePanel::OnSoundRandom)
112+ EVT_CHOICE(ID_EFFECT, MonsterAppearancePanel::OnItem)
113+ EVT_CHOICE(ID_EFFECT_MELEE, MonsterAppearancePanel::OnItem)
114+ EVT_CHOICE(ID_EFFECT_CONTRAIL, MonsterAppearancePanel::OnItem)
112115
116+ EVT_TEXT(ID_DOOR_RETRY_MASK, MonsterAppearancePanel::OnItem)
117+
113118 EVT_BUTTON(ID_RESET, MonsterAppearancePanel::OnResetButton)
114119 END_EVENT_TABLE()
115120
116-static void setChoice(wxChoice* choice, int index, int max)
117-{
118- index = index == NONE ? max : index;
119- choice->SetSelection(index);
120-}
121-static int getChoice(wxChoice* choice, int max)
122-{
123- int index = choice->GetSelection();
124- index = index == max ? NONE : index;
125- return index;
126-}
127-static int getChoice(wxCommandEvent* choice, int max)
128-{
129- int index = choice->GetSelection();
130- index = index == max ? NONE : index;
131- return index;
132-}
133121
134122 MonsterAppearancePanel::MonsterAppearancePanel(wxWindow* parent, wxWindowID id)
135123 :wxPanel(parent, id)
@@ -193,6 +181,8 @@
193181 effectMeleeChoice = new wxChoice(this, ID_EFFECT_MELEE);
194182 effectContrailChoice = new wxChoice(this, ID_EFFECT_CONTRAIL);
195183
184+ doorRetryMaskText = new wxTextCtrl(this, ID_DOOR_RETRY_MASK);
185+
196186 //reset
197187 resetButton = new wxButton(this, ID_RESET, _T("Reset"));
198188
@@ -349,7 +339,7 @@
349339
350340
351341 // right column
352- wxFlexGridSizer* soundAndEffectSizer = new wxFlexGridSizer(3, 1, 0,0);
342+ wxFlexGridSizer* soundAndEffectSizer = new wxFlexGridSizer(4, 1, 0,0);
353343 // sound
354344 wxFlexGridSizer* soundFlexSizer = new wxFlexGridSizer(10,2,0,0);
355345 soundFlexSizer->Add(new wxStaticText(this, wxID_ANY, _T("Pitch")));
@@ -388,6 +378,8 @@
388378 wxStaticBoxSizer* effectStaticSizer = new wxStaticBoxSizer(effectStaticBox, wxVERTICAL);
389379 effectStaticSizer->Add(effectFlexSizer);
390380 soundAndEffectSizer->Add(effectStaticSizer);
381+ soundAndEffectSizer->Add(new wxStaticText(this, wxID_ANY, _T("Door Retry Mask")));
382+ soundAndEffectSizer->Add(doorRetryMaskText);
391383 soundAndEffectSizer->Add(this->resetButton);
392384
393385 baseSizer->Add(infoSizer);
@@ -402,7 +394,72 @@
402394 MonsterAppearancePanel::~MonsterAppearancePanel()
403395 {
404396 }
397+void MonsterAppearancePanel::OnItem(wxCommandEvent& ev)
398+{
399+ int type = wxGetApp().getEditingMonsterIndex();
400+ //
401+ int col = collectionChoice->GetSelection();
402+ int clut = getNumberFromTextCtrl(paletteText);
403+ monster_definitions[type].collection = BUILD_COLLECTION(col, clut);
404+ monster_definitions[type].vitality = getNumberFromTextCtrl(vitalityText);
405+ monster_definitions[type]._class = wxGetApp().monsterClassBind[
406+ classChoice->GetSelection()].bind;
407+ monster_definitions[type].radius = getNumberFromTextCtrl(radiusText);
408+ monster_definitions[type].height = getNumberFromTextCtrl(heightText);
409+ monster_definitions[type].preferred_hover_height = getNumberFromTextCtrl(hoverText);
410+ monster_definitions[type].minimum_ledge_delta = getNumberFromTextCtrl(minLedgeText);
411+ monster_definitions[type].maximum_ledge_delta = getNumberFromTextCtrl(maxLedgeText);
412+ monster_definitions[type].external_velocity_scale = getNumberFromTextCtrl(extVelScaleText);
413+ monster_definitions[type].carrying_item_type =
414+ getChoice(carryItemChoice, NUMBER_OF_DEFINED_ITEMS);
415+ monster_definitions[type].half_visual_arc = getNumberFromTextCtrl(halfVisualArcText);
416+ monster_definitions[type].half_vertical_visual_arc = getNumberFromTextCtrl(vertVisualArcText);
417+ monster_definitions[type].intelligence =
418+ wxGetApp().monsterIntelligenceBind[intelligenceChoice->GetSelection()].bind;
419+ monster_definitions[type].speed = getNumberFromTextCtrl(speedText);
420+ monster_definitions[type].gravity = getNumberFromTextCtrl(gravityText);
405421
422+ //sequences
423+ monster_definitions[type].stationary_shape = getNumberFromTextCtrl(stationalyText);
424+ monster_definitions[type].moving_shape = getNumberFromTextCtrl(movingText);
425+ monster_definitions[type].hit_shapes = getNumberFromTextCtrl(hittingText);
426+ monster_definitions[type].soft_dying_shape = getNumberFromTextCtrl(softDyingText);
427+ monster_definitions[type].soft_dead_shapes = getNumberFromTextCtrl(softDeadText);
428+ monster_definitions[type].hard_dying_shape = getNumberFromTextCtrl(hardDyingText);
429+ monster_definitions[type].hard_dead_shapes = getNumberFromTextCtrl(hardDeadText);
430+ monster_definitions[type].teleport_in_shape = getNumberFromTextCtrl(teleportInText);
431+ monster_definitions[type].teleport_out_shape = getNumberFromTextCtrl(teleportOutText);
432+
433+ //shrapnel
434+ monster_definitions[type].shrapnel_damage.base = getNumberFromTextCtrl(shrapnelBaseText);
435+ monster_definitions[type].shrapnel_damage.random = getNumberFromTextCtrl(shrapnelRndText);
436+ monster_definitions[type].shrapnel_damage.scale = getNumberFromTextCtrl(shrapnelScaleText);
437+ monster_definitions[type].shrapnel_radius = getNumberFromTextCtrl(shrapnelRadiusText);
438+ monster_definitions[type].shrapnel_damage.flags =
439+ shrapnelIsAlienCheckbox->GetValue() ? 1 : 0;
440+ monster_definitions[type].shrapnel_damage.type =
441+ getChoice(shrapnelTypeChoice, NUMBER_OF_DAMAGE_TYPES);
442+
443+ //sound
444+ monster_definitions[type].sound_pitch = getNumberFromTextCtrl(soundPitchText);
445+ monster_definitions[type].activation_sound = getChoice(soundActivationChoice, NUMBER_OF_SOUND_DEFINITIONS);
446+ monster_definitions[type].friendly_activation_sound = getChoice(soundFriendActChoice, NUMBER_OF_SOUND_DEFINITIONS);
447+ monster_definitions[type].clear_sound = getChoice(soundClearChoice, NUMBER_OF_SOUND_DEFINITIONS);
448+ monster_definitions[type].kill_sound = getChoice(soundKillChoice, NUMBER_OF_SOUND_DEFINITIONS);
449+ monster_definitions[type].apology_sound = getChoice(soundApologyChoice, NUMBER_OF_SOUND_DEFINITIONS);
450+ monster_definitions[type].friendly_fire_sound= getChoice(soundFriendFireChoice, NUMBER_OF_SOUND_DEFINITIONS);
451+ monster_definitions[type].flaming_sound = getChoice(soundFlamingChoice, NUMBER_OF_SOUND_DEFINITIONS);
452+ monster_definitions[type].random_sound = getChoice(soundRandomChoice, NUMBER_OF_SOUND_DEFINITIONS);
453+ monster_definitions[type].random_sound_mask = getNumberFromTextCtrl(soundRandomMask);
454+
455+ //effect
456+ monster_definitions[type].impact_effect = getChoice(effectChoice, NUMBER_OF_EFFECT_TYPES);
457+ monster_definitions[type].melee_impact_effect = getChoice(effectMeleeChoice, NUMBER_OF_EFFECT_TYPES);
458+ monster_definitions[type].contrail_effect = getChoice(effectContrailChoice, NUMBER_OF_EFFECT_TYPES);
459+}
460+
461+
462+/*
406463 void MonsterAppearancePanel::OnCollection(wxCommandEvent& ev)
407464 {
408465 }
@@ -445,12 +502,16 @@
445502 void MonsterAppearancePanel::OnIntelligence(wxCommandEvent& ev)
446503 {
447504 }
505+
448506 void MonsterAppearancePanel::OnSpeedText(wxCommandEvent& ev)
449507 {
508+ OnItem(ev);
450509 }
451510 void MonsterAppearancePanel::OnSpeedChoice(wxCommandEvent& ev)
452511 {
512+ OnItem(ev);
453513 }
514+
454515 void MonsterAppearancePanel::OnGravity(wxCommandEvent& ev)
455516 {
456517 }
@@ -501,10 +562,12 @@
501562 void MonsterAppearancePanel::OnShrapnelIsAlien(wxCommandEvent& ev)
502563 {
503564 }
565+*/
504566 void MonsterAppearancePanel::OnCopyFrom(wxCommandEvent& ev)
505567 {
506568 }
507569
570+/*
508571 void MonsterAppearancePanel::OnSoundPitch(wxCommandEvent& ev)
509572 {
510573 }
@@ -546,14 +609,22 @@
546609 {
547610 }
548611
549-void MonsterAppearancePanel::OnResetButton(wxCommandEvent& ev)
612+void MonsterAppearancePanel::OnDoorRetryMask(wxCommandEvent& ev)
550613 {
551614 }
552-void MonsterAppearancePanel::OnDoorRetryMask(wxCommandEvent& ev)
615+*/
616+void MonsterAppearancePanel::OnResetButton(wxCommandEvent& ev)
553617 {
618+ int reply = wxMessageBox(_T("Are you sure to reset this monster?"),
619+ _T(""), wxCENTRE|wxOK|wxCANCEL);
620+ if(reply == wxOK){
621+ int type = wxGetApp().getEditingMonsterIndex();
622+ memcpy(&monster_definitions[type],
623+ wxGetApp().getDefaultValues()->getMonsterDefinition(type),
624+ sizeof(monster_definition));
625+ }
554626 }
555627
556-
557628 void MonsterAppearancePanel::setup()
558629 {
559630 int type = wxGetApp().getEditingMonsterIndex();
@@ -564,7 +635,9 @@
564635 collectionChoice->SetSelection(collection);
565636 paletteText->SetValue(wx::string::getString("%d", clut));
566637 vitalityText->SetValue(wx::string::getString("%d", monster_definitions[type].vitality));
567- classChoice->SetSelection(monster_definitions[type]._class);
638+ int cls = hpl::aleph::getIndexFromInformationBinded(monster_definitions[type]._class,
639+ wxGetApp().monsterClassBind, NUMBER_OF_CLASS_INFORMATIONS);
640+ classChoice->SetSelection(cls);
568641 radiusText->SetValue(wx::string::getString("%d", monster_definitions[type].radius));
569642 heightText->SetValue(wx::string::getString("%d", monster_definitions[type].height));
570643 hoverText->SetValue(wx::string::getString("%d", monster_definitions[type].preferred_hover_height));
@@ -598,6 +671,15 @@
598671 teleportInText->SetValue(wx::string::getString("%d", monster_definitions[type].teleport_in_shape));
599672 teleportOutText->SetValue(wx::string::getString("%d", monster_definitions[type].teleport_out_shape));
600673
674+ //shrapnel
675+ setChoice(shrapnelTypeChoice, monster_definitions[type].shrapnel_damage.type,
676+ NUMBER_OF_DAMAGE_TYPES);
677+ shrapnelBaseText->SetValue(wx::string::getString("%d", monster_definitions[type].shrapnel_damage.base));
678+ shrapnelRadiusText->SetValue(wx::string::getString("%d", monster_definitions[type].shrapnel_radius));
679+ shrapnelRndText->SetValue(wx::string::getString("%d", monster_definitions[type].shrapnel_damage.random));
680+ shrapnelScaleText->SetValue(wx::string::getString("%d", monster_definitions[type].shrapnel_damage.scale));
681+ shrapnelIsAlienCheckbox->SetValue(monster_definitions[type].shrapnel_damage.flags != 0);
682+
601683 //sound
602684 soundPitchText->SetValue(wx::string::getString("%d", monster_definitions[type].teleport_out_shape));
603685 setChoice(soundActivationChoice, monster_definitions[type].activation_sound, NUMBER_OF_SOUND_DEFINITIONS);
@@ -614,4 +696,6 @@
614696 setChoice(effectChoice, monster_definitions[type].impact_effect, NUMBER_OF_EFFECT_TYPES);
615697 setChoice(effectMeleeChoice, monster_definitions[type].melee_impact_effect, NUMBER_OF_EFFECT_TYPES);
616698 setChoice(effectContrailChoice, monster_definitions[type].contrail_effect, NUMBER_OF_EFFECT_TYPES);
699+
700+ doorRetryMaskText->SetValue(wx::string::getString("%d", monster_definitions[type].door_retry_mask));
617701 }
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/MonsterAppearancePanel.h (revision 463)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/MonsterAppearancePanel.h (revision 464)
@@ -67,7 +67,7 @@
6767 wxChoice* effectContrailChoice;
6868
6969 //TODO door retry mask
70- wxTextCtrl* doorRetryMask;
70+ wxTextCtrl* doorRetryMaskText;
7171
7272 //button
7373 wxButton* resetButton;
@@ -78,6 +78,7 @@
7878 virtual ~MonsterAppearancePanel();
7979 protected:
8080 DECLARE_EVENT_TABLE()
81+
8182 void OnCollection(wxCommandEvent& ev);
8283 void OnPalette(wxCommandEvent& ev);
8384 void OnVitality(wxCommandEvent& ev);
@@ -92,8 +93,10 @@
9293 void OnHalfVisualArc(wxCommandEvent& ev);
9394 void OnVertVisualArc(wxCommandEvent& ev);
9495 void OnIntelligence(wxCommandEvent& ev);
96+
9597 void OnSpeedText(wxCommandEvent& ev);
9698 void OnSpeedChoice(wxCommandEvent& ev);
99+
97100 void OnGravity(wxCommandEvent& ev);
98101
99102 void OnStationaly(wxCommandEvent& ev);
@@ -112,6 +115,7 @@
112115 void OnShrapnelScale(wxCommandEvent& ev);
113116 void OnShrapnelType(wxCommandEvent& ev);
114117 void OnShrapnelIsAlien(wxCommandEvent& ev);
118+
115119 void OnCopyFrom(wxCommandEvent& ev);
116120
117121 void OnSoundPitch(wxCommandEvent& ev);
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/PhysicsEditorOneWX.cpp (revision 463)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/PhysicsEditorOneWX.cpp (revision 464)
@@ -388,3 +388,28 @@
388388 {
389389 editingWeaponIndex = index;
390390 }
391+
392+void setChoice(wxChoice* choice, int index, int max)
393+{
394+ index = index == NONE ? max : index;
395+ choice->SetSelection(index);
396+}
397+int getChoice(wxChoice* choice, int max)
398+{
399+ int index = choice->GetSelection();
400+ index = index == max ? NONE : index;
401+ return index;
402+}
403+int getChoice(wxCommandEvent* choice, int max)
404+{
405+ int index = choice->GetSelection();
406+ index = index == max ? NONE : index;
407+ return index;
408+}
409+
410+int getNumberFromTextCtrl(wxTextCtrl* textCtrl)
411+{
412+ //TODO 正規表現でチェック
413+ int num = atoi(wxConvertWX2MB(textCtrl->GetValue()));
414+ return num;
415+}
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/Common.h (revision 463)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/Common.h (revision 464)
@@ -41,4 +41,9 @@
4141
4242 #include "PhysicsEditorCommonSrc/PhysicsEditorCommon.h"
4343
44+void setChoice(wxChoice* choice, int index, int max);
45+int getChoice(wxChoice* choice, int max);
46+int getChoice(wxCommandEvent* choice, int max);
47+int getNumberFromTextCtrl(wxTextCtrl* textCtrl);
48+
4449 #endif
旧リポジトリブラウザで表示