public override void OnLoad(ConfigNode node)
        {
            if (node == null)
            {
                return;
            }

            Util.DebugLog("");

            //version = Util.ConfigValue(node, "version", Version);     // get saved version, defaults to current version if none

            Settings ??= new Settings();                          // get trajectories settings from the config.xml file if it exists or create a new one
            if (Settings != null)
            {
                Settings.Load();

                DescentProfile.Start();
                Trajectory.Start();
                MapOverlay.Start();
                FlightOverlay.Start();
                NavBallOverlay.Start();
                MainGUI.Start();
                AppLauncherButton.Start();
            }
            else
            {
                Util.LogError("There was a problem with the config.xml settings file");
            }
        }
Exemple #2
0
    void Start()
    {
        // set all options to playerprefs at main menu/level 1
        terrain = GameObject.FindGameObjectWithTag("MainEnvironment").GetComponent <TerrainScript>();
        mainGUI = terrain.canvas.GetComponent <MainGUI>();

        Quality.value = QualitySettings.GetQualityLevel();
        if (Screen.fullScreen == true)
        {
            FullScreen.value = 1;
        }
        else
        {
            FullScreen.value = 0;
        }
        ResolutionX.text       = Screen.width.ToString();
        ResolutionY.text       = Screen.width.ToString();
        SensitivityLevel.value = mainGUI.Sensitivity;

        Keybinds = Instantiate(KeybindsPrefab, new Vector2(0, 0), transform.rotation) as GameObject;
        Keybinds.transform.SetParent(terrain.canvas.transform);
        Keybinds.GetComponent <RectTransform>().localPosition = new Vector2(-Screen.width / 5, -Screen.height / 10);
        Keybinds.transform.localScale = new Vector3(1, 1, 1);
        Keybinds.GetComponentInChildren <Button>().onClick.AddListener(() => SetActiveWindow(Keybinds, false));
        Keybinds.SetActive(false);
    }
Exemple #3
0
    void Start()
    {
        canvas             = GameObject.Find("Canvas").GetComponentInChildren <Canvas>();
        characterInventory = canvas.GetComponentInChildren <CharacterInventoryGUI>();
        terrain            = GameObject.FindWithTag("MainEnvironment").GetComponentInChildren <TerrainScript>();
        inventoryWindow    = characterInventory.GetComponentInChildren <CharacterInventoryPickupWindowGUI>();
        Weapons            = terrain.Player.GetComponentInChildren <WeaponsDatabase>();
        Armors             = terrain.Player.GetComponentInChildren <ArmorDatabase>();
        wepSwitch          = terrain.Player.GetComponentInChildren <WeaponSwitch>();
        armorSwitch        = terrain.Player.GetComponentInChildren <ArmorSwitch>();
        Stats        = terrain.Player.GetComponentInChildren <CharacterStats>();
        mainGUI      = canvas.GetComponent <MainGUI>();
        movement     = terrain.Player.GetComponentInChildren <CharacterMovement>();
        characterGUI = canvas.GetComponentInChildren <CharacterSkillBarGUI>();

        CurrentItemLocationIndex = -1;

        PreviousUpgradedIcon = transform.Find("ParentUpgradeItemPrevious").Find("UpgradeItemPrevious").gameObject;
        AfterUpgradedIcon    = transform.Find("ParentUpgradeItemAfter").Find("UpgradeItemAfter").gameObject;
        transform.Find("Confirm").GetComponent <Button>().onClick.AddListener(() => CreateRarity());

        HoverRectINIT = Instantiate(HoverWindowRectPrefab, transform.position, transform.rotation) as GameObject;
        HoverRectINIT.transform.SetParent(transform);
        HoverRectINIT.transform.localScale = new Vector3(1, 1, 1);
        HoverRectINIT.GetComponentInChildren <Image>().enabled = false;
        HoverRectINIT.transform.Find("Image").GetComponentInChildren <Text>().enabled      = false;
        HoverRectINIT.transform.Find("Image").Find("Level").GetComponent <Text>().enabled  = false;
        HoverRectINIT.transform.Find("Image").Find("Rarity").GetComponent <Text>().enabled = false;
        HoverRectINIT.transform.Find("Image").Find("Rate1").GetComponent <Text>().enabled  = false;
        HoverRectINIT.transform.Find("Image").Find("Rate2").GetComponent <Text>().enabled  = false;
        HoverRectINIT.transform.Find("Image").Find("Rate3").GetComponent <Text>().enabled  = false;
        HoverRectINIT.transform.Find("Image").Find("Rate4").GetComponent <Text>().enabled  = false;
        HoverRectINIT.transform.Find("Image").Find("Rate5").GetComponent <Text>().enabled  = false;
    }
        private void buttonBack_Click(object sender, EventArgs e)
        {
            MainGUI openForm = new MainGUI();

            openForm.Show();
            this.Hide();
        }
