private void DrawButtonHotkey(int actIndex, ButtonBase button, SpriteBatch spriteBatch) { var spriteFont = _uiContentStorage.GetAuxTextFont(); var text = (actIndex + 1).ToString(); var stringSize = spriteFont.MeasureString(text); var textX = button.Rect.Center.X; var textY = button.Rect.Top - stringSize.Y; spriteBatch.DrawString(spriteFont, text, new Vector2(textX, textY), Color.White); }
private void DrawMonsterInfo(IActorViewModel actorViewModel, SpriteBatch spriteBatch, int viewPortWidth, int viewPortHeight) { if (actorViewModel.Actor.Person is not MonsterPerson monsterPerson) { return; } var position = new Vector2(viewPortWidth - 100, viewPortHeight - 100); spriteBatch.DrawString(_uiContentStorage.GetAuxTextFont(), MonsterHelper.GetPerkHintText(monsterPerson), position, Color.White); var isNumbersShow = false; #if SHOW_NUMS isNumbersShow = true; #endif if (isNumbersShow) { var stats = monsterPerson.GetModule <ISurvivalModule>().Stats; var monsterCombatActModule = monsterPerson.GetModule <ICombatActModule>(); var defaultAct = monsterCombatActModule.GetCurrentCombatActs().First(); spriteBatch.DrawString(_uiContentStorage.GetAuxTextFont(), GetRollAsString(defaultAct.Efficient), position + new Vector2(0, 16), Color.White); for (var statIndex = 0; statIndex < stats.Length; statIndex++) { var stat = stats[statIndex]; var offsetY = statIndex * 16; var statPosition = new Vector2(0, 32 + offsetY); var statText = $"{stat.Type} - {stat.Value} ({stat.ValueShare:0.##})"; spriteBatch.DrawString(_uiContentStorage.GetAuxTextFont(), statText, position + statPosition, Color.White); } } }