示例#1
0
        private bool SelectItem(int column, int index, bool immediateMove)
        {
            if (immediateMove)
            {
                if (column == 0)
                {
                    this.index1 = index;
                }
                else
                {
                    this.index2 = index;
                }
                UICursor.UpdateTargetLoc();
            }

            if (column == 0)
            {
                if (!can_trade(this.actor1, this.actor2, index))
                {
                    return(false);
                }

                Mode = column + 1;
                Grey_Cursor.force_loc(UICursor.target_loc);
                Grey_Cursor.visible = true;
                Selected            = new int[] { 0, index };
                refresh(true);

                if (!Input.IsControllingOnscreenMouse)
                {
                    this.index2 = Items2 < Num ? Items2 : Math.Min(Items2, Selected[1]);
                }
                Items2 = Math.Min(Num, Items2 + 1);
            }
            else
            {
                if (!can_trade(this.actor2, this.actor1, index))
                {
                    return(false);
                }

                Mode = column + 1;
                Grey_Cursor.force_loc(UICursor.target_loc);
                Grey_Cursor.visible = true;
                Selected            = new int[] { 1, index };
                refresh(true);

                if (!Input.IsControllingOnscreenMouse)
                {
                    this.index1 = Items1 < Num ? Items1 : Math.Min(Items1, Selected[1]);
                }
                Items1 = Math.Min(Num, Items1 + 1);
            }
            if (immediateMove)
            {
                UICursor.UpdateTargetLoc();
                UICursor.move_to_target_loc();
            }
            return(true);
        }
示例#2
0
        public WindowRankingsOverview(string chapter, Difficulty_Modes difficulty)
        {
            Chapter    = chapter;
            Difficulty = difficulty;

            initialize_sprites();
            update_black_screen();

            // Jump to chapter
            int index = Rankings.FindIndex(x => x.Key == chapter);

            Nodes.set_active_node(Nodes[index]);
            Cursor.UpdateTargetLoc();
            Cursor.move_to_target_loc();
        }
        public WindowCommandSupportViewerActor(int actorId, Vector2 loc)
        {
            Rows = LINES;

            ActorId = actorId;
            Header  = new Support_Command_Components(LINES, this.SupportsRemaining, true);
            Header.color_override = 0;

            List <string> strs = GetNames();

            initialize(loc, 8 + 16, strs);
            Window_Img.color_override = 0;
            Window_Img.set_lines(LINES, (int)Size_Offset.Y + 8);

            int width = WIDTH - 16;

            this.text_offset = new Vector2(width - (this.ColumnCount + 1) * 8, 0);
            set_columns(this.ColumnCount);
            this.size_offset = new Vector2(width - this.text_area_width, Size_Offset.Y);
            Window_Img.set_lines(LINES, (int)Size_Offset.Y + 8);

            initialize_scrollbar();
            if (Scrollbar != null)
            {
                Scrollbar.loc += new Vector2(4, 0);
            }

            // Bar
            Glow            = true;
            this.glow_width = 16;
            this.bar_offset = new Vector2(-4, 0);

            // Cursor
            UICursor.UpdateTargetLoc(ScrollOffset);
            UICursor.move_to_target_loc();
            PlayerCursor        = new Character_Sprite(Global.Content.Load <Texture2D>(@"Graphics/Characters/Cursor"));
            PlayerCursor.offset = new Vector2(4, 0 - 2);

            SetUnits();
        }