void Awake()
 {
     dead = false;
     uim = GameObject.Find ("UserInterface").GetComponent<UserInterfaceManager>();
     fpsc = gameObject.GetComponent<FPSController> ();
     csc = GetComponentInChildren<CharacterSoundController>();
 }
Ejemplo n.º 2
0
        public HealthScannerWindow(Entity assignedEnt, Vector2D mousePos, UserInterfaceManager uiMgr,
                                   IResourceManager resourceManager)
        {
            _resourceManager = resourceManager;
            assigned = assignedEnt;
            _uiMgr = uiMgr;

            _overallHealth = new TextSprite("hpscan" + assignedEnt.Uid.ToString(), "",
                                            _resourceManager.GetFont("CALIBRI"));
            _overallHealth.Color = Color.ForestGreen;

            _background = _resourceManager.GetSprite("healthscan_bg");

            _head = _resourceManager.GetSprite("healthscan_head");
            _chest = _resourceManager.GetSprite("healthscan_chest");
            _arml = _resourceManager.GetSprite("healthscan_arml");
            _armr = _resourceManager.GetSprite("healthscan_armr");
            _groin = _resourceManager.GetSprite("healthscan_groin");
            _legl = _resourceManager.GetSprite("healthscan_legl");
            _legr = _resourceManager.GetSprite("healthscan_legr");

            Position = new Point((int) mousePos.X, (int) mousePos.Y);

            Setup();
            Update(0);
        }
Ejemplo n.º 3
0
 public void Init(GameObject manager)
 {
     cm = manager.GetComponent<CharacterManager>();
     am = manager.GetComponent<AnnouncementManager>();
     uim = GameObject.Find ("UserInterface").GetComponent<UserInterfaceManager>();
     cas = GetComponentInChildren<CharacterSoundController>();
     health = maximumHealth;
     UpdateHealthToUI ();
 }
