Esempio n. 1
0
        public static void GamblerText(this Entity player, string text, Vector3 color, Vector3 glowColor, float intensity, float glowIntensity)
        {
            HudElem hud = GambleTextHuds[player.EntRef];

            hud.Call("destroy");

            hud = HudElem.CreateFontString(player, "hudbig", 2);
            var ent = hud.Entity;

            hud.SetPoint("CENTERMIDDLE", "CENTERMIDDLE", 0, 0);
            hud.SetText(text);
            hud.Color     = color;
            hud.GlowColor = glowColor;
            hud.Alpha     = 0;
            hud.GlowAlpha = glowIntensity;

            hud.ChangeFontScaleOverTime(0.25f, 0.75f);
            hud.Call("FadeOverTime", 0.25f);
            hud.Alpha = intensity;

            player.AfterDelay(250, e => player.Call("playLocalSound", "mp_bonus_end"));

            player.AfterDelay(3000, e =>
            {
                if (hud.Entity == ent)
                {
                    hud.ChangeFontScaleOverTime(0.25f, 2f);
                    hud.Call("FadeOverTime", 0.25f);
                    hud.Alpha = 0;
                }
            });

            player.AfterDelay(4000, e =>
            {
                if (hud.Entity == ent)
                {
                    hud.ChangeFontScaleOverTime(0.25f, 2f);
                    hud.Call("FadeOverTime", 0.25f);
                    hud.Alpha = 0;
                }
            });
        }
Esempio n. 2
0
        public static void TextPopup2(this Entity player, string text)
        {
            HudElem hud = player.GetTextPopup2Hud();

            if (hud == null)
            {
                hud = HudElem.NewClientHudElem(player);
            }
            hud.Call("destroy");

            hud = HudElem.CreateFontString(player, "hudbig", 0.8f);
            hud.SetPoint("BOTTOMCENTER", "BOTTOMCENTER", 0, -105);
            hud.SetText(text);
            hud.Alpha     = 0.85f;
            hud.GlowColor = new Vector3(0.3f, 0.9f, 0.9f);
            hud.GlowAlpha = 0.55f;
            hud.Call("SetPulseFX", 100, 3000, 1000);
            hud.ChangeFontScaleOverTime(0.1f, 0.75f);
            player.AfterDelay(100, e =>
            {
                hud.ChangeFontScaleOverTime(0.1f, 0.65f);
            });
        }
Esempio n. 3
0
    private static void buildEmoteMenu(Entity player)
    {
        if (player.GetField <bool>("emoteMenuOpen"))
        {
            return;
        }

        if (player.GetField <bool>("isEmoting"))
        {
            return;
        }

        if (!player.IsAlive)
        {
            return;
        }

        player.SetField("emoteMenuOpen", true);

        HudElem bg = NewClientHudElem(player);

        bg.AlignX          = HudElem.XAlignments.Center;
        bg.AlignY          = HudElem.YAlignments.Middle;
        bg.HorzAlign       = HudElem.HorzAlignments.Center;
        bg.VertAlign       = HudElem.VertAlignments.Middle;
        bg.Alpha           = 0;
        bg.Archived        = false;
        bg.Foreground      = true;
        bg.HideIn3rdPerson = false;
        bg.HideWhenDead    = true;
        bg.HideWhenInDemo  = false;
        bg.HideWhenInMenu  = false;
        bg.X     = 0;
        bg.Y     = 0;
        bg.Color = new Vector3(1, 1, 1);
        bg.SetShader("compassping_portable_radar_sweep", 0, 0);

        bg.ScaleOverTime(0.5f, 320, 320);
        bg.FadeOverTime(0.5f);
        bg.Alpha = 1;

        HudElem bgCross = NewClientHudElem(player);

        bgCross.Parent          = bg;
        bgCross.AlignX          = HudElem.XAlignments.Center;
        bgCross.AlignY          = HudElem.YAlignments.Middle;
        bgCross.HorzAlign       = HudElem.HorzAlignments.Center;
        bgCross.VertAlign       = HudElem.VertAlignments.Middle;
        bgCross.Alpha           = 0;
        bgCross.Archived        = false;
        bgCross.Foreground      = true;
        bgCross.HideIn3rdPerson = false;
        bgCross.HideWhenDead    = true;
        bgCross.HideWhenInDemo  = false;
        bgCross.HideWhenInMenu  = false;
        bgCross.X     = 0;
        bgCross.Y     = 120;
        bgCross.Color = new Vector3(0, .8f, .8f);
        bgCross.SetShader("damage_feedback", 0, 0);

        bgCross.ScaleOverTime(0.5f, 260, 460);
        bgCross.FadeOverTime(0.5f);
        bgCross.Alpha = .7f;

        HudElem selections1 = NewClientHudElem(player);

        selections1.Parent          = bg;
        selections1.AlignX          = HudElem.XAlignments.Center;
        selections1.AlignY          = HudElem.YAlignments.Top;
        selections1.HorzAlign       = HudElem.HorzAlignments.Center;
        selections1.VertAlign       = HudElem.VertAlignments.Middle;
        selections1.Alpha           = 0;
        selections1.Archived        = false;
        selections1.Foreground      = true;
        selections1.HideIn3rdPerson = false;
        selections1.HideWhenDead    = true;
        selections1.HideWhenInDemo  = false;
        selections1.HideWhenInMenu  = false;
        selections1.X    = 0;
        selections1.Y    = -120;
        selections1.Font = HudElem.Fonts.HudSmall;
        //selections1.FontScale = .8f;
        selections1.FontScale = .1f;
        selections1.SetText("   " + emoteList_names[0] + "\n\n\n\n         (^3[{+actionslot 4}]^7)\n\n\n\n\n\n         (^3[{+actionslot 7}]^7)\n\n\n\n" + emoteList_names[3]);

        selections1.FadeOverTime(0.5f);
        selections1.Alpha = 1;
        selections1.ChangeFontScaleOverTime(.5f);
        selections1.FontScale = 1f;

        HudElem selections2 = NewClientHudElem(player);

        selections2.Parent          = bg;
        selections2.AlignX          = HudElem.XAlignments.Center;
        selections2.AlignY          = HudElem.YAlignments.Middle;
        selections2.HorzAlign       = HudElem.HorzAlignments.Center;
        selections2.VertAlign       = HudElem.VertAlignments.Middle;
        selections2.Alpha           = 0;
        selections2.Archived        = false;
        selections2.Foreground      = true;
        selections2.HideIn3rdPerson = false;
        selections2.HideWhenDead    = true;
        selections2.HideWhenInDemo  = false;
        selections2.HideWhenInMenu  = false;
        selections2.X         = 0;
        selections2.Y         = 0;
        selections2.Font      = HudElem.Fonts.HudSmall;
        selections2.FontScale = .1f;
        selections2.SetText(emoteList_names[1] + "    (^3[{+actionslot 5}]^7)          (^3[{+actionslot 6}]^7)  " + emoteList_names[2]);

        selections2.FadeOverTime(0.5f);
        selections2.Alpha = 1;
        selections2.ChangeFontScaleOverTime(.5f);
        selections2.FontScale = 1f;

        player.SetField("emoteMenu", bg);
    }