Exemple #1
0
        public Hud(FreelancerGame game, List <GameData.BaseHotspot> hotspots = null)
        {
            manager = new UIManager(game);
            //backgrounds
            contactslist = new HudModelElement(manager, "hud_target.cmp", -0.73f, -0.69f, 2.1f, 2.9f);
            manager.Elements.Add(contactslist);

            shipinfo = new HudModelElement(manager, "hud_shipinfo.cmp", 0.73f, -0.69f, 2.1f, 2.9f);
            manager.Elements.Add(shipinfo);

            numberbox = new HudNumberBoxElement(manager);
            manager.Elements.Add(numberbox);

            gauge = new HudGaugeElement(manager);
            manager.Elements.Add(gauge);

            chatbox = new HudChatBox(manager);
            manager.Elements.Add(chatbox);

            //Maneuvers
            if (hotspots == null)
            {
                mnvs       = game.GameData.GetManeuvers().ToList();
                navbuttons = new HudNavBox(mnvs, manager);
            }
            else
            {
                navbuttons = new HudNavBox(game.GameData.GetBaseNavbarIcons(), hotspots, manager);
            }
            navbuttons.Show();

            manager.Clicked += Manager_OnClick;

            reticle         = game.ResourceManager.GetDrawable(game.GameData.ResolveDataPath("INTERFACE/HUD/hud_reticle.3db"));
            reticle_health  = game.ResourceManager.GetDrawable(game.GameData.ResolveDataPath("INTERFACE/HUD/hud_reticle_health.3db"));
            reticle_shields = game.ResourceManager.GetDrawable(game.GameData.ResolveDataPath("INTERFACE/HUD/hud_reticle_shields.3db"));

            UI_HUD_targetarrow   = game.ResourceManager.FindMaterial(CrcTool.FLModelCrc("UI_HUD_targetarrow")).Render;
            UI_HUD_targetingblue = game.ResourceManager.FindMaterial(CrcTool.FLModelCrc("UI_HUD_targetingblue")).Render;

            TextEntry = false;
        }