Ejemplo n.º 4
0
        public FloatingDecoration(IResourceManager resourceManager, string spriteName)
        {
            _resourceManager = resourceManager;
            DrawSprite = _resourceManager.GetSprite(spriteName);
//DrawSprite.Smoothing = Smoothing.Smooth;

            _uiMgr = (UserInterfaceManager) IoCManager.Resolve<IUserInterfaceManager>();

            Update(0);
        }
 void Awake()
 {
     uim = GameObject.Find("UserInterface").GetComponent<UserInterfaceManager>();
     cas = GetComponentInChildren<CharacterSoundController>();
     bulletSpawnPoint = transform.FindChild("Camera");
     overlay = bulletSpawnPoint.FindChild("Overlay").gameObject;
     bulletSpawnPoint = bulletSpawnPoint.FindChild("BulletSpawnPoint");
     crossHairs = overlay.transform.FindChild ("Crosshairs").gameObject;
     dead = false;
 }
    void Awake()
    {
        csc = GetComponentInChildren<CharacterSoundController>();
        uim = GameObject.Find("UserInterface").GetComponent<UserInterfaceManager>();
        lc = GetComponentInChildren<LaserController>();
        cameraTf = transform.FindChild("Camera");
        overlay = cameraTf.FindChild ("Overlay").gameObject;
        crosshairs = overlay.transform.FindChild ("Crosshairs").gameObject;
        dead = false;

        actionCooldown = 0.6f;
        previousActionTime = Time.time;
    }
        public void UserInterfaceManager_can_add_ErrorMessages_and_retrieve_them()
        {
            const string errorMessage1 = "how dare you!";
            const string errorMessage2 = "STOP IT!";

            var messageQueue = new Queue<string>();
                var userSession = new Mock<IUserSession>();
            userSession.Setup(x => x.GetMessages()).Returns(messageQueue);

            var provider = new UserInterfaceManager(userSession.Object);
            provider.AddMessage(errorMessage1);
            provider.AddMessage(errorMessage2);

            var messages = provider.GetMessages();

            messages.Count().ShouldEqual(2);
        }
 void Awake()
 {
     handAnimator = transform.FindChild("Camera").FindChild("Overlay").FindChild("Hands").GetComponent<Animator>();
     dead = false;
     uim = GameObject.Find("UserInterface").GetComponent<UserInterfaceManager>();
     cas = GetComponentInChildren<CharacterSoundController>();
     cameraTf = transform.FindChild("Camera");
     overlay = cameraTf.FindChild ("Overlay").gameObject;
     ps = overlay.transform.FindChild("Particles").GetComponent<ParticleSystem>();
     weaponPivot = cameraTf.FindChild ("WeaponPivot").gameObject;
     slashRange = GetComponentInChildren<MeleeRangeInformer> ();
     weaponPivot.SetActive (false);
     actionCooldown = 0.7f;
     previousActionTime = Time.time;
     enemyInAim = false;
     //mwd = weaponPivot.GetComponentInChildren<MeleeWeaponDamages> ();
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Must be overriden by child classes for their own server specific startup behaviour.
        /// </summary>
        protected override void StartupComponents()
        {
            m_log.Info("[STARTUP]: Beginning startup processing");

            Version = Util.EnhanceVersionInformation();

            m_log.Info("[STARTUP]: Version: " + Version + "\n");

            Console = new Console(this,"Region", this);
            IConfig cnf = m_configSource.Source.Configs["Startup"];
            string loginURI = "http://127.0.0.1:9000/";
            string firstName = string.Empty;
            string lastName = string.Empty;
            string password = string.Empty;
            string startlocation = "";
            bool loadtextures = true;
            bool multipleSims = false;

            if (cnf != null)
            {
                loginURI = cnf.GetString("login_uri", "");
                firstName = cnf.GetString("first_name", "test");
                lastName = cnf.GetString("last_name", "user");
                password = cnf.GetString("pass_word", "nopassword");
                loadtextures = cnf.GetBoolean("load_textures", true);
                MeshSculpties = cnf.GetBoolean("mesh_sculpties", MeshSculpties);
                BackFaceCulling = cnf.GetBoolean("backface_culling", BackFaceCulling);
                AvatarMesh = cnf.GetString("avatar_mesh", AvatarMesh);
                AvatarMaterial = cnf.GetString("avatar_material", AvatarMaterial);
                AvatarScale = cnf.GetFloat("avatar_scale", AvatarScale);
                startlocation = cnf.GetString("start_location", "");
                multipleSims = cnf.GetBoolean("multiple_sims", multipleSims);
                ProcessFoliage = cnf.GetBoolean("process_foliage", ProcessFoliage);
                m_limitFramesPerSecond = cnf.GetBoolean("limitfps", m_limitFramesPerSecond);
            }
            LoadTextures = loadtextures;
            MainConsole.Instance = Console;

            // Initialize LibOMV
            if (NetworkInterface == null) NetworkInterface = new RadegastNetworkModule(RInstance);
            NetworkInterface.MultipleSims = multipleSims;
            NetworkInterface.OnLandUpdate += OnNetworkLandUpdate;
            NetworkInterface.OnConnected += OnNetworkConnected;
            NetworkInterface.OnObjectAdd += OnNetworkObjectAdd;
            NetworkInterface.OnSimulatorConnected += OnNetworkSimulatorConnected;
            NetworkInterface.OnObjectUpdate += OnNetworkObjectUpdate;
            NetworkInterface.OnObjectRemove += OnNetworkObjectRemove;
            NetworkInterface.OnAvatarAdd += OnNetworkAvatarAdd;
            //NetworkInterface.OnChat +=new NetworkChatDelegate(OnNetworkChat);
            //NetworkInterface.OnFriendsListUpdate +=new NetworkFriendsListUpdateDelegate(OnNetworkFriendsListChange);

            //NetworkInterface.Login(loginURI, firstName + " " + lastName, password, startlocation);

            // Startup the GUI
            Renderer = new RaegastRenderer(this,Device);
            Renderer.Startup();

            GUIFont defaultFont = Renderer.GuiEnvironment.GetFont("defaultfont.png");

            skin = Renderer.GuiEnvironment.Skin;
            skin.Font = defaultFont;
            skincolor = skin.GetColor(GuiDefaultColor.Face3D);
            skincolor.A = 255;
            skin.SetColor(GuiDefaultColor.Face3D, skincolor);
            skincolor = skin.GetColor(GuiDefaultColor.Shadow3D);
            skincolor.A = 255;
            skin.SetColor(GuiDefaultColor.Shadow3D, skincolor);
            // Set up event handler for the GUI window events.
            Renderer.Device.OnEvent += new OnEventDelegate(OnDeviceEvent);

            Renderer.Device.Resizeable = true;

            MeshManager = new MeshManager(Renderer.SceneManager.MeshManipulator, Renderer.Device);

            SceneGraph = new VSceneGraph(this);

            // Set up the picker.
            SceneGraph.TrianglePicker = new TrianglePickerMapper(Renderer.SceneManager.CollisionManager);
            SceneGraph.TriangleSelector = Renderer.SceneManager.CreateMetaTriangleSelector();

            // Only create a texture manager if the user configuration option is enabled for downloading textures
            if (LoadTextures)
            {
                TextureManager = new TextureManager(this,Renderer.Device, Renderer.Driver, SceneGraph.TrianglePicker, SceneGraph.TriangleSelector, "IdealistCache", NetworkInterface);
                TextureManager.OnTextureLoaded += OnNetworkTextureDownloaded;
            }

            AvatarController = new AvatarController(NetworkInterface, null);

            TerrainManager = ModuleManager.GetTerrainManager(this, m_configSource);

            Renderer.SceneManager.SetAmbientLight(new Colorf(1f, 0.2f, 0.2f, 0.2f));

            // This light simulates the sun
            //SceneNode light2 = Renderer.SceneManager.AddLightSceneNode(Renderer.SceneManager.RootSceneNode, new Vector3D(0, 255, 0), new Colorf(0f, 0.5f, 0.5f, 0.5f), 250, -1);
            SceneNode light2 = Renderer.SceneManager.AddLightSceneNode(Renderer.SceneManager.RootSceneNode, new Vector3D(0, 255, 0), new Colorf(0f, 0.6f, 0.6f, 0.6f), 512, -1);

            // Fog is on by default, this line disables it.
            //Renderer.SceneManager.VideoDriver.SetFog(new Color(0, 255, 255, 255), false, 9999, 9999, 0, false, false);
            float fogBrightness = 0.8f;
            Renderer.SceneManager.VideoDriver.SetFog(new Color(0, (int)(0.5f * 255 * fogBrightness), (int)(0.5f * 255 * fogBrightness), (int)(1.0f * 255 * fogBrightness)), true, 50, 100, 0, true, true);

            //ATMOSkySceneNode skynode = new ATMOSkySceneNode(Renderer.Driver.GetTexture("irrlicht2_up.jpg"), null, Renderer.SceneManager, 100, -1);
            
            //ATMOSphere atmosphere = new ATMOSphere(Renderer.Device.Timer, null, Renderer.SceneManager, -1);
            //atmosphere.SkyTexture = Renderer.Driver.GetTexture("irrlicht2_up.jpg");

            
            Renderer.Driver.SetTextureFlag(TextureCreationFlag.CreateMipMaps, false);
            bool Broken = false;
            if (!Broken) Renderer.SceneManager.AddSkyBoxSceneNode(null, new Texture[] {
                Renderer.Driver.GetTexture("topax2.jpg"),
                Renderer.Driver.GetTexture("irrlicht2_dn.jpg"),
                Renderer.Driver.GetTexture("rightax2.jpg"),
				Renderer.Driver.GetTexture("leftax2.jpg"),
                Renderer.Driver.GetTexture("frontax2.jpg"),
                Renderer.Driver.GetTexture("backax2.jpg")}, 
0);

            Renderer.Driver.SetTextureFlag(TextureCreationFlag.CreateMipMaps, true);
            

            CameraController = new CameraController(this,Renderer.SceneManager);

            SceneGraph.WaterNode = new WaterSceneNode(null, Renderer.SceneManager, new Dimension2Df(180, 180), new Dimension2D(100, 100), new Dimension2D(512, 512));
            SceneGraph.WaterNode.Position = new Vector3D(0, 30, 0);
            //SceneGraph.WaterNode.WaveHeight *= .4f;
            SceneGraph.WaterNode.RefractionFactor = 0.3f;
            SceneGraph.WaterNode.WaveDisplacement = 2f;
            SceneGraph.WaterNode.WaveHeight = 2f;
            SceneGraph.WaterNode.WaveLength = 2f;
            SceneGraph.WaterNode.WaveSpeed = 5f;
            SceneGraph.WaterNode.WaveRepetition = 20f;
            SceneGraph.WaterNode.Scale = new Vector3D(0.2f,0.2f,0.2f);
            SceneGraph.WaterNode.MultiColor = new Colorf(0.9f, 0.7f, 0.7f, 1.0f);

            UserInterface = new UserInterfaceManager(this, Renderer.Driver, Renderer.SceneManager, Renderer.GuiEnvironment, CameraController, AvatarController);
            UserInterface.DefaultFont = defaultFont;
             
            XmlReader xml = Broken? null: XmlReader.Create(new StreamReader("../../../media/About.xml"));
            while (xml != null && xml.Read())
            {
                switch (xml.NodeType)
                {
                    case XmlNodeType.Text:
                        UserInterface.AboutText = xml.ReadContentAsString();
                        break;
                    case XmlNodeType.Element:
                        if (xml.Name.Equals("startUpModel"))
                        {
                        }
                        else if (xml.Name.Equals("messageText"))
                            UserInterface.AboutCaption = xml.GetAttribute("caption");
                        break;
                }
            }

            string formsUiConfigurationOption = m_configSource.Source.Configs["Startup"].GetString("forms", "true");
            if (formsUiConfigurationOption == "true")
            {
                frmCommunications f = new frmCommunications(NetworkInterface);
                f.Visible = true;
                this.m_formsThread = new Thread(delegate() { Application.DoEvents(); Thread.Sleep(50); });
                m_formsThread.Start();
            }

            AnimationManager = new AnimationManager(this);

            TimeSpan timeTaken = DateTime.UtcNow - StartupTime;

            m_log.InfoFormat("[STARTUP]: Startup took {0}m {1}s", timeTaken.Minutes, timeTaken.Seconds);

        }
Ejemplo n.º 10
0
        public void Activate(Inventor.ApplicationAddInSite addInSiteObject, bool firstTime)
        {        
            try
            {
                SetupDynamoPaths();
                inventorApplication = addInSiteObject.Application;
                PersistenceManager.InventorApplication = inventorApplication;
                userInterfaceManager = inventorApplication.UserInterfaceManager;

                //initialize event delegates
                userInterfaceEvents = inventorApplication.UserInterfaceManager.UserInterfaceEvents;

                UserInterfaceEventsSink_OnResetCommandBarsEventDelegate = new UserInterfaceEventsSink_OnResetCommandBarsEventHandler(UserInterfaceEvents_OnResetCommandBars);
                userInterfaceEvents.OnResetCommandBars += UserInterfaceEventsSink_OnResetCommandBarsEventDelegate;

                UserInterfaceEventsSink_OnResetEnvironmentsEventDelegate = new UserInterfaceEventsSink_OnResetEnvironmentsEventHandler(UserInterfaceEvents_OnResetEnvironments);
                userInterfaceEvents.OnResetEnvironments += UserInterfaceEventsSink_OnResetEnvironmentsEventDelegate;

                UserInterfaceEventsSink_OnResetRibbonInterfaceEventDelegate = new UserInterfaceEventsSink_OnResetRibbonInterfaceEventHandler(UserInterfaceEvents_OnResetRibbonInterface);
                userInterfaceEvents.OnResetRibbonInterface += UserInterfaceEventsSink_OnResetRibbonInterfaceEventDelegate;

                appEvents = inventorApplication.ApplicationEvents;
                appEvents.OnActivateDocument += appEvents_OnActivateDocument;
                appEvents.OnDeactivateDocument += appEvents_OnDeactivateDocument;

                Icon dynamoIcon = Resources.logo_square_32x32;

                //retrieve the GUID for this class
                GuidAttribute addInCLSID;
                addInCLSID = (GuidAttribute)GuidAttribute.GetCustomAttribute(this.GetType(), typeof(GuidAttribute));
                string addInCLSIDString;
                addInCLSIDString = "{" + addInCLSID.Value + "}";

                dynamoAddinButton = new DynamoInventorAddinButton(
                        buttonDisplayName, buttonInternalName, CommandTypesEnum.kShapeEditCmdType,
                        addInCLSIDString, "Initialize Dynamo.",
                        "Dynamo is a visual programming environment for Inventor.", dynamoIcon, dynamoIcon, ButtonDisplayEnum.kDisplayTextInLearningMode);

                CommandCategory assemblyUtilitiesCategory = inventorApplication.CommandManager.CommandCategories.Add(commandCategoryDisplayName, commandCategoryInternalName, addInCLSID);
                assemblyUtilitiesCategory.Add(dynamoAddinButton.ButtonDefinition);

                if (firstTime == true)
                {
                    InterfaceStyleEnum interfaceStyle;
                    interfaceStyle = userInterfaceManager.InterfaceStyle;

                    if (interfaceStyle == InterfaceStyleEnum.kClassicInterface)
                    {
                        CommandBar assemblyUtilityCommandBar;

                        assemblyUtilityCommandBar = userInterfaceManager.CommandBars.Add(commandBarDisplayName,
                                                                                         commandBarInternalName,
                                                                                         CommandBarTypeEnum.kRegularCommandBar,
                                                                                         addInCLSID);
                    }

                    else
                    {   
                        Inventor.Ribbons ribbons = userInterfaceManager.Ribbons;
                        Inventor.Ribbon assemblyRibbon = ribbons["Assembly"];
                        RibbonTabs ribbonTabs = assemblyRibbon.RibbonTabs;
                        RibbonTab assemblyRibbonTab = ribbonTabs["id_AddInsTab"];
                        RibbonPanels ribbonPanels = assemblyRibbonTab.RibbonPanels;
                        assemblyRibbonPanel = ribbonPanels.Add(ribbonPanelDisplayName, ribbonPanelInternalName, "{DB59D9A7-EE4C-434A-BB5A-F93E8866E872}", "", false);
                        CommandControls assemblyRibbonPanelCtrls = assemblyRibbonPanel.CommandControls;
                        CommandControl assemblyCmdBtnCmdCtrl = assemblyRibbonPanelCtrls.AddButton(dynamoAddinButton.ButtonDefinition, true, true, "", false); 

                        Inventor.Ribbon partRibbon = ribbons["Part"];
                        RibbonTabs partRibbonTabs = partRibbon.RibbonTabs;
                        RibbonTab modelRibbonTab = partRibbonTabs["id_AddInsTab"];
                        RibbonPanels partRibbonPanels = modelRibbonTab.RibbonPanels;
                        partRibbonPanel = partRibbonPanels.Add(ribbonPanelDisplayName, ribbonPanelInternalName, "{DB59D9A7-EE4C-434A-BB5A-F93E8866E872}", "", false);
                        CommandControls partRibbonPanelCtrls = partRibbonPanel.CommandControls;
                        CommandControl partCmdBtnCmdCtrl = partRibbonPanelCtrls.AddButton(dynamoAddinButton.ButtonDefinition, true, true, "", false);

                        Inventor.Ribbon drawingRibbon = ribbons["Drawing"];
                        RibbonTabs drawingRibbonTabs = drawingRibbon.RibbonTabs;
                        RibbonTab drawingRibbonTab = drawingRibbonTabs["id_AddInsTab"];
                        RibbonPanels drawingRibbonPanels = drawingRibbonTab.RibbonPanels;
                        drawingRibbonPanel = drawingRibbonPanels.Add(ribbonPanelDisplayName, ribbonPanelInternalName, "{DB59D9A7-EE4C-434A-BB5A-F93E8866E872}", "", false);
                        CommandControls drawingRibbonPanelCtrls = drawingRibbonPanel.CommandControls;
                        CommandControl drawingCmdBtnCmdCtrl = drawingRibbonPanelCtrls.AddButton(dynamoAddinButton.ButtonDefinition, true, true, "", false);  
                    }
                }
            }

            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
            }
        }
    void HandleSpawning()
    {
        uim = GameObject.Find("UserInterface").GetComponent<UserInterfaceManager>();
        am = GameObject.Find("GameManager").GetComponent<AnnouncementManager>();

        if (GameObject.Find("GameManager").GetComponent<GameManager>().GetLevelObjective() == LevelObjective.KillYourCharacters) {
            otherCharactersAreEnemies = true;
        } else {
            otherCharactersAreEnemies = false;
        }

        firstActive = false;
        secondActive = false;
        thirdActive = false;

        dyingWithouSwitching = false;

        if (uim != null) {
            uim.HideCharacterInfos();
        }

        characters = new List<GameObject>();
        GameState.characters = characters;
        CheckSpawns();
    }
