Example #1
0
        public void Init(Rect screenRect, bool showFrame, bool selectable, List <Item> cards, IListCallback callback, GUIContent buttonLeftContent, GUIContent buttonRightContent, bool leftButtonEnabled, bool rightButtonEnabled, bool leftHighlightable, bool rightHighlightable, Texture itemButtonTexture, bool clickableItems, bool rightrightbutton)
        {
            this.showFrame          = showFrame;
            this.selectable         = selectable;
            this.cards              = cards;
            this.callback           = callback;
            this.buttonLeftContent  = buttonLeftContent;
            this.buttonRightContent = buttonRightContent;
            this.leftButtonEnabled  = leftButtonEnabled;
            this.rightButtonEnabled = rightButtonEnabled;
            this.itemButtonTexture  = itemButtonTexture;
            this.leftHighlightable  = leftHighlightable;
            this.rightHighlightable = rightHighlightable;
            this.clickableItems     = clickableItems;
            if (showFrame)
            {
                this.margins = new Vector4(12f, 12f, 12f, 12f + this.BOTTOM_MARGIN_EXTRA);
            }
            else
            {
                this.margins = new Vector4(0f, 0f, 0f, 0f + this.BOTTOM_MARGIN_EXTRA);
            }
            this.outerRect   = screenRect;
            this.innerBGRect = new Rect(this.outerRect.x + this.margins.x, this.outerRect.y + this.margins.y, this.outerRect.width - (this.margins.x + this.margins.z), this.outerRect.height - (this.margins.y + this.margins.w));
            float num = 0.005f * Screen.width;

            this.innerRect = new Rect(this.innerBGRect.x + num, this.innerBGRect.y + num, this.innerBGRect.width - (2f * num), this.innerBGRect.height - (2f * num));
            float height = this.BOTTOM_MARGIN_EXTRA - (0.01f * Screen.height);

            this.buttonLeftRect  = new Rect(this.innerRect.x + (this.innerRect.width * 0.03f), this.innerBGRect.yMax + (height * 0.28f), this.innerRect.width * 0.45f, height);
            this.buttonRightRect = new Rect(this.innerRect.xMax - (this.innerRect.width * 0.48f), this.innerBGRect.yMax + (height * 0.28f), this.innerRect.width * 0.45f, height);
            float num3 = (((float)Screen.height) / ((float)Screen.width)) * 0.25f;

            this.fieldHeight = (this.innerRect.width - this.scrollBarSize) / ((1f / num3) + 1f);
            //this.costIconSize = this.fieldHeight;
            //this.costIconWidth = this.fieldHeight / 2f;
            //this.costIconHeight = (this.costIconWidth * 72f) / 73f;
            this.cardHeight       = this.fieldHeight * 0.72f;
            this.cardWidth        = (this.cardHeight * 100f) / 75f;
            this.labelX           = this.fieldHeight + (this.cardWidth * 1.45f);
            this.labelsWidth      = ((this.innerRect.width - this.labelX) /*- this.costIconSize*/) - this.scrollBarSize;
            this.maxCharsName     = (int)(this.labelsWidth / 12f);
            this.maxCharsRK       = (int)(this.labelsWidth / 10f);
            this.rightrightbutton = rightrightbutton;
        }
 public void Init(Rect screenRect, bool showFrame, bool selectable, List<Item> cards, IListCallback callback, GUIContent buttonLeftContent, GUIContent buttonRightContent, bool leftButtonEnabled, bool rightButtonEnabled, bool leftHighlightable, bool rightHighlightable, Texture itemButtonTexture, bool clickableItems, bool rightrightbutton)
 {
     this.showFrame = showFrame;
     this.selectable = selectable;
     this.cards = cards;
     this.callback = callback;
     this.buttonLeftContent = buttonLeftContent;
     this.buttonRightContent = buttonRightContent;
     this.leftButtonEnabled = leftButtonEnabled;
     this.rightButtonEnabled = rightButtonEnabled;
     this.itemButtonTexture = itemButtonTexture;
     this.leftHighlightable = leftHighlightable;
     this.rightHighlightable = rightHighlightable;
     this.clickableItems = clickableItems;
     if (showFrame)
     {
     this.margins = new Vector4(12f, 12f, 12f, 12f + this.BOTTOM_MARGIN_EXTRA);
     }
     else
     {
     this.margins = new Vector4(0f, 0f, 0f, 0f + this.BOTTOM_MARGIN_EXTRA);
     }
     this.outerRect = screenRect;
     this.innerBGRect = new Rect(this.outerRect.x + this.margins.x, this.outerRect.y + this.margins.y, this.outerRect.width - (this.margins.x + this.margins.z), this.outerRect.height - (this.margins.y + this.margins.w));
     float num = 0.005f * Screen.width;
     this.innerRect = new Rect(this.innerBGRect.x + num, this.innerBGRect.y + num, this.innerBGRect.width - (2f * num), this.innerBGRect.height - (2f * num));
     float height = this.BOTTOM_MARGIN_EXTRA - (0.01f * Screen.height);
     this.buttonLeftRect = new Rect(this.innerRect.x + (this.innerRect.width * 0.03f), this.innerBGRect.yMax + (height * 0.28f), this.innerRect.width * 0.45f, height);
     this.buttonRightRect = new Rect(this.innerRect.xMax - (this.innerRect.width * 0.48f), this.innerBGRect.yMax + (height * 0.28f), this.innerRect.width * 0.45f, height);
     float num3 = (((float) Screen.height) / ((float) Screen.width)) * 0.25f;
     this.fieldHeight = (this.innerRect.width - this.scrollBarSize) / ((1f / num3) + 1f);
     //this.costIconSize = this.fieldHeight;
     //this.costIconWidth = this.fieldHeight / 2f;
     //this.costIconHeight = (this.costIconWidth * 72f) / 73f;
     this.cardHeight = this.fieldHeight * 0.72f;
     this.cardWidth = (this.cardHeight * 100f) / 75f;
     this.labelX = this.fieldHeight + (this.cardWidth * 1.45f);
     this.labelsWidth = ((this.innerRect.width - this.labelX) /*- this.costIconSize*/) - this.scrollBarSize;
     this.maxCharsName = (int) (this.labelsWidth / 12f);
     this.maxCharsRK = (int) (this.labelsWidth / 10f);
     this.rightrightbutton = rightrightbutton;
 }
 public Builder SetAdapter(IListAdapter adapter, IListCallback callback)
 {
     if (this.CustomView != null)
         throw new InvalidOperationException("You cannot set adapter() when you're using a custom view.");
     this.Adapter = adapter;
     this.ListCallbackCustom = callback;
     return this;
 }
 public Builder SetItemsCallback(IListCallback callback)
 {
     this.ListCallback = callback;
     this.ListCallbackSingleChoice = null;
     this.ListCallbackMultiChoice = null;
     return this;
 }