Example #1
0
        private void MakeItemGroups()
        {
            Node itemDef = DefaultNode.CreateClone(this);

            itemDef.addComponent(typeof(ItemPayload), true);
            itemDef.movement.active = false;

            var infos = Component.compInfos;

            foreach (Type t in infos.Keys)
            {
                Info info = infos[t];
                if ((info.compType & mtypes.item) != mtypes.item)
                {
                    continue;
                }
                if (t == typeof(ItemPayload))
                {
                    continue;
                }
                //if (info.userLevel == UserLevel.Developer || info.userLevel == UserLevel.Advanced) continue;
                Node nodeDef = itemDef.CreateClone(this);
                //nodeDef.addComponent(t, true);
                Component c = Node.MakeComponent(t, true, nodeDef);
                nodeDef.Comp <ItemPayload>().AddComponentItem(c);
                Groups.Items.AddGroup(new Group(this, nodeDef, t.ToString().LastWord('.') + " Item"));
            }
        }
Example #2
0
        private void MakePresetGroups()
        {
            var infos   = Component.compInfos;
            int runenum = 0;

            foreach (Type t in infos.Keys)
            {
                Info info = infos[t];
                if ((info.compType & mtypes.essential) == mtypes.essential)
                {
                    continue;
                }
                if ((info.compType & mtypes.exclusiveLinker) == mtypes.exclusiveLinker)
                {
                    continue;
                }
                if ((info.compType & mtypes.item) == mtypes.item)
                {
                    continue;
                }
                if (info.userLevel == UserLevel.Developer || info.userLevel == UserLevel.Advanced)
                {
                    continue;
                }
                if (t == typeof(Lifetime))
                {
                    continue;
                }
                if (t == typeof(Rune))
                {
                    continue;
                }
                Node nodeDef = DefaultNode.CreateClone(this);
                nodeDef.SetColor(Utils.randomColor());
                nodeDef.addComponent(t, true);
                nodeDef.addComponent(typeof(Rune), true);
                nodeDef.Comp <Rune>().runeTexture = (Textures)runenum++;
                Groups.Preset.AddGroup(new Group(this, nodeDef, t.ToString().LastWord('.') + " Group"));
            }
        }