Пример #1
0
 private void cmbBonfire_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (loaded && !reading)
     {
         DSRBonfire bonfire = cmbBonfire.SelectedItem as DSRBonfire;
         Hook.LastBonfire = bonfire.ID;
     }
 }
Пример #2
0
        private void updatePlayer()
        {
            nudHealth.Value     = Hook.Health;
            nudHealthMax.Value  = Hook.HealthMax;
            nudStamina.Value    = Hook.Stamina;
            nudStaminaMax.Value = Hook.StaminaMax;

            try
            {
                Hook.GetPosition(out float x, out float y, out float z, out float angle);
                nudPosX.Value     = (decimal)x;
                nudPosY.Value     = (decimal)y;
                nudPosZ.Value     = (decimal)z;
                nudPosAngle.Value = angleToDegree(angle);

                Hook.GetStablePosition(out x, out y, out z, out angle);
                nudStableX.Value     = (decimal)x;
                nudStableY.Value     = (decimal)y;
                nudStableZ.Value     = (decimal)z;
                nudStableAngle.Value = angleToDegree(angle);
            }
            catch (OverflowException)
            {
                nudPosX.Value     = 0;
                nudPosY.Value     = 0;
                nudPosZ.Value     = 0;
                nudPosAngle.Value = 0;

                nudStableX.Value     = 0;
                nudStableY.Value     = 0;
                nudStableZ.Value     = 0;
                nudStableAngle.Value = 0;
            }

            cbxDeathCam.Checked = Hook.DeathCam;
            if (cbxSpeed.Checked)
            {
                Hook.AnimSpeed = (float)nudSpeed.Value;
            }

            int        bonfireID   = Hook.LastBonfire;
            DSRBonfire lastBonfire = cmbBonfire.SelectedItem as DSRBonfire;

            if (!cmbBonfire.DroppedDown && bonfireID != lastBonfire.ID && !unknownBonfires.Contains(bonfireID))
            {
                DSRBonfire thisBonfire = null;
                foreach (object item in cmbBonfire.Items)
                {
                    DSRBonfire bonfire = item as DSRBonfire;
                    if (bonfireID == bonfire.ID)
                    {
                        thisBonfire = bonfire;
                        break;
                    }
                }

                if (thisBonfire == null)
                {
                    unknownBonfires.Add(bonfireID);
                    MessageBox.Show("Unknown bonfire ID, please report me: " + bonfireID, "Unknown Bonfire");
                }
                else
                {
                    cmbBonfire.SelectedItem = thisBonfire;
                }
            }
        }