Exemple #1
0
 public override Dictionary<int, string> GetNamedProperties(EditorScope scope, VMPrimitiveOperand operand)
 {
     var map = new Dictionary<int, string>();
     var op = (VMSnapOperand)operand;
     switch (op.Mode)
     {
         case VMSnapSlotScope.Global:
             var gslots = scope.GetResource<STR>(257, ScopeSource.Global);
             for (int i = 0; i < gslots.Length; i++)
                 map.Add(i, gslots.GetString(i));
             return map;
         case VMSnapSlotScope.Literal:
             var slotNs = scope.GetResource<STR>(257, ScopeSource.Private);
             var slotRes = scope.GetResource<SLOT>(scope.GetOBJD().SlotID, ScopeSource.Private);
             if (slotRes == null) return map;
             var slots = slotRes.Slots[3];
             for (int i = 0; i < slots.Count; i++)
                 map.Add(i, (slotNs != null && slotNs.GetString(i) != null)?slotNs.GetString(i):"slot "+i);
             return map;
         case VMSnapSlotScope.StackVariable:
             var str = scope.GetVarScopeDataNames(VMVariableScope.Parameters);
             for (int i = 0; i < str.Count; i++)
                 map.Add(str[i].Value, str[i].Name);
             return map;
         default:
             map.Add(0, "---");
             return map;
     }
 }
 public override void PopulateOperandView(BHAVEditor master, EditorScope escope, TableLayoutPanel panel)
 {
     panel.Controls.Add(new OpLabelControl(master, escope, Operand,
         new OpStaticTextProvider("Sleeps for the ticks specified by the chosen parameter, decrementing it towards zero. "
         + "Can be interrupted by the user cancelling the interaction, and the Notify Out Of Idle primitive.")));
     panel.Controls.Add(new OpComboControl(master, escope, Operand, "Ticks in Parameter:", "StackVarToDec", new OpStaticNamedPropertyProvider(escope.GetVarScopeDataNames(VMVariableScope.Parameters))));
     panel.Controls.Add(new OpFlagsControl(master, escope, Operand, "Flags:", new OpFlag[] {
         new OpFlag("Allow Push", "AllowPush")
         }));
     panel.Controls.Add(new OpLabelControl(master, escope, Operand, new OpStaticTextProvider("Allow Push is not well understood, and currently does nothing.")));
 }
