public static void ShowSignIn(int paneCount, bool onlineOnly) { // if (paneCount != 1) { // new ArgumentException ("paneCount Can only be 1 on iPhone"); // return; // } if (isVisible) { return; } // We clear the key cache state here to prevent any extraneous keys from // corrupting the key states from the time we call the method // to the time it is actually shown. This seems to be caused because // we are interrupting the normal flow the game update logic. Window.ClearKeyCacheState(); MonoGameGamerServicesHelper.ShowSigninSheet(); if (GamerServicesComponent.LocalNetworkGamer == null) { GamerServicesComponent.LocalNetworkGamer = new LocalNetworkGamer(); } else { GamerServicesComponent.LocalNetworkGamer.SignedInGamer.BeginAuthentication(null, null); } }
void profileSelected() { if (tableView.SelectedRowCount > 0) { var rowSelected = tableView.SelectedRow; SignedInGamer sig = new SignedInGamer(); sig.DisplayName = gamerList[(int)rowSelected].DisplayName; sig.Gamertag = gamerList[(int)rowSelected].Gamertag; sig.InternalIdentifier = gamerList[(int)rowSelected].PlayerInternalIdentifier; Gamer.SignedInGamers.Add(sig); } MonoGameGamerServicesHelper.SerializeProfiles(gamerList); NSApp.StopModal(); }
public static void ShowSignIn(int paneCount, bool onlineOnly) { if (paneCount != 1 && paneCount != 2 && paneCount != 4) { ArgumentException argumentException = new ArgumentException("paneCount Can only be 1, 2 or 4 on Windows"); } else { MonoGameGamerServicesHelper.ShowSigninSheet(); if (GamerServicesComponent.LocalNetworkGamer == null) { GamerServicesComponent.LocalNetworkGamer = new LocalNetworkGamer(); } else { GamerServicesComponent.LocalNetworkGamer.SignedInGamer.BeginAuthentication((AsyncCallback)null, (object)null); } } }
public static void ShowSignIn(int paneCount, bool onlineOnly) { if (paneCount != 1) { new ArgumentException("paneCount Can only be 1 on iPhone"); return; } MonoGameGamerServicesHelper.ShowSigninSheet(); if (GamerServicesComponent.LocalNetworkGamer == null) { GamerServicesComponent.LocalNetworkGamer = new LocalNetworkGamer(); } else { GamerServicesComponent.LocalNetworkGamer.SignedInGamer.BeginAuthentication(null, null); } }
internal static void Initialise(Game game) { #if !DIRECTX MonoGameGamerServicesHelper.Initialise(game); #endif }
internal static void Initialise(Game game) { MonoGameGamerServicesHelper.Initialise(game); }
// Shared initialization code void Initialize() { //window = new NSWindow(new RectangleF(0,0, 470, 250), NSWindowStyle.Titled | NSWindowStyle.Closable, NSBackingStore.Buffered, false); window = new NSWindow(new RectF(0, 0, 470, 250), NSWindowStyle.Titled, NSBackingStore.Buffered, false); window.HasShadow = true; NSView content = window.ContentView; window.WindowController = this; window.Title = "Sign In"; NSTextField signInLabel = new NSTextField(new RectF(17, 190, 109, 17)); signInLabel.StringValue = "Sign In:"; signInLabel.Editable = false; signInLabel.Bordered = false; signInLabel.BackgroundColor = NSColor.Control; content.AddSubview(signInLabel); // Create our select button selectButton = new NSButton(new RectF(358, 12, 96, 32)); selectButton.Title = "Select"; selectButton.SetButtonType(NSButtonType.MomentaryPushIn); selectButton.BezelStyle = NSBezelStyle.Rounded; selectButton.Activated += delegate { profileSelected(); }; selectButton.Enabled = false; content.AddSubview(selectButton); // Setup our table view NSScrollView tableContainer = new NSScrollView(new RectF(20, 60, 428, 123)); tableContainer.BorderType = NSBorderType.BezelBorder; tableContainer.AutohidesScrollers = true; tableContainer.HasVerticalScroller = true; tableView = new NSTableView(new RectF(0, 0, 420, 123)); tableView.UsesAlternatingRowBackgroundColors = true; NSTableColumn colGamerTag = new NSTableColumn("Gamer"); tableView.AddColumn(colGamerTag); colGamerTag.Width = 420; colGamerTag.HeaderCell.Title = "Gamer Profile"; tableContainer.DocumentView = tableView; content.AddSubview(tableContainer); // Create our add button NSButton addButton = new NSButton(new RectF(20, 27, 25, 25)); //Console.WriteLine(NSImage.AddTemplate); addButton.Image = NSImage.ImageNamed("NSAddTemplate"); addButton.SetButtonType(NSButtonType.MomentaryPushIn); addButton.BezelStyle = NSBezelStyle.SmallSquare; addButton.Activated += delegate { addLocalPlayer(); }; content.AddSubview(addButton); // Create our remove button NSButton removeButton = new NSButton(new RectF(44, 27, 25, 25)); removeButton.Image = NSImage.ImageNamed("NSRemoveTemplate"); removeButton.SetButtonType(NSButtonType.MomentaryPushIn); removeButton.BezelStyle = NSBezelStyle.SmallSquare; removeButton.Activated += delegate { removeLocalPlayer(); }; content.AddSubview(removeButton); gamerList = MonoGameGamerServicesHelper.DeserializeProfiles(); // for (int x= 1; x< 25; x++) { // gamerList.Add("Player " + x); // } tableView.DataSource = new GamersDataSource(this); tableView.Delegate = new GamersTableDelegate(this); }