Exemple #5
0
    void Start()
    {
        InvokeRepeating("ChangeSkyBoxes", 0, 3);
        InvokeRepeating("ChangeWeather", 0, 120);
        InvokeRepeating("DayAndNight", 0, 0.05f); //0.05 * 20 = 1 second

        if (photonView.isMine)
        {
            PlayerHeight      = 0;
            tempAlpha         = 50;
            alpha             = 100000; // testing
            characterMovement = transform.GetComponentInParent <CharacterMovement>();
            target            = transform.root.transform;
            terrain           = GameObject.FindGameObjectWithTag("MainEnvironment").GetComponent <TerrainScript>();
            maingui           = terrain.canvas.GetComponent <MainGUI>();
            MapCamera         = transform.root.Find("Camera").GetComponent <Camera>();
            SkyBoxCamera      = transform.Find("SkyboxCamera").GetComponent <Camera>();
            SkyboxColors      = SkyBoxCamera.GetComponentInChildren <Skybox>();
            Sun      = terrain.transform.Find("Sun").gameObject;
            Clouds   = terrain.transform.Find("Clouds").GetComponent <ParticleSystem>();
            DirLight = terrain.transform.GetComponentsInChildren <Light>();
            RenderSettings.skybox = SkyboxColors.material;
            transform.SetParent(null);

            Vector3 Angles = transform.eulerAngles;
            x = Angles.x;
            y = Angles.y;
            currentDistance    = distance;
            desireDistance     = distance;
            correctedDistance  = distance;
            CameraTarget       = target;
            transform.position = target.position;
        }
    }
        public MusicApp(string ResourceFolderName, string ConfigFileName, string WindowTitle, uint WindowWidth, uint WindowHeight) : base(ResourceFolderName, ConfigFileName, WindowTitle, WindowWidth, WindowHeight)
        {
            #region Load Assets

            //Textures
            AssetManager.Load(AssetType.Texture, "MAIN_BACKGROUND.jpg", "main_bg");
            AssetManager.Load(AssetType.Texture, "texture_button_play.png", "button_play");
            AssetManager.Load(AssetType.Texture, "texture_button_pause.png", "button_pause");
            AssetManager.Load(AssetType.Texture, "texture_button_stop.png", "button_stop");
            AssetManager.Load(AssetType.Texture, "texture_button_next.png", "button_next");
            AssetManager.Load(AssetType.Texture, "texture_button_previous.png", "button_previous");
            AssetManager.Load(AssetType.Texture, "texture_button_volume.png", "button_volume");
            AssetManager.Load(AssetType.Texture, "texture_minus.png", "minus");
            AssetManager.Load(AssetType.Texture, "texture_plus.png", "plus");
            AssetManager.Load(AssetType.Texture, "texture_button_songlist.png", "button_songlist");
            AssetManager.Load(AssetType.Texture, "texture_arrow_up.png", "arrow_up");
            AssetManager.Load(AssetType.Texture, "texture_arrow_down.png", "arrow_down");
            AssetManager.Load(AssetType.Texture, "texture_arrow_left.png", "arrow_left");
            AssetManager.Load(AssetType.Texture, "texture_arrow_right.png", "arrow_right");

            //Fonts
            AssetManager.Load(AssetType.Font, "Sans_Culottes_By_K-Type.ttf", "sansC");

            #endregion Load Assets

            //Main BG
            new SimpleSprite("Main_BG", Alignment.LEFT_TOP, 0, 0, "main_bg");
            GetElemByName("Main_BG").RenderLayer = 0;

            //Main Gui
            Main_GUI = new MainGUI();
        }