Exemple #3
0
        public override Dictionary <int, string> GetNamedProperties(EditorScope scope, VMPrimitiveOperand operand)
        {
            var map = new Dictionary <int, string>();
            var op  = (VMSnapOperand)operand;

            switch (op.Mode)
            {
            case VMSnapSlotScope.Global:
                var gslots = scope.GetResource <STR>(257, ScopeSource.Global);
                if (gslots == null)
                {
                    var gslotsres = scope.GetResource <SLOT>(100,ScopeSource.Global);
                    for (int i = 0; i < gslotsres.Chronological.Count; i++)
                    {
                        map.Add(i,i.ToString());
                    }
                }
                else
                {
                    for (int i = 0; i < gslots.Length; i++)
                    {
                        map.Add(i, gslots.GetString(i));
                    }
                }
                return(map);

            case VMSnapSlotScope.Literal:
                var slotNs  = scope.GetResource <STR>(257, ScopeSource.Private);
                var slotRes = scope.GetResource <SLOT>(scope.GetOBJD().SlotID,ScopeSource.Private);
                if (slotRes == null || !slotRes.Slots.ContainsKey(3))
                {
                    return(map);
                }
                var slots = slotRes.Slots[3];
                for (int i = 0; i < slots.Count; i++)
                {
                    map.Add(i,(slotNs != null && slotNs.GetString(i) != null)?slotNs.GetString(i):"slot " + i);
                }
                return(map);

            case VMSnapSlotScope.StackVariable:
                var str = scope.GetVarScopeDataNames(VMVariableScope.Parameters);
                for (int i = 0; i < str.Count; i++)
                {
                    map.Add(str[i].Value,str[i].Name);
                }
                return(map);

            default:
                map.Add(0,"---");
                return(map);
            }
        }
        public override void PopulateOperandView(BHAVEditor master, EditorScope escope, TableLayoutPanel panel)
        {
            panel.Controls.Add(new OpLabelControl(master, escope, Operand, new OpStaticTextProvider("Finds a location to place the Stack Object, using a variety of modes and options.")));
            panel.Controls.Add(new OpComboControl(master, escope, Operand, "Mode:", "Mode", new OpStaticNamedPropertyProvider(EditorScope.Behaviour.Get<STR>(239))));

            panel.Controls.Add(new OpFlagsControl(master, escope, Operand, "Flags:", new OpFlag[] {
                new OpFlag("Use Local As Ref", "UseLocalAsRef"),
                new OpFlag("Allow Intersection", "AllowIntersection"),
                new OpFlag("User Editable Tiles Only", "UserEditableTilesOnly"),
                }));
            panel.Controls.Add(new OpLabelControl(master, escope, Operand, new OpStaticTextProvider("If 'Use Local As Ref' is set, the object with ID specified in the local is used as the starting position instead of the caller.")));
            panel.Controls.Add(new OpComboControl(master, escope, Operand, "Local:", "Local", new OpStaticNamedPropertyProvider(escope.GetVarScopeDataNames(VMVariableScope.Local))));
        }
        public override void PopulateOperandView(BHAVEditor master, EditorScope escope, TableLayoutPanel panel)
        {
            panel.Controls.Add(new OpLabelControl(master, escope, Operand, new OpStaticTextProvider("Sets a motive to change at a specific delta per hour until it hits the specified value. You can clear all active changes by setting the Clear All flag.")));

            panel.Controls.Add(new OpComboControl(master, escope, Operand, "Motive:", "Motive", new OpStaticNamedPropertyProvider(escope.GetVarScopeDataNames(VMVariableScope.MyMotives))));
            panel.Controls.Add(new OpScopeControl(master, escope, Operand, "Delta:", "DeltaOwner", "DeltaData"));
            panel.Controls.Add(new OpScopeControl(master, escope, Operand, "Max:", "MaxOwner", "MaxData"));

            panel.Controls.Add(new OpFlagsControl(master, escope, Operand, "Flags:", new OpFlag[] {
                new OpFlag("Apply Change Once", "Once"),
                new OpFlag("Clear All", "ClearAll"),
                }));
        }
        public override Dictionary <int, string> GetNamedProperties(EditorScope scope, VMPrimitiveOperand operand)
        {
            var map = new Dictionary <int, string>();
            var op  = (VMGotoRoutingSlotOperand)operand;

            switch (op.Type)
            {
            case VMSlotScope.Global:
                var gslots = scope.GetResource <STR>(257, ScopeSource.Global);
                if (gslots == null)
                {
                    return(map);
                }
                for (int i = 0; i < gslots.Length; i++)
                {
                    map.Add(i, gslots.GetString(i));
                }
                return(map);

            case VMSlotScope.Literal:
                var slotNs  = scope.GetResource <STR>(257, ScopeSource.Private);
                var slotRes = scope.GetResource <SLOT>(scope.GetOBJD().SlotID,ScopeSource.Private);
                if (slotRes == null)
                {
                    return(map);
                }
                var slots = slotRes.Slots[3];
                for (int i = 0; i < slots.Count; i++)
                {
                    map.Add(i,(slotNs != null && slotNs.GetString(i) != null)?slotNs.GetString(i):"slot " + i);
                }
                return(map);

            case VMSlotScope.StackVariable:
                var str = scope.GetVarScopeDataNames(VMVariableScope.Parameters);
                for (int i = 0; i < str.Count; i++)
                {
                    map.Add(str[i].Value,str[i].Name);
                }
                return(map);

            default:
                return(map);
            }
        }
 public override void PopulateOperandView(BHAVEditor master, EditorScope escope, TableLayoutPanel panel)
 {
     panel.Controls.Add(new OpLabelControl(master, escope, Operand,
                                           new OpStaticTextProvider("Sleeps for the ticks specified by the chosen parameter, decrementing it towards zero. "
                                                                    + "Can be interrupted by the user cancelling the interaction, and the Notify Out Of Idle primitive.")));
     panel.Controls.Add(new OpComboControl(master, escope, Operand, "Ticks in Parameter:", "StackVarToDec", new OpStaticNamedPropertyProvider(escope.GetVarScopeDataNames(VMVariableScope.Parameters))));
     panel.Controls.Add(new OpFlagsControl(master, escope, Operand, "Flags:", new OpFlag[] {
         new OpFlag("Allow Push", "AllowPush")
     }));
     panel.Controls.Add(new OpLabelControl(master, escope, Operand, new OpStaticTextProvider("Allow Push is not well understood, and currently does nothing.")));
 }
