private static int GetStand(StandOptions opts) { if (!AMSTools.FileOK(opts.FileName)) { return(-1); } try { string uri = Parameters.AMS_REST_SERVICE_URI + $"{Parameters.APT_CODE}/Stands"; string result = AMSTools.GetRestURI(uri).Result; XElement xmlRoot = XDocument.Parse(result).Root; XElement db = (from n in xmlRoot.Descendants() where (n.Name == "FixedResource" && n.Elements("Name").FirstOrDefault().Value == opts.Stand) select n).FirstOrDefault <XElement>(); if (db == null) { Console.WriteLine($"Stand {opts.Stand} not found"); return(-1); } AMSTools.Out(AMSTools.PrintXML(db.ToString()), opts.FileName); } catch (Exception e) { Console.WriteLine(e.Message); } return(1); }
void ReadSettings() { Action = (ActionOptions)Settings.Default.Action; Guard = (GuardOptions)Settings.Default.Guard; Stand = (StandOptions)Settings.Default.Stand; CounterHit = (CounterHitOptions)Settings.Default.CounterHit; Stun = (StunOptions)Settings.Default.Stun; SAGauge = (SAGaugeOptions)Settings.Default.SAGauge; AttackData = (AttackDataOptions)Settings.Default.AttackData; InputDisplay = (InputDisplayOptions)Settings.Default.InputDisplay; LagSimulation = Settings.Default.LagSimulation; dgvPlayer1.Visible = (InputDisplay != InputDisplayOptions.Off); lblComboDamage.Visible = lblComboDamageT.Visible = lblLastDamage.Visible = lblLastDamageT.Visible = lblMaxCombo.Visible = lblMaxComboT.Visible /*= lblMaxDamage.Visible = lblMaxDamageT.Visible */ = (AttackData == AttackDataOptions.On); lblComboDamage.Text = "0 (0%)"; switch (InputDisplay) { case InputDisplayOptions.Off: dgvPlayer1.Rows.Clear(); dgvPlayer2.Rows.Clear(); formWidth = 180; break; case InputDisplayOptions.On: formWidth = 180; dgvPlayer2.Rows.Clear(); break; case InputDisplayOptions.Dual: formWidth = 360; break; } SetWindowPos(this.Handle, Game.Window, Game.WindowCoords.Left - formWidth, Game.WindowCoords.Top, formWidth, Game.WindowCoords.Height, SWP_SHOWWINDOW); if (AttackData == AttackDataOptions.On) { MaxDamage = 0; MaxComboLength = 0; P2HealthBeforeCurrentCombo = 160; DateTime LastComboEndedTime = DateTime.Now.AddDays(99); } KeyboardManager.LoadStateOnPlayback = Settings.Default.LoadStateOnPlayback; }