public void DrawBuff(Graphics g, int roundKey) { MemBaseBuff[] copybuffs = new MemBaseBuff[buffDict.Count]; buffDict.Values.CopyTo(copybuffs, 0); if (copybuffs.Length >= 1 && roundKey % 2 == 0) { int index = 0; int wid = 100 / copybuffs.Length; foreach (var buff in copybuffs) { var color = BuffBook.GetBuffColor(buff.Id); var brush = new SolidBrush(color); if (index == copybuffs.Length - 1)//最后一个 { g.FillRectangle(brush, wid * index, 0, 100 - wid * (index - 1), 100); } else { g.FillRectangle(brush, wid * index, 0, wid, 100); } brush.Dispose(); g.DrawImage(BuffBook.GetBuffImage(buff.Id, (buff.RoundMark / 3) % 2), new Rectangle(wid * index + (wid - 20) / 2, 40, 20, 20), new Rectangle(0, 0, 20, 20), GraphicsUnit.Pixel); index++; } } }
public void DrawBuffToolTip(TipImage tipData) { MemBaseBuff[] memBasebuffInfos = new MemBaseBuff[buffDict.Count]; buffDict.Values.CopyTo(memBasebuffInfos, 0); foreach (MemBaseBuff buffdata in memBasebuffInfos) { Buff buff = buffdata.BuffInfo; string tp = ""; if (buff.BuffConfig.Type[1] == 's') { tp = string.Format("{0}(剩余{1:0.0}回合)", buff.BuffConfig.Name, buffdata.TimeLeft); } else if (buff.BuffConfig.Type[1] == 'a') { tp = string.Format("{0}({1})", buff.BuffConfig.Name, buff.Descript); } tipData.AddImageNewLine(BuffBook.GetBuffImage(buffdata.Id, 0)); tipData.AddText(tp, BuffBook.GetBuffColor(buffdata.Id)); } }