Ejemplo n.º 1
0
        public PeventEditor(Pevent pevent, SpriteBundle bundle, PeventClassBundle bundlec)
        {
            InitializeComponent();

            using (XNAUtils utils = new XNAUtils())
            {
                sBundle = bundle;
                pEvent = pevent;
                pSprite = pevent.pSprite;
                cBundle = bundlec;

                foreach (PeventClass pClass in cBundle.ListpEventClass)
                    CB_Class.Items.Add(pClass);
                CB_Class.Text = pevent.Class.ToString();
                CB_Direction.SelectedItem = pevent.Direction.ToString();
                CHK_Flying.Checked = pevent.Flying;

                if (pSprite != null)
                    PN_Graphics.BackgroundImage = utils.ConvertToImage(pevent.pSprite.SpriteImage);

                CB_MoveType.SelectedItem = pevent.MoveType.ToString();
                TB_Name.Text = pevent.Name;
                TB_Script.Text = pevent.Script;
                LB_Position.Text = pevent.Position.X + " x " + pevent.Position.Y;
                NUM_Sight.Value = new Decimal(pEvent.Sight);
                CHK_Through.Checked = pevent.Through;
                CB_TriggerType.SelectedItem = pevent.TriggerType.ToString();
                NUM_Speed.Value = new Decimal(pevent.Velocity);
                CHK_Disposable.Checked = pevent.Disposable;

                HasAccepted = false;
                this.CB_MoveType.SelectedIndexChanged += new System.EventHandler(this.CB_MoveType_SelectedIndexChanged);
            }
        }
Ejemplo n.º 2
0
 public ClassManager(PeventClassBundle bundle)
 {
     InitializeComponent();
     pBundle = bundle;
     foreach(PeventClass pClass in pBundle.ListpEventClass)
         LB_Classes.Items.Add(pClass.Name);
     CB_Type.DataSource = System.Enum.GetValues(typeof(PeventType));
     CB_TriggerType.DataSource = System.Enum.GetValues(typeof(PeventTriggerType));
     CB_Mouvement.DataSource = System.Enum.GetValues(typeof(PeventMoveType));
     CB_Direction.DataSource = System.Enum.GetValues(typeof(PeventDirection));
 }
Ejemplo n.º 3
0
 public ProjectRessources(SerializationInfo info, StreamingContext context)
 {
     Maps = (List<Map>)info.GetValue("Maps", typeof(List<Map>));
     Sprites = (SpriteBundle)info.GetValue("Sprites", typeof(SpriteBundle));
     CommunPevents = (List<Pevent>)info.GetValue("CommunPevents", typeof(List<Pevent>));
     Songs = (SongBundle)info.GetValue("Songs", typeof(SongBundle));
     Classes = (PeventClassBundle)info.GetValue("PeventClassBundle", typeof(PeventClassBundle));
     Icons = (List<pIcon>)info.GetValue("Icons", typeof(List<pIcon>));
     Sounds = (SoundBundle)info.GetValue("Sounds", typeof(SoundBundle));
     Animations = (List<Animation>)info.GetValue("Animations", typeof(List<Animation>));
     Elements = (List<Elemental>)info.GetValue("Elements", typeof(List<Elemental>));
     Battlers = (List<Battler>)info.GetValue("Battlers", typeof(List<Battler>));
 }
Ejemplo n.º 4
0
 public ProjectRessources()
 {
     Maps = new List<Map>();
     Sprites = new SpriteBundle();
     CommunPevents = new List<Pevent>();
     Songs = new SongBundle();
     Classes = new PeventClassBundle();
     Icons = new List<pIcon>();
     Sounds = new SoundBundle();
     Animations = new List<Animation>();
     Elements = new List<Elemental>();
     Battlers = new List<Battler>();
 }
Ejemplo n.º 5
0
        public PeventListEditor(List<Pevent> EventsToEdit, SpriteBundle bundle, PeventClassBundle bundlec, Map map)
        {
            InitializeComponent();

            SaveCalled = false;
            sbundle = bundle;

            for (int i = 0; i < EventsToEdit.Count; i++)
                PeventListPanel.Controls.Add(new PeventListItem(EventsToEdit[i], bundle, bundlec, map));

            if (PeventListPanel.Controls.Count <= (PeventListPanel.Height / PeventListPanel.Controls[0].Height))
                PeventListPanel.Width -= SystemInformation.VerticalScrollBarWidth;

            InitiateGeneralModifier(bundlec);

            this.Controls.Add(GeneralModifier);
        }