Exemple #7
0
 private void Start()
 {
     _mainGUI = mainGUI.GetComponent <MainGUI>();
     _board   = new Board(numOfRows, numOfColumns);
     SetLevel(0);
     _timer = _secondsPerMove;
     InitDomino();
 }
Exemple #8
0
 // Use this for initialization
 void Start()
 {
     TransRef   = GetComponent <RectTransform>();
     ScrollRef  = GetComponent <ScrollRect>();
     ContentRef = ScrollRef.content;
     terrain    = GameObject.FindWithTag("MainEnvironment").GetComponentInChildren <TerrainScript>();
     maingui    = terrain.canvas.GetComponent <MainGUI>();
     MaxScroll  = ContentRef.rect.height - TransRef.rect.height;
 }
Exemple #9
0
 internal void OnDestroy()
 {
     Util.DebugLog("");
     AppLauncherButton.DestroyToolbarButton();
     MainGUI.DeSpawn();
     foreach (var trajectory in LoadedVesselsTrajectories)
     {
         trajectory.Destroy();
     }
 }
 internal void OnDestroy()
 {
     Util.DebugLog("");
     AttachedVessel = null;
     AppLauncherButton.DestroyToolbarButton();
     MainGUI.DeSpawn();
     NavBallOverlay.DestroyTransforms();
     FlightOverlay.Destroy();
     MapOverlay.DestroyRenderer();
     Trajectory.Destroy();
     DescentProfile.Clear();
 }
Exemple #11
0
 void Start()
 {
     movement           = gameObject.GetComponentInChildren <CharacterMovement>();
     MiscItems          = gameObject.GetComponentInChildren <MiscellaneousItemsDatabase>();
     GatheringSkill     = gameObject.GetComponentInChildren <GatheringSkillDatabase>();
     terrain            = GameObject.FindGameObjectWithTag("MainEnvironment").GetComponent <TerrainScript>();
     Stats              = gameObject.GetComponentInChildren <CharacterStats>();
     ItemPickup         = gameObject.GetComponentInChildren <PickupObjects>();
     characterInventory = terrain.canvas.GetComponentInChildren <CharacterInventoryGUI>();
     mainGUI            = terrain.canvas.GetComponentInChildren <MainGUI>();
     ItemID             = transform.GetComponentInChildren <WeaponSwitch>();
 }
    private void OnGUI()
    {
        GUILayout.BeginArea(new Rect(40, (Screen.height - 25), 300, 50));
        GUILayout.BeginHorizontal();
        if (GUILayout.Button(selectedText))
        {
            if (selected)
            {
                selectedText = "Hide Map";
                selected     = false;
                aboveCamera.SetActive(true);
                mainCamera.SetActive(false);
                map.SetActive(true);
                GameObject me = GameObject.Find("3rd Person Controller");
                Rect       r  = new Rect(((-(3f * me.transform.position)).x - 75f), ((-(2f * me.transform.position)).z + 510f), pin.pixelInset.width, pin.pixelInset.height);



                pin.pixelInset = r;

                pin.gameObject.SetActive(true);


                //GameObject aboveCam = GameObject.Find("AboveCam");
                //aboveCam.SetActive(false);
            }
            else
            {
                selectedText = "Show Map";
                //GameObject aboveCam = GameObject.Find("AboveCam");
                //aboveCam.SetActive(true);
                selected = true;
                aboveCamera.SetActive(false);
                mainCamera.SetActive(true);
                map.SetActive(false);
                pin.gameObject.SetActive(false);
            }
        }
        if (GUILayout.Button("Show Menu"))
        {
            clickAndDrag.isenabled = false;
            MainGUI.enableMenu();
        }



        GUILayout.EndHorizontal();

        GUILayout.EndArea();
        GUI.Label(new Rect((Screen.width - 400), (Screen.height - 60), 200, 30), "Now at: " + BuildLocation, style);
    }
