コード例 #1
0
        public override void PreOpen()
        {
            base.PreOpen();

            if (!Tree.Initialized)
            {
                // initialize tree
                Tree.Initialize();

                // spit out debug info
#if DEBUG
                Log.Message("ResearchTree :: duplicated positions:\n " + string.Join("\n", Tree.Leaves.Where(n => Tree.Leaves.Any(n2 => n != n2 && n.X == n2.X && n.Y == n2.Y)).Select(n => n.X + ", " + n.Y + ": " + n.Label).ToArray()));
                Log.Message("ResearchTree :: out-of-bounds nodes:\n" + string.Join("\n", Tree.Leaves.Where(n => n.X < 1 || n.Y < 1).Select(n => n.ToString()).ToArray()));
                Log.Message(Tree.ToString());
#endif
            }

            // clear node availability caches
            ResearchNode.ClearCaches();

            // set to topleft (for some reason vanilla alignment overlaps bottom buttons).
            windowRect.x      = 0f;
            windowRect.y      = 0f;
            windowRect.width  = Screen.width;
            windowRect.height = Screen.height - 35f;
        }
コード例 #2
0
        public override void PreOpen()
        {
            base.PreOpen();
            SetRects();

            if (!Tree.Initialized)
            {
                // initialize tree
                Tree.Initialize();
            }

            // clear node availability caches
            ResearchNode.ClearCaches();

            _dragging             = false;
            closeOnClickedOutside = false;
        }