Ejemplo n.º 1
0
        public override void Load(IController hud)
        {
            base.Load(hud);

            OtherAreaPrefix = "\u2694 "; //?
            //MinutesSecondsFormat = "{0:%m}m {0:%s}s";
            MinutesSecondsFormat = "{0:%m}:{0:ss}";
            //SecondsFormat = "{0:%s}s";
            SecondsFormat = "{0:%s}";

            RiftPercentFormat    = " ({0:#}%)";
            ClosingSecondsFormat = " ({0:%s})";

            pauseTimer = Hud.CreateWatch();

            InRiftFont = Hud.Render.CreateFont("tahoma", 7, 224, 255, 210, 150, true, false, false);
            InRiftFont.SetShadowBrush(222, 0, 0, 0, true);

            OtherAreaFont = Hud.Render.CreateFont("tahoma", 8, 224, 240, 240, 240, true, false, false);
            OtherAreaFont.SetShadowBrush(222, 0, 0, 0, true);

            /*
             * InRiftDecorator = new TopLabelDecorator(hud)
             * {
             *  BackgroundBrush = Hud.Render.CreateBrush(0, 0, 0, 0, 0),
             *  BorderBrush = Hud.Render.CreateBrush(200, 255, 255, 255, 2),
             *  TextFont = Hud.Render.CreateFont("tahoma", 7, 224, 255, 210, 150, true, false, false),
             *  TextFunc = GetText,
             * };
             * InRiftDecorator.TextFont.SetShadowBrush(222, 0, 0, 0, true);
             *
             * OtherAreaDecorator = new TopLabelDecorator(hud)
             * {
             *  BackgroundBrush = Hud.Render.CreateBrush(0, 0, 0, 0, 0),
             *  BorderBrush = Hud.Render.CreateBrush(0, 0, 0, 0, 2),
             *  TextFont = Hud.Render.CreateFont("tahoma", 8, 224, 240, 240, 240, true, false, false),
             *  TextFunc = GetText,
             * };
             * OtherAreaDecorator.TextFont.SetShadowBrush(222, 0, 0, 0, true);/**/
        }
Ejemplo n.º 2
0
        public override void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.AfterClip)
            {
                return;
            }
            if (Hud.Inventory.InventoryMainUiElement.Visible)
            {
                return;
            }
            if (riftQuest == null)
            {
                return;
            }
            if (riftQuest.State == QuestState.none)
            {
                return;
            }
            if (riftQuest.QuestStepId > 10)
            {
                return;
            }
            if (Hud.Game.SpecialArea == SpecialArea.GreaterRift)
            {
                return;
            }

            var uiRect = Hud.Render.GetUiElement("Root.NormalLayer.eventtext_bkgrnd.eventtext_region.stackpanel.rift_wrapper.rift_container.rift_progress_bar");

            if (uiRect == null)
            {
                return; //useless ??
            }
            var layout = OtherAreaFont.GetTextLayout(GetText());

            if (uiRect.Visible)
            {
                var x = uiRect.Rectangle.Left - layout.Metrics.Width / 2 + uiRect.Rectangle.Width * (float)Hud.Game.RiftPercentage / 100.0f;
                InRiftFont.DrawText(layout, x, uiRect.Rectangle.Bottom + Hud.Window.Size.Height * 0.015f);
            }
            else
            {
                var uiMapRect = Hud.Render.MinimapUiElement;
                var x         = uiMapRect.Rectangle.Right - layout.Metrics.Width - Hud.Window.Size.Height * 0.033f;
                var y         = uiMapRect.Rectangle.Bottom + Hud.Window.Size.Height * 0.0033f;

                OtherAreaFont.DrawText(layout, x, y);
            }

            //if (uiRect.Visible)
            //{
            //    var w = uiRect.Rectangle.Width;//3.4f;
            //    //var x = uiRect.Rectangle.Left + uiRect.Rectangle.Width/2 - w/2;
            //    var x = uiRect.Rectangle.Left + uiRect.Rectangle.Width*(float)Hud.Game.RiftPercentage/100.0f;
            //    Simon.Says.Debug(Hud.Game.RiftPercentage.ToString());
            //    InRiftDecorator.Paint(x, uiRect.Rectangle.Bottom + Hud.Window.Size.Height*0.015f, w, uiRect.Rectangle.Height, HorizontalAlign.Left);
            //    //InRiftDecorator.Paint(uiRect.Rectangle.Left, uiRect.Rectangle.Bottom + 7, uiRect.Rectangle.Width, uiRect.Rectangle.Height, HorizontalAlign.Center);
            //}
            //else
            //{
            //    var uiMapRect = Hud.Render.MinimapUiElement;
            //    OtherAreaDecorator.Paint(uiMapRect.Rectangle.Left, uiMapRect.Rectangle.Bottom, uiMapRect.Rectangle.Width - (Hud.Window.Size.Height * 0.032f) /**/, Hud.Window.Size.Height * 0.028f, HorizontalAlign.Right);
            //}
        }