Example #1
0
 public ViewModule(uint width, uint height, IntPtr windowHandle)
 {
     int test = 103;
     _windowWidth = width;
     _windowHeight = height;
     _renderer = new RendererManager();
     _renderer.Initialize( _windowWidth, _windowHeight, windowHandle );
     _backBuffer = _renderer.GetImageBackBuffer(width, height, windowHandle);
 }
        protected override IEnumerator execute()
        {
            Command presentMove = null;

            if (this.overrideCurve != null)
            {
                IDictionary <DataComposition, VisibilityConfiguration> cards = SampleUtil.GetCards(MatchCardLayer.GameplayAnimation);
                presentMove = new PlayCardAnimation(CardAnimations.Get().GetMoveAnimation(MatchCardLayer.GameplayAnimation, cards, this.card.get_Composition(), this.overrideCurve));
            }
            else if (this.isPlayerOne)
            {
                presentMove = MoveAnimations.Find().GetAnim(this.card, MatchCurves.EndPoint.Player1Deck, MatchCurves.EndPoint.Player1PresentRight, MatchCardLayer.GameplayAnimation);
            }
            else
            {
                presentMove = MoveAnimations.Find().GetAnim(this.card, MatchCurves.EndPoint.Player2Deck, MatchCurves.EndPoint.PresentCenter, MatchCardLayer.GameplayAnimation);
            }
            if (this.message != null)
            {
                Finder.FindOrThrow <FailFeedbackUGUI>().Show(new LocalizedString(this.message, new object[0]));
            }
            this.presentArea.set_Card(this.card);
            RendererManager render = Finder.FindOrThrow <RendererManager>();

            render.Register(this);
            while (presentMove.MoveNext())
            {
                object obj = presentMove.Current;
                yield return(obj);
            }
            yield return(new WaitForSeconds(0.75f));

            ShowCardDeath deathFX = new ShowCardDeath(this.card.get_Composition(), (this.message != null) ? (Constants.rO() + "2") : Constants.rO(), this.commandToRun);

            while (deathFX.MoveNext())
            {
                object obj2 = deathFX.Current;
                yield return(obj2);
            }
            this.presentArea.set_Card(null);
            render.Unregister(this);
            yield break;
            yield break;
        }
Example #3
0
        private void LoadTextures()
        {
            RendererManager.LoadTexture(
                "o9k.outline_hp",
                @"panorama\images\hud\reborn\buff_outline_psd.vtex_c",
                new TextureProperties
            {
                ColorRatio = new Vector4(0f, 1f, 0f, 1f)
            });

            RendererManager.LoadTexture(
                "o9k.outline_mp",
                @"panorama\images\hud\reborn\buff_outline_psd.vtex_c",
                new TextureProperties
            {
                ColorRatio = new Vector4(0f, 0.6f, 1f, 1f),
                IsSliced   = true
            });
        }
Example #4
0
        private void OnDraw()
        {
            try
            {
                var time     = DateTime.Now.ToString(this.timeFormat);
                var timeSize = RendererManager.MeasureText(time, this.textSize);

                var bgWidth      = timeSize.X * 2.5f;
                var bgPosition   = this.position - new Vector2(bgWidth, 0);
                var textPosition = this.position - new Vector2(timeSize.X + (4 * Hud.Info.ScreenRatio), 0);

                RendererManager.DrawTexture("o9k.time_bg", new RectangleF(bgPosition.X, bgPosition.Y, bgWidth, this.textSize * 1.25f));
                RendererManager.DrawText(time, textPosition, Color.LightGray, this.textSize);
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }
        }
