• R/O
  • SSH
  • HTTPS

marathon: コミット


コミットメタ情報

リビジョン466 (tree)
日時2007-09-03 21:14:36
作者hogepiyo

ログメッセージ

*** empty log message ***

変更サマリ

差分

--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/MonsterAppearancePanel.cpp (revision 465)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/MonsterAppearancePanel.cpp (revision 466)
@@ -98,22 +98,22 @@
9898
9999 EVT_BUTTON(ID_COPY_FROM, MonsterAppearancePanel::OnCopyFrom)
100100
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)
101+ EVT_TEXT(ID_PITCH, MonsterAppearancePanel::OnSoundPitch)
102+ EVT_CHOICE(ID_ACTIVATION, MonsterAppearancePanel::OnSoundActivation)
103+ EVT_CHOICE(ID_FRIEND_ACT, MonsterAppearancePanel::OnSoundFriendAct)
104+ EVT_CHOICE(ID_CLEAR, MonsterAppearancePanel::OnSoundClear)
105+ EVT_CHOICE(ID_KILL, MonsterAppearancePanel::OnSoundKill)
106+ EVT_CHOICE(ID_APOLYGY, MonsterAppearancePanel::OnSoundApology)
107+ EVT_CHOICE(ID_FRIEND_FIRE, MonsterAppearancePanel::OnSoundFriendFire)
108+ EVT_CHOICE(ID_FLAMING, MonsterAppearancePanel::OnSoundFlaming)
109+ EVT_CHOICE(ID_RANDOM, MonsterAppearancePanel::OnSoundRandom)
110+ EVT_TEXT(ID_RANDOM_MASK, MonsterAppearancePanel::OnSoundRandomMask)
111111
112- EVT_CHOICE(ID_EFFECT, MonsterAppearancePanel::OnItem)
113- EVT_CHOICE(ID_EFFECT_MELEE, MonsterAppearancePanel::OnItem)
114- EVT_CHOICE(ID_EFFECT_CONTRAIL, MonsterAppearancePanel::OnItem)
112+ EVT_CHOICE(ID_EFFECT, MonsterAppearancePanel::OnEffect)
113+ EVT_CHOICE(ID_EFFECT_MELEE, MonsterAppearancePanel::OnEffectMelee)
114+ EVT_CHOICE(ID_EFFECT_CONTRAIL, MonsterAppearancePanel::OnEffectContrail)
115115
116- EVT_TEXT(ID_DOOR_RETRY_MASK, MonsterAppearancePanel::OnItem)
116+ EVT_TEXT(ID_DOOR_RETRY_MASK, MonsterAppearancePanel::OnDoorRetryMask)
117117
118118 EVT_BUTTON(ID_RESET, MonsterAppearancePanel::OnResetButton)
119119 END_EVENT_TABLE()
@@ -394,225 +394,290 @@
394394 MonsterAppearancePanel::~MonsterAppearancePanel()
395395 {
396396 }
397-void MonsterAppearancePanel::OnItem(wxCommandEvent& ev)
397+
398+void MonsterAppearancePanel::OnCollection(wxCommandEvent& ev)
398399 {
399400 int type = wxGetApp().getEditingMonsterIndex();
400401 //
401- int col = collectionChoice->GetSelection();
402+ int col = ev.GetSelection();
402403 int clut = getNumberFromTextCtrl(paletteText);
403404 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);
421-
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);
459405 }
460-
461-
462-/*
463-void MonsterAppearancePanel::OnCollection(wxCommandEvent& ev)
464-{
465-}
466406 void MonsterAppearancePanel::OnPalette(wxCommandEvent& ev)
467407 {
408+ int type = wxGetApp().getEditingMonsterIndex();
409+ //
410+ int col = collectionChoice->GetSelection();
411+ int clut = getNumberFromTextCtrl(&ev);
412+ monster_definitions[type].collection = BUILD_COLLECTION(col, clut);
468413 }
469414 void MonsterAppearancePanel::OnVitality(wxCommandEvent& ev)
470415 {
416+ int type = wxGetApp().getEditingMonsterIndex();
417+ monster_definitions[type].vitality = getNumberFromText(&ev);
471418 }
472419 void MonsterAppearancePanel::OnClass(wxCommandEvent& ev)
473420 {
421+ int type = wxGetApp().getEditingMonsterIndex();
422+ monster_definitions[type]._class =
423+ wxGetApp().monsterClassBind[ev.GetSelection()].bind;
474424 }
475425 void MonsterAppearancePanel::OnRadius(wxCommandEvent& ev)
476426 {
427+ int type = wxGetApp().getEditingMonsterIndex();
428+ monster_definitions[type].radius = getNumberFromText(&ev);
477429 }
478430 void MonsterAppearancePanel::OnHeight(wxCommandEvent& ev)
479431 {
432+ int type = wxGetApp().getEditingMonsterIndex();
433+ monster_definitions[type].height= getNumberFromText(&ev);
480434 }
481435 void MonsterAppearancePanel::OnHover(wxCommandEvent& ev)
482436 {
437+ int type = wxGetApp().getEditingMonsterIndex();
438+ monster_definitions[type].preferred_hover_height = getNumberFromText(&ev);
483439 }
484440 void MonsterAppearancePanel::OnMinLedge(wxCommandEvent& ev)
485441 {
442+ int type = wxGetApp().getEditingMonsterIndex();
443+ monster_definitions[type].minimum_ledge_delta = getNumberFromText(&ev);
486444 }
487445 void MonsterAppearancePanel::OnMaxLedge(wxCommandEvent& ev)
488446 {
447+ int type = wxGetApp().getEditingMonsterIndex();
448+ monster_definitions[type].maximum_ledge_delta = getNumberFromText(&ev);
489449 }
490450 void MonsterAppearancePanel::OnExtVelScale(wxCommandEvent& ev)
491451 {
452+ int type = wxGetApp().getEditingMonsterIndex();
453+ monster_definitions[type].external_velocity_scale = getNumberFromText(&ev);
492454 }
493455 void MonsterAppearancePanel::OnCarryItem(wxCommandEvent& ev)
494456 {
457+ int type = wxGetApp().getEditingMonsterIndex();
458+ monster_definitions[type].carry_item =
459+ getChoice(carryItemChoice, NUMBER_OF_DEFINED_ITEMS);
495460 }
496461 void MonsterAppearancePanel::OnHalfVisualArc(wxCommandEvent& ev)
497462 {
463+ int type = wxGetApp().getEditingMonsterIndex();
464+ monster_definitions[type].half_visual_arc = getNumberFromText(&ev);
498465 }
499466 void MonsterAppearancePanel::OnVertVisualArc(wxCommandEvent& ev)
500467 {
468+ int type = wxGetApp().getEditingMonsterIndex();
469+ monster_definitions[type].half_vertical_visual_arc = getNumberFromText(&ev);
501470 }
502471 void MonsterAppearancePanel::OnIntelligence(wxCommandEvent& ev)
503472 {
473+ int type = wxGetApp().getEditingMonsterIndex();
474+ monster_definitions[type].intelligence = wxGetApp().monsterIntelligenceBind[getChoice(&ev)].bind;
504475 }
505476
506477 void MonsterAppearancePanel::OnSpeedText(wxCommandEvent& ev)
507478 {
508- OnItem(ev);
479+ int type = wxGetApp().getEditingMonsterIndex();
480+ monster_definitions[type].speed = getNumberFromText(&ev);
481+
482+ int oldIndex = this->speedChoice->GetSelection();
483+ int index = hpl::aleph::getIndexFromInformationBinded(
484+ value, wxGetApp().monsterIntelligenceBind, NUMBER_OF_MONSTER_INTELLIGENCE_INFORMATIONS);
485+ if(index < 0){
486+ index = NUMBER_OF_MONSTER_INTELLIGENCE_INFORMATIONS;
487+ }else{
488+ }
489+ if(index != oldIndex){
490+ this->speedChoice->SetSelection(index);
491+ }
492+
509493 }
510494 void MonsterAppearancePanel::OnSpeedChoice(wxCommandEvent& ev)
511495 {
512- OnItem(ev);
496+ int type = wxGetApp().getEditingMonsterIndex();
497+ int sel = ev.GetSelection();
498+ if(sel >= NUMBER_OF_SPEED_INFORMATIONS){
499+ }else{
500+ //monster_definitions[type].speed = getNumberFromText(&ev);
501+ int prefferedNum = wxGetApp().speedBind[sel].bind;
502+ if(getNumberFromTextCtrl(this->speedText) != prefferedNum){
503+ this->speedText->SetValue(wx::string::getString("%d", prefferedNum));
504+ }
505+ }
513506 }
514507
515508 void MonsterAppearancePanel::OnGravity(wxCommandEvent& ev)
516509 {
510+ int type = wxGetApp().getEditingMonsterIndex();
511+ monster_definitions[type]. = getNumberFromText(&ev);
517512 }
518513
519514 void MonsterAppearancePanel::OnStationaly(wxCommandEvent& ev)
520515 {
516+ int type = wxGetApp().getEditingMonsterIndex();
517+ monster_definitions[type].stationary_shape = getNumberFromText(&ev);
521518 }
522519 void MonsterAppearancePanel::OnMoving(wxCommandEvent& ev)
523520 {
521+ int type = wxGetApp().getEditingMonsterIndex();
522+ monster_definitions[type].moving_shape = getNumberFromText(&ev);
524523 }
525524 void MonsterAppearancePanel::OnHitting(wxCommandEvent& ev)
526525 {
526+ int type = wxGetApp().getEditingMonsterIndex();
527+ monster_definitions[type].hit_shapes = getNumberFromText(&ev);
527528 }
528529 void MonsterAppearancePanel::OnSoftDying(wxCommandEvent& ev)
529530 {
531+ int type = wxGetApp().getEditingMonsterIndex();
532+ monster_definitions[type].soft_dying_shape = getNumberFromText(&ev);
530533 }
531534 void MonsterAppearancePanel::OnSoftDead(wxCommandEvent& ev)
532535 {
536+ int type = wxGetApp().getEditingMonsterIndex();
537+ monster_definitions[type].soft_dead_shapes = getNumberFromText(&ev);
533538 }
534539 void MonsterAppearancePanel::OnHardDying(wxCommandEvent& ev)
535540 {
541+ int type = wxGetApp().getEditingMonsterIndex();
542+ monster_definitions[type].hard_dying_shape = getNumberFromText(&ev);
536543 }
537544 void MonsterAppearancePanel::OnHardDead(wxCommandEvent& ev)
538545 {
546+ int type = wxGetApp().getEditingMonsterIndex();
547+ monster_definitions[type].hard_dead_shapes = getNumberFromText(&ev);
539548 }
540549 void MonsterAppearancePanel::OnTeleportIn(wxCommandEvent& ev)
541550 {
551+ int type = wxGetApp().getEditingMonsterIndex();
552+ monster_definitions[type].teleport_in_shape = getNumberFromText(&ev);
542553 }
543554 void MonsterAppearancePanel::OnTeleportOut(wxCommandEvent& ev)
544555 {
556+ int type = wxGetApp().getEditingMonsterIndex();
557+ monster_definitions[type].teleport_out_shape = getNumberFromText(&ev);
545558 }
546559
547560 void MonsterAppearancePanel::OnShrapnelRadius(wxCommandEvent& ev)
548561 {
562+ int type = wxGetApp().getEditingMonsterIndex();
563+ monster_definitions[type]. = getNumberFromText(&ev);
549564 }
550565 void MonsterAppearancePanel::OnShrapnelBase(wxCommandEvent& ev)
551566 {
567+ int type = wxGetApp().getEditingMonsterIndex();
568+ monster_definitions[type]. = getNumberFromText(&ev);
552569 }
553570 void MonsterAppearancePanel::OnShrapnelRnd(wxCommandEvent& ev)
554571 {
572+ int type = wxGetApp().getEditingMonsterIndex();
573+ monster_definitions[type]. = getNumberFromText(&ev);
555574 }
556575 void MonsterAppearancePanel::OnShrapnelScale(wxCommandEvent& ev)
557576 {
577+ int type = wxGetApp().getEditingMonsterIndex();
578+ monster_definitions[type]. = getNumberFromText(&ev);
558579 }
559580 void MonsterAppearancePanel::OnShrapnelType(wxCommandEvent& ev)
560581 {
582+ int type = wxGetApp().getEditingMonsterIndex();
583+ monster_definitions[type]. = getChoice(&ev, NUMBER_OF_DAMAGE_TYPES);
561584 }
562585 void MonsterAppearancePanel::OnShrapnelIsAlien(wxCommandEvent& ev)
563586 {
587+ int type = wxGetApp().getEditingMonsterIndex();
588+ monster_definitions[type]. = ev.IsChecked() ? 1: 0;
564589 }
565-*/
590+
566591 void MonsterAppearancePanel::OnCopyFrom(wxCommandEvent& ev)
567592 {
593+ //TODO
568594 }
569595
570-/*
596+
571597 void MonsterAppearancePanel::OnSoundPitch(wxCommandEvent& ev)
572598 {
599+ int type = wxGetApp().getEditingMonsterIndex();
600+ monster_definitions[type].sound_pitch = getNumberFromText(&ev);
573601 }
574602 void MonsterAppearancePanel::OnSoundActivation(wxCommandEvent& ev)
575603 {
604+ int type = wxGetApp().getEditingMonsterIndex();
605+ monster_definitions[type].activation_sound = getChoice(&ev,
606+ NUMBER_OF_SOUND_DEFINITIONS);
576607 }
577608 void MonsterAppearancePanel::OnSoundFriendAct(wxCommandEvent& ev)
578609 {
610+ int type = wxGetApp().getEditingMonsterIndex();
611+ monster_definitions[type]. = getChoice(&ev,
612+ NUMBER_OF_SOUND_DEFINITIONS);
579613 }
580614 void MonsterAppearancePanel::OnSoundClear(wxCommandEvent& ev)
581615 {
616+ int type = wxGetApp().getEditingMonsterIndex();
617+ monster_definitions[type]. = getChoice(&ev,
618+ NUMBER_OF_SOUND_DEFINITIONS);
582619 }
583620 void MonsterAppearancePanel::OnSoundKill(wxCommandEvent& ev)
584621 {
622+ int type = wxGetApp().getEditingMonsterIndex();
623+ monster_definitions[type]. = getChoice(&ev,
624+ NUMBER_OF_SOUND_DEFINITIONS);
585625 }
586626 void MonsterAppearancePanel::OnSoundApology(wxCommandEvent& ev)
587627 {
628+ int type = wxGetApp().getEditingMonsterIndex();
629+ monster_definitions[type]. = getChoice(&ev,
630+ NUMBER_OF_SOUND_DEFINITIONS);
588631 }
589632 void MonsterAppearancePanel::OnSoundFriendFire(wxCommandEvent& ev)
590633 {
634+ int type = wxGetApp().getEditingMonsterIndex();
635+ monster_definitions[type]. = getChoice(&ev,
636+ NUMBER_OF_SOUND_DEFINITIONS);
591637 }
592638 void MonsterAppearancePanel::OnSoundFlaming(wxCommandEvent& ev)
593639 {
640+ int type = wxGetApp().getEditingMonsterIndex();
641+ monster_definitions[type]. = getChoice(&ev,
642+ NUMBER_OF_SOUND_DEFINITIONS);
594643 }
595644 void MonsterAppearancePanel::OnSoundRandom(wxCommandEvent& ev)
596645 {
646+ int type = wxGetApp().getEditingMonsterIndex();
647+ monster_definitions[type]. = getChoice(&ev,
648+ NUMBER_OF_SOUND_DEFINITIONS);
597649 }
598650 void MonsterAppearancePanel::OnSoundRandomMask(wxCommandEvent& ev)
599651 {
652+ int type = wxGetApp().getEditingMonsterIndex();
653+ monster_definitions[type]. = getNumberFromText(&ev);
600654 }
601655
602656 void MonsterAppearancePanel::OnEffect(wxCommandEvent& ev)
603657 {
658+ int type = wxGetApp().getEditingMonsterIndex();
659+ monster_definitions[type]. = getChoice(&ev,
660+ NUMBER_OF_EFFECT_TYPES);
604661 }
605662 void MonsterAppearancePanel::OnEffectMelee(wxCommandEvent& ev)
606663 {
664+ int type = wxGetApp().getEditingMonsterIndex();
665+ monster_definitions[type]. = getChoice(&ev,
666+ NUMBER_OF_EFFECT_TYPES);
607667 }
608668 void MonsterAppearancePanel::OnEffectContrail(wxCommandEvent& ev)
609669 {
670+ int type = wxGetApp().getEditingMonsterIndex();
671+ monster_definitions[type]. = getChoice(&ev,
672+ NUMBER_OF_EFFECT_TYPES);
610673 }
611674
612675 void MonsterAppearancePanel::OnDoorRetryMask(wxCommandEvent& ev)
613676 {
677+ int type = wxGetApp().getEditingMonsterIndex();
678+ monster_definitions[type]. = getNumberFromText(&ev);
614679 }
615-*/
680+
616681 void MonsterAppearancePanel::OnResetButton(wxCommandEvent& ev)
617682 {
618683 int reply = wxMessageBox(_T("Are you sure to reset this monster?"),
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/PhysicsEditorOneWX.cpp (revision 465)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/PhysicsEditorOneWX.cpp (revision 466)
@@ -413,3 +413,9 @@
413413 int num = atoi(wxConvertWX2MB(textCtrl->GetValue()));
414414 return num;
415415 }
416+
417+int getNumberFromTextCtrl(wxCommandEvent* ev)
418+{
419+ int num = atoi(wxConvertWX2MB(ev->GetString()));
420+ return num;
421+}
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/Common.h (revision 465)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/Common.h (revision 466)
@@ -45,5 +45,6 @@
4545 int getChoice(wxChoice* choice, int max);
4646 int getChoice(wxCommandEvent* choice, int max);
4747 int getNumberFromTextCtrl(wxTextCtrl* textCtrl);
48+int getNumberFromTextCtrl(wxCommandEvent* ev);
4849
4950 #endif
旧リポジトリブラウザで表示