Exemple #8
0
 public override void PopulateOperandView(BHAVEditor master, EditorScope escope, TableLayoutPanel panel)
 {
     panel.Controls.Add(new OpLabelControl(master, escope, Operand,
                                           new OpStaticTextProvider("Sleeps for the ticks specified by the chosen parameter, decrementing it towards zero. "
                                                                    + "Can be interrupted by the Notify Out Of Idle primitive.")));
     panel.Controls.Add(new OpComboControl(master, escope, Operand, "Ticks in Parameter:", "StackVarToDec", new OpStaticNamedPropertyProvider(escope.GetVarScopeDataNames(VMVariableScope.Parameters))));
 }
        public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            var newProps = new List <PropertyDescriptor>();

            newProps.Add(new VMDataPropertyDescriptor("Stack Object ID", "The stack object.", attributes,
                                                      VMExtDataType.StackObject, 0, Object, Frame, Editor));

            var objDat = Scope.GetVarScopeDataNames(VMVariableScope.Parameters);

            foreach (var entry in objDat)
            {
                newProps.Add(new VMDataPropertyDescriptor(entry.Name, entry.Description, attributes,
                                                          VMExtDataType.Parameter, entry.Value, Object, Frame, Editor));
            }

            objDat = Scope.GetVarScopeDataNames(VMVariableScope.Local);
            foreach (var entry in objDat)
            {
                newProps.Add(new VMDataPropertyDescriptor(entry.Name, entry.Description, attributes,
                                                          VMExtDataType.Local, entry.Value, Object, Frame, Editor));
            }

            objDat = Scope.GetVarScopeDataNames(VMVariableScope.MyObjectAttributes);
            foreach (var entry in objDat)
            {
                newProps.Add(new VMDataPropertyDescriptor(entry.Name, entry.Description, attributes,
                                                          VMExtDataType.Attributes, entry.Value, Object, Frame, Editor));
            }

            if (Object is VMAvatar)
            {
                objDat = Scope.GetVarScopeDataNames(VMVariableScope.MyPersonData);
                foreach (var entry in objDat)
                {
                    newProps.Add(new VMDataPropertyDescriptor(entry.Name, entry.Description, attributes,
                                                              VMExtDataType.PersonData, entry.Value, Object, Frame, Editor));
                }

                objDat = Scope.GetVarScopeDataNames(VMVariableScope.MyMotives);
                foreach (var entry in objDat)
                {
                    newProps.Add(new VMDataPropertyDescriptor(entry.Name, entry.Description, attributes,
                                                              VMExtDataType.Motives, entry.Value, Object, Frame, Editor));
                }
            }

            objDat = Scope.GetVarScopeDataNames(VMVariableScope.MyObject);
            foreach (var entry in objDat)
            {
                newProps.Add(new VMDataPropertyDescriptor(entry.Name, entry.Description, attributes,
                                                          VMExtDataType.ObjectData, entry.Value, Object, Frame, Editor));
            }

            objDat = Scope.GetVarScopeDataNames(VMVariableScope.Temps);
            foreach (var entry in objDat)
            {
                newProps.Add(new VMDataPropertyDescriptor(entry.Name, entry.Description, attributes,
                                                          VMExtDataType.Temp, entry.Value, Object, Frame, Editor));
            }

            objDat = Scope.GetVarScopeDataNames(VMVariableScope.TempXL);
            foreach (var entry in objDat)
            {
                newProps.Add(new VMDataPropertyDescriptor(entry.Name, entry.Description, attributes,
                                                          VMExtDataType.TempXL, entry.Value, Object, Frame, Editor));
            }

            objDat = Scope.GetVarScopeDataNames(VMVariableScope.Global);
            foreach (var entry in objDat)
            {
                newProps.Add(new VMDataPropertyDescriptor(entry.Name, entry.Description, attributes,
                                                          VMExtDataType.Globals, entry.Value, Object, Frame, Editor));
            }

            return(new PropertyDescriptorCollection(newProps.ToArray()));
        }
