Ejemplo n.º 1
0
 public HudNavBox(Dictionary <string, string> icons, List <GameData.BaseHotspot> hotspots, UIManager manager)
 {
     this.manager  = manager;
     this.hotspots = hotspots;
     navbuttons    = new HudModelElement(manager, Boxes[hotspots.Count], BoxPos.X, BoxPos.Y, BoxScale.X, BoxScale.Y);
     toggleButtons = new HudToggleButtonElement[hotspots.Count];
     IconScale     = new Vector2(2.08f, 2.96f);
     for (int i = 0; i < hotspots.Count; i++)
     {
         string hack = null;
         if (!icons.ContainsKey(hotspots[i].SetVirtualRoom ?? hotspots[i].Room))
         {
             hack = "Cityscape";                     //HACK: This probably means FL doesn't determine icons based on room name
         }
         toggleButtons[i] = new HudBaseButtonElement(
             manager,
             icons[hack ?? hotspots[i].SetVirtualRoom ?? hotspots[i].Room],
             BaseIconPositions[hotspots.Count][i * 2],
             BaseIconPositions[hotspots.Count][i * 2 + 1],
             IconScale.X,
             IconScale.Y
             )
         {
             Tag = "mnv" + i.ToString()
         };
     }
 }
Ejemplo n.º 2
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;
        }
Ejemplo n.º 3
0
 public HudNavBox(List <Maneuver> maneuvers, UIManager manager)
 {
     this.manager   = manager;
     this.maneuvers = maneuvers;
     navbuttons     = new HudModelElement(manager, Boxes[maneuvers.Count], BoxPos.X, BoxPos.Y, BoxScale.X, BoxScale.Y);
     toggleButtons  = new HudToggleButtonElement[maneuvers.Count];
     for (int i = 0; i < maneuvers.Count; i++)
     {
         toggleButtons[i] = new HudToggleButtonElement(
             manager,
             maneuvers[i].ActiveModel,
             maneuvers[i].InactiveModel,
             IconPositions[i * 2],
             IconPositions[i * 2 + 1],
             IconScale.X,
             IconScale.Y
             )
         {
             Tag = "mnv" + i.ToString()
         };
     }
 }