Esempio n. 1
0
        public WorldGenConfiguration(JObject configurationRoot)
            : base(configurationRoot)
        {
            //IL_0013: Unknown result type (might be due to invalid IL or missing references)
            //IL_0018: Unknown result type (might be due to invalid IL or missing references)
            //IL_001c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0026: Expected O, but got Unknown
            //IL_0032: Unknown result type (might be due to invalid IL or missing references)
            //IL_0037: Unknown result type (might be due to invalid IL or missing references)
            //IL_003b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0045: Expected O, but got Unknown
            _003F val = (JObject)configurationRoot.get_Item("Biomes");

            if ((int)val == 0)
            {
                val = new JObject();
            }
            _biomeRoot = (JObject)(object)val;
            _003F val2 = (JObject)configurationRoot.get_Item("Passes");

            if ((int)val2 == 0)
            {
                val2 = new JObject();
            }
            _passRoot = (JObject)(object)val2;
        }
Esempio n. 2
0
        private unsafe void SetKeywordContainerAlignment()
        {
            //IL_0006: Unknown result type (might be due to invalid IL or missing references)
            //IL_000b: Unknown result type (might be due to invalid IL or missing references)
            //IL_000c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0011: Unknown result type (might be due to invalid IL or missing references)
            //IL_0012: Unknown result type (might be due to invalid IL or missing references)
            //IL_0035: Unknown result type (might be due to invalid IL or missing references)
            //IL_0047: Unknown result type (might be due to invalid IL or missing references)
            _003F   val   = this.get_transform();
            Vector2 pivot = val.get_pivot();
            float   num   = ((IntPtr)(void *)val.get_lossyScale()).x * (m_keywordsContainer.width + m_keywordsContainer.spacing);

            KeywordTooltipContainer.HorizontalAlignment h = (!(((IntPtr)(void *)pivot).x > 0.5f)) ? KeywordTooltipContainer.HorizontalAlignment.Right : KeywordTooltipContainer.HorizontalAlignment.Left;
            KeywordTooltipContainer.VerticalAlignment   v = (!(((IntPtr)(void *)pivot).y > 0.5f)) ? KeywordTooltipContainer.VerticalAlignment.Down : KeywordTooltipContainer.VerticalAlignment.Up;
            if (base.borderDistanceToScreen.right < num)
            {
                h = KeywordTooltipContainer.HorizontalAlignment.Left;
            }
            if (base.borderDistanceToScreen.left < num)
            {
                h = KeywordTooltipContainer.HorizontalAlignment.Right;
            }
            m_keywordsContainer.SetAlignement(h, v);
        }
        public void SetAlignement(HorizontalAlignment h, VerticalAlignment v)
        {
            //IL_001f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0024: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f5: Unknown result type (might be due to invalid IL or missing references)
            //IL_00fa: Unknown result type (might be due to invalid IL or missing references)
            //IL_00fb: Unknown result type (might be due to invalid IL or missing references)
            //IL_0101: Unknown result type (might be due to invalid IL or missing references)
            //IL_0102: Unknown result type (might be due to invalid IL or missing references)
            //IL_0108: Unknown result type (might be due to invalid IL or missing references)
            //IL_0109: Unknown result type (might be due to invalid IL or missing references)
            //IL_010f: Unknown result type (might be due to invalid IL or missing references)
            m_horizontalAlignment = h;
            m_verticalAlignment   = v;
            Vector2 anchoredPosition = default(Vector2);

            anchoredPosition._002Ector(0f, 0f);
            Vector2 zero = Vector2.get_zero();
            Vector2 val  = default(Vector2);

            val._002Ector(1f, 0f);
            switch (h)
            {
            case HorizontalAlignment.Left:
                anchoredPosition.x = 0f - m_spacing;
                zero.x             = 1f;
                val.x = 0f;
                break;

            case HorizontalAlignment.Right:
                anchoredPosition.x = m_spacing;
                zero.x             = 0f;
                val.x = 1f;
                break;

            default:
                throw new ArgumentOutOfRangeException("h", h, null);
            }
            switch (v)
            {
            case VerticalAlignment.Up:
                zero.y = 1f;
                val.y  = 1f;
                break;

            case VerticalAlignment.Down:
                zero.y = 0f;
                val.y  = 0f;
                break;

            default:
                throw new ArgumentOutOfRangeException("v", v, null);
            }
            _003F val2 = this.get_transform();

            val2.set_pivot(zero);
            val2.set_anchorMin(val);
            val2.set_anchorMax(val);
            val2.set_anchoredPosition(anchoredPosition);
        }
