Inheritance: FSO.Client.UI.Framework.UIContainer
Esempio n. 1
0
        public override void Execute(BHAV bhav, UIBHAVEditor editor)
        {
            var newInst = new BHAVInstruction[bhav.Instructions.Length - 1];
            byte index = 0;
            for (int i = 0; i < bhav.Instructions.Length; i++)
            {
                if (i != Primitive.InstPtr)
                {
                    var inst = bhav.Instructions[i];
                    newInst[index++] = inst;
                    if (inst.TruePointer < 253 && inst.TruePointer > Primitive.InstPtr) inst.TruePointer--;
                    if (inst.FalsePointer < 253 && inst.FalsePointer > Primitive.InstPtr) inst.FalsePointer--;
                }
            }

            foreach (var prim in FromTrue)
            {
                prim.TrueUI = null;
                prim.Instruction.TruePointer = 253;
            }

            foreach (var prim in FromFalse)
            {
                prim.FalseUI = null;
                prim.Instruction.FalsePointer = 253;
            }

            bhav.Instructions = newInst;
            editor.BHAVView.RemovePrimitive(Primitive);
            FSO.SimAntics.VM.BHAVChanged(bhav);
        }
Esempio n. 2
0
 public override void Undo(BHAV bhav, UIBHAVEditor editor)
 {
     Prim.Instruction.Operand = OldOp;
     Prim.RefreshOperand();
     Prim.UpdateDisplay();
     FSO.SimAntics.VM.BHAVChanged(bhav);
 }
Esempio n. 3
0
        public override void Undo(BHAV bhav, UIBHAVEditor editor)
        {
            var newInst = new BHAVInstruction[bhav.Instructions.Length + 1];
            byte index = 0;
            for (int i = 0; i < newInst.Length; i++)
            {
                if (i == Primitive.InstPtr) newInst[i] = Primitive.Instruction;
                else
                {
                    var inst = bhav.Instructions[index++];
                    newInst[i] = inst;
                    if (inst.TruePointer < 252 && inst.TruePointer >= Primitive.InstPtr) inst.TruePointer++;
                    if (inst.FalsePointer < 252 && inst.FalsePointer >= Primitive.InstPtr) inst.FalsePointer++;
                }
            }

            foreach (var prim in FromTrue)
            {
                prim.TrueUI = Primitive;
                prim.Instruction.TruePointer = Primitive.InstPtr;
            }

            foreach (var prim in FromFalse)
            {
                prim.FalseUI = Primitive;
                prim.Instruction.FalsePointer = Primitive.InstPtr;
            }

            bhav.Instructions = newInst;
            editor.BHAVView.Primitives.Add(Primitive);
            editor.BHAVView.RealPrim.Insert(Primitive.InstPtr, Primitive);
            editor.BHAVView.Add(Primitive);

            FSO.SimAntics.VM.BHAVChanged(bhav);
        }
Esempio n. 4
0
        public override void Execute(BHAV bhav, UIBHAVEditor editor)
        {
            if (NewPrimitive.Type != PrimBoxType.Primitive)
            {
                editor.BHAVView.Primitives.Add(NewPrimitive);
                editor.BHAVView.Add(NewPrimitive);
            }
            else
            {
                var newInst = new BHAVInstruction[bhav.Instructions.Length + 1];
                for (int i = 0; i < bhav.Instructions.Length; i++)
                {
                    newInst[i] = bhav.Instructions[i];
                }
                newInst[newInst.Length - 1] = NewPrimitive.Instruction;
                NewPrimitive.InstPtr = (byte)(newInst.Length - 1);

                bhav.Instructions = newInst;
                editor.BHAVView.AddPrimitive(NewPrimitive);
                NewPrimitive.UpdateDisplay();

                Content.Content.Get().Changes.ChunkChanged(bhav);

                FSO.SimAntics.VM.BHAVChanged(bhav);
            }
        }
Esempio n. 5
0
 public override void Execute(BHAV bhav, UIBHAVEditor editor)
 {
     Prim.Instruction.Operand = NewOp;
     Prim.UpdateDisplay();
     Content.Content.Get().Changes.ChunkChanged(bhav);
     FSO.SimAntics.VM.BHAVChanged(bhav);
 }
Esempio n. 6
0
 public override void Execute(BHAV bhav, UIBHAVEditor editor)
 {
     Old = editor.BHAVView.EditTarget;
     OldScope = editor.BHAVView.Scope;
     OldFrame = editor.DebugFrame;
     editor.BHAVView.OnSelectedChanged -= SelectCallback;
     editor.SwitchBHAV(Target, TargetScope, Frame);
     editor.BHAVView.OnSelectedChanged += SelectCallback;
 }
Esempio n. 7
0
        public void InitBHAV(BHAV bhav, EditorScope scope)
        {
            var mainCont = new UIExternalContainer(1024, 768);
            Editor = new UIBHAVEditor(bhav, scope);
            mainCont.Add(Editor);
            GameFacade.Screens.AddExternal(mainCont);

            SetUI(mainCont);
        }
        private int UseLastValue; //times to use last believed value before we poll the real entity.

        #endregion Fields

        #region Constructors

        public VMDataPropertyDescriptor(string name, string description, Attribute[] attrs, VMExtDataType type, int id, 
            VMEntity obj, VMStackFrame frame, UIBHAVEditor editor)
            : base(name, attrs)
        {
            Type = type;
            ID = id;
            Object = obj;
            Frame = frame;
            Editor = editor;
            _Description = description;
        }
