public void DrawWeapon(Vector3 drawLoc)
        {
            Thing storedWeapon = ArmorRack.GetStoredWeapon();

            if (storedWeapon == null)
            {
                return;
            }

            Vector3 weaponDrawLoc = drawLoc;
            Mesh    weaponMesh;
            float   angle = -90f;

            if (ArmorRack.Rotation == Rot4.South)
            {
                weaponDrawLoc   += new Vector3(0.0f, 2.0f, -0.1f);
                weaponDrawLoc.y += 1f;
                weaponMesh       = MeshPool.plane10;
                angle            = -25f;
            }
            else if (ArmorRack.Rotation == Rot4.North)
            {
                weaponDrawLoc += new Vector3(0.0f, 0.0f, -0.11f);
                ref Vector3 local = ref weaponDrawLoc;
                weaponMesh = MeshPool.plane10;
            }
예제 #2
0
 public static bool PawnCanEquipWeaponSet(ArmorRack rack, Pawn pawn)
 {
     return(!(pawn.WorkTagIsDisabled(WorkTags.Violent) && rack.GetStoredWeapon() != null));
 }
        protected override void FillTab()
        {
            Text.Font = GameFont.Small;
            Rect rect     = new Rect(0.0f, 20f, this.size.x, this.size.y - 20f).ContractedBy(10f);
            Rect position = new Rect(rect.x, rect.y, rect.width, rect.height);

            GUI.BeginGroup(position);
            Text.Font = GameFont.Small;
            GUI.color = Color.white;
            Rect outRect  = new Rect(0.0f, 0.0f, position.width, position.height);
            Rect viewRect = outRect;

            Widgets.BeginScrollView(outRect, ref this.scrollPosition, viewRect, true);
            float     num       = 0.0f;
            ArmorRack armorRack = SelThing as ArmorRack;

            Widgets.ListSeparator(ref num, viewRect.width, "Equipment".Translate());
            Thing storedWeapon = armorRack.GetStoredWeapon();

            if (storedWeapon != null)
            {
                this.DrawThingRow(ref num, viewRect.width, storedWeapon, false);
            }

            Widgets.ListSeparator(ref num, viewRect.width, "Apparel".Translate());
            foreach (Apparel apparel in armorRack.GetStoredApparel()
                     .OrderByDescending((ap => ap.def.apparel.bodyPartGroups[0].listOrder)))
            {
                this.DrawThingRow(ref num, viewRect.width, (Thing)apparel, false);
            }

            Widgets.EndScrollView();
            GUI.EndGroup();
            GUI.color   = Color.white;
            Text.Anchor = TextAnchor.UpperLeft;

            Listing_Standard listingStandard2 = new Listing_Standard();
            Rect             rect2            = new Rect(0f, rect.height, 100f, 30f);

            listingStandard2.Begin(rect2);
            Widgets.Dropdown(
                listingStandard2.GetRect(30f),
                armorRack,
                (a => a.PawnKindDef),
                (b => this.GetBodyDefOptions()),
                armorRack.PawnKindDef.race.label
                );
            listingStandard2.End();

            Listing_Standard listingStandard1 = new Listing_Standard();
            Rect             rect1            = new Rect(105.0f, rect.height, 100f, 30f);

            listingStandard1.Begin(rect1);
            Widgets.Dropdown(
                listingStandard1.GetRect(30f),
                armorRack,
                (a => a.BodyTypeDef),
                (b => GetBodyDefTypeOptions()),
                armorRack.BodyTypeDef.ToString()
                );
            listingStandard1.End();
        }