public void useBannerMenu(BannerButton banner, GameObject prev, GameObject current) { usingBannerMenu = true; this.banner = banner; this.prev = prev; this.current = current; prev.SetActive(false); current.SetActive(true); gameObject.SetActive(true); }
public void show(BannerButton bannerButton, GameOverBanner another = null) { overlay = transform.Find("Overlay"); contents = transform.Find("Contents").gameObject; positionX = contents.GetComponent<RectTransform>().anchoredPosition.x; distance = Mathf.Abs(positionX - positionXEnd); if (another == null) { status++; isLast = false; } else { waiting = true; waitingTarget = another; contents.GetComponent<Text>().text = bannerButton.getDescription(); } bannerButton.transform.SetParent(contents.transform, false); }
void ReleaseDesignerOutlets() { if (BannerButton != null) { BannerButton.Dispose(); BannerButton = null; } if (InterstitialButton != null) { InterstitialButton.Dispose(); InterstitialButton = null; } if (LoadButton != null) { LoadButton.Dispose(); LoadButton = null; } if (VideoButton != null) { VideoButton.Dispose(); VideoButton = null; } }
public BuyDialog(int featureLicenceId, string featureTitle, Gtk.Window parent) : base() { this.featureTitle = featureTitle; this.featureLicenceId = featureLicenceId; this.HasSeparator = false; if (parent != null) { this.TransientFor = parent; } this.WidthRequest = 570; this.HeightRequest = 450; this.ModifyBg(Gtk.StateType.Normal, Style.White); string userLicenceId = "-100"; if (MainClass.User != null) { userLicenceId = MainClass.User.LicenseId; } int iTyp = 0; if (!Int32.TryParse(userLicenceId, out iTyp)) { iTyp = -100; } featureLicence = MainClass.LicencesSystem.GetLicence(this.featureLicenceId.ToString()); handCursor = new Gdk.Cursor(Gdk.CursorType.Hand2); regularCursor = new Gdk.Cursor(Gdk.CursorType.Xterm); viewHeader = new TextView(); viewHeader.CanFocus = false; TextBuffer buffer = viewHeader.Buffer; viewFooter = new TextView(); TextBuffer buffer2 = viewFooter.Buffer; viewFooter.KeyPressEvent += new KeyPressEventHandler(KeyPress); viewFooter.WidgetEventAfter += new WidgetEventAfterHandler(EventAfter); viewFooter.MotionNotifyEvent += new MotionNotifyEventHandler(MotionNotify); viewFooter.HeightRequest = 15; viewFooter.CanFocus = false; viewTable = new TextView(); viewTable.CanFocus = false; TextBuffer buffer3 = viewTable.Buffer; ScrolledWindow sw = new ScrolledWindow(); sw.SetPolicy(PolicyType.Automatic, PolicyType.Automatic); sw.HeightRequest = 115; sw.Add(viewHeader); ScrolledWindow sw2 = new ScrolledWindow(); sw2.SetPolicy(PolicyType.Automatic, PolicyType.Automatic); sw2.HeightRequest = 15; sw2.Add(viewFooter); ScrolledWindow sw3 = new ScrolledWindow(); sw3.SetPolicy(PolicyType.Automatic, PolicyType.Automatic); sw3.Add(viewTable); CreateTags(buffer); CreateTags(buffer2); CreateTags(buffer3); InsertTextHeader(buffer); InsertTextFooter(buffer2); InsertTextTable(buffer3); Table tbl = new Table(4, 1, false); if (MainClass.Platform.IsMac) { tbl.BorderWidth = 20; } else { tbl.BorderWidth = 6; } BannerButton btnBuy = new BannerButton(); btnBuy.ModifyBase(StateType.Normal, new Gdk.Color(109, 158, 24)); btnBuy.ModifyBg(StateType.Normal, new Color(109, 158, 24)); btnBuy.HeightRequest = 38; btnBuy.WidthRequest = 170; string buyPath = System.IO.Path.Combine(MainClass.Paths.ResDir, "btnBuy.png"); btnBuy.ButtonPressEvent += delegate(object o, ButtonPressEventArgs args) { string url = "http://moscrif.com/download?t={0}"; if (MainClass.User != null && (!String.IsNullOrEmpty(MainClass.User.Token))) { url = string.Format(url, MainClass.User.Token); } System.Diagnostics.Process.Start(url); this.Respond(Gtk.ResponseType.Ok); }; btnBuy.ImageIcon = new Pixbuf(buyPath); BannerButton btnCancel = new BannerButton(); btnCancel.HeightRequest = 38; btnCancel.WidthRequest = 170; string cancelPath = System.IO.Path.Combine(MainClass.Paths.ResDir, "btnCancel.png"); btnCancel.ImageIcon = new Pixbuf(cancelPath); btnCancel.ButtonPressEvent += delegate(object o, ButtonPressEventArgs args) { this.Respond(Gtk.ResponseType.Cancel); }; Table tblButton = new Table(1, 4, false); tblButton.ColumnSpacing = 12; tblButton.BorderWidth = 6; tblButton.Attach(new Label(""), 0, 1, 0, 1, AttachOptions.Expand, AttachOptions.Expand, 0, 0); tblButton.Attach(btnCancel, 1, 2, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); tblButton.Attach(btnBuy, 2, 3, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0); tblButton.Attach(new Label(""), 3, 4, 0, 1, AttachOptions.Expand, AttachOptions.Expand, 0, 0); tbl.Attach(sw, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0); tbl.Attach(sw3, 0, 1, 1, 2, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill | AttachOptions.Expand, 0, 0); tbl.Attach(tblButton, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 0, 0); tbl.Attach(sw2, 0, 1, 3, 4, AttachOptions.Fill, AttachOptions.Shrink, 0, 0); tbl.ShowAll(); this.VBox.Add(tbl); this.ShowAll(); }