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;
     }
 }
Exemple #2
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 static STR GetAnimTable(EditorScope escope, VMAnimationScope scope)
 {
     switch (scope)
     {
         case VMAnimationScope.Object:
             var anitableID = escope.GetOBJD().AnimationTableID;
             anitableID = 129;
             return escope.GetResource<STR>(anitableID, ScopeSource.Private);
         case VMAnimationScope.Misc:
             return EditorScope.Globals.Resource.Get<STR>(156);
         case VMAnimationScope.PersonStock:
             return EditorScope.Globals.Resource.Get<STR>(130);
         case VMAnimationScope.Global:
             return EditorScope.Globals.Resource.Get<STR>(128);
     }
     return null;
 }
        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);
            }
        }
Exemple #5
0
        public static STR GetAnimTable(EditorScope escope, VMAnimationScope scope)
        {
            switch (scope)
            {
            case VMAnimationScope.Object:
                var anitableID = escope.GetOBJD().AnimationTableID;
                if (anitableID == 0)
                {
                    anitableID = 129;
                }
                return(escope.GetResource <STR>(anitableID, ScopeSource.Private));

            case VMAnimationScope.Misc:
                return(EditorScope.Globals.Resource.Get <STR>(156));

            case VMAnimationScope.PersonStock:
                return(EditorScope.Globals.Resource.Get <STR>(130));

            case VMAnimationScope.Global:
                return(EditorScope.Globals.Resource.Get <STR>(128));
            }
            return(null);
        }