Exemple #13
0
 internal void OnApplicationQuit()
 {
     Util.Log("Ending after {0} seconds", Time.time);
     AppLauncherButton.Destroy();
     MainGUI.Destroy();
     foreach (var trajectory in LoadedVesselsTrajectories)
     {
         trajectory.Destroy();
     }
     if (Settings != null)
     {
         Settings.Destroy();
     }
     Settings = null;
 }
 // Use this for initialization
 void Start()
 {
     gameStateManager = GameObject.Find("GameStateManager");
     gameStateScript = gameStateManager.GetComponent<GameStateScript>();
     MainCamera = GameObject.Find("Main Camera");
     BackgroundController = MainCamera.GetComponent<BackgroundController>();
     MainGUI = MainCamera.GetComponent<MainGUI>();
     JumpSoundObject = GameObject.Find("JumpSoundDumpster");
     jumpSoundScript = JumpSoundObject.GetComponent<JumpSoundScript>();
     PlayerLose = PlayerStart - 2;
     Lost = false;
     gameStateScript.Lost = false;
     gameStateScript.Won = false;
     gameStateScript.GameOver = false;
 }
 internal void OnApplicationQuit()
 {
     Util.Log("Ending after {0} seconds", Time.time);
     AttachedVessel = null;
     AppLauncherButton.Destroy();
     MainGUI.Destroy();
     NavBallOverlay.Destroy();
     FlightOverlay.Destroy();
     MapOverlay.Destroy();
     Trajectory.Destroy();
     DescentProfile.Destroy();
     if (Settings != null)
     {
         Settings.Destroy();
     }
     Settings = null;
 }
Exemple #16
0
        /*public override void OnSave(ConfigNode node)
         * {
         *  if (node == null)
         *      return;
         *
         *  Util.DebugLog("Node: {0}", node.name);
         *
         *  //node.AddValue("version", Version);                       // save version
         * }*/

        internal void Update()
        {
            if (Util.IsPaused || Settings == null || !Util.IsFlight)
            {
                return;
            }

            if (AttachedVessel != FlightGlobals.ActiveVessel)
            {
                AttachVessel();
            }

            Trajectory.Update();
            MapOverlay.Update();
            FlightOverlay.Update();
            NavBallOverlay.Update();
            MainGUI.Update();
        }
Exemple #17
0
        public override SpriteBatch Draw(GameTime gametime, SpriteBatch spriteBatch)
        {
            Game1.graphics.GraphicsDevice.Clear(Color.AliceBlue);

            spriteBatch.Draw(backGroundTexture, Vector2.Zero, backGroundTexture.Bounds, Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0);
            //spriteBatch.Draw(arrowTexture, ResolutionUtility.mousePos - new Vector2(arrowTexture.Bounds.Height / 2, arrowTexture.Bounds.Width) * 1, arrowTexture.Bounds, sceneColor, 0, Vector2.Zero, 1, SpriteEffects.None, 0);
            //  spriteBatch.DrawString(popUpFont, Game1.graphics.PreferredBackBufferWidth + " x " + Game1.graphics.PreferredBackBufferHeight, new Vector2(500, 100) * 1, Color.Black, 0, Vector2.Zero, 1, SpriteEffects.None, 1);
            //  spriteBatch.DrawString(popUpFont, "Complex sprites on screen: " + shapes.Count, new Vector2(300, 200) * 1, Color.Black, 0, Vector2.Zero, 1, SpriteEffects.None, 1);
            // spriteBatch.DrawString(popUpFont, "Press Space to quit.\nArrow keys to move camera.\nPress I to add up to 4 heroes.\nLMB to select a hero.\nEsc or bs to deselect selection. \nFriendly fire is: " + bFriendlyFire, new Vector2(300, 200) * 1, Color.Black, 0, Vector2.Zero, 1, SpriteEffects.None, 1);

            DrawMapBorder(spriteBatch);

            if (bPaused)
            {
                spriteBatch.DrawString(pauseFont, "PAUSED", new Vector2(430, 20) - SceneUtility.Axis, Color.Black, 0, Vector2.Zero, 1, SpriteEffects.None, 1);
            }

            foreach (var character in activeObjects)
            {
                character.Draw(spriteBatch);
            }


            foreach (var shape in shapes)
            {
                shape.Draw(spriteBatch);
            }

            if (SceneUtility.currentScene == (int)Game1.Screens.BGame)
            {
                MainGUI.Draw(spriteBatch);
            }


            if (bShowPopUp)
            {
                pauseScreen.Draw(spriteBatch);
                spriteBatch.Draw(selectionIndicatorTexture, pauseScreen.popUpButtons[currentPauseChoice].ButtonBox(), Color.White);
            }

            return(spriteBatch);
        }