Exemple #10
0
        public override void PopulateOperandView(BHAVEditor master, EditorScope escope, TableLayoutPanel panel)
        {
            panel.Controls.Add(new OpLabelControl(master, escope, Operand, new OpStaticTextProvider("Finds a location to place the Stack Object, using a variety of modes and options.")));
            panel.Controls.Add(new OpComboControl(master, escope, Operand, "Mode:", "Mode", new OpStaticNamedPropertyProvider(EditorScope.Behaviour.Get <STR>(239))));

            panel.Controls.Add(new OpFlagsControl(master, escope, Operand, "Flags:", new OpFlag[] {
                new OpFlag("Use Local As Ref", "UseLocalAsRef"),
                new OpFlag("Prefer Non-Empty", "PreferNonEmpty"),
                new OpFlag("User Editable Tiles Only", "UserEditableTilesOnly"),
            }));
            panel.Controls.Add(new OpLabelControl(master, escope, Operand, new OpStaticTextProvider("If 'Use Local As Ref' is set, the object with ID specified in the local is used as the starting position instead of the caller.")));
            panel.Controls.Add(new OpComboControl(master, escope, Operand, "Local:", "Local", new OpStaticNamedPropertyProvider(escope.GetVarScopeDataNames(VMVariableScope.Local))));
        }
        public override void PopulateOperandView(BHAVEditor master, EditorScope escope, TableLayoutPanel panel)
        {
            panel.Controls.Add(new OpLabelControl(master, escope, Operand,
                                                  new OpStaticTextProvider("Tracks 'relationship' variables of one object to another. Can be used between both objects and avatars, and can optionally persist relationships in the city server. Returns False on failure if 'Fail if too small' is checked.")));

            var old = (Operand is VMOldRelationshipOperand);

            panel.Controls.Add(new OpComboControl(master, escope, Operand, "Get/Set/Adjust:", "SetMode", new OpStaticNamedPropertyProvider(EditorScope.Behaviour.Get <STR>(169))));
            panel.Controls.Add(new OpComboControl(master, escope, Operand, "Mode:", "Mode", new OpStaticNamedPropertyProvider(EditorScope.Behaviour.Get <STR>((ushort)(old ? 170 : 235)))));
            panel.Controls.Add(new OpValueControl(master, escope, Operand, "Relationship Var:", "RelVar", new OpStaticValueBoundsProvider(0, 255)));

            if (old)
            {
                panel.Controls.Add(new OpComboControl(master, escope, Operand, "Target Parameter:", "VarData", new OpStaticNamedPropertyProvider(escope.GetVarScopeDataNames(VMVariableScope.Parameters))));
            }
            else
            {
                panel.Controls.Add(new OpScopeControl(master, escope, Operand, "Target Variable:", "VarScope", "VarData"));
            }

            panel.Controls.Add(new OpFlagsControl(master, escope, Operand, "Flags:", new OpFlag[] {
                new OpFlag("Fail if too small", "FailIfTooSmall"),
                new OpFlag("Use Neighbor", "UseNeighbor"),
            }));

            if (!old)
            {
                panel.Controls.Add(new OpComboControl(master, escope, Operand, "Object in Local:", "Local", new OpStaticNamedPropertyProvider(escope.GetVarScopeDataNames(VMVariableScope.Local))));
            }
        }
        public override void PopulateOperandView(BHAVEditor master, EditorScope escope, TableLayoutPanel panel)
        {
            panel.Controls.Add(new OpLabelControl(master, escope, Operand,
                new OpStaticTextProvider("Tracks 'relationship' variables of one object to another. Can be used between both objects and avatars, and can optionally persist relationships in the city server. Returns False on failure if 'Fail if too small' is checked.")));

            var old = (Operand is VMOldRelationshipOperand);

            panel.Controls.Add(new OpComboControl(master, escope, Operand, "Get/Set/Adjust:", "SetMode", new OpStaticNamedPropertyProvider(EditorScope.Behaviour.Get<STR>(169))));
            panel.Controls.Add(new OpComboControl(master, escope, Operand, "Mode:", "Mode", new OpStaticNamedPropertyProvider(EditorScope.Behaviour.Get<STR>((ushort)(old ? 170 : 235)))));
            panel.Controls.Add(new OpValueControl(master, escope, Operand, "Relationship Var:", "RelVar", new OpStaticValueBoundsProvider(0, 255)));

            if (old) panel.Controls.Add(new OpComboControl(master, escope, Operand, "Target Parameter:", "VarData", new OpStaticNamedPropertyProvider(escope.GetVarScopeDataNames(VMVariableScope.Parameters))));
            else panel.Controls.Add(new OpScopeControl(master, escope, Operand, "Target Variable:", "VarScope", "VarData"));

            panel.Controls.Add(new OpFlagsControl(master, escope, Operand, "Flags:", new OpFlag[] {
                new OpFlag("Fail if too small", "FailIfTooSmall"),
                new OpFlag("Use Neighbor", "UseNeighbor"),
                }));

            if (!old) panel.Controls.Add(new OpComboControl(master, escope, Operand, "Object in Local:", "Local", new OpStaticNamedPropertyProvider(escope.GetVarScopeDataNames(VMVariableScope.Local))));
        }
        public override void PopulateOperandView(BHAVEditor master, EditorScope escope, TableLayoutPanel panel)
        {
            panel.Controls.Add(new OpLabelControl(master, escope, Operand, new OpStaticTextProvider("Sets a motive to change at a specific delta per hour until it hits the specified value. You can clear all active changes by setting the Clear All flag.")));

            panel.Controls.Add(new OpComboControl(master, escope, Operand, "Motive:", "Motive", new OpStaticNamedPropertyProvider(escope.GetVarScopeDataNames(VMVariableScope.MyMotives))));
            panel.Controls.Add(new OpScopeControl(master, escope, Operand, "Delta:", "DeltaOwner", "DeltaData"));
            panel.Controls.Add(new OpScopeControl(master, escope, Operand, "Max:", "MaxOwner", "MaxData"));

            panel.Controls.Add(new OpFlagsControl(master, escope, Operand, "Flags:", new OpFlag[] {
                new OpFlag("Apply Change Once", "Once"),
                new OpFlag("Clear All", "ClearAll"),
            }));
        }