コード例 #1
0
 // Token: 0x06000025 RID: 37 RVA: 0x00004E94 File Offset: 0x00003094
 private void OnDraw(O9K.Core.Managers.Renderer.IRenderer renderer)
 {
     try
     {
         foreach (Unit9 unit in this.units)
         {
             if (unit.IsValid && unit.IsVisible && unit.IsAlive)
             {
                 Vector2 healthBarPosition = unit.HealthBarPosition;
                 if (!healthBarPosition.IsZero)
                 {
                     Vector2    healthBarSize = unit.HealthBarSize;
                     Vector2    location      = healthBarPosition + new Vector2(0f, healthBarSize.Y + 1f) + this.position;
                     Vector2    vector        = new Vector2(healthBarSize.X, healthBarSize.Y * 0.53f) + this.size;
                     Rectangle9 rec           = new Rectangle9(location, vector.X, vector.Y) + 1.5f;
                     Rectangle9 rec2          = new Rectangle9(location, vector.X * unit.ManaPercentageBase, vector.Y);
                     renderer.DrawFilledRectangle(rec, System.Drawing.Color.Black);
                     renderer.DrawFilledRectangle(rec2, System.Drawing.Color.FromArgb(25, 54, 255));
                     if (this.showAmount)
                     {
                         renderer.DrawText(rec + 5f, unit.Mana.ToString("####"), System.Drawing.Color.White, RendererFontFlags.Center | RendererFontFlags.VerticalCenter, this.manaTextSize, "Calibri");
                     }
                 }
             }
         }
     }
     catch (InvalidOperationException)
     {
     }
     catch (Exception exception)
     {
         Logger.Error(exception, null);
     }
 }
コード例 #2
0
 // Token: 0x0600011E RID: 286 RVA: 0x0000AFB4 File Offset: 0x000091B4
 private void OnDraw(O9K.Core.Managers.Renderer.IRenderer renderer)
 {
     try
     {
         Vector2 vector = this.position.Value;
         foreach (Unit9 unit in this.units)
         {
             if (unit.IsValid)
             {
                 renderer.DrawTexture(unit.Name, vector, this.heroSize, 0f, 1f);
                 Rectangle9 rec = new Rectangle9(vector.X + this.heroSize.X + 1f, vector.Y, this.itemSize.X, this.itemSize.Y);
                 for (int i = 0; i < 6; i++)
                 {
                     renderer.DrawTexture("inventory_item_bg", rec + new Vector2((this.itemSize.X + 1f) * (float)i, 0f), 0f, 1f);
                 }
                 foreach (Ability9 ability in from x in unit.Abilities
                          orderby x.Id == AbilityId.item_tpscroll
                          select x)
                 {
                     if (ability.Id == AbilityId.item_tpscroll)
                     {
                         Rectangle9 rec2 = new Rectangle9(vector + new Vector2(this.heroSize.X * 0.7f, this.heroSize.Y * 0.35f), this.itemSize.X * 0.55f, this.itemSize.X * 0.55f);
                         renderer.DrawTexture("outline", rec2 + 1f, 0f, 1f);
                         renderer.DrawTexture(ability.Name + "_rounded", rec2, 0f, 1f);
                         if (this.showCooldown)
                         {
                             float remainingCooldown = ability.RemainingCooldown;
                             if (remainingCooldown > 0f)
                             {
                                 renderer.DrawTexture("inventory_tp_cd_bg", rec2, 0f, 1f);
                                 renderer.DrawText(rec2, Math.Ceiling((double)remainingCooldown).ToString("N0"), System.Drawing.Color.White, RendererFontFlags.Center | RendererFontFlags.VerticalCenter, this.size * 0.35f, "Calibri");
                             }
                         }
                     }
                     else if (ability.IsItem && ability.IsUsable)
                     {
                         Rectangle9 rec3 = rec - 4f;
                         renderer.DrawTexture(ability.Name, rec3, 0f, 1f);
                         if (this.showCharges && ability.IsDisplayingCharges)
                         {
                             string     text    = ability.BaseItem.CurrentCharges.ToString("N0");
                             Vector2    vector2 = renderer.MeasureText(text, this.size * 0.35f, "Calibri");
                             Rectangle9 rec4    = rec3.SinkToBottomRight(vector2.X * 1.1f, vector2.Y * 0.8f);
                             renderer.DrawFilledRectangle(rec4, System.Drawing.Color.Black);
                             renderer.DrawText(rec4, text, System.Drawing.Color.White, RendererFontFlags.Left, this.size * 0.35f, "Calibri");
                         }
                         if (this.showCooldown)
                         {
                             float remainingCooldown2 = ability.RemainingCooldown;
                             if (remainingCooldown2 > 0f)
                             {
                                 renderer.DrawTexture("inventory_item_cd_bg", rec3, 0f, 1f);
                                 renderer.DrawText(rec3, Math.Ceiling((double)remainingCooldown2).ToString("N0"), System.Drawing.Color.White, RendererFontFlags.Center | RendererFontFlags.VerticalCenter, this.size * 0.7f, "Calibri");
                             }
                         }
                         rec += new Vector2(this.itemSize.X + 1f, 0f);
                     }
                 }
                 vector += new Vector2(0f, (float)(this.size + 1));
             }
         }
     }
     catch (InvalidOperationException)
     {
     }
     catch (Exception exception)
     {
         Logger.Error(exception, null);
     }
 }