Exemple #18
0
        static void Main()
        {
            BlockingCollection <double> rawCollection         = new BlockingCollection <double>();
            BlockingCollection <double> graphCollection       = new BlockingCollection <double>();
            BlockingCollection <double> calibrationCollection = new BlockingCollection <double>();
            BlockingCollection <double> alarmCollection       = new BlockingCollection <double>();
            BlockingCollection <double> filterCollection      = new BlockingCollection <double>();

            DAQ               daq         = new DAQ();
            ConvertAlgo       convertAlgo = new ConvertAlgo();
            BloodPressureAlgo bpAlgo      = new BloodPressureAlgo();
            PulseAlgo         pulseAlgo   = new PulseAlgo();

            IDAQ       transducerdaq = new TransducerDAQ(daq, rawCollection, calibrationCollection);
            IData      data          = new Database();
            IAlarmType alarmType     = new HighAlarm();
            ILimits    limits        = new UC9S5_Limits();


            IAlarm  alarm                      = new UC5S1_Alarm(alarmCollection, limits, alarmType, bpAlgo);
            IFilter filter                     = new UC7S3_Filter(filterCollection, data, convertAlgo);
            UC1M1_ZeroAdjustment uc1           = new UC1M1_ZeroAdjustment(calibrationCollection, transducerdaq);
            DataTreatment        dataTreatment = new DataTreatment(rawCollection, graphCollection, filterCollection, alarmCollection, convertAlgo, data, alarm, uc1);
            IMeasure             measurement   = new UC2M2_UC3M3_Measure(transducerdaq, dataTreatment, alarm, filter);
            ICalibrate           calibrate     = new UC6S2_Calibrate(calibrationCollection, transducerdaq, data);
            IZeroAdjustment      zero          = new UC1M1_ZeroAdjustment(calibrationCollection, transducerdaq);
            IPulse pulse = new UC8S4_Pulse(dataTreatment, pulseAlgo);
            ISave  save  = new UC4M4_SaveData(data, dataTreatment);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            ZeroAdjustmentGUI   zeroAdjustment = new ZeroAdjustmentGUI(zero);
            CalibrateGUI        calibrateGUI   = new CalibrateGUI(calibrate, measurement);
            LoginToCalibrateGUI login          = new LoginToCalibrateGUI(calibrateGUI);
            SaveDataGUI         saveGUI        = new SaveDataGUI(save);
            ChangeLimitsGUI     limitsGUI      = new ChangeLimitsGUI(limits);
            MainGUI             gui            = new MainGUI(dataTreatment, measurement, login, zeroAdjustment, alarm, pulse, bpAlgo, filter, saveGUI, limitsGUI, calibrateGUI);

            Application.Run(gui);
        }
Exemple #19
0
        public override void OnLoad(ConfigNode node)
        {
            if (node == null)
            {
                return;
            }
            Util.DebugLog("");

            LoadedVesselsTrajectories ??= new List <Trajectory>();
            Settings ??= new Settings(); // get trajectories settings from the config.xml file if it exists or create a new one
            if (Settings != null)
            {
                Settings.Load();

                AttachVessel(FlightGlobals.ActiveVessel);
                MainGUI.Start();
                AppLauncherButton.Start();
            }
            else
            {
                Util.LogError("There was a problem with the config.xml settings file");
            }
        }
Exemple #20
0
    // Update is called once per frame
    void Update()
    {
        if (GameObject.Find("3rd Person Controller").GetComponent <NavMeshAgent>().enabled == true)
        {
            GetComponent <NavMeshAgent> ().destination = newLocation;


            if ((Vector3.Distance(ThisThing.transform.position, newLocation)) < 2)
            {
                animation.Play("stop");
                if (hasStop)
                {
                    ThisThing.transform.rotation *= Quaternion.AngleAxis(180, transform.up);
                    hasStop = false;
                    MainGUI.showMessage(description, title);
                }
            }
            else
            {
                animation.Play("run");
                hasStop = true;
            }
        }
    }
        /*public override void OnSave(ConfigNode node)
         * {
         *  if (node == null)
         *      return;
         *
         *  Util.DebugLog("Node: {0}", node.name);
         *
         *  //node.AddValue("version", Version);                       // save version
         * }*/

        internal void Update()
        {
            if (Util.IsPaused || Settings == null || !Util.IsFlight)
            {
                return;
            }

            if (AttachedVessel != FlightGlobals.ActiveVessel)
            {
                AttachVessel();
            }

            Trajectory.Update();
            MapOverlay.Update();
            FlightOverlay.Update();
            NavBallOverlay.Update();
            MainGUI.Update();
            if (!Settings.NewGui)
#pragma warning disable CS0618 // Type or member is obsolete
            {
                OldGUI.Update();
            }
#pragma warning restore CS0618 // Type or member is obsolete
        }