Ejemplo n.º 12
0
 void Start()
 {
     gm = GameObject.Find("GameManager").GetComponent<GameManager>();
     am = gm.gameObject.GetComponent<AnnouncementManager>();
     uim = GameObject.Find("UserInterface").GetComponent<UserInterfaceManager>();
     OnLevelWasLoaded (GameState.GetLevel());
     if (gm.GetLevelObjective() == LevelObjective.KillYourCharacters) {
         otherCharactersAreEnemies = true;
     } else {
         otherCharactersAreEnemies = false;
     }
 }
Ejemplo n.º 13
0
 void GiveEnemyCountToUI()
 {
     if (!otherCharactersAreEnemies) {
         if (uim == null) {
             uim = GameObject.Find("UserInterface").GetComponent<UserInterfaceManager>();
         }
         uim.UpdateEnemyCount(enemies.Count);
     }
 }
Ejemplo n.º 14
0
    void OnLevelWasLoaded(int level)
    {
        if (level == 0) {
            Cursor.visible = true;
            Destroy(gameObject);
        }

        GameState.SetLastLevel(howManyLevels);

        #if !UNITY_EDITOR
                    Cursor.visible = false;
        #endif

        if (!initialized && level != 0) {
            am = gameObject.GetComponent<AnnouncementManager>();
            cm = gameObject.GetComponent<CharacterManager>();
            em = gameObject.GetComponent<EnemyManager>();
            uim = GameObject.Find("UserInterface").GetComponent<UserInterfaceManager>();

            objective = GameObject.Find("LevelLoader").GetComponent<LevelLoader>().levelObjective;
            am.InformLevelObjective(objective);

            initialized = true;
            levelCompleted = false;
            am.LevelLoadedFader();
            Invoke("LateStart", 0.1f);
        }
    }