Esempio n. 1
0
        private static IEnumerator initGameHud()
        {
            yield return(Wait(1));

            //Delete GSC hud and set custom hud
            int startOfIcons = 0;

            for (int i = 65536; i < 65800; i++)
            {
                HudElem temp = HudElem.GetHudElem(i);
                if (temp.FontScale == 1.6f && (string)temp.GetField(4) == "small")
                {
                    startOfIcons = i - 1;
                    break;
                }
            }

            if (startOfIcons == 0)
            {
                yield break;
            }

            ballIcon_allies = HudElem.GetHudElem(startOfIcons);
            ballText_allies = HudElem.GetHudElem(startOfIcons + 1);
            ballIcon_axis   = HudElem.GetHudElem(startOfIcons + 4);
            ballText_axis   = HudElem.GetHudElem(startOfIcons + 5);
            HudElem ballIcon2_allies = HudElem.GetHudElem(startOfIcons + 2);
            HudElem ballText2_allies = HudElem.GetHudElem(startOfIcons + 3);
            HudElem ballIcon2_axis   = HudElem.GetHudElem(startOfIcons + 6);
            HudElem ballText2_axis   = HudElem.GetHudElem(startOfIcons + 7);

            //ballIcon2_allies.Destroy();
            ballIcon2_allies.Alpha = 0;
            //ballIcon2_axis.Destroy();
            ballIcon2_axis.Alpha = 0;
            //ballText2_allies.Destroy();
            ballText2_allies.Alpha = 0;
            //ballText2_axis.Destroy();
            ballText2_axis.Alpha = 0;

            ballIcon_allies.SetShader("equipment_emp_grenade", 32, 32);
            ballIcon_axis.SetShader("equipment_emp_grenade", 32, 32);
            ballText_allies.SetText("HOME");
            ballText_axis.SetText("HOME");

            //axisSiteAttackerWaypoint = HudElem.GetHudElem(65540);//Allies attacker
            //axisSiteDefenderWaypoint = HudElem.GetHudElem(65541);//Axis defend
            //alliesSiteDefenderWaypoint = HudElem.GetHudElem(65542);//Allies defend
            //alliesSiteAttackerWaypoint = HudElem.GetHudElem(65543);//Axis attack

            startOfIcons = 0;
            HudElem[] gameHud = new HudElem[4] {
                alliesSiteAttackerWaypoint, alliesSiteDefenderWaypoint, axisSiteAttackerWaypoint, axisSiteDefenderWaypoint
            };

            for (int i = 65544; i < 65800; i++)
            {
                HudElem temp = HudElem.GetHudElem(i);
                if ((string)temp.GetField(4) == "default" && temp.Alpha == 0.5019608f && !gameHud.Contains(temp))
                {
                    temp = HudElem.GetHudElem(i + 1);
                    if ((string)temp.GetField(4) == "default" && temp.Alpha == 0.5019608f && !gameHud.Contains(temp))//Check for the second one after
                    {
                        startOfIcons = i;
                        break;
                    }
                }
            }

            if (startOfIcons == 0)
            {
                yield break;
            }

            HudElem flagIcon = HudElem.GetHudElem(startOfIcons);

            flagIcon.Destroy();
            flagIcon = HudElem.GetHudElem(startOfIcons + 1);
            flagIcon.Destroy();
            flagIcon = HudElem.GetHudElem(startOfIcons + 2);
            flagIcon.Destroy();
            flagIcon = HudElem.GetHudElem(startOfIcons + 3);
            flagIcon.Destroy();
        }