Exemple #22
0
        internal void Update()
        {
            if (Util.IsPaused || Settings == null || !Util.IsFlight)
            {
                return;
            }

            foreach (var vessel in FlightGlobals.VesselsLoaded)
            {
                if (vessel.FindPartModuleImplementing <ModuleCommand>() != null &&
                    (Settings.MultiTrajectories || vessel == FlightGlobals.ActiveVessel) &&
                    LoadedVesselsTrajectories.All(t => t.AttachedVessel != vessel))
                {
                    AttachVessel(vessel);
                }
            }

            for (var i = LoadedVesselsTrajectories.Count - 1; i >= 0; i--)
            {
                Trajectory trajectory = LoadedVesselsTrajectories[i];
                if (trajectory.AttachedVessel.FindPartModuleImplementing <ModuleCommand>() == null ||
                    (!Settings.MultiTrajectories && trajectory.AttachedVessel != FlightGlobals.ActiveVessel) ||
                    FlightGlobals.VesselsLoaded.All(v => v != trajectory.AttachedVessel))
                {
                    trajectory.Destroy();
                    LoadedVesselsTrajectories.RemoveAt(i);
                }
            }

            foreach (var trajectory in LoadedVesselsTrajectories)
            {
                trajectory.Update();
            }

            MainGUI.Update();
        }
Exemple #23
0
 // Use this for initialization
 void Awake()
 {
     if(_mainGUI == null)
     {
         DontDestroyOnLoad(gameObject);
         _mainGUI = this;
     }
     else if(_mainGUI != this)
     {
         Destroy(this.gameObject);
     }
 }
