Skip to content

Commit

Permalink
Update CharaSim for CMST.121
Browse files Browse the repository at this point in the history
  • Loading branch information
Kagamia committed Jan 2, 2017
1 parent f0845fc commit 459b75e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
6 changes: 6 additions & 0 deletions WzComparerR2.Common/CharaSim/Item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public Item()
this.Specs = new Dictionary<ItemSpecType, int>();
}

public int Level { get; set; }

public Dictionary<ItemPropType, int> Props { get; private set; }
public Dictionary<ItemSpecType, int> Specs { get; private set; }

Expand Down Expand Up @@ -94,6 +96,10 @@ public static Item CreateFromNode(Wz_Node node, GlobalFindNodeFunction findNode)
}
break;

case "lv":
item.Level = Convert.ToInt32(subNode.Value);
break;

default:
ItemPropType type;
if (Enum.TryParse(subNode.Text, out type))
Expand Down
4 changes: 2 additions & 2 deletions WzComparerR2/CharaSimControl/GearTooltipRender2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -654,11 +654,11 @@ private Bitmap RenderBase(out int picH)
}
if (!string.IsNullOrEmpty(sr.Desc))
{
GearGraphics.DrawString(g, sr.Desc, GearGraphics.ItemDetailFont2, 11, 247, ref picH, 16);
GearGraphics.DrawString(g, sr.Desc, GearGraphics.ItemDetailFont2, 11, 245, ref picH, 16);
}
foreach (string str in desc)
{
GearGraphics.DrawString(g, str, GearGraphics.ItemDetailFont, 11, 247, ref picH, 16);
GearGraphics.DrawString(g, str, GearGraphics.ItemDetailFont, 11, 245, ref picH, 16);
}
picH += 5;
}
Expand Down
14 changes: 12 additions & 2 deletions WzComparerR2/CharaSimControl/ItemTooltipRender2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,19 @@ private Bitmap RenderItem(out int picH)

int right = tooltip.Width - 18;

if (!string.IsNullOrEmpty(sr.Desc))
string desc = null;
if (item.Level > 0)
{
GearGraphics.DrawString(g, sr.Desc + sr.AutoDesc, GearGraphics.ItemDetailFont2, 98, right, ref picH, 16);
desc += $"[LV.{item.Level}] ";
}
desc += sr.Desc;
if (!string.IsNullOrEmpty(desc))
{
GearGraphics.DrawString(g, desc, GearGraphics.ItemDetailFont2, 98, right, ref picH, 16);
}
if (!string.IsNullOrEmpty(sr.AutoDesc))
{
GearGraphics.DrawString(g, sr.AutoDesc, GearGraphics.ItemDetailFont2, 98, right, ref picH, 16);
}
if (item.Props.TryGetValue(ItemPropType.tradeAvailable, out value) && value > 0)
{
Expand Down
18 changes: 9 additions & 9 deletions WzComparerR2/CharaSimControl/SkillTooltipRender2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,21 @@ private Bitmap RenderSkill(out int picH)
//绘制desc
picH = 35;
if (!Skill.PreBBSkill)
GearGraphics.DrawString(g, "[最高等级:" + Skill.MaxLevel + "]", GearGraphics.ItemDetailFont2, 92, 272, ref picH, 16);
GearGraphics.DrawString(g, "[最高等级:" + Skill.MaxLevel + "]", GearGraphics.ItemDetailFont2, 90, 270, ref picH, 16);

if (sr.Desc != null)
{
string hdesc = SummaryParser.GetSkillSummary(sr.Desc, Skill.Level, Skill.Common, SummaryParams.Default);
//string hStr = SummaryParser.GetSkillSummary(skill, skill.Level, sr, SummaryParams.Default);
GearGraphics.DrawString(g, hdesc, GearGraphics.ItemDetailFont2, 92, 272, ref picH, 16);
GearGraphics.DrawString(g, hdesc, GearGraphics.ItemDetailFont2, 90, 270, ref picH, 16);
}
if (Skill.ReqLevel > 0)
{
GearGraphics.DrawString(g, "#c[要求等级:" + Skill.ReqLevel.ToString() + "]#", GearGraphics.ItemDetailFont2, 92, 272, ref picH, 16);
GearGraphics.DrawString(g, "#c[要求等级:" + Skill.ReqLevel.ToString() + "]#", GearGraphics.ItemDetailFont2, 90, 270, ref picH, 16);
}
if (Skill.ReqAmount > 0)
{
GearGraphics.DrawString(g, "#c" + ItemStringHelper.GetSkillReqAmount(Skill.SkillID, Skill.ReqAmount) + "#", GearGraphics.ItemDetailFont2, 92, 272, ref picH, 16);
GearGraphics.DrawString(g, "#c" + ItemStringHelper.GetSkillReqAmount(Skill.SkillID, Skill.ReqAmount) + "#", GearGraphics.ItemDetailFont2, 90, 270, ref picH, 16);
}

//分割线
Expand All @@ -117,20 +117,20 @@ private Bitmap RenderSkill(out int picH)
if (Skill.Level > 0)
{
string hStr = SummaryParser.GetSkillSummary(Skill, Skill.Level, sr, SummaryParams.Default);
GearGraphics.DrawString(g, "[现在等级 " + Skill.Level + "]", GearGraphics.ItemDetailFont, 10, 274, ref picH, 16);
GearGraphics.DrawString(g, "[现在等级 " + Skill.Level + "]", GearGraphics.ItemDetailFont, 8, 272, ref picH, 16);
if (hStr != null)
{
GearGraphics.DrawString(g, hStr, GearGraphics.ItemDetailFont2, 10, 274, ref picH, 16);
GearGraphics.DrawString(g, hStr, GearGraphics.ItemDetailFont2, 8, 272, ref picH, 16);
}
}

if (Skill.Level < Skill.MaxLevel)
{
string hStr = SummaryParser.GetSkillSummary(Skill, Skill.Level + 1, sr, SummaryParams.Default);
GearGraphics.DrawString(g, "[下次等级 " + (Skill.Level + 1) + "]", GearGraphics.ItemDetailFont, 10, 274, ref picH, 16);
GearGraphics.DrawString(g, "[下次等级 " + (Skill.Level + 1) + "]", GearGraphics.ItemDetailFont, 8, 272, ref picH, 16);
if (hStr != null)
{
GearGraphics.DrawString(g, hStr, GearGraphics.ItemDetailFont2, 10, 274, ref picH, 16);
GearGraphics.DrawString(g, hStr, GearGraphics.ItemDetailFont2, 8, 272, ref picH, 16);
}
}
picH += 9;
Expand Down Expand Up @@ -197,7 +197,7 @@ private Bitmap RenderSkill(out int picH)
picH += 9;
foreach (var descEx in skillDescEx)
{
GearGraphics.DrawString(g, descEx, GearGraphics.ItemDetailFont, 8, 266, ref picH, 16);
GearGraphics.DrawString(g, descEx, GearGraphics.ItemDetailFont, 8, 272, ref picH, 16);
}
picH += 9;
}
Expand Down

4 comments on commit 459b75e

@Sunaries
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this update mean?

@Kagamia
Copy link
Owner Author

@Kagamia Kagamia commented on 459b75e Jan 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simply text position tuning.

@Sunaries
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kagamia I was referring to the added code in Item.cs and ItemTooltipRender2.cs 😮

@Kagamia
Copy link
Owner Author

@Kagamia Kagamia commented on 459b75e Jan 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sunaries
For item level display:
4000663

Please sign in to comment.