Example #5
0
 private void btnRendererOptions_Click(object Sender, EventArgs E)
 {
     if (_CachedConfigForm == null)
     {
         IRenderer Renderer = RendererManager.Instance().InstantiateRenderer((_SelectedRenderer).RendererName);
         _CachedConfigForm = Renderer.ConfigurationForm;
     }
     if (_CachedConfigForm == null)
     {
         MessageBox.Show(". does not have an advanced configuration.", "No Advanced Configuration", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         _CachedConfigForm.ConfigStrings = _RenderingConfig.AdvancedRenderOptions;
         _CachedConfigForm.ShowDialog(this);
         _RenderingConfig.AdvancedRenderOptions = _CachedConfigForm.ConfigStrings;
         QueuePreview();
     }
 }
Example #6
0
        public void DrawOnMinimap(IMinimap minimap)
        {
            var particlePosition = this.particle.Position;

            if (particlePosition.IsZero)
            {
                return;
            }

            var position = minimap.WorldToMinimap(particlePosition, 25 * Hud.Info.ScreenRatio);

            if (position.IsZero)
            {
                return;
            }

            RendererManager.DrawTexture("o9k.outline_red", position * 1.08f);
            RendererManager.DrawTexture(this.minimapHeroTexture, position, TextureType.MiniUnit);
        }
Example #7
0
 public void Draw(Rectangle9 position, float textSize)
 {
     try
     {
         RendererManager.DrawTexture(this.texture, position);
         RendererManager.DrawRectangle(position - 1, Color.Black);
         RendererManager.DrawTexture("o9k.ability_cd_bg", position);
         RendererManager.DrawText(
             Math.Ceiling(this.RemainingCooldown).ToString("N0"),
             position,
             Color.White,
             FontFlags.Center | FontFlags.VerticalCenter,
             textSize);
     }
     catch (Exception e)
     {
         Logger.Error(e);
     }
 }
Example #8
0
        private void DrawTownPortalScroll(Hero hero, Vector2 position, Vector2 size, float mana)
        {
            var tp = hero.Inventory.TownPortalScroll;

            if (tp != null)
            {
                RendererManager.DrawTexture(tp.Name, new RectangleF(position.X, position.Y, size.X, size.Y), TextureType.RoundAbility, true);

                var manaCost   = tp.ManaCost;
                var enoughMana = mana >= manaCost;

                var cooldown = Math.Ceiling(tp.Cooldown);
                if (cooldown > 0 || !enoughMana)
                {
                    RendererManager.DrawFilledRectangle(new RectangleF(position.X, position.Y, size.X, size.Y), Color.Zero, enoughMana ? new Color(40, 40, 40, 180) : new Color(25, 25, 130, 190), 0);
                }
                else
                {
                    RendererManager.DrawFilledRectangle(new RectangleF(position.X, position.Y, size.X, size.Y), Color.Zero, new Color(0, 0, 0, 100), 0);
                }

                if (cooldown > 0)
                {
                    var cooldownText = Math.Min(cooldown, 99).ToString(CultureInfo.InvariantCulture);
                    var cooldownSize = cooldown > 9 ? size.Y * 0.65f : size.Y * 0.7f;
                    var textSize     = RendererManager.MeasureText(cooldownText, cooldownSize);
                    var pos          = position + new Vector2(size.X / 2 - textSize.X / 2, size.Y / 2 - textSize.Y / 2);

                    RendererManager.DrawText(cooldownText, pos, Color.WhiteSmoke, cooldownSize);
                }

                if (!enoughMana && cooldown <= 0)
                {
                    var manaCostText = Math.Min(Math.Ceiling(manaCost - mana), 99).ToString(CultureInfo.InvariantCulture);
                    var manaCostSize = size.Y * 0.65f;
                    var textSize     = RendererManager.MeasureText(manaCostText, manaCostSize);
                    var pos          = position + new Vector2(size.X / 2 - textSize.X / 2, size.Y / 2 - textSize.Y / 2);

                    RendererManager.DrawText(manaCostText, pos, Color.LightBlue, manaCostSize);
                }
            }
        }
Example #9
0
        private void DrawEvadableAbilities()
        {
            try
            {
                foreach (var unit in this.abilityManager.EvadableAbilities.Select(x => x.Ability.Owner)
                         .Where(x => x.IsAlive && x.IsVisible)
                         .Distinct()
                         .ToList())
                {
                    var position = RendererManager.WorldToScreen(unit.Position);
                    if (position.IsZero)
                    {
                        continue;
                    }

                    position -= new Vector2(-50, 110);

                    foreach (var ability in this.abilityManager.EvadableAbilities.Where(x => x.Owner.Equals(unit))
                             .OrderBy(x => x.Ability.BaseAbility.AbilitySlot)
                             .ToList())
                    {
                        var text = ability.Ability.DisplayName;
                        if (ability is IModifierCounter modifier)
                        {
                            text += " (Modifier " + (modifier.ModifierEnemyCounter ? "enemy" : "ally") + ")";
                        }

                        RendererManager.DrawText(
                            text,
                            (position += new Vector2(0, 20)) + new Vector2(20, 0),
                            ability.Ability.BaseAbility.IsInAbilityPhase ? Color.LawnGreen :
                            ability.Ability.CanBeCasted() ? Color.White : Color.Gray,
                            "Arial",
                            TextSize);
                    }
                }
            }
            catch (Exception e)
            {
                Logger.Warn(e.ToString());
            }
        }
Example #10
0
        protected override void Draw()
        {
            //value fill
            var fillPct = ((float)this.Value - this.MinValue) / (this.MaxValue - this.MinValue);

            RendererManager.DrawLine(
                this.Position + new Vector2(0, this.Size.Y / 2),
                this.Position + new Vector2(this.Size.X * fillPct, this.Size.Y / 2),
                this.MenuStyle.BackgroundColor,
                this.Size.Y);

            base.Draw();

            //value text
            var valuePosition = new Vector2(
                (this.Position.X + this.Size.X) - this.MenuStyle.RightIndent - this.valueTextSize.X,
                this.Position.Y + ((this.Size.Y - this.MenuStyle.TextSize) / 3.3f));

            RendererManager.DrawText(this.Value.ToString(), valuePosition, Color.White, this.MenuStyle.Font, this.MenuStyle.TextSize);
        }
Example #11
0
        public virtual void DrawOnMap(IMinimap minimap)
        {
            var position = minimap.WorldToScreen(this.Position, 45 * Hud.Info.ScreenRatio);

            if (position.IsZero)
            {
                return;
            }

            RendererManager.DrawTexture("o9k.outline_red", position * 1.12f);
            RendererManager.DrawTexture(this.HeroTexture, position, UnitTextureType.RoundUnit);

            var abilityTexturePosition = position * 0.5f;

            abilityTexturePosition.X += abilityTexturePosition.Width * 0.8f;
            abilityTexturePosition.Y += abilityTexturePosition.Height * 0.6f;

            RendererManager.DrawTexture("o9k.outline_green_pct100", abilityTexturePosition * 1.2f);
            RendererManager.DrawTexture(this.AbilityTexture, abilityTexturePosition, TextureType.RoundAbility);
        }
Example #12
0
        protected virtual void RendererOnDraw()
        {
            if (UnitComboMenu.ToggleHotkeyItem)
            {
                var target = TargetSelector.UnitTarget;
                if (target != null)
                {
                    var topPanel = target.TopPanel;
                    if (topPanel != null)
                    {
                        var size  = 50 * HUDInfo.RatioPercentage;
                        var midle = (topPanel.SizeX / 2) - (size / 2);

                        var iconPosition = topPanel.IconPosition;
                        var position     = new RectangleF(iconPosition.X + midle, iconPosition.Y + (110 * HUDInfo.RatioPercentage), size, size);
                        RendererManager.DrawTexture(@"others\green_arrow.png", position);
                    }
                }
            }
        }
Example #13
0
        protected override void InitializeCore()
        {
            base.InitializeCore();

            Name     = "UIComponentRenderer";
            game     = RenderSystem.Services.GetService <IGame>();
            input    = RenderSystem.Services.GetService <InputManager>();
            uiSystem = RenderSystem.Services.GetService <UISystem>();
            graphicsDeviceService = RenderSystem.Services.GetSafeServiceAs <IGraphicsDeviceService>();

            if (uiSystem == null)
            {
                var gameSytems = RenderSystem.Services.GetSafeServiceAs <IGameSystemCollection>();
                uiSystem = new UISystem(RenderSystem.Services);
                RenderSystem.Services.AddService(uiSystem);
                gameSytems.Add(uiSystem);
            }

            rendererManager = new RendererManager(new DefaultRenderersFactory(RenderSystem.Services));
        }
Example #14
0
        private void OnDraw()
        {
            try
            {
                foreach (var ability in this.abilities)
                {
                    if (!ability.IsValid || !this.toggler.IsEnabled(ability.Name))
                    {
                        continue;
                    }

                    if (!ability.CanBeCasted(false))
                    {
                        continue;
                    }

                    var position = this.minimap.WorldToScreen(ability.Owner.Position, 35 * Hud.Info.ScreenRatio);
                    if (position.IsZero)
                    {
                        continue;
                    }

                    var scale = (GameManager.RawGameTime % 1) + 0.5f;
                    if (scale > 1)
                    {
                        scale = 2 - scale;
                    }

                    RendererManager.DrawTexture("o9k.outline_green", position * scale * 1.3f);
                    RendererManager.DrawTexture(ability.TextureName, position * scale, TextureType.RoundAbility);
                }
            }
            catch (InvalidOperationException)
            {
                // ignore
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }
        }
Example #15
0
        void ShowHelp()
        {
            Console.WriteLine("SeeSharp Syntax:  SeeSharp ( params )");
            Console.WriteLine("    -?, -h: . . . . . . Show this help and exit.");
            Console.WriteLine("    -w world/path:  . . Path to save folder.  Mandatory.");
            Console.WriteLine("    -o output/path: . . Where to save exported map image.  Omit to skip this step.");
            Console.WriteLine("    -T :. . . . . . . . Use multithreaded renderer.");
            Console.WriteLine("    -m output/path: . . Where to save world metrics.    Omit to skip this step.");
            Console.WriteLine("    -s output/path: . . Where to save sign information.    Omit to skip this step.");
            Console.WriteLine("    -p palette/path:. . Add an additional palette to the renderer, ex for custom blocks");
            Console.WriteLine("    -l [0..15]: . . . . Minimum light value to render.  Defaults to 15 if skipped.");
            Console.WriteLine("    -d #: . . . . . . . Dimension to render.  Defaults to 0 / Overworld.");
            Console.WriteLine("    -r Renderer-Name: . Which renderer to use.  'Standard' is built in");
            Console.WriteLine("    -R Option Value:. . Advanced renderer option");

            IRenderer Renderer = RendererManager.Instance().InstantiateRenderer(!String.IsNullOrEmpty(_Configuration.RendererName) ? _Configuration.RendererName : "");

            Console.WriteLine("");
            Console.WriteLine(Renderer.RendererFriendlyName + " advanced options: ");
            Renderer.PrintHelpInfo();
        }
Example #16
0
        public override void AfterRender()
        {
            var selectedElement = SceneEditorScene.SelectedElement;

            if (selectedElement != null)
            {
                RendererManager.BackupState(RendererBackupMode.DepthTest);
                RendererManager.DepthTest(true, DepthFunction.Always);

                _applyMoverAxisTransform(selectedElement.WorldTransform);

                _renderMoverAxis();

                RendererManager.RestoreState(RendererBackupMode.DepthTest);

                if (((SceneEditorScene)ParentScene).BoundingBoxes.ContainsKey(selectedElement))
                {
                    _renderSelectedElementBoundingBox();
                }
            }
        }
Example #17
0
        protected override void EnemyNotVisibleTimer(Hero hero, TopPanel topPanel)
        {
            if (!VisibleStatusMenu.EnemyNotVisibleTimeItem)
            {
                return;
            }

            var notVisibleTime = (int)Math.Min(GameManager.Time - hero.LastVisibleTime, 99);

            if (notVisibleTime <= 0)
            {
                return;
            }

            var text     = notVisibleTime.ToString();
            var size     = VisibleStatusMenu.SizeItem.Value * HUDInfo.RatioPercentage;
            var extraPos = new Vector2((31 * HUDInfo.RatioPercentage) - RendererManager.MeasureText(text, size).X / 2, (10 * HUDInfo.RatioPercentage) - (size * 0.4f));
            var color    = new Color(VisibleStatusMenu.RedItem.Value, VisibleStatusMenu.GreenItem.Value, VisibleStatusMenu.BlueItem.Value);

            RendererManager.DrawText(text, topPanel.IconPosition + extraPos, color, size);
        }
Example #18
0
        public override void Draw(RectangleF position, IMinimap minimap)
        {
            var heroPosition    = GetHeroPosition(position);
            var abilityPosition = GetAbilityPosition(position, heroPosition);
            var arrowPosition   = GetArrowPosition(position, heroPosition, abilityPosition);
            var opacity         = this.GetOpacity();

            if (this.heroName == null)
            {
                position.X += heroPosition.Width;
                RendererManager.DrawTexture("o9k.notification_bg", position, opacity);
            }
            else
            {
                RendererManager.DrawTexture("o9k.notification_bg", position, opacity);
                RendererManager.DrawTexture(this.heroName, heroPosition, TextureType.Unit, opacity);
            }

            RendererManager.DrawTexture("o9k.ping", arrowPosition, opacity);
            RendererManager.DrawTexture(this.abilityName, abilityPosition, TextureType.Ability, opacity);
        }
Example #19
0
        private void OnDraw()
        {
            try
            {
                if (this.modifier?.IsValid != true)
                {
                    RendererManager.Draw -= this.OnDraw;
                    return;
                }

                if (this.unit?.IsVisible != true)
                {
                    return;
                }

                var position = RendererManager.WorldToScreen(this.unit.Position);
                if (position.IsZero)
                {
                    return;
                }

                var ratio         = Hud.Info.ScreenRatio;
                var remainingTime = this.endTime - GameManager.RawGameTime;
                var time          = Math.Ceiling(remainingTime).ToString("N0");
                var pct           = (int)(100 - ((remainingTime / this.duration) * 100));

                var rec             = new Rectangle9(position, new Vector2(30 * ratio));
                var outlinePosition = rec * 1.17f;

                RendererManager.DrawTexture(AbilityId.abyssal_underlord_dark_rift, rec, AbilityTextureType.Round);
                RendererManager.DrawTexture("o9k.modifier_bg", rec);
                RendererManager.DrawTexture("o9k.outline_green", outlinePosition);
                RendererManager.DrawTexture("o9k.outline_black" + pct, outlinePosition);
                RendererManager.DrawText(time, rec, Color.White, FontFlags.Center | FontFlags.VerticalCenter, 22 * ratio);
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }
        }
Example #20
0
        private void LoadTextures()
        {
            foreach (var player in EntityManager.GetEntities <Player>())
            {
                var id = player.SelectedHeroId;
                if (id == HeroId.npc_dota_hero_base)
                {
                    continue;
                }

                RendererManager.LoadTexture(id);
                RendererManager.LoadTexture(id, UnitTextureType.RoundUnit);
                RendererManager.LoadTexture(id, UnitTextureType.MiniUnit);

                this.loaded.Add(id.ToString());
            }

            RendererManager.LoadTexture("o9k.x", @"panorama\images\hud\reborn\ping_icon_retreat_psd.vtex_c");
            RendererManager.LoadTexture("rune_arcane", TextureType.RoundAbility);
            RendererManager.LoadTexture("rune_doubledamage", TextureType.RoundAbility);
            RendererManager.LoadTexture("rune_haste", TextureType.RoundAbility);
            RendererManager.LoadTexture("rune_invis", TextureType.RoundAbility);
            RendererManager.LoadTexture("rune_regen", TextureType.RoundAbility);
            RendererManager.LoadTexture("npc_dota_roshan", "npc_dota_hero_roshan", TextureType.Unit);
            RendererManager.LoadTexture("npc_dota_roshan", "npc_dota_hero_roshan", TextureType.RoundUnit);

            RendererManager.LoadTexture(AbilityId.item_bottle);
            RendererManager.LoadTexture("item_bottle_arcane", TextureType.Ability);
            RendererManager.LoadTexture("item_bottle_bounty", TextureType.Ability);
            RendererManager.LoadTexture("item_bottle_doubledamage", TextureType.Ability);
            RendererManager.LoadTexture("item_bottle_haste", TextureType.Ability);
            RendererManager.LoadTexture("item_bottle_illusion", TextureType.Ability);
            RendererManager.LoadTexture("item_bottle_invisibility", TextureType.Ability);
            RendererManager.LoadTexture("item_bottle_regeneration", TextureType.Ability);
            RendererManager.LoadTexture("item_bottle_water", TextureType.Ability);

            this.LoadAbilityTexture(AbilityId.item_smoke_of_deceit);
            this.LoadAbilityTexture(AbilityId.item_ward_sentry);
            this.LoadAbilityTexture(AbilityId.item_ward_observer);
        }
Example #21
0
        public void DrawInformation(float mySpeed, bool showDamage, bool showSpeed, Vector2 position, float size)
        {
            var hpBar = this.Unit.HealthBarPosition;

            if (hpBar.IsZero)
            {
                return;
            }

            var hpSize   = this.Unit.HealthBarSize;
            var iconSize = size * 0.75f;

            var iconPosition = hpBar + position + new Vector2(hpSize.X, size - iconSize);
            var textPosition = hpBar + position + new Vector2(hpSize.X + iconSize + 3, 0);

            if (showDamage)
            {
                RendererManager.DrawTexture("o9k.attack_minimalistic", new RectangleF(iconPosition.X, iconPosition.Y, iconSize, iconSize));
                RendererManager.DrawText(this.Hits == 0 ? "?" : this.Hits.ToString(), textPosition, Color.White, size);

                iconPosition += new Vector2(0, size);
                textPosition += new Vector2(0, size);
            }

            if (showSpeed)
            {
                RendererManager.DrawTexture("o9k.speed_minimalistic", new RectangleF(iconPosition.X, iconPosition.Y, iconSize, iconSize));

                var speed = (int)(mySpeed - this.Unit.Speed);
                if (speed >= 0)
                {
                    RendererManager.DrawText(speed.ToString(), textPosition, Color.White, size);
                }
                else
                {
                    RendererManager.DrawText((speed * -1).ToString(), textPosition, Color.DarkOrange, size);
                }
            }
        }
Example #22
0
        private void OnDraw()
        {
            try
            {
                var seconds = GameManager.GameTime % 60;

                foreach (var camp in this.drawCamps)
                {
                    var position = RendererManager.WorldToScreen(camp.DrawPosition);
                    if (position.IsZero)
                    {
                        continue;
                    }

                    var stackTime = Math.Ceiling(camp.StackTime - seconds);
                    if (stackTime <= -2)
                    {
                        continue;
                    }

                    var stackTimeText = stackTime <= 0 ? "now" : stackTime.ToString("N0");
                    RendererManager.DrawText("Stack in: " + stackTimeText, position, Color.White, 18 * Hud.Info.ScreenRatio);

                    //renderer.DrawText(
                    //    position,
                    //    "Stack in: " + stackTimeText + " " + (camp.StackTime - seconds) + " " + camp.StackTime,
                    //    Color.White,
                    //    18 * Hud.Info.ScreenRatio);
                }
            }
            catch (InvalidOperationException)
            {
                // ignore
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }
        }
Example #23
0
        private void RendererManagerOnDraw()
        {
            if (ColorScreen)
            {
                var color = new Color(
                    SpiritBreakerChargeMenu.RedItem.Value,
                    SpiritBreakerChargeMenu.GreenItem.Value,
                    SpiritBreakerChargeMenu.BlueItem.Value,
                    SpiritBreakerChargeMenu.AlphaItem.Value);

                var screenSize = RendererManager.ScreenSize;
                RendererManager.DrawFilledRectangle(new RectangleF(0, 0, screenSize.X, screenSize.Y), Color.Zero, color, 0);
            }

            if (OnMinimap)
            {
                var startPos = startChargePosition.WorldToMinimap();
                var endPos   = endChargePosition.WorldToMinimap();
                RendererManager.DrawLine(startPos, endPos, Color.WhiteSmoke, 1);
                RendererManager.DrawTexture(@"mini_heroes\npc_dota_hero_spirit_breaker.png", new RectangleF(startPos.X - 11, startPos.Y - 13, 24, 24));
            }
        }
Example #24
0
        public override void Draw(RectangleF position, IMinimap minimap)
        {
            var notificationSize = GetNotificationSize(position);
            var textureSize      = GetTextureSize(notificationSize);
            var healthSize       = GetHealthSize(textureSize);
            var manaSize         = GetManaSize(textureSize);
            var opacity          = this.GetOpacity();

            RendererManager.DrawTexture("o9k.notification_bg", notificationSize, opacity);
            RendererManager.DrawTexture(this.unit.Name, textureSize, TextureType.Unit, opacity);

            RendererManager.DrawTexture("o9k.health_enemy_bg", healthSize, opacity);
            RendererManager.DrawTexture("o9k.mana_bg", manaSize, opacity);

            if (!this.unit.IsAlive)
            {
                return;
            }

            RendererManager.DrawTexture("o9k.health_enemy", this.GetCurrentHealthSize(healthSize), opacity);
            RendererManager.DrawTexture("o9k.mana", this.GetCurrentManaSize(manaSize), opacity);
        }
        static void Main(string[] args)
        {
            // Initialize internals
            CoreUtility.Initialize();

            string mapPath = @"C:\Users\Public\Documents\MapSurfer.NET\2.6\Samples\Projects\Bremen.msnpx";// @"\map\example.msnpx";

            // Load map from file and initialize data source providers.
            using (Map map = Map.FromFile(mapPath, true))
            {
                map.Size = new SizeF(600, 600);
                map.ZoomToFullExtent();

                using (IRenderer renderer = RendererManager.CreateDefaultInstance())
                {
                    using (RenderSurface surface = RenderContext.Render(map, renderer))
                    {
                        surface.Save(@"G:\Temp\000.png", new object[] { ImageFormat.Png });
                    }
                }
            }
        }
Example #26
0
        private void OnAbilityAdded(Ability9 ability)
        {
            try
            {
                if (this.loaded.Contains(ability.TextureName))
                {
                    return;
                }

                if (!ability.IsTalent)
                {
                    RendererManager.LoadTexture(ability.TextureName, TextureType.Ability);
                    RendererManager.LoadTexture(ability.TextureName, TextureType.RoundAbility);
                }

                this.loaded.Add(ability.TextureName);
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }
        }
Example #27
0
        private void AddHero(HeroId id)
        {
            var name = id.ToString();

            if (this.heroes.ContainsKey(name))
            {
                return;
            }

            if (this.Renderer == null)
            {
                this.loadTextures.Add(id);
            }
            else
            {
                RendererManager.LoadTexture(id);
            }

            if (this.savedHeroes.TryGetValue(name, out var savedValue))
            {
                this.heroes[name] = savedValue;
            }
            else
            {
                this.heroes[name] = this.defaultValue;
            }

            if (this.SizeCalculated)
            {
                this.CalculateSize();
                this.ParentMenu.CalculateWidth();
            }

            if (this.heroes.Count >= 5)
            {
                EntityManager9.UnitAdded -= this.OnUnitAdded;
            }
        }
Example #28
0
        private void LoadTexture()
        {
            if (this.textureKey.Contains("npc_dota"))
            {
                textureType = TextureType.Unit;
                RendererManager.LoadTexture(this.textureKey, textureType);
                this.textureSize = this.MenuStyle.TextureHeroSize * new Vector2(1.4f, 1.2f);
            }
            else
            {
                if (Enum.TryParse <AbilityId>(this.textureKey, out var id))
                {
                    textureType = TextureType.Ability;
                    RendererManager.LoadTexture(id);
                }

                this.textureSize = new Vector2(this.MenuStyle.TextureAbilitySize) * 1.2f;
            }

            this.TextIndent = (int)(this.textureSize.X + (this.MenuStyle.LeftIndent / 2f));
            base.CalculateSize();
            this.ParentMenu.CalculateWidth();
        }
Example #29
0
        private void RendererOnDraw()
        {
            try
            {
                var pos = RendererManager.WorldToScreen(Owner.Position);
                if (pos.IsZero)
                {
                    return;
                }
                RendererManager.DrawText($"{1.601f - (GameManager.RawGameTime - _startTime):0.00}", pos, Color.White,
                                         25);
            }
            catch (Exception)
            {
                StopTimer();
                return;
            }

            if (1.601f - (GameManager.RawGameTime - _startTime) <= 0)
            {
                StopTimer();
            }
        }
Example #30
0
        private void OnDraw()
        {
            try
            {
                var show = false;
                var text = "Snatcher ";

                if (this.toggleKey)
                {
                    text += "(T)";
                    show  = true;
                }

                if (this.holdKey)
                {
                    text += "(H)";
                    show  = true;
                }

                if (this.aegisKey)
                {
                    text += "(A)";
                    show  = true;
                }

                if (!show)
                {
                    return;
                }

                RendererManager.DrawText(text, new Vector2(this.statusX, this.statusY), Color.LawnGreen, 20 * Hud.Info.ScreenRatio);
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }
        }
Example #31
0
        protected override void ManaBar(float mana, float maximumMana, float manaPerc, Vector2 hpBarPosition, float manaBarSizeY)
        {
            if (!ManaBarMenu.ManaBarItem)
            {
                return;
            }

            var manaBarPosition = ManaBarUtils.ManaBarPosition(hpBarPosition);
            var pos             = ManaBarUtils.ManaBarBackPosition(manaBarPosition);
            var size            = new Vector2(HUDInfo.HpBarSizeX - 1, manaBarSizeY + 3);
            var size2           = new Vector2(ManaBarUtils.ManaBarSizeX(manaPerc), manaBarSizeY);

            RendererManager.DrawFilledRectangle(new RectangleF(pos.X, pos.Y, size.X, size.Y), Color.Zero, Color.Black, 0);
            RendererManager.DrawTexture("Divine.BeAware.Resources.Textures.ui_manabar.png", new RectangleF(manaBarPosition.X, manaBarPosition.Y, size2.X, size2.Y));

            if (ManaBarMenu.ManaBarValueItem)
            {
                var manaText    = $"{ (int)mana }/{ (int)maximumMana }";
                var sizeText    = 12.5f * HUDInfo.RatioPercentage;
                var measureText = RendererManager.MeasureText(manaText, sizeText);

                RendererManager.DrawText(manaText, ManaBarUtils.ManaBarValuePosition(manaBarPosition, measureText.X), Color.WhiteSmoke, sizeText);
            }
        }
Example #32
0
 static Engine()
 {
   behaviourManager = new BehaviourManager();
   rendererManager = new RendererManager();
 }