Ejemplo n.º 6
0
        public PeventEditor(Point position, SpriteBundle bundle, PeventClassBundle bundlec, Size map)
        {
            InitializeComponent();
            HasAccepted = false;

            LB_Position.Text = position.X + " x " + position.Y;

            pEvent = new Pevent();
            pEvent.Position = position;
            pEvent.ArretMouvement = new List<Point>();
            sBundle = bundle;
            cBundle = bundlec;
            Map = map;

            foreach (PeventClass pClass in cBundle.ListpEventClass)
                CB_Class.Items.Add(pClass);

            this.CB_MoveType.SelectedIndexChanged += new System.EventHandler(this.CB_MoveType_SelectedIndexChanged);
        }
Ejemplo n.º 7
0
        public PeventLister(List<Pevent> pListePevent, SpriteBundle pbundle, PeventClassBundle pbundlec, Map pmap)
        {
            map = pmap;
            bundle = pbundle;
            bundlec = pbundlec;

            InitializeComponent();

            EventsToEdit = new List<Pevent>();

            int i = 0;
            ListePevent = pListePevent;
            foreach (Pevent item in ListePevent)
            {
                CheckBox c = new CheckBox();
                c.Width = Panel_pEvents.Width - SystemInformation.VerticalScrollBarWidth - 8;
                c.Name = i.ToString();
                c.Text = item.Name;
                c.CheckedChanged += new System.EventHandler(CB_CheckChanged);

                Panel_pEvents.Controls.Add(c);
                i++;
            }
        }
Ejemplo n.º 8
0
        private void InitiateGeneralModifier(PeventClassBundle bundlec)
        {
            foreach (PeventClass pClass in bundlec.ListpEventClass)
                CB_Class.Items.Add(pClass);

            #region Handlers

            BTN_PositionXAdd.Click += new EventHandler(GeneralModifier_NUM_PosX_Add_Click);
            BTN_PositionYAdd.Click += new EventHandler(GeneralModifier_NUM_PosY_Add_Click);
            BTN_SightAdd.Click += new EventHandler(GeneralModifier_NUM_Sight_Add_Click);
            BTN_SpeedAdd.Click += new EventHandler(GeneralModifier_NUM_Speed_Add_Click);

            BTN_PositionXLower.Click += new EventHandler(GeneralModifier_NUM_PosX_Lower_Click);
            BTN_PositionYLower.Click += new EventHandler(GeneralModifier_NUM_PosY_Lower_Click);
            BTN_SightLower.Click += new EventHandler(GeneralModifier_NUM_Sight_Lower_Click);
            BTN_SpeedLower.Click += new EventHandler(GeneralModifier_NUM_Speed_Lower_Click);

            CB_Class.SelectedIndexChanged += new System.EventHandler(GeneralModifier_CB_Class_SelectedIndexChanged);
            CB_Direction.SelectedIndexChanged += new System.EventHandler(GeneralModifier_CB_Direction_SelectedIndexChanged);
            CB_MoveType.SelectedIndexChanged += new System.EventHandler(GeneralModifier_CB_MoveType_SelectedIndexChanged);
            CB_TriggerType.SelectedIndexChanged += new System.EventHandler(GeneralModifier_CB_TriggerType_SelectedIndexChanged);

            CHK_Flying.CheckedChanged += new System.EventHandler(GeneralModifier_CHK_Flying_CheckedChanged);
            CHK_Through.CheckedChanged += new System.EventHandler(GeneralModifier_CHK_Through_CheckedChanged);
            CHK_Disposable.CheckedChanged += new System.EventHandler(GeneralModifier_CHK_Disposable_CheckedChanged);

            BTN_Graphics.Click += new EventHandler(GeneralModifier_BTN_Graphics_Click);
            BTN_Script.Click += new EventHandler(GeneralModifier_BTN_Script_Click);

            #endregion

            #region Tooltips

            System.Windows.Forms.ToolTip THEtooltip = new System.Windows.Forms.ToolTip();

            THEtooltip.SetToolTip(TB_Name, "Name");

            THEtooltip.SetToolTip(CB_Class, "Class");
            THEtooltip.SetToolTip(CB_Direction, "Direction");
            THEtooltip.SetToolTip(CB_MoveType, "Movement type");
            THEtooltip.SetToolTip(CB_TriggerType, "Trigger type");

            THEtooltip.SetToolTip(PN_PositionX, "Position X");
            THEtooltip.SetToolTip(PN_PositionY, "Position Y");
            THEtooltip.SetToolTip(PN_Sight, "Sight");
            THEtooltip.SetToolTip(PN_Speed, "Speed");

            THEtooltip.SetToolTip(CHK_Flying, "Flying");
            THEtooltip.SetToolTip(CHK_Through, "Trough");
            THEtooltip.SetToolTip(CHK_Disposable, "Disposable");

            #endregion
        }