public static void RefreshQuestInterfaceOnCurrentPage() { try { dynamic p = GameAssets.CurrentPage; HeroStatsPage statsPage = p.StatsFrame.Content; statsPage.UpdateQuestTimer(); } catch (RuntimeBinderException) { // No stats frame on this page! // Best solution according to: // https://stackoverflow.com/a/5768449/14770235 } catch (NullReferenceException) { // This might be necessary instead of the above with the new approach. } }
public static void RefreshBlessingInterfaceOnCurrentPage(BlessingType blessingType) { try { dynamic p = GameAssets.CurrentPage; HeroStatsPage statsPage = p.StatsFrame.Content; statsPage.UpdateBlessingTimer(); switch (blessingType) { case BlessingType.ClickDamage: statsPage.GenerateStatValueDamageToolTip(); break; case BlessingType.CritChance or BlessingType.CritDamage: statsPage.GenerateStatValueCritToolTip(); break; case BlessingType.PoisonDamage: statsPage.GenerateStatValuePoisonToolTip(); break; case BlessingType.AuraDamage or BlessingType.AuraSpeed: statsPage.GenerateStatValueAuraToolTip(); break; } } catch (RuntimeBinderException) { // No stats frame on this page! // Best solution according to: // https://stackoverflow.com/a/5768449/14770235 } catch (NullReferenceException) { // This might be necessary instead of the above with the new approach. } }
public static void RefreshStatsAndEquipmentPanelsOnCurrentPage() { try { dynamic p = GameAssets.CurrentPage; HeroStatsPage statsPage = p.StatsFrame.Content; statsPage.RefreshAllDynamicStatsAndToolTips(); EquipmentPage equipmentPage = p.EquipmentFrame.Content; equipmentPage.ChangeActiveTab(); equipmentPage.RefreshCurrentEquipmentTab(); } catch (RuntimeBinderException) { // No stats frame on this page! // Best solution according to: // https://stackoverflow.com/a/5768449/14770235 } catch (NullReferenceException) { // This might be necessary instead of the above with the new approach. } }