Ejemplo n.º 1
0
    public void SetBodyOptions(BodyOptions tshirt, BodyOptions arms, BodyOptions pants, BodyOptions shoes)
    {
        this.TShirt.SetActiveSelfSafe(tshirt == BodyOptions.Default);
        this.TShirtNoArms.SetActiveSelfSafe(tshirt == BodyOptions.NoArms);
        bool flag = arms == BodyOptions.JustHands;

        this.Arms.SetActiveSelfSafe(!flag);
        this.Hands.SetActiveSelfSafe(flag);
        this._pants.SetActiveSelfSafe(pants == BodyOptions.Default);
        this.Shoes.SetActiveSelfSafe(shoes == BodyOptions.Default);
    }
Ejemplo n.º 2
0
        // object owning data should be locked
        private static void Render3D(IPluginViewSettings pluginViewSettings, EventTypePluginData data, nui.Registration registration)
        {
            Debug.Assert(data != null);

            BodyPlugin3DViewSettings bodyPluginViewSettings = pluginViewSettings as BodyPlugin3DViewSettings;

            if ((bodyPluginViewSettings != null) && (registration != null) && (data.body != null) && data.bodiesValid)
            {
                if (bodyPluginViewSettings.RenderBodies || bodyPluginViewSettings.RenderHands)
                {
                    data.body.Begin();

                    for (uint i = 0; i < BodyPlugin.bodyOptions.Length; ++i)
                    {
                        if (bodyPluginViewSettings.RenderBodies)
                        {
                            BodyOptions bodyOption = BodyPlugin.bodyOptions[i];

                            data.body.RenderBones(i, bodyOption.BoneEffect);

                            if (bodyPluginViewSettings.RenderJointOrientations)
                            {
                                data.body.RenderJointOrientations(i, bodyOption.JointEffect);
                            }

                            data.body.RenderJoints(i, bodyOption.JointEffect);

                            if (bodyPluginViewSettings.RenderInfo && (data.font != null))
                            {
                                // PlayderIndex (sic)
                                data.body.RenderInfo(i, viz.BodyInfoFlag.PlayderIndex, data.font, bodyOption.ColorVector);
                            }
                        }

                        if (bodyPluginViewSettings.RenderHands)
                        {
                            data.body.RenderHandStates(i);
                        }
                    }

                    data.body.End(0.0f);
                }
            }
        }