Esempio n. 4
0
        internal IEnumerable <StatDrawEntry> SpecialDisplayStats()
        {
            if (this.sowMinSkill > 0)
            {
                yield return(new StatDrawEntry(StatCategoryDefOf.Basics, "MinGrowingSkillToSow".Translate(), this.sowMinSkill.ToString(), 0, string.Empty));

                /*Error: Unable to find new state assignment for yield return*/;
            }
            string attributes = string.Empty;

            if (this.Harvestable)
            {
                if (!attributes.NullOrEmpty())
                {
                    attributes += ", ";
                }
                attributes += "Harvestable".Translate();
            }
            if (this.LimitedLifespan)
            {
                if (!attributes.NullOrEmpty())
                {
                    attributes += ", ";
                }
                _003F val = attributes + "LimitedLifespan".Translate();
            }
            yield return(new StatDrawEntry(StatCategoryDefOf.Basics, "GrowingTime".Translate(), this.growDays.ToString("0.##") + " " + "Days".Translate(), 0, string.Empty)
            {
                overrideReportText = "GrowingTimeDesc".Translate()
            });

            /*Error: Unable to find new state assignment for yield return*/;
        }
        public unsafe void ShowAt(TooltipPosition position, Vector3 worldPosition)
        {
            //IL_0006: Unknown result type (might be due to invalid IL or missing references)
            //IL_000b: Unknown result type (might be due to invalid IL or missing references)
            //IL_000c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0011: Unknown result type (might be due to invalid IL or missing references)
            //IL_0012: Unknown result type (might be due to invalid IL or missing references)
            //IL_0014: Unknown result type (might be due to invalid IL or missing references)
            //IL_001e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0024: Unknown result type (might be due to invalid IL or missing references)
            //IL_002a: Expected O, but got Unknown
            //IL_002a: Unknown result type (might be due to invalid IL or missing references)
            //IL_0030: Expected O, but got Unknown
            //IL_002b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0030: Unknown result type (might be due to invalid IL or missing references)
            //IL_0032: Unknown result type (might be due to invalid IL or missing references)
            //IL_0037: Unknown result type (might be due to invalid IL or missing references)
            //IL_003f: Unknown result type (might be due to invalid IL or missing references)
            //IL_004b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0107: Unknown result type (might be due to invalid IL or missing references)
            _003F   val        = this.get_transform();
            Vector3 lossyScale = val.get_lossyScale();

            val.set_pivot(GetPivotFor(position));
            RectTransform transform = val.get_root();
            Rect          val2      = RectTransformToScreenSpace(val, worldPosition);
            Rect          rect      = RectTransformToScreenSpace(transform);

            Enlarge(ref rect, -10f * ((IntPtr)(void *)lossyScale).x, -10f * ((IntPtr)(void *)lossyScale).y);
            float num  = rect.get_xMax() - val2.get_xMax();
            float num2 = val2.get_xMin() - rect.get_xMin();
            float num3 = rect.get_yMax() - val2.get_yMax();
            float num4 = val2.get_yMin() - rect.get_yMin();

            m_borderDistanceToScreen = new RectOffset(num2, num, num3, num4);
            if (num < 0f)
            {
                worldPosition.x += num;
            }
            if (num2 < 0f)
            {
                worldPosition.x -= num2;
            }
            if (num3 < 0f)
            {
                worldPosition.y += num3;
            }
            if (num4 < 0f)
            {
                worldPosition.y -= num4;
            }
            DisplayTooltip(worldPosition);
        }
        public unsafe void ShowAt(TooltipPosition location, RectTransform targetRect)
        {
            //IL_0006: Unknown result type (might be due to invalid IL or missing references)
            //IL_000b: Unknown result type (might be due to invalid IL or missing references)
            //IL_000c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0011: Unknown result type (might be due to invalid IL or missing references)
            //IL_0012: Unknown result type (might be due to invalid IL or missing references)
            //IL_0018: Unknown result type (might be due to invalid IL or missing references)
            //IL_0022: Expected O, but got Unknown
            //IL_001d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0022: Unknown result type (might be due to invalid IL or missing references)
            //IL_0024: Unknown result type (might be due to invalid IL or missing references)
            //IL_0029: Unknown result type (might be due to invalid IL or missing references)
            //IL_0031: Unknown result type (might be due to invalid IL or missing references)
            //IL_003d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0049: Unknown result type (might be due to invalid IL or missing references)
            //IL_004e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0052: Unknown result type (might be due to invalid IL or missing references)
            //IL_0057: Unknown result type (might be due to invalid IL or missing references)
            //IL_0058: Unknown result type (might be due to invalid IL or missing references)
            //IL_005d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0062: Unknown result type (might be due to invalid IL or missing references)
            //IL_0063: Unknown result type (might be due to invalid IL or missing references)
            //IL_006c: Unknown result type (might be due to invalid IL or missing references)
            //IL_006e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0073: Unknown result type (might be due to invalid IL or missing references)
            //IL_007c: Unknown result type (might be due to invalid IL or missing references)
            //IL_008d: Unknown result type (might be due to invalid IL or missing references)
            _003F   val        = this.get_transform();
            Vector3 lossyScale = val.get_lossyScale();
            Rect    screenRect = RectTransformToScreenSpace(val.get_root());
            Rect    rect       = RectTransformToScreenSpace(targetRect);

            Enlarge(ref rect, 10f * ((IntPtr)(void *)lossyScale).x, 10f * ((IntPtr)(void *)lossyScale).y);
            Rect rect2 = val.get_rect();

            location = BestLocation(Vector2.Scale(rect2.get_size(), Vector2.op_Implicit(lossyScale)), screenRect, rect, location);
            Vector3 position = GetPosition(rect, location);

            position.z = ((IntPtr)(void *)this.get_transform().get_position()).z;
            ShowAt(location, position);
        }
 private static View GetViewFromElements(Document doc, ICollection <ElementId> ids)
 {
     foreach (ElementId id in ids)
     {
         Element val = doc.GetElement(id);
         if (val is View)
         {
             return(val as View);
         }
         if (val is Viewport)
         {
             Viewport val2 = val as Viewport;
             return(doc.GetElement(val2.get_ViewId()) as View);
         }
     }
     if (!IsNonDetailViewSelected(doc, ids))
     {
         FilteredElementCollector val3 = new FilteredElementCollector(doc, ids);
         val3.OfCategory(-2000278);
         if (val3.GetElementCount() > 0)
         {
             Element val4 = val3.FirstElement();
             FilteredElementCollector val5 = new FilteredElementCollector(doc);
             val5.OfCategory(-2000279);
             string name = val4.get_Name();
             View   val6 = null;
             foreach (Element item in val5)
             {
                 if (item.get_Name() == name)
                 {
                     _003F val7 = item;
                     val6 = val7;
                     return(val7);
                 }
             }
         }
         return(null);
     }
     return(null);
 }