Beispiel #1
0
        // Function from file: storage.dm
        public virtual void orient2hud(dynamic user = null)
        {
            int             adjusted_contents = 0;
            ByTable         numbered_contents = null;
            Obj_Item        I         = null;
            bool            found     = false;
            NumberedDisplay ND        = null;
            int             row_num   = 0;
            int             col_count = 0;

            adjusted_contents = this.contents.len;

            if (this.display_contents_with_number)
            {
                numbered_contents = new ByTable();
                adjusted_contents = 0;

                foreach (dynamic _b in Lang13.Enumerate(this.contents, typeof(Obj_Item)))
                {
                    I = _b;

                    found = false;

                    foreach (dynamic _a in Lang13.Enumerate(numbered_contents, typeof(NumberedDisplay)))
                    {
                        ND = _a;


                        if (ND.sample_object.type == I.type)
                        {
                            ND.number++;
                            found = true;
                            break;
                        }
                    }

                    if (!found)
                    {
                        adjusted_contents++;
                        numbered_contents.Add(new NumberedDisplay(I));
                    }
                }
            }
            row_num   = 0;
            col_count = Num13.MinInt(7, ((int)(this.storage_slots ?? 0))) - 1;

            if (adjusted_contents > 7)
            {
                row_num = Num13.Floor((adjusted_contents - 1) / 7);
            }
            this.standard_orient_objs(row_num, col_count, numbered_contents);
            return;
        }
Beispiel #2
0
        // Function from file: storage.dm
        public void standard_orient_objs(int rows = 0, int cols = 0, ByTable display_contents = null)
        {
            int             cx = 0;
            int             cy = 0;
            NumberedDisplay ND = null;
            Obj             O  = null;

            cx = 4;
            cy = rows + 2;
            this.boxes.screen_loc = "4:16,2:16 to " + (cols + 4) + ":16," + (rows + 2) + ":16";

            if (this.display_contents_with_number)
            {
                foreach (dynamic _a in Lang13.Enumerate(display_contents, typeof(NumberedDisplay)))
                {
                    ND = _a;

                    ND.sample_object.mouse_opacity = 2;
                    ND.sample_object.screen_loc    = "" + cx + ":16," + cy + ":16";
                    ND.sample_object.maptext       = "<font color='white'>" + ((ND.number ?? 0) > 1 ? "" + ND.number : "") + "</font>";
                    ND.sample_object.layer         = 20;
                    cx++;

                    if (cx > cols + 4)
                    {
                        cx = 4;
                        cy--;
                    }
                }
            }
            else
            {
                foreach (dynamic _b in Lang13.Enumerate(this.contents, typeof(Obj)))
                {
                    O = _b;

                    O.mouse_opacity = 2;
                    O.screen_loc    = "" + cx + ":16," + cy + ":16";
                    O.maptext       = "";
                    O.layer         = 20;
                    cx++;

                    if (cx > cols + 4)
                    {
                        cx = 4;
                        cy--;
                    }
                }
            }
            this.closer.screen_loc = "" + (cols + 5) + ":16,2:16";
            return;
        }
        // Function from file: bags.dm
        public override void orient2hud(dynamic user = null)
        {
            int     adjusted_contents = 0;
            ByTable numbered_contents = null;
            Obj_Item_Stack_Sheet I    = null;
            NumberedDisplay      D    = null;
            int row_num   = 0;
            int col_count = 0;

            adjusted_contents = this.contents.len;

            if (this.display_contents_with_number)
            {
                numbered_contents = new ByTable();
                adjusted_contents = 0;

                foreach (dynamic _a in Lang13.Enumerate(this.contents, typeof(Obj_Item_Stack_Sheet)))
                {
                    I = _a;

                    adjusted_contents++;
                    D        = new NumberedDisplay(I);
                    D.number = I.amount;
                    numbered_contents.Add(D);
                }
            }
            row_num   = 0;
            col_count = Num13.MinInt(7, ((int)(this.storage_slots ?? 0))) - 1;

            if (adjusted_contents > 7)
            {
                row_num = Num13.Floor((adjusted_contents - 1) / 7);
            }
            this.standard_orient_objs(row_num, col_count, numbered_contents);
            return;
        }