Exemple #24
0
 // Constructor
 public UIShutdown(MainGUI main)
 {
     this.main = main;
     InitializeComponent();
 }
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            //  Console.WriteLine(SteamFriends.GetPersonaName());


            base.Initialize();
            initiateActions();

            ResolutionUtility.bMouseIsVisible = this.IsMouseVisible;
            hitboxHelp       = Content.Load <Texture2D>(@"Graphics\HitBoxHelp");
            selectionTexture = Content.Load <Texture2D>(@"Graphics\MainMenu\TestRectangle");
            mapBorderHelp    = Content.Load <Texture2D>(@"Graphics\Tiles\Basic\BorderTest");
            WhiteTex         = Content.Load <Texture2D>(@"White");
            scenes.Insert((int)(Screens.MainMenu), new MainMenu());
            scenes.Insert((int)(Screens.MainGameStart), new NewGameScene());
            scenes.Insert((int)(Screens.MainGameContinue), new ContinueGameScene());
            scenes.Insert((int)(Screens.OWGame), new OWGame());
            scenes.Insert((int)(Screens.BGame), new MainGame());
            scenes.Insert((int)(Screens.Options), new Options());
            scenes.Insert((int)(Screens.ExitGame), new Scene());
            scenes.Insert((int)(Screens.Editor), new Editor());


            CursorUtility.Initialize(this);
            MainGUI.Initialize(this);


            if (!bRunEditMode)
            {
                scenes[SceneUtility.currentScene].Initialize(this);
            }



            graphics.PreferMultiSampling       = true;
            graphics.PreferredBackBufferWidth  = this.GraphicsDevice.DisplayMode.Width;
            graphics.PreferredBackBufferHeight = this.GraphicsDevice.DisplayMode.Height;
            //   this.Window.Position = new Point(100, 100);
            //graphics.IsFullScreen = true;
            this.IsMouseVisible = false;
            graphics.ApplyChanges();
            LoadAssets();
            this.Window.AllowUserResizing = false;
            //Window.IsBorderless = true;
            Window.AllowAltF4 = true;
            //Window.Location = Point.Zero;
            //900,506
            ResolutionUtility.WindowSizeBeforeFullScreen = new Vector2(1366, 768);
            ResolutionUtility.AdjustResolution(1366, 768, graphics);
            gameRender  = new RenderTarget2D(GraphicsDevice, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            gameRender  = new RenderTarget2D(GraphicsDevice, 1366, 768);
            UIRender    = new RenderTarget2D(GraphicsDevice, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            monitorSize = new Vector2(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height);
            Console.WriteLine("Primary Monitor Size: " + monitorSize);

            EditorFileWriter.LoadSaveSettings();
            startScreen = new StartScreen();
#if !DEBUG
            // GameProcessor.Launch();
#endif
            // GameProcessor.Launch();
        }
 void Start()
 {
     mg = GlobalVars.maingui;
 }
Exemple #27
0
 public Reader(MainGUI mainGUI)
 {
     mainWin         = mainGUI;
     sortedFilePaths = new Dictionary <int, string>();
 }
Exemple #28
0
 public RemoveProductGUI(MainGUI mgui)
 {
     InitializeComponent();
     this.parent = mgui;
 }
Exemple #29
0
 void Start()
 {
     instance = this;
 }
Exemple #30
0
 public static void InitGUI() => Gui = new MainGUI();
 // Use this for initialization
 void Start()
 {
     Health = MaxHealth;
     LegAnimator = Legs.GetComponent<Animator> ();
     rb = GetComponent<Rigidbody2D> ();
     if (isLocalPlayer) {
         CameraMovement CM = Camera.main.GetComponent<CameraMovement> ();
         CM.player = transform;
         GUI = CM.GUI;
     }
     BaseGravity = rb.gravityScale;
 }
Exemple #32
0
        //************************

        public override void Update(GameTime gameTime, Game1 game)
        {
            bool bHasTarget = SelectionUtility.HasMemberSelected();

            if (!bShowPopUp && !bPaused)
            {
                base.Update(gameTime, game);


                CameraUpdate();
                NormalRunUpdate(gameTime);

                if (bHasTarget)
                {
                    CommandUpdate();
                }

                SelectionUtility.Update(gameTime, activeObjects);
                MainGUI.Update(gameTime);
            }

            if (bShowPopUp && !bPaused)
            {
                ButtonControlPopUp(gameTime);
            }

            if (bPaused && !bShowPopUp)
            {
                SelectionUtility.Update(gameTime, activeObjects);
                MainGUI.Update(gameTime);
                PauseRunUpdate();
                CameraUpdate();

                if (bHasTarget)
                {
                    CommandUpdatePaused();
                }
            }

            if (bPaused && bShowPopUp)
            {
                ButtonControlPopUp(gameTime);
            }

            SceneUtility.xAxis = xAxis;
            SceneUtility.yAxis = yAxis;

            activeSceneObjects.Clear();
            activeSceneObjects.AddRange(shapes);
            activeSceneObjects.AddRange(enemies);
            activeSceneObjects.AddRange(heroes);

            activeSceneShapeCollections.Clear();
            activeSceneShapeCollections.Add(new IdentifiableShapeList("All Characters List", activeObjects));

            activeSceneButtonCollections.Clear();
            activeSceneButtonCollections.Add(new IdentifiableShapeList("Pop-up buttons List", pauseScreen.popUpButtons));

            activeSceneCharactersCollections.Clear();
            activeSceneCharactersCollections.Add(new IdentifiableShapeList("Enemies List", enemies));
            activeSceneCharactersCollections.Add(new IdentifiableShapeList("Heroes List", heroes));
        }
Exemple #33
0
 /// <summary>
 /// Only use this for MainGUI - as this is the only window which can be
 /// closed without being deactivated first.
 /// </summary>
 /// <param name="window"> The MainGUI window. </param>
 public static void saveWindowProperties(MainGUI mainGUI)
 {
     onSavePosition(mainGUI);
 }
    // Update is called once per frame
    void Update()
    {
        GameObject me = GameObject.Find("3rd Person Controller");

        BuildLocation = MainGUI.Check(me.transform.position);
    }
 //Currently, I'm thinking inventory items will be represented by an array GameObject[20] or whatever, which
 //is persistent between scenes (use DontDestroyOnLoad.) Each array element is a persistent
 //object tagged InventoryItem, with a component inheriting from ItemBehavior or something like that.
 //The objects representing inventory items would have behavior components unique to the item,
 //but pretty sure you could use GetComponent with the base type ItemBehavior and it would always work.
 //Also: Prefix all GameObjects representing inventory items with "Inv" and an underscore.
 //Perhaps there's a less complicated way, but I'm just putting in the framework for menus at the moment.
 void Start()
 {
     MainGUI = GameObject.Find("_MainGUI").GetComponent<MainGUI>();
 }
        private void btnLogin_Click( object sender, EventArgs e )
        {
            try
            {
                //If either the username or the password is incorrect, throw an error and stop all processes.
                if ( String.IsNullOrEmpty( txtUsername.Text.Trim() ) || String.IsNullOrEmpty( txtPassword.Text.Trim() ) )
                {
                    //Modifies the error based on the field that is empty.
                    MessageBox.Show( "Please enter your " + ( String.IsNullOrEmpty( txtUsername.Text.Trim() ) && String.IsNullOrEmpty( txtPassword.Text.Trim() ) ? "username and password" : String.IsNullOrEmpty( txtUsername.Text.Trim() ) ? "username" : String.IsNullOrEmpty( txtPassword.Text.Trim() ) ? "password" : "" ) + ".", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
                    return;
                }
                using ( SqlConnection cn = new SqlConnection( @"server=.\SQLEXPRESS; Database=CinemaDB; Integrated Security=SSPI;" ) )
                {
                    if ( cn.State == ConnectionState.Closed ) cn.Open();

                    using ( SqlCommand cmd = new SqlCommand( "GetUserInformation", cn ) )
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.Add( "@username", SqlDbType.NVarChar ).Value = txtUsername.Text.Trim();
                        cmd.Parameters.Add( "@password", SqlDbType.NVarChar ).Value = txtPassword.Text.Trim();

                        using ( SqlDataReader dr = cmd.ExecuteReader() )
                        {
                            //If any data is returned, set the UserInformation properties.
                            if ( dr.Read() )
                            {
                                if ( dr[ 0 ].ToString().Equals( "That username is invalid!" ) )
                                {
                                    throw new Exception( dr[ 0 ].ToString() );
                                }
                                else if ( dr[ 0 ].ToString().Equals( "Entered username and password do not match!" ) )
                                {
                                    throw new Exception( dr[ 0 ].ToString() );
                                }
                                else if ( dr[ 0 ].ToString().Equals( "That acount has been de-activated!" ) )
                                {
                                    throw new Exception( dr[ 0 ].ToString() );
                                }
                                else
                                {
                                    //Set user details.
                                    UserInformation.UserID = dr.GetGuid( dr.GetOrdinal( "UserGuid" ) );
                                    UserInformation.Name = dr.GetString( dr.GetOrdinal( "UserName" ) );
                                    UserInformation.Surname = dr.GetString( dr.GetOrdinal( "UserSurname" ) );
                                    UserInformation.DoB = dr.GetDateTime( dr.GetOrdinal( "UserDoB" ) );
                                    UserInformation.ContactNumber = dr[ 5 ].ToString();
                                    UserInformation.AdminLevel = dr.GetInt32( dr.GetOrdinal( "AdminLevel" ) );

                                    //Hides the login panel and shows the main panel.
                                    this.Visible = false;
                                    MainGUI mainpage = new MainGUI();
                                    mainpage.ShowDialog();
                                }
                            }
                        }
                    }
                }
            }
            catch ( Exception ex )
            {
                MessageBox.Show( ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error );
            }
        }
 void Start()
 {
     GUI = this;
     //FuelImage = FuelTransform.GetComponent<Image> ();
     //FuelEmptyImage = FuelTransformEmpty.GetComponent<Image> ();
     //PowerUpIcon.CrossFadeAlpha (0f, 0f, true);
     //FuelImage.CrossFadeAlpha (0f, 0f, true);
     //FuelEmptyImage.CrossFadeAlpha (0f, 0f, true);
 }