private void UpdateTooltipAndStatus() { var ErrorsList = Mod.GetErrors(); var WarningsList = Mod.GetWarnings(); if (ErrorsList.Count > 0 || WarningsList.Count > 0) { Icon = ErrorsList.Count > 0 ? StatusIconType.Error : StatusIconType.Warning; TooltipHeader.Text = "Action Required"; TooltipText.Text = ""; foreach (string error in Mod.GetErrors()) { TooltipText.Text += TooltipText.Text == "" ? "" : "\n"; TooltipText.Text += error; } foreach (string warning in Mod.GetWarnings()) { TooltipText.Text += TooltipText.Text == "" ? "" : "\n"; TooltipText.Text += warning; } return; } Icon = StatusIconType.Ok; TooltipHeader.Text = "All good"; TooltipText.Text = "This mod is setup correctly"; }
private void UpdateTooltipAndStatus() { if (Mod.RequiresUpdate) { Icon = StatusIconType.Update; TooltipHeader.Text = "Update Available"; TooltipText.Text = "This mod has an update available! Download it from Titanfall Mods via the context menu."; return; } var ErrorsList = Mod.GetErrors(); var WarningsList = Mod.GetWarnings(); if (ErrorsList.Count > 0 || WarningsList.Count > 0) { Icon = ErrorsList.Count > 0 ? StatusIconType.Error : StatusIconType.Warning; TooltipHeader.Text = "Action Required"; TooltipText.Text = ""; foreach (string error in Mod.GetErrors()) { TooltipText.Text += TooltipText.Text == "" ? "" : "\n"; TooltipText.Text += error; } foreach (string warning in Mod.GetWarnings()) { TooltipText.Text += TooltipText.Text == "" ? "" : "\n"; TooltipText.Text += warning; } return; } Icon = StatusIconType.Ok; TooltipHeader.Text = "All good"; TooltipText.Text = "This mod is up to date!"; }
public void RemoveStatus(StatusIconType status) { if (statuses.Contains(status)) { statuses.Remove(status); UpdateIcons(); } }
public void AddStatus(StatusIconType status) { if (!statuses.Contains(status)) { statuses.Add(status); UpdateIcons(); } }
public static string GetIcon(StatusIconType icon) { switch (icon) { default: case StatusIconType.Warning: return("error.png"); case StatusIconType.Ok: return("accept.png"); case StatusIconType.Error: return("exclamation.png"); case StatusIconType.Update: return("connect.png"); } }
public override void Update(GameTime gameTime) { if (!Game.IsActive || !Visible) return; var c = World.Instance.MainPlayer.ActiveCharacter; _icons = 0; if(World.Instance.ActiveMapRenderer.MapRef.IsPK) _icons |= StatusIconType.PK; if(c.SelectedSpell > 0) _icons |= StatusIconType.Spell; if(c.PaperDoll[(int)EquipLocation.Weapon] > 0) _icons |= StatusIconType.Weapon; if(c.PaperDoll[(int)EquipLocation.Shield] > 0) _icons |= StatusIconType.Shield; base.Update(gameTime); }
void UpdateIcons() { while (statuses.Count > pool.Count) { ExpandPool(); } foreach (StatusIconPoolGO poolGO in pool) { poolGO.mr.enabled = false; } for (int i = 0; i < statuses.Count; i += 1) { StatusIconType type = statuses[i]; pool[i].mr.enabled = true; pool[i].mr.material = visuals[(int)type].material; pool[i].mf.mesh = visuals[(int)type].mesh; pool[i].t.localPosition = Vector3.right * (i - (statuses.Count - 1) * .5f) * separation; } }
private Rectangle GetSourceRectangle(StatusIconType type) { //convert from power of two 'flag' value to base 10 index var index = (int)Math.Log((int) type, 2); var xOffset = _widthDelta*index; return new Rectangle(xOffset, 0, _widthDelta, _heightDelta); }