private void InitializeComponent() { new ComponentResourceManager(typeof(FreeCardsPopup)); this.freeCardsPanel = new FreeCardsPanel(); base.SuspendLayout(); this.freeCardsPanel.Location = new Point(0, 0); this.freeCardsPanel.Name = "freeCardsPanel"; this.freeCardsPanel.PanelActive = true; this.freeCardsPanel.Size = new Size(0x3e8, 600); this.freeCardsPanel.StoredGraphics = null; this.freeCardsPanel.TabIndex = 0; base.AutoScaleDimensions = new SizeF(6f, 13f); base.AutoScaleMode = AutoScaleMode.None; base.ClientSize = new Size(0x3e8, 600); base.ControlBox = false; base.Controls.Add(this.freeCardsPanel); base.FormBorderStyle = FormBorderStyle.None; base.Icon = Resources.shk_icon; base.MaximizeBox = false; this.MaximumSize = new Size(0x3e8, 600); base.MinimizeBox = false; this.MinimumSize = new Size(0x3e8, 600); base.Name = "FreeCardsPopup"; base.ShowIcon = false; base.ShowInTaskbar = false; base.StartPosition = FormStartPosition.Manual; this.Text = "Free Cards"; base.TransparencyKey = ARGBColors.Fuchsia; base.ResumeLayout(false); }
public void revealCard() { _lastInstance = this; XmlRpcCardsProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressCards, URLs.ProfileServerPort, URLs.ProfileCardPath).getFreeCard(new XmlRpcCardsRequest(RemoteServices.Instance.UserGuid.ToString().Replace("-", "")), new CardsEndResponseDelegate(FreeCardsPanel.revealCardCallback), this); this.revealButton.Enabled = false; }
public static void revealCardCallback(ICardsProvider provider, ICardsResponse response) { if (response.SuccessCode.Value == 1) { try { int? nullable3; int? nullable5; int? nullable7; int? nullable9; int? nullable11; int? nullable13; int? nullable15; int? nullable17; int? nullable19; int? nullable21; if (_lastInstance != null) { try { _lastInstance.Invoke(new CardsEndResponseDelegate(_lastInstance.revealCardCallbackPanel), new object[] { provider, response }); } catch (Exception) { } _lastInstance = null; } GFXLibrary.Instance.closeBigCardsLoader(); bool[] flagArray2 = new bool[10]; nullable3 = null; nullable5 = null; nullable7 = null; nullable9 = null; nullable11 = null; nullable13 = null; nullable15 = null; nullable17 = null; nullable19 = null; nullable21 = null; if (((XmlRpcCardsResponse) response).VeteranLevel1.HasValue) { nullable3 = ((XmlRpcCardsResponse) response).VeteranLevel1; } flagArray2[0] = (nullable3.GetValueOrDefault() == 1) && nullable3.HasValue; if (((XmlRpcCardsResponse) response).VeteranLevel2.HasValue) { nullable5 = ((XmlRpcCardsResponse) response).VeteranLevel2; } flagArray2[1] = (nullable5.GetValueOrDefault() == 1) && nullable5.HasValue; if (((XmlRpcCardsResponse) response).VeteranLevel3.HasValue) { nullable7 = ((XmlRpcCardsResponse) response).VeteranLevel3; } flagArray2[2] = (nullable7.GetValueOrDefault() == 1) && nullable7.HasValue; if (((XmlRpcCardsResponse) response).VeteranLevel4.HasValue) { nullable9 = ((XmlRpcCardsResponse) response).VeteranLevel4; } flagArray2[3] = (nullable9.GetValueOrDefault() == 1) && nullable9.HasValue; if (((XmlRpcCardsResponse) response).VeteranLevel5.HasValue) { nullable11 = ((XmlRpcCardsResponse) response).VeteranLevel5; } flagArray2[4] = (nullable11.GetValueOrDefault() == 1) && nullable11.HasValue; if (((XmlRpcCardsResponse) response).VeteranLevel6.HasValue) { nullable13 = ((XmlRpcCardsResponse) response).VeteranLevel6; } flagArray2[5] = (nullable13.GetValueOrDefault() == 1) && nullable13.HasValue; if (((XmlRpcCardsResponse) response).VeteranLevel7.HasValue) { nullable15 = ((XmlRpcCardsResponse) response).VeteranLevel7; } flagArray2[6] = (nullable15.GetValueOrDefault() == 1) && nullable15.HasValue; if (((XmlRpcCardsResponse) response).VeteranLevel8.HasValue) { nullable17 = ((XmlRpcCardsResponse) response).VeteranLevel8; } flagArray2[7] = (nullable17.GetValueOrDefault() == 1) && nullable17.HasValue; if (((XmlRpcCardsResponse) response).VeteranLevel9.HasValue) { nullable19 = ((XmlRpcCardsResponse) response).VeteranLevel9; } flagArray2[8] = (nullable19.GetValueOrDefault() == 1) && nullable19.HasValue; if (((XmlRpcCardsResponse) response).VeteranLevel10.HasValue) { nullable21 = ((XmlRpcCardsResponse) response).VeteranLevel10; } flagArray2[9] = (nullable21.GetValueOrDefault() == 1) && nullable21.HasValue; bool[] stages = flagArray2; GameEngine.Instance.World.importFreeCardData(((XmlRpcCardsResponse) response).VeteranCurrentLevel.Value, stages, DateTime.Now.AddSeconds((double) ((XmlRpcCardsResponse) response).VeteranSecondsLeft.Value), DateTime.Now); } catch (Exception exception) { MyMessageBox.Show(exception.Message, SK.Text("GENERIC_Error", "Error")); } } else { MyMessageBox.Show(response.Message, SK.Text("FreeCardsPanel_Cannot_Free_Card", "Could not get free card.")); } }