protected override void DrawContents(Gdk.Drawable d) { Gdk.GC gc = new Gdk.GC(d); Cairo.Context g = Gdk.CairoHelper.Create(d); g.SelectFontFace("Lucida Console", FontSlant.Normal, FontWeight.Bold); g.SetFontSize(24); TextExtents te; #region Left string str, vit, dex, mag, spi, lck; int atk, atkp, def, defp, mat, mdf, mdfp; str = Selected.Strength.ToString(); vit = Selected.Vitality.ToString(); dex = Selected.Dexterity.ToString(); mag = Selected.Magic.ToString(); spi = Selected.Spirit.ToString(); lck = Selected.Luck.ToString(); atk = Ally.Attack(Selected); atkp = Ally.AttackPercent(Selected); def = Ally.Defense(Selected); defp = Ally.DefensePercent(Selected); mat = Ally.MagicAttack(Selected); mdf = Ally.MagicDefense(Selected); mdfp = Ally.MagicDefensePercent(Selected); Cairo.Color greenish = new Color(.3, .8, .8); Graphics.ShadowedText(g, greenish, "Attack", X + x0, Y + yr + (line * 0)); Graphics.ShadowedText(g, greenish, "Attack %", X + x0, Y + yr + (line * 1)); Graphics.ShadowedText(g, greenish, "Defense", X + x0, Y + yr + (line * 2)); Graphics.ShadowedText(g, greenish, "Defense %", X + x0, Y + yr + (line * 3)); Graphics.ShadowedText(g, greenish, "Magic", X + x0, Y + yr + (line * 4)); Graphics.ShadowedText(g, greenish, "Magic def", X + x0, Y + yr + (line * 5)); Graphics.ShadowedText(g, greenish, "Magic def %", X + x0, Y + yr + (line * 6)); te = g.TextExtents(atk.ToString()); Graphics.ShadowedText(g, atk.ToString(), X + x1 - te.Width, Y + yr + (line * 0)); te = g.TextExtents(atkp.ToString()); Graphics.ShadowedText(g, atkp.ToString(), X + x1 - te.Width, Y + yr + (line * 1)); te = g.TextExtents(def.ToString()); Graphics.ShadowedText(g, def.ToString(), X + x1 - te.Width, Y + yr + (line * 2)); te = g.TextExtents(defp.ToString()); Graphics.ShadowedText(g, defp.ToString(), X + x1 - te.Width, Y + yr + (line * 3)); te = g.TextExtents(mat.ToString()); Graphics.ShadowedText(g, mat.ToString(), X + x1 - te.Width, Y + yr + (line * 4)); te = g.TextExtents(mdf.ToString()); Graphics.ShadowedText(g, mdf.ToString(), X + x1 - te.Width, Y + yr + (line * 5)); te = g.TextExtents(mdfp.ToString()); Graphics.ShadowedText(g, mdfp.ToString(), X + x1 - te.Width, Y + yr + (line * 6)); if (EquipList.Instance.IsControl) { int t_atk, t_atkp, t_def, t_defp, t_mat, t_mdf, t_mdfp; IItem temp; switch (EquipTop.Instance.Option) { case 0: temp = Selected.Weapon; Selected.Weapon = (Weapon)EquipList.Instance.Selection; break; case 1: temp = Selected.Armor; Selected.Armor = (Armor)EquipList.Instance.Selection; break; case 2: temp = Selected.Accessory; Selected.Accessory = (Accessory)EquipList.Instance.Selection; break; default: temp = Selected.Weapon; break; } t_atk = Ally.Attack(Selected); t_atkp = Ally.AttackPercent(Selected); t_def = Ally.Defense(Selected); t_defp = Ally.DefensePercent(Selected); t_mat = Ally.MagicAttack(Selected); t_mdf = Ally.MagicDefense(Selected); t_mdfp = Ally.MagicDefensePercent(Selected); switch (EquipTop.Instance.Option) { case 0: Selected.Weapon = (Weapon)temp; break; case 1: Selected.Armor = (Armor)temp; break; case 2: Selected.Accessory = (Accessory)temp; break; default: break; } Color c; Color yellow = new Color(.8, .8, 0); Color red = new Color(0.8, 0, 0); Color white = new Color(1, 1, 1); Graphics.ShadowedText(g, white, ">", X + x2, Y + yr + (line * 0)); Graphics.ShadowedText(g, white, ">", X + x2, Y + yr + (line * 1)); Graphics.ShadowedText(g, white, ">", X + x2, Y + yr + (line * 2)); Graphics.ShadowedText(g, white, ">", X + x2, Y + yr + (line * 3)); Graphics.ShadowedText(g, white, ">", X + x2, Y + yr + (line * 4)); Graphics.ShadowedText(g, white, ">", X + x2, Y + yr + (line * 5)); Graphics.ShadowedText(g, white, ">", X + x2, Y + yr + (line * 6)); te = g.TextExtents(t_atk.ToString()); if (t_atk < atk) { c = red; } else if (t_atk > atk) { c = yellow; } else { c = white; } Graphics.ShadowedText(g, c, t_atk.ToString(), X + x3 - te.Width, Y + yr + (line * 0)); te = g.TextExtents(t_atkp.ToString()); if (t_atkp < atkp) { c = red; } else if (t_atkp > atkp) { c = yellow; } else { c = white; } Graphics.ShadowedText(g, c, t_atkp.ToString(), X + x3 - te.Width, Y + yr + (line * 1)); te = g.TextExtents(t_def.ToString()); if (t_def < def) { c = red; } else if (t_def > def) { c = yellow; } else { c = white; } Graphics.ShadowedText(g, c, t_def.ToString(), X + x3 - te.Width, Y + yr + (line * 2)); te = g.TextExtents(t_defp.ToString()); if (t_defp < defp) { c = red; } else if (t_defp > defp) { c = yellow; } else { c = white; } Graphics.ShadowedText(g, c, t_defp.ToString(), X + x3 - te.Width, Y + yr + (line * 3)); te = g.TextExtents(t_mat.ToString()); if (t_mat < mat) { c = red; } else if (t_mat > mat) { c = yellow; } else { c = white; } Graphics.ShadowedText(g, c, t_mat.ToString(), X + x3 - te.Width, Y + yr + (line * 4)); te = g.TextExtents(t_mdf.ToString()); if (t_mdf < mdf) { c = red; } else if (t_mdf > mdf) { c = yellow; } else { c = white; } Graphics.ShadowedText(g, c, t_mdf.ToString(), X + x3 - te.Width, Y + yr + (line * 5)); te = g.TextExtents(t_mdfp.ToString()); if (t_mdfp < mdfp) { c = red; } else if (t_mdfp > mdfp) { c = yellow; } else { c = white; } Graphics.ShadowedText(g, c, t_mdfp.ToString(), X + x3 - te.Width, Y + yr + (line * 6)); } #endregion Left ((IDisposable)g.Target).Dispose(); ((IDisposable)g).Dispose(); }
protected override void DrawContents(Gdk.Drawable d) { Gdk.GC gc = new Gdk.GC(d); Cairo.Context g = Gdk.CairoHelper.Create(d); g.SelectFontFace("Lucida Console", FontSlant.Normal, FontWeight.Bold); g.SetFontSize(24); TextExtents te; string lvl, hp, hpm, mp, mpm, exp, next, llvl; #region Top Row d.DrawPixbuf(gc, Graphics.GetProfile(Selected.Name), 0, 0, X + xpic, Y + ypic, Graphics.PROFILE_WIDTH, Graphics.PROFILE_HEIGHT, Gdk.RgbDither.None, 0, 0); g.Color = new Color(.3, .8, .8); g.MoveTo(X + x3, Y + ya); g.ShowText("LV"); g.MoveTo(X + x3, Y + yb); g.ShowText("HP"); g.MoveTo(X + x3, Y + yc); g.ShowText("MP"); g.Color = new Color(1, 1, 1); Graphics.ShadowedText(g, Selected.Name, X + x3, Y + y); lvl = Selected.Level.ToString(); hp = Selected.HP.ToString() + "/"; hpm = Selected.MaxHP.ToString(); mp = Selected.MP.ToString() + "/"; mpm = Selected.MaxMP.ToString(); exp = Selected.Exp.ToString(); next = Selected.ToNextLevel.ToString(); llvl = Selected.LimitLevel.ToString(); te = g.TextExtents(lvl); Graphics.ShadowedText(g, lvl, X + x4 - te.Width, Y + ya); te = g.TextExtents(hp); Graphics.ShadowedText(g, hp, X + x5 - te.Width, Y + yb); te = g.TextExtents(hpm); Graphics.ShadowedText(g, hpm, X + x6 - te.Width, Y + yb); te = g.TextExtents(mp); Graphics.ShadowedText(g, mp, X + x5 - te.Width, Y + yc); te = g.TextExtents(mpm); Graphics.ShadowedText(g, mpm, X + x6 - te.Width, Y + yc); Graphics.ShadowedText(g, "Exp:", X + x8, Y + ya); Graphics.ShadowedText(g, "Next lvl:", X + x8, Y + yb); Graphics.ShadowedText(g, "Limit lvl:", X + x8, Y + yc); te = g.TextExtents(exp); Graphics.ShadowedText(g, exp, X + x12 - te.Width, Y + ya); te = g.TextExtents(next); Graphics.ShadowedText(g, next, X + x12 - te.Width, Y + yb); te = g.TextExtents(llvl); Graphics.ShadowedText(g, llvl, X + x11 - te.Width, Y + yc); #endregion Top #region Left string str, vit, dex, mag, spi, lck; string atk, atkp, def, defp, mat, mdf, mdfp; str = Selected.Strength.ToString(); vit = Selected.Vitality.ToString(); dex = Selected.Dexterity.ToString(); mag = Selected.Magic.ToString(); spi = Selected.Spirit.ToString(); lck = Selected.Luck.ToString(); atk = Ally.Attack(Selected).ToString(); atkp = Ally.AttackPercent(Selected).ToString(); def = Ally.Defense(Selected).ToString(); defp = Ally.DefensePercent(Selected).ToString(); mat = Ally.MagicAttack(Selected).ToString(); mdf = Ally.MagicDefense(Selected).ToString(); mdfp = Ally.MagicDefensePercent(Selected).ToString(); Cairo.Color greenish = new Color(.3, .8, .8); Graphics.ShadowedText(g, greenish, "Strength", X + x0, Y + yq + (line * 0)); Graphics.ShadowedText(g, greenish, "Vitality", X + x0, Y + yq + (line * 1)); Graphics.ShadowedText(g, greenish, "Dexterity", X + x0, Y + yq + (line * 2)); Graphics.ShadowedText(g, greenish, "Magic", X + x0, Y + yq + (line * 3)); Graphics.ShadowedText(g, greenish, "Spirit", X + x0, Y + yq + (line * 4)); Graphics.ShadowedText(g, greenish, "Luck", X + x0, Y + yq + (line * 5)); Graphics.ShadowedText(g, greenish, "Attack", X + x0, Y + yr + (line * 0)); Graphics.ShadowedText(g, greenish, "Attack %", X + x0, Y + yr + (line * 1)); Graphics.ShadowedText(g, greenish, "Defense", X + x0, Y + yr + (line * 2)); Graphics.ShadowedText(g, greenish, "Defense %", X + x0, Y + yr + (line * 3)); Graphics.ShadowedText(g, greenish, "Magic", X + x0, Y + yr + (line * 4)); Graphics.ShadowedText(g, greenish, "Magic def", X + x0, Y + yr + (line * 5)); Graphics.ShadowedText(g, greenish, "Magic def %", X + x0, Y + yr + (line * 6)); te = g.TextExtents(str); Graphics.ShadowedText(g, str, X + x1 - te.Width, Y + yq + (line * 0)); te = g.TextExtents(vit); Graphics.ShadowedText(g, vit, X + x1 - te.Width, Y + yq + (line * 1)); te = g.TextExtents(dex); Graphics.ShadowedText(g, dex, X + x1 - te.Width, Y + yq + (line * 2)); te = g.TextExtents(mag); Graphics.ShadowedText(g, mag, X + x1 - te.Width, Y + yq + (line * 3)); te = g.TextExtents(spi); Graphics.ShadowedText(g, spi, X + x1 - te.Width, Y + yq + (line * 4)); te = g.TextExtents(lck); Graphics.ShadowedText(g, lck, X + x1 - te.Width, Y + yq + (line * 5)); te = g.TextExtents(atk); Graphics.ShadowedText(g, atk, X + x1 - te.Width, Y + yr + (line * 0)); te = g.TextExtents(atkp); Graphics.ShadowedText(g, atkp, X + x1 - te.Width, Y + yr + (line * 1)); te = g.TextExtents(def); Graphics.ShadowedText(g, def, X + x1 - te.Width, Y + yr + (line * 2)); te = g.TextExtents(defp); Graphics.ShadowedText(g, defp, X + x1 - te.Width, Y + yr + (line * 3)); te = g.TextExtents(mat); Graphics.ShadowedText(g, mat, X + x1 - te.Width, Y + yr + (line * 4)); te = g.TextExtents(mdf); Graphics.ShadowedText(g, mdf, X + x1 - te.Width, Y + yr + (line * 5)); te = g.TextExtents(mdfp); Graphics.ShadowedText(g, mdfp, X + x1 - te.Width, Y + yr + (line * 6)); #endregion Left #region Right g.Color = new Color(.1, .1, .2); g.Rectangle(x9, yi, 8 * xs, yj - yi); g.Fill(); g.Rectangle(x9, yk, 8 * xs, yl - yk); g.Fill(); Cairo.Color gray1 = new Color(.2, .2, .2); Cairo.Color gray2 = new Color(.7, .7, .8); int links, slots; slots = Selected.Weapon.Slots.Length; links = Selected.Weapon.Links; for (int j = 0; j < links; j++) { Graphics.RenderLine(g, gray2, 3, X + x9 + (xs / 2) + (j * 2 * xs), Y + yi - ys - zs, X + x9 + (xs / 2) + ((j * 2 + 1) * xs), Y + yi - ys - zs); Graphics.RenderLine(g, gray2, 3, X + x9 + (xs / 2) + (j * 2 * xs), Y + yi - ys, X + x9 + (xs / 2) + ((j * 2 + 1) * xs), Y + yi - ys); Graphics.RenderLine(g, gray2, 3, X + x9 + (xs / 2) + (j * 2 * xs), Y + yi - ys + zs, X + x9 + (xs / 2) + ((j * 2 + 1) * xs), Y + yi - ys + zs); } for (int i = 0; i < slots; i++) { Graphics.RenderCircle(g, gray2, 14, X + x9 + (i * xs) + (xs / 2), Y + yi - ys); if (Selected.Weapon.Slots[i] == null) { Graphics.RenderCircle(g, gray1, 10, X + x9 + (i * xs) + (xs / 2), Y + yi - ys); } else { Graphics.RenderCircle(g, Selected.Weapon.Slots[i].Color, 10, X + x9 + (i * xs) + (xs / 2), Y + yi - ys); } } slots = Selected.Armor.Slots.Length; links = Selected.Armor.Links; for (int j = 0; j < links; j++) { Graphics.RenderLine(g, gray2, 3, X + x9 + (xs / 2) + (j * 2 * xs), Y + yk - ys - zs, X + x9 + (xs / 2) + ((j * 2 + 1) * xs), Y + yk - ys - zs); Graphics.RenderLine(g, gray2, 3, X + x9 + (xs / 2) + (j * 2 * xs), Y + yk - ys, X + x9 + (xs / 2) + ((j * 2 + 1) * xs), Y + yk - ys); Graphics.RenderLine(g, gray2, 3, X + x9 + (xs / 2) + (j * 2 * xs), Y + yk - ys + zs, X + x9 + (xs / 2) + ((j * 2 + 1) * xs), Y + yk - ys + zs); } for (int i = 0; i < slots; i++) { Graphics.RenderCircle(g, gray2, 14, X + x9 + (i * xs) + (xs / 2), Y + yk - ys); if (Selected.Armor.Slots[i] == null) { Graphics.RenderCircle(g, gray1, 10, X + x9 + (i * xs) + (xs / 2), Y + yk - ys); } else { Graphics.RenderCircle(g, Selected.Armor.Slots[i].Color, 10, X + x9 + (i * xs) + (xs / 2), Y + yk - ys); } } g.Color = new Color(.3, .8, .8); g.MoveTo(X + x7, Y + yh); g.ShowText("Wpn."); g.MoveTo(X + x7, Y + yj); g.ShowText("Arm."); g.MoveTo(X + x7, Y + yl); g.ShowText("Acc."); g.Color = new Color(1, 1, 1); Graphics.ShadowedText(g, Selected.Weapon.Name, X + x8, Y + yh); Graphics.ShadowedText(g, Selected.Armor.Name, X + x8, Y + yj); Graphics.ShadowedText(g, Selected.Accessory.Name, X + x8, Y + yl); #endregion Right ((IDisposable)g.Target).Dispose(); ((IDisposable)g).Dispose(); }