Ejemplo n.º 3
0
    public void SetVariation(int variation, int hair, List <int> clothingItemIdList)
    {
        Material[] tShirtClean = null;
        Material[] tShirtRed   = null;
        Mesh       hatMesh     = null;

        Material[]             hatClean = null;
        Material[]             hatRed   = null;
        ClothingItem.BoneGroup index    = ClothingItem.BoneGroup.Tops;
        Mesh topMesh = null;

        Material[] array     = null;
        Material[] topRed    = null;
        Mesh       pantsMesh = null;

        Material[]  pantsClean = null;
        Material[]  pantsRed   = null;
        bool        flag       = false;
        BodyOptions tshirt     = BodyOptions.Default;
        BodyOptions arms       = BodyOptions.Default;
        BodyOptions pants      = BodyOptions.Default;
        BodyOptions shoes      = BodyOptions.Default;

        this._activeVariationIndex = variation;
        for (int i = 0; i < this.Variations.Length; i++)
        {
            if (i != this._activeVariationIndex)
            {
                this.Variations[i].Toggle(false);
            }
        }
        for (int j = clothingItemIdList.Count - 1; j >= 0; j--)
        {
            if (clothingItemIdList[j] <= 0)
            {
                tshirt = BodyOptions.None;
                arms   = BodyOptions.JustHands;
                pants  = BodyOptions.None;
            }
            else
            {
                ClothingItem clothingItem = ClothingItemDatabase.ClothingItemById(clothingItemIdList[j]);
                if (clothingItem._displayType == ClothingItem.DisplayTypes.FullBody)
                {
                    tshirt    = BodyOptions.None;
                    arms      = BodyOptions.JustHands;
                    pants     = BodyOptions.None;
                    shoes     = BodyOptions.None;
                    index     = clothingItem._boneGroup;
                    topMesh   = clothingItem._meshLods[0];
                    array     = this.GetMaterials(clothingItem);
                    topRed    = ((clothingItem._materialsRed == null || clothingItem._materialsRed.Length <= 0) ? array : clothingItem._materialsRed);
                    pantsMesh = null;
                }
                else if (clothingItem._displayType == ClothingItem.DisplayTypes.Pants)
                {
                    pantsMesh  = clothingItem._meshLods[0];
                    pantsClean = this.GetMaterials(clothingItem);
                    pantsRed   = clothingItem._materialsRed;
                }
                else if (clothingItem._displayType == ClothingItem.DisplayTypes.TShirt)
                {
                    tShirtClean = this.GetMaterials(clothingItem);
                    tShirtRed   = clothingItem._materialsRed;
                }
                else if (clothingItem._displayType == ClothingItem.DisplayTypes.Hat)
                {
                    if (this.AllowHats())
                    {
                        hatMesh  = clothingItem._meshLods[0];
                        hatClean = this.GetMaterials(clothingItem);
                        hatRed   = clothingItem._materialsRed;
                        flag     = true;
                    }
                }
                else
                {
                    index   = clothingItem._boneGroup;
                    topMesh = clothingItem._meshLods[0];
                    array   = this.GetMaterials(clothingItem);
                    topRed  = ((clothingItem._materialsRed == null || clothingItem._materialsRed.Length <= 0) ? array : clothingItem._materialsRed);
                    switch (clothingItem._displayType)
                    {
                    case ClothingItem.DisplayTypes.TopPartial_Hands:
                        tshirt = BodyOptions.NoArms;
                        arms   = BodyOptions.JustHands;
                        break;

                    case ClothingItem.DisplayTypes.TopPartial_Arms:
                        tshirt = BodyOptions.Default;
                        arms   = BodyOptions.Default;
                        break;

                    case ClothingItem.DisplayTypes.TopFull_Hands:
                        tshirt = BodyOptions.None;
                        arms   = BodyOptions.JustHands;
                        break;

                    case ClothingItem.DisplayTypes.TopFull_Arms:
                        tshirt = BodyOptions.None;
                        arms   = BodyOptions.Default;
                        break;
                    }
                }
                if (clothingItem._hidePants)
                {
                    pants = BodyOptions.None;
                }
                if (clothingItem._hideShoes)
                {
                    shoes = BodyOptions.None;
                }
            }
        }
        this.ActiveVariation.Toggle(true);
        this.ActiveVariation.SetMeshes(hatMesh, topMesh, this.BoneGroups[(int)index].Bones, pantsMesh);
        this.ActiveVariation.SetMaterials(hatClean, hatRed, array, topRed, tShirtClean, tShirtRed, pantsClean, pantsRed);
        this.ActiveVariation.SetBodyOptions(tshirt, arms, pants, shoes);
        this.ActiveVariation.SetHair((!flag) ? hair : -1);
    }
        static Req CreateReq(bool expectContinue, string[] data, BodyOptions options)
        {
            var head = default(HttpRequestHead);
            head.Version = new Version(1, 0);
            head.Headers = new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);

            if (expectContinue)
            {
                head.Version = new Version(1, 1);
                head.Headers["Expect"] = "100-continue";
            }

            DataBuffer bodyBuffer = null;
            if (data != null)
            {
                switch (options)
                {
                    case BodyOptions.NoHeaderIndications:
                        bodyBuffer = CreateBody(data);
                        break;
                    case BodyOptions.ContentLength:
                        bodyBuffer = CreateBody(data);
                        head.Headers["Content-Length"] = bodyBuffer.GetCount().ToString();
                        break;
                    case BodyOptions.TransferEncodingChunked:
                        bodyBuffer = CreateBody(data);
                        head.Headers["Transfer-Encoding"] = "chunked";
                        break;
                    case BodyOptions.TransferEncodingNotChunked:
                        bodyBuffer = CreateBody(data);
                        head.Headers["Transfer-Encoding"] = "asddfashjkfdsa";
                        break;
                }
            }

            return new Req()
            {
                Head = head,
                Body = bodyBuffer
            };
        }