Esempio n. 9
0
        public override void Undo(BHAV bhav, UIBHAVEditor editor)
        {
            //primitive we added should be at the end
            var newInst = new BHAVInstruction[bhav.Instructions.Length - 1];
            for (int i = 0; i < newInst.Length; i++)
            {
                newInst[i] = bhav.Instructions[i];
            }

            bhav.Instructions = newInst;
            editor.BHAVView.RemovePrimitive(NewPrimitive);
            FSO.SimAntics.VM.BHAVChanged(bhav);
        }
Esempio n. 10
0
        public override void Execute(BHAV bhav, UIBHAVEditor editor)
        {
            var newInst = new BHAVInstruction[bhav.Instructions.Length + 1];
            for (int i = 0; i < bhav.Instructions.Length; i++)
            {
                newInst[i] = bhav.Instructions[i];
            }
            newInst[newInst.Length - 1] = NewPrimitive.Instruction;
            NewPrimitive.InstPtr = (byte)(newInst.Length - 1);

            bhav.Instructions = newInst;
            editor.BHAVView.AddPrimitive(NewPrimitive);
            NewPrimitive.UpdateDisplay();
            FSO.SimAntics.VM.BHAVChanged(bhav);
        }
Esempio n. 11
0
        public override void Undo(BHAV bhav, UIBHAVEditor editor)
        {
            if (TrueBranch)
            {
                InstUI.Instruction.TruePointer = (OldDestUI == null) ? (byte)253 : OldDestUI.InstPtr;
                InstUI.TrueUI = OldDestUI;
            }
            else
            {
                InstUI.Instruction.FalsePointer = (OldDestUI == null) ? (byte)253 : OldDestUI.InstPtr;
                InstUI.FalseUI = OldDestUI;
            }

            FSO.SimAntics.VM.BHAVChanged(bhav);
        }
Esempio n. 12
0
        public override void Execute(BHAV bhav, UIBHAVEditor editor)
        {
            if (TrueBranch)
            {
                InstUI.Instruction.TruePointer = (DestUI == null)?(byte)253:DestUI.InstPtr;
                InstUI.TrueUI = DestUI;
            }
            else
            {
                InstUI.Instruction.FalsePointer = (DestUI == null) ? (byte)253 : DestUI.InstPtr;
                InstUI.FalseUI = DestUI;
            }

            Content.Content.Get().Changes.ChunkChanged(bhav);
            FSO.SimAntics.VM.BHAVChanged(bhav);
        }
Esempio n. 13
0
 public override void Undo(BHAV bhav, UIBHAVEditor editor)
 {
     if (Primitive.Type != PrimBoxType.Primitive)
     {
         //do nothing.
     }
     else
     {
         bhav.Instructions[0] = Old0.Instruction;
         bhav.Instructions[OldPtr] = Primitive.Instruction;
         Primitive.InstPtr = OldPtr;
         Old0.InstPtr = 0;
         foreach (var prim in FromTrue) prim.Instruction.TruePointer = OldPtr;
         foreach (var prim in FromFalse) prim.Instruction.FalsePointer = OldPtr;
         foreach (var prim in FromTrue0) prim.Instruction.TruePointer = 0;
         foreach (var prim in FromFalse0) prim.Instruction.FalsePointer = 0;
         Content.Content.Get().Changes.ChunkChanged(bhav);
         FSO.SimAntics.VM.BHAVChanged(bhav);
     }
 }
Esempio n. 14
0
        public void InitBHAV(BHAV bhav, EditorScope scope, VMEntity debugEnt, VMStackFrame debugFrame, BHAVPrimSelect callback)
        {
            if (FSOUI == null)
            {
                var mainCont = new UIExternalContainer(1024, 768);
                Editor = new UIBHAVEditor(bhav, scope, debugEnt);
                mainCont.Add(Editor);
                GameFacade.Screens.AddExternal(mainCont);

                SetUI(mainCont);
                Editor.BHAVView.OnSelectedChanged += callback;
            } else
            {
                //reuse existing
                lock (FSOUI)
                {
                    Editor.QueueCommand(new ChangeBHAVCommand(bhav, scope, debugFrame, callback));
                }
            }
        }
Esempio n. 15
0
        public override void Undo(BHAV bhav, UIBHAVEditor editor)
        {
            if (NewPrimitive.Type != PrimBoxType.Primitive)
            {
                editor.BHAVView.Primitives.Remove(NewPrimitive);
                editor.BHAVView.Remove(NewPrimitive);
            }
            else
            {
                //primitive we added should be at the end
                var newInst = new BHAVInstruction[bhav.Instructions.Length - 1];
                for (int i = 0; i < newInst.Length; i++)
                {
                    newInst[i] = bhav.Instructions[i];
                }

                bhav.Instructions = newInst;
                editor.BHAVView.RemovePrimitive(NewPrimitive);
                Content.Content.Get().Changes.ChunkChanged(bhav);
                FSO.SimAntics.VM.BHAVChanged(bhav);
            }
        }
Esempio n. 16
0
 public abstract void Execute(BHAV bhav, UIBHAVEditor editor);
Esempio n. 17
0
 public override void Undo(BHAV bhav, UIBHAVEditor editor)
 {
     editor.BHAVView.OnSelectedChanged -= SelectCallback;
     editor.SwitchBHAV(Old, OldScope, OldFrame);
     editor.BHAVView.OnSelectedChanged += SelectCallback;
 }
Esempio n. 18
0
        public override void Undo(BHAV bhav, UIBHAVEditor editor)
        {
            InstUI.Instruction.Breakpoint = !InstUI.Instruction.Breakpoint;

            FSO.SimAntics.VM.BHAVChanged(bhav);
        }
Esempio n. 19
0
 public abstract void Undo(BHAV bhav, UIBHAVEditor editor);