public BasicCore(Game1 game)
 {
     this.game = game;
     this.screen = new Screen();
     this.content = new ContentHandler(this.game.Content);
     this.r = new Registry();
 }
        public void StartGame()
        {
            gamePlayScreen = new GamePlayScreen(this);
            currentScreen = Screen.GamePlayScreen;

            modeScreen = null;
        }
        public void BackToStart()
        {
            startScreen = new StartScreen(this);
            currentScreen = Screen.StartScreen;

            modeScreen = null;
        }
 public void ParentItemIsUnsetOnRemovedConductedItem() {
     var conductor = new Conductor<IScreen>.Collection.OneActive();
     var conducted = new Screen();
     conductor.Items.Add(conducted);
     conductor.Items.RemoveAt(0);
     Assert.NotEqual(conductor, conducted.Parent);
 }
        public void modeSelect()
        {
            modeScreen = new ModeScreen(this);
            currentScreen = Screen.ModeScene;

            startScreen = null;
        }
Example #6
0
        //get a screen from db
        public List<Screen> ReadScreen(int screenNo)
        {
            Screen scrn = null;
            SqlDataReader reader = null;
            List<Screen> screenList = new List<Screen>();
            try
            {
                dbConn.Open();
                SqlCommand command = new SqlCommand(("SELECT * FROM CinemaScreen WHERE (@screenNo) = (screenNo)"), dbConn);
                command.Parameters.Add("@screenNo", SqlDbType.Int).Value = scrn.screenNo;
                reader = command.ExecuteReader();

                while (reader.Read())
                { //noOfSeats is the number of seats in a row
                  //12 rows, 8 seats pr. row
                    scrn = new Screen((int)reader["screenNo"], (int)reader["noOfRows"], (int)reader["noOfSeats"]);

                    screenList.Add(scrn);
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                    reader.Close();

                    dbConn.Close();

            }
            return screenList;
        }
Example #7
0
        //make a screen in db
        internal int InsertScreen(Screen scrn)
        {
            int result = 0;
            try
            {   //noOfSeats is the number of seats in a row
                  //12 rows, 8 seats pr. row
                dbConn.Open();
                SqlCommand command = new SqlCommand(("INSERT INTO CinemaScreen (screenNo, noOfRows, noOfSeats) VALUES ((@screenNo), (@noOfRows), (@noOfSeats))"), dbConn);

                command.Parameters.Add("@screenNo", SqlDbType.Int).Value = scrn.screenNo;
                command.Parameters.Add("@noOfRows", SqlDbType.Int).Value = scrn.numberOfRows;
                command.Parameters.Add("@noOfSeats", SqlDbType.Int).Value = scrn.numberOfSeatsInARow;

                result = command.ExecuteNonQuery();
            }
            catch (SqlException)
            {
                throw;
            }
            finally
            {
                dbConn.Close();
            }
            return result;
        }
Example #8
0
 public void LoadScreen(Screen s)
 {
     //out with the old, in with the new
     currentScreen.Unload();
     currentScreen = s;
     currentScreen.Load();
 }
Example #9
0
 ///<summary>Inserts one Screen into the database.  Returns the new priKey.</summary>
 internal static long Insert(Screen screen)
 {
     if(DataConnection.DBtype==DatabaseType.Oracle) {
         screen.ScreenNum=DbHelper.GetNextOracleKey("screen","ScreenNum");
         int loopcount=0;
         while(loopcount<100){
             try {
                 return Insert(screen,true);
             }
             catch(Oracle.DataAccess.Client.OracleException ex){
                 if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){
                     screen.ScreenNum++;
                     loopcount++;
                 }
                 else{
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else {
         return Insert(screen,false);
     }
 }
    public void TestMouseOverThumb() {
      Screen screen = new Screen(100, 100);
      VerticalSliderControl slider = new VerticalSliderControl();
      slider.Bounds = new UniRectangle(10, 10, 100, 100);
      slider.ThumbSize = 0.33f;
      slider.ThumbPosition = 0.25f;
      screen.Desktop.Children.Add(slider);

      float movableRange = 1.0f - slider.ThumbSize;
      float top = movableRange * slider.ThumbPosition;
      float bottom = top + slider.ThumbSize;

      top *= slider.Bounds.Size.Y.Offset;
      bottom *= slider.Bounds.Size.Y.Offset;
      float thumbHeight = bottom - top;

      // Position above the thumb should be reported as outside of the thumb.
      slider.ProcessMouseMove(100, 100, 50, top - thumbHeight / 2.0f);
      Assert.IsFalse(slider.MouseOverThumb);

      // Move the mouse over the thumb. The property should now return true.
      slider.ProcessMouseMove(100, 100, 50, top + thumbHeight / 2.0f);
      Assert.IsTrue(slider.MouseOverThumb);

      // Move the mouse away from the thumb, but stay over the control.
      // The property should now return false again.      
      slider.ProcessMouseMove(100, 100, 50, bottom + thumbHeight / 2.0f);
      Assert.IsFalse(slider.MouseOverThumb);
    }
Example #11
0
 public ScreenInput(Screen screen, SpriteFont Font, String Command)
     : base(screen)
 {
     this.Font = Font;
     this.Size.Y = Font.LineSpacing;
     this.Command = Command;
 }
Example #12
0
 public static bool IsViewEnabled(Screen viewModel)
 {
     IPermissionsService _permissionService = IoC.Get<IPermissionsService>();
     IViewLocator _viewLocator = IoC.Get<IViewLocator>();
     DependencyObject view=_viewLocator.LocateForModel(viewModel, null, null);
     return _permissionService.IsViewEnabled(view.GetType().Assembly.FullName.Split(',')[0], view.GetType().Name);
 }
Example #13
0
 public Screen Mouseclik(int x, int y)
 {
     Rectangle mouserec = new Rectangle(x, y, 10, 10);
     if (mouserec.Intersects(world1rect))
     {
         current = Screen.ChooseLevelScreen;
         return (current);
     }
     else if (mouserec.Intersects(world2rect))
     {
         current = Screen.ChooseLevelScreen2;
         return (current);
     }
     else if (mouserec.Intersects(world3rect))
     {
         current = Screen.ChooseLevelScreen3;
         return (current);
     }
     else if (mouserec.Intersects(backbuttonw))
     {
         current = Screen.StartScreen;
         return (current);
     }
     return (current);
 }
Example #14
0
 public Overlay(Screen screen, Color color)
 {
     _screen = screen;
     _spriteBatch = screen.screenSystem.spriteBatch;
     _color = color;
     _pixel = ResourceManager.getTexture("pixel");
 }
Example #15
0
 public void quitGame()
 {
     startScreen = new StartScreen(this);
     currentScreen = Screen.StartScreen;
     gameScreen = null;
     scoreboardScreen = null;
 }
Example #16
0
		public MonoGameGuiManager CreateGui( )
		{
			
			var textureAtlas = new TextureAtlas("Atlas1");
            var upRegion = textureAtlas.AddRegion("cog", 48, 0, 47, 47);
            var cogRegion = textureAtlas.AddRegion("up", 0, 0, 47, 47);

			_gui = new MonoGameGuiManager(_game.GraphicsDevice, _game.Content);
            _gui.LoadContent(new GuiContent(textureAtlas, "ExampleFont.fnt", "ExampleFont_0"));
			
			var screen = new Screen(800, 480);
			var dockLayout = new DockLayout();
			var gridLayout = new GridLayout(1, 2);
			var leftStackLayout = new StackLayout() { Orientation = Orientation.Horizontal, VerticalAlignment = VerticalAlignment.Bottom };
			var loadRubeFileBtn = CreateButton(cogRegion);
			var dumpRubeFileBtn = CreateButton(upRegion);
						
			dockLayout.Items.Add(new DockItem(gridLayout, DockStyle.Bottom));

            dumpRubeFileBtn.Tag = "dump";
			loadRubeFileBtn.Tag = "load";
			leftStackLayout.Items.Add(loadRubeFileBtn);
			leftStackLayout.Items.Add(dumpRubeFileBtn);
			
			gridLayout.Items.Add(new GridItem(leftStackLayout, 0, 0));
			
			
			screen.Items.Add(dockLayout);
			_gui.Screen = screen;

			return _gui;
		}
Example #17
0
 public void ReadAndRenderFile ( string _filename )
 {
     IAnsiDecoder vt100 = new AnsiDecoder();
     //vt100.Encoding = encodingInfo.GetEncoding (); // encodingInfo.Name, new EncoderExceptionFallback(), new DecoderReplacementFallback ("U") );
     Screen screen = new Screen ( 80, 160 );
     vt100.Subscribe ( screen );
     
     using ( BinaryReader reader = new BinaryReader(File.Open(_filename, FileMode.Open)) )
     {
         try
         {
             int read = 0;
             while ( (read = reader.Read()) != -1 )
             {
                 vt100.Input ( new byte[] { (byte) read } );
             }
         }
         catch ( EndOfStreamException )
         {
         }
     }
     System.Console.Write ( screen.ToString() );
     Bitmap bitmap = screen.ToBitmap ( new Font("Courier New", 10) );
     bitmap.Save ( _filename + ".png", System.Drawing.Imaging.ImageFormat.Png );
 }
 public VulkanisLevelManager(Texture2D texture, Vector2 position, Vector2 screen, NebulaGame aGame, Level aLevel,
     List<Sprite> aSpritesList, List<Sprite> aPlatformsList, SpriteFont aFont, Asis aAsis, Screen aInstructions, Screen aGameOverScreen, List<Screen> aVictoryScreens, Screen aCutScene, TimeTravelManager aTimeTravelManager, SoundEffect backgroundMusic)
     : base(texture, position, screen, aGame, aLevel, aSpritesList, aPlatformsList, aFont, aAsis, aInstructions, aGameOverScreen, aVictoryScreens, aCutScene, aTimeTravelManager, backgroundMusic)
 {
     EndOfLevelPos = xSL * 9 - xSL / 4;
     setFinishingTimes(50, 75, 112);
 }
Example #19
0
 public void removeScreen(Screen exitingScreen, float trans)
 {
     if (screenList.Last() == exitingScreen)
     {
         screenList.Remove(exitingScreen);
     }
 }
Example #20
0
 public Panel(Screen screen, Rectangle bound, Sprite background)
     : base(screen)
 {
     Bound = bound;
     Background = background;
     SubControls = new Dictionary<string, Control>();
 }
        /// <summary>
        /// The constructor for this selector.
        /// </summary>
        public ScreenTextureSelector(Engine engine, Screen screen)
            : base(screen)
        {
            // Adds the page forward and back buttons to the screen.
            int _buttonHeight = screen.GetTotalElementHeight();
            ScreenButton _but = new ScreenButton(screen, "Back", "<", engine.FontMain);
            _but.Position.X = Screen.boarderSize;
            _but.Size.X = 32;
            _but.Position.Y = _buttonHeight;
            screen.ElementList.Add(_but);
            _but = new ScreenButton(screen, "Forward", ">", engine.FontMain);
            _but.Position.X = Screen.boarderSize + 32 + Screen.boarderSize;
            _but.Size.X = 32;
            _but.Position.Y = _buttonHeight;
            screen.ElementList.Add(_but);

            // Creates a new input field and adds it to the screen.
            this.InputField = new ScreenInput(screen, engine.FontMain);
            screen.AddElement(InputField);

            // Resizes and places the bread and butter of this element.
            this.Position.Y = screen.GetTotalElementHeight();
            this.Size.Y = 128;

            // Determines the max rows and columns that will fit.
            this.PrevMaximumColumns = (int)Math.Floor(Size.X / TilePreviewSize);
            this.PrevMaximumRows = (int)Math.Floor(Size.Y / TilePreviewSize);

            // Creates new lists to display.
            FilterTiles(engine);
        }
Example #22
0
    public void Initialize(Screen screen)
    {
        _screen = screen;
        gameObject.name = "Player_"+screen.name;

        /*float size = Mathf.Min(screen.transform.localScale.x,screen.transform.localScale.y);
        transform.localScale = new Vector3(
            size * scaleFactor,
            size * scaleFactor,
            transform.localScale.z
        );*/

        transform.localScale = new Vector3(
            transform.localScale.x/(float)screen.level,
            transform.localScale.y/(float)screen.level,
            transform.localScale.z
        );

        _startPosition = new Vector3(
            screen.transform.position.x,
            screen.transform.position.y - screen.transform.localScale.y/2f + transform.localScale.y/2f + 7f/(float)screen.level,
            -1f
        );

        transform.position = _startPosition;

        /*_splitPosition = new Vector3(
            screen.transform.position.x,
            screen.transform.position.y + screen.transform.localScale.y/2f - transform.localScale.y/2f,
            -1f
        );*/

        borderMargin /= (float)screen.level;
    }
Example #23
0
 public LabelTextureButton(
     Screen screen,
     SpriteBatch spriteBatch,
     UIAlignment alignment,
     int x,
     int y,
     Texture2D selectedTexture,
     Texture2D deselectedTexture,
     Rectangle localHitBox,
     SpriteFont font,
     TextAlignment textAlignment,
     string text,
     int textXOffset,
     int textYOffset,
     int outline,
     Color selectedColor,
     Color deselectedColor,
     Action onActivate,
     Action onMouseOver,
     Action onMouseOut)
     : base(screen, spriteBatch, alignment, x, y, selectedTexture, deselectedTexture, localHitBox, onActivate, onMouseOver, onMouseOut)
 {
     _font = font;
     _textAlignment = textAlignment;
     _text = text;
     _textXOffset = textXOffset;
     _textYOffset = textYOffset;
     _outline = outline;
     _selectedColor = selectedColor;
     _deselectedColor = deselectedColor;
 }
Example #24
0
 // Constructor for custom pane textures
 public Pane(
     Screen screen,
     Texture2D topLeftCorner,
     Texture2D topRightCorner,
     Texture2D bottomRightCorner,
     Texture2D bottomLeftCorner,
     Texture2D leftSide,
     Texture2D topSide,
     Texture2D rightSide,
     Texture2D bottomSide,
     Texture2D background,
     UIAlignment alignment,
     int x,
     int y,
     int width,
     int height)
 {
     _screen = screen;
     _spriteBatch = _screen.screenSystem.spriteBatch;
     _topLeftCorner = topLeftCorner;
     _topRightCorner = topRightCorner;
     _bottomRightCorner = bottomRightCorner;
     _bottomLeftCorner = bottomLeftCorner;
     _leftSide = leftSide;
     _topSide = topSide;
     _rightSide = rightSide;
     _bottomSide = bottomSide;
     _background = background;
     _alignment = alignment;
     _xOffset = x;
     _yOffset = y;
     _width = width;
     _height = height;
 }
Example #25
0
		///<summary>Converts a DataTable to a list of objects.</summary>
		public static List<Screen> TableToList(DataTable table){
			List<Screen> retVal=new List<Screen>();
			Screen screen;
			for(int i=0;i<table.Rows.Count;i++) {
				screen=new Screen();
				screen.ScreenNum       = PIn.Long  (table.Rows[i]["ScreenNum"].ToString());
				screen.ScreenDate      = PIn.Date  (table.Rows[i]["ScreenDate"].ToString());
				screen.GradeSchool     = PIn.String(table.Rows[i]["GradeSchool"].ToString());
				screen.County          = PIn.String(table.Rows[i]["County"].ToString());
				screen.PlaceService    = (PlaceOfService)PIn.Int(table.Rows[i]["PlaceService"].ToString());
				screen.ProvNum         = PIn.Long  (table.Rows[i]["ProvNum"].ToString());
				screen.ProvName        = PIn.String(table.Rows[i]["ProvName"].ToString());
				screen.Gender          = (PatientGender)PIn.Int(table.Rows[i]["Gender"].ToString());
				screen.Race            = (PatientRaceOld)PIn.Int(table.Rows[i]["Race"].ToString());
				screen.GradeLevel      = (PatientGrade)PIn.Int(table.Rows[i]["GradeLevel"].ToString());
				screen.Age             = PIn.Byte  (table.Rows[i]["Age"].ToString());
				screen.Urgency         = (TreatmentUrgency)PIn.Int(table.Rows[i]["Urgency"].ToString());
				screen.HasCaries       = (YN)PIn.Int(table.Rows[i]["HasCaries"].ToString());
				screen.NeedsSealants   = (YN)PIn.Int(table.Rows[i]["NeedsSealants"].ToString());
				screen.CariesExperience= (YN)PIn.Int(table.Rows[i]["CariesExperience"].ToString());
				screen.EarlyChildCaries= (YN)PIn.Int(table.Rows[i]["EarlyChildCaries"].ToString());
				screen.ExistingSealants= (YN)PIn.Int(table.Rows[i]["ExistingSealants"].ToString());
				screen.MissingAllTeeth = (YN)PIn.Int(table.Rows[i]["MissingAllTeeth"].ToString());
				screen.Birthdate       = PIn.Date  (table.Rows[i]["Birthdate"].ToString());
				screen.ScreenGroupNum  = PIn.Long  (table.Rows[i]["ScreenGroupNum"].ToString());
				screen.ScreenGroupOrder= PIn.Int   (table.Rows[i]["ScreenGroupOrder"].ToString());
				screen.Comments        = PIn.String(table.Rows[i]["Comments"].ToString());
				retVal.Add(screen);
			}
			return retVal;
		}
Example #26
0
 public override void Draw(Screen screen)
 {
     if(Parent is Level)
     {
         base.Draw(screen);
     }
 }
        private void CalculateRealScreenPosition(Screen screen, Vector intersection)
        {
            CursorPositionX += (intersection.x * screen.WidthPixels - CursorPositionX) * VelocityResponse;
            CursorPositionY += ((1 - intersection.y) * screen.HeightPixels - CursorPositionY) * VelocityResponse;

            mouseFacade.SetCursorPosition((int)CursorPositionX, (int)CursorPositionY);
        }
 public ScreenFadeOutTransition(Screen screen, Color color, bool queue = true, float speed = 0.05f, Action onBegin = null, Action onEnd = null)
     : base(screen, queue, speed, onBegin, onEnd)
 {
     _color = color;
     _screen = screen;
     _pixel = ResourceManager.getTexture("pixel");
 }
Example #29
0
 /// <summary>
 /// This Method Performs Drag and Drop an element from scrolllist to Workfield by Sikuli4net
 /// </summary>
 /// <param name="scrollElement">Scroll Element class</param>
 public void DragAndDrop(ScrollElement scrollElement)
 {
     Pattern pattern_Drag = new Pattern(Configuration.PathToImgs()+scrollElement.GetImageDragPatern());
     Pattern pattern_Drop = new Pattern(Configuration.PathToImgs() + "wrk.png",0.5f);
     Screen scrn = new Screen();
     scrn.DragDrop(pattern_Drag,pattern_Drop);
 }
Example #30
0
        public Screen Mouseclik(int x, int y)
        {
            Rectangle mouserec = new Rectangle(x, y, 10, 10);
            if (mouserec.Intersects(level1rect))
            {
                GlobalVar.texture = "textsable";
                GlobalVar.xmlfile = "pets";
                GlobalVar.sound = "grassland";
                current = Screen.GamePlayScreen;
            }
            else if (mouserec.Intersects(level2rect))
            {
                GlobalVar.texture = "textg";
                GlobalVar.xmlfile = "Level";
                GlobalVar.sound = "grassland";
                current = Screen.GamePlayScreen;
            }
            else if (mouserec.Intersects(level3rect))
            {

                GlobalVar.texture = "textsable";
                GlobalVar.xmlfile = "Level";
                GlobalVar.sound = "grassland";
                current = Screen.GamePlayScreen;
            }
            else if (mouserec.Intersects(backbutton))
            {
                current = Screen.ChooseWorldScreen;
            }
            return (current);
        }
Example #31
0
 void DisplayWinScreen()
 {
     currentScreen = Screen.Win;
     Terminal.ClearScreen();
     ShowLevelReward();
 }
Example #32
0
 public static Task <IDialogResult> ShowNotification(this IDialogService dialogService, string message, string title,
                                                     bool isCountdown    = false, bool getsFocus     = true,
                                                     bool modal          = true, Screen openOnScreen = null,
                                                     bool hasCancel      = false, string customOk    = null,
                                                     string customCancel = null)
 {
     DialogParameters dialogParameters = new()  {
         { nameof(MessageBoxViewModel.Message), message },
         { nameof(MessageBoxViewModel.Title), title },
        public override System.Diagnostics.ProcessStartInfo Generate(string system, string emulator, string core, string rom, string playersControllers, ScreenResolution resolution)
        {
            string path = AppConfig.GetFullPath("vpinball");

            if (path == null)
            {
                return(null);
            }

            string exe = Path.Combine(path, "VPinballX.exe");

            if (!File.Exists(exe))
            {
                return(null);
            }

            _rom    = rom;
            _splash = ShowSplash(rom);

            EnsureUltraDMDRegistered(path);
            EnsureBackglassServerRegistered(path);
            EnsureVPinMameRegistered(path);

            string romPath = Path.Combine(Path.GetDirectoryName(rom), "roms");

            if (!Directory.Exists(romPath))
            {
                romPath = null;
            }

            ScreenRes sr = ScreenRes.Load(Path.GetDirectoryName(rom));

            if (sr != null)
            {
                if (Screen.AllScreens.Length == 1 || SystemInformation.TerminalServerSession)
                {
                    sr.Delete();
                }
                else
                {
                    sr.ScreenResX = resolution == null ? Screen.PrimaryScreen.Bounds.Width : resolution.Width;
                    sr.ScreenResY = resolution == null ? Screen.PrimaryScreen.Bounds.Height : resolution.Height;

                    Screen secondary = Screen.AllScreens.FirstOrDefault(s => !s.Primary);
                    sr.Screen2ResX = secondary.Bounds.Width;
                    sr.Screen2ResY = secondary.Bounds.Height;
                    sr.Monitor     = 2;

                    sr.Save();
                }
            }

            SetupOptions(path, romPath, resolution);

            return(new ProcessStartInfo()
            {
                FileName = exe,
                Arguments = "-play  \"" + rom + "\"",
                WindowStyle = _splash != null ? ProcessWindowStyle.Minimized : ProcessWindowStyle.Normal,
                UseShellExecute = true
            });
        }
Example #34
0
        private async Task HandleLogic()
        {
            try
            {
                if (m_delivery_state != DELIVERY_STATE.DELIVERY_INACTIVE)
                {
                    /* Check Vehicle and Player health */
                    if (IsPedDeadOrDying(Game.PlayerPed.Handle, true))
                    {
                        FinishDelivery(m_active_delivery_type, SafeDepositReturn.NO);
                        return;
                    }

                    if (GetVehicleEngineHealth(m_delivery_vehicle.Handle) < 20 && m_delivery_vehicle != null)
                    {
                        FinishDelivery(m_active_delivery_type, SafeDepositReturn.NO);
                        return;
                    }

                    var     playerPed = Game.PlayerPed;
                    Vector3 pCoords   = Game.PlayerPed.Position;


                    /* Moving towards vehicle delivery point logic */
                    if (m_delivery_state == DELIVERY_STATE.PLAYER_STARTED_DELIVERY)
                    {
                        /* Check if the player is still inside the delivery vehicle */
                        if (!isPlayerInsideDeliveryVehicle())
                        {
                            Screen.ShowSubtitle(DeliveryData._U["GET_BACK_IN_VEHICLE"]);
                        }

                        /* Check if player reached the vehicle delivery point */
                        if (World.GetDistance(pCoords, m_active_delivery_point.Item1) < 1.5f)
                        {
                            m_delivery_state = DELIVERY_STATE.PLAYER_REACHED_VEHICLE_POINT;
                            PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true);
                        }
                    }

                    /* Make player grab the props for delivery */
                    if (m_delivery_state == DELIVERY_STATE.PLAYER_REACHED_VEHICLE_POINT)
                    {
                    }

                    /* Delivering the goods logic */
                    if (m_delivery_state == DELIVERY_STATE.PLAYER_REMOVED_GOODS_FROM_VEHICLE)
                    {
                        /* Display delivery hint for vans and trucks */
                        if (m_active_delivery_type == DeliveryType.Van || m_active_delivery_type == DeliveryType.Truck)
                        {
                            Screen.ShowSubtitle(DeliveryData._U["DELIVER_INSIDE_SHOP"]);

                            if (m_active_delivery_type == DeliveryType.Van && !IsEntityPlayingAnim(Game.PlayerPed.Handle, "anim@heists@box_carry@", "walk", 3))
                            {
                                ForceCarryAnimation();
                            }
                        }

                        /* Check if player reached the delivery point */
                        if (World.GetDistance(pCoords, m_active_delivery_point.Item2) < 1.5f)
                        {
                            /* Complete payment*/
                            int reward_amount = 0;
                            if (m_active_delivery_type == DeliveryType.Scooter)
                            {
                                reward_amount = DeliveryData.DELIVERIES_REWARD_SCOOTER; Screen.ShowNotification(DeliveryData._U["DELIVERY_POINT_REWARD"] + DeliveryData.DELIVERIES_REWARD_SCOOTER.ToString());
                            }
                            if (m_active_delivery_type == DeliveryType.Van)
                            {
                                reward_amount = DeliveryData.DELIVERIES_REWARD_VAN; Screen.ShowNotification(DeliveryData._U["DELIVERY_POINT_REWARD"] + DeliveryData.DELIVERIES_REWARD_VAN.ToString());
                            }
                            if (m_active_delivery_type == DeliveryType.Truck)
                            {
                                reward_amount = DeliveryData.DELIVERIES_REWARD_TRUCK; Screen.ShowNotification(DeliveryData._U["DELIVERY_POINT_REWARD"] + DeliveryData.DELIVERIES_REWARD_TRUCK.ToString());
                            }

                            TriggerServerEvent("esx_deliveries:AddCashMoney", reward_amount);
                            PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true);

                            /* Check if this is the last delivery */
                            if (IsLastDelivery())
                            {
                                RemovePlayerProps();
                                m_active_blip.Delete();
                                CitizenFX.Core.Debug.WriteLine("Player completed all deliveries. Calling ReturnToVehicle");
                                m_active_delivery_point = new Tuple <Vector3, Vector3>(m_baselocation_return_point, Vector3.Zero);
                                ReturnToBase(m_active_delivery_type);
                                Screen.ShowSubtitle(DeliveryData._U["GET_BACK_TO_DELIVERYHUB"]);
                                m_delivery_state = DELIVERY_STATE.PLAYER_RETURNING_TO_BASE;
                                return;
                            }
                            else
                            {
                                RemovePlayerProps();
                                GetNextDeliveryPoint(false);
                                m_delivery_state = DELIVERY_STATE.PLAYER_STARTED_DELIVERY;
                                PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true);
                            }
                        }
                    }

                    /* Return to base logic */
                    if (m_delivery_state == DELIVERY_STATE.PLAYER_RETURNING_TO_BASE)
                    {
                    }

                    await Delay(500);
                }
                else
                {
                    await Delay(1000);
                }
            } catch (Exception e)
            {
                CitizenFX.Core.Debug.WriteLine($"{e.Message} : Exception thrown on HandleLogic()");
            }
        }
 protected override void OnSuspending(Screen next)
 {
     base.OnSuspending(next);
     cancelLoad();
 }
Example #36
0
 private void Home_Move(object sender, EventArgs e)
 {
     this.Location = new Point(Screen.FromPoint(this.Location).WorkingArea.Right - this.Width, 0);
 }
Example #37
0
        private async Task HandleMarkers()
        {
            // Draw Mission Start Markers
            Vector3 pCoords = Game.PlayerPed.Position;

            /* Check if a delivery is active */
            if (m_delivery_state != DELIVERY_STATE.DELIVERY_INACTIVE)
            {
                /* Check if player reached the vehicle return location */
                World.DrawMarker(MarkerType.ChevronUpx1, m_baselocation_deleter, Vector3.Zero, Vector3.Zero, new Vector3(1.5f, 1.5f, 1.5f), System.Drawing.Color.FromArgb(150, 255, 50, 0), true, true);
                if (World.GetDistance(pCoords, m_baselocation_deleter) < 1.5f)
                {
                    Screen.DisplayHelpTextThisFrame(DeliveryData._U["END_DELIVERY"]);
                    if (Game.IsControlJustReleased(0, Control.Context))
                    {
                        EndDelivery();
                        return;
                    }
                }


                if (m_delivery_state == DELIVERY_STATE.PLAYER_STARTED_DELIVERY)
                {
                    if (!isPlayerInsideDeliveryVehicle())
                    {
                        Vector3 vehpos = m_delivery_vehicle.Position;
                        vehpos.Z += 1.0f;

                        if (m_active_delivery_type == DeliveryType.Van)
                        {
                            vehpos.Z += 1.0f;
                        }
                        if (m_active_delivery_type == DeliveryType.Truck)
                        {
                            vehpos.Z += 2.0f;
                        }

                        World.DrawMarker(MarkerType.ChevronUpx1, vehpos, Vector3.Zero, Vector3.Zero, new Vector3(0.8f, 0.8f, 0.8f), System.Drawing.Color.FromArgb(150, 255, 128, 0), true, true, true);
                    }
                    else
                    {
                        if (World.GetDistance(pCoords, m_active_delivery_point.Item1) < 150.0f)
                        {
                            World.DrawMarker(MarkerType.ChevronUpx1, m_active_delivery_point.Item1, Vector3.Zero, Vector3.Zero, new Vector3(1.5f, 1.5f, 1.5f), System.Drawing.Color.FromArgb(150, 255, 128, 0), true, true);
                        }
                    }
                }

                if (m_delivery_state == DELIVERY_STATE.PLAYER_REACHED_VEHICLE_POINT)
                {
                    if (!isPlayerInsideDeliveryVehicle())
                    {
                        Vector3 trunkPos           = m_delivery_vehicle.Position;
                        Vector3 trunkForwardVector = GetEntityForwardVector(m_delivery_vehicle.Handle);

                        float scaleFactor = 1.0f;
                        if (m_active_delivery_type == DeliveryType.Scooter)
                        {
                            scaleFactor = DeliveryData.COLLECT_GOODS_SCALE_VECTOR_SCOOTER;
                        }
                        if (m_active_delivery_type == DeliveryType.Van)
                        {
                            scaleFactor = DeliveryData.COLLECT_GOODS_SCALE_VECTOR_VAN;
                        }
                        if (m_active_delivery_type == DeliveryType.Truck)
                        {
                            scaleFactor = DeliveryData.COLLECT_GOODS_SCALE_VECTOR_TRUCK;
                        }

                        trunkPos   -= trunkForwardVector * scaleFactor;
                        trunkPos.Z += 0.7f;

                        Vector3 arrowSize = new Vector3(0.8f);
                        if (m_active_delivery_type == DeliveryType.Scooter)
                        {
                            arrowSize = new Vector3(0.15f);
                        }

                        World.DrawMarker(MarkerType.ChevronUpx1, trunkPos, Vector3.Zero, Vector3.Zero, arrowSize, System.Drawing.Color.FromArgb(150, 255, 128, 0), true, true, true);

                        if (World.GetDistance(pCoords, trunkPos) < 1.0f)
                        {
                            Screen.DisplayHelpTextThisFrame(DeliveryData._U["REMOVE_GOODS"]);

                            if (Game.IsControlJustReleased(0, Control.Context))
                            {
                                await GetPlayerPropsForDelivery(m_active_delivery_type);

                                m_delivery_state = DELIVERY_STATE.PLAYER_REMOVED_GOODS_FROM_VEHICLE;
                            }
                        }
                    }
                }

                if (m_delivery_state == DELIVERY_STATE.PLAYER_REMOVED_GOODS_FROM_VEHICLE)
                {
                    World.DrawMarker(MarkerType.ChevronUpx1, m_active_delivery_point.Item2, Vector3.Zero, Vector3.Zero, new Vector3(1.5f, 1.5f, 1.5f), System.Drawing.Color.FromArgb(150, 255, 128, 0), true, true);
                }

                if (m_delivery_state == DELIVERY_STATE.PLAYER_RETURNING_TO_BASE)
                {
                    World.DrawMarker(MarkerType.ChevronUpx1, m_baselocation_deleter, Vector3.Zero, Vector3.Zero, new Vector3(1.5f, 1.5f, 1.5f), System.Drawing.Color.FromArgb(150, 255, 128, 0), true, true);
                }
            }

            if (m_delivery_state == DELIVERY_STATE.DELIVERY_INACTIVE)
            {
                if (World.GetDistance(pCoords, m_baselocation_coords) < 150.0f)
                {
                    World.DrawMarker(MarkerType.MotorcycleSymbol, m_baselocation_scooter, Vector3.Zero, Vector3.Zero, new Vector3(2.5f, 2.5f, 2.5f), System.Drawing.Color.FromArgb(150, 255, 128, 0), true, true);
                    World.DrawMarker(MarkerType.CarSymbol, m_baselocation_van, Vector3.Zero, Vector3.Zero, new Vector3(2.5f, 2.5f, 2.5f), System.Drawing.Color.FromArgb(150, 255, 128, 0), true, true);
                    World.DrawMarker(MarkerType.TruckSymbol, m_baselocation_truck, Vector3.Zero, Vector3.Zero, new Vector3(2.5f, 2.5f, 2.5f), System.Drawing.Color.FromArgb(150, 255, 128, 0), true, true);

                    if (World.GetDistance(pCoords, m_baselocation_scooter) < 1.5f)
                    {
                        Screen.DisplayHelpTextThisFrame(DeliveryData._U["START_DELIVERY"] + DeliveryData.SAFE_DEPOSIT_SCOOTER.ToString());
                        if (Game.IsControlJustReleased(0, Control.Context))
                        {
                            await StartDelivery(DeliveryType.Scooter);

                            PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true);
                        }
                    }

                    if (World.GetDistance(pCoords, m_baselocation_van) < 1.5f)
                    {
                        Screen.DisplayHelpTextThisFrame(DeliveryData._U["START_DELIVERY"] + DeliveryData.SAFE_DEPOSIT_VAN.ToString());
                        if (Game.IsControlJustReleased(0, Control.Context))
                        {
                            m_active_delivery_type = DeliveryType.Van;
                            await StartDelivery(DeliveryType.Van);

                            PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true);
                        }
                    }

                    if (World.GetDistance(pCoords, m_baselocation_truck) < 1.5f)
                    {
                        Screen.DisplayHelpTextThisFrame(DeliveryData._U["START_DELIVERY"] + DeliveryData.SAFE_DEPOSIT_TRUCK.ToString());
                        if (Game.IsControlJustReleased(0, Control.Context))
                        {
                            m_active_delivery_type = DeliveryType.Truck;
                            await StartDelivery(DeliveryType.Truck);

                            PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true);
                        }
                    }
                }
            }
        }
Example #38
0
    public override void SelectOption()
    {
        Resolution resolution = GetElement(dropdown.value);

        Screen.SetResolution(resolution.width, resolution.height, Screen.fullScreen, resolution.refreshRate);
    }
Example #39
0
 private void updateOption()
 {
     if (selectedOption == 0)
     {
         if (selectedOptionIndex[selectedOption] == 0)
         {
             textSpeedHighlight.text        = "Slow";
             textSpeedHighlight.pixelOffset = new Vector2(155, 159);
             PlayerPrefs.SetInt("textSpeed", 0);
         }
         else if (selectedOptionIndex[selectedOption] == 1)
         {
             textSpeedHighlight.text        = "Medium";
             textSpeedHighlight.pixelOffset = new Vector2(191, 159);
             PlayerPrefs.SetInt("textSpeed", 1);
         }
         else
         {
             textSpeedHighlight.text        = "Fast";
             textSpeedHighlight.pixelOffset = new Vector2(238, 159);
             PlayerPrefs.SetInt("textSpeed", 2);
         }
     }
     else if (selectedOption == 1)
     {
         int repetitions = selectedOptionIndex[selectedOption];
         musicVolumeHighlight.text = "";
         for (int i = 0; i < repetitions; i++)
         {
             musicVolumeHighlight.text += "| ";
         }
         float mVol = ((float)selectedOptionIndex[1] / 20f) * ((float)selectedOptionIndex[1] / 20f);
         PlayerPrefs.SetFloat("musicVolume", mVol);
     }
     else if (selectedOption == 2)
     {
         int repetitions = selectedOptionIndex[selectedOption];
         sfxVolumeHighlight.text = "";
         for (int i = 0; i < repetitions; i++)
         {
             sfxVolumeHighlight.text += "| ";
         }
         float sVol = ((float)selectedOptionIndex[2] / 20f) * ((float)selectedOptionIndex[2] / 20f);
         PlayerPrefs.SetFloat("sfxVolume", sVol);
     }
     else if (selectedOption == 3)
     {
         frameStyle.text         = "Style " + (selectedOptionIndex[selectedOption] + 1);
         frameStyleShadow.text   = frameStyle.text;
         DialogBoxBorder.texture = Resources.Load <Texture>("Frame/dialog" + (selectedOptionIndex[3] + 1));
         PlayerPrefs.SetInt("frameStyle", selectedOptionIndex[3] + 1);
     }
     else if (selectedOption == 4)
     {
         if (selectedOptionIndex[selectedOption] == 0)
         {
             battleSceneHighlight.text        = "Off";
             battleSceneHighlight.pixelOffset = new Vector2(186, 95);
         }
         else
         {
             battleSceneHighlight.text        = "On";
             battleSceneHighlight.pixelOffset = new Vector2(217, 95);
         }
     }
     else if (selectedOption == 5)
     {
         if (selectedOptionIndex[selectedOption] == 0)
         {
             battleStyleHighlight.text        = "Switch";
             battleStyleHighlight.pixelOffset = new Vector2(171, 79);
         }
         else
         {
             battleStyleHighlight.text        = "Set";
             battleStyleHighlight.pixelOffset = new Vector2(217, 79);
         }
     }
     else if (selectedOption == 6)
     {
         if (selectedOptionIndex[selectedOption] == 0)
         {
             screenSizeHighlight.text        = "x1";
             screenSizeHighlight.pixelOffset = new Vector2(150, 63);
             if (!Screen.fullScreen)
             {
                 Screen.SetResolution(342, 192, Screen.fullScreen);
             }
         }
         else if (selectedOptionIndex[selectedOption] == 1)
         {
             screenSizeHighlight.text        = "x2";
             screenSizeHighlight.pixelOffset = new Vector2(177, 63);
             if (!Screen.fullScreen)
             {
                 Screen.SetResolution(684, 384, Screen.fullScreen);
             }
         }
         else if (selectedOptionIndex[selectedOption] == 2)
         {
             screenSizeHighlight.text        = "x3";
             screenSizeHighlight.pixelOffset = new Vector2(204, 63);
             if (!Screen.fullScreen)
             {
                 Screen.SetResolution(1026, 576, Screen.fullScreen);
             }
         }
         else if (selectedOptionIndex[selectedOption] == 3)
         {
             screenSizeHighlight.text        = "x4";
             screenSizeHighlight.pixelOffset = new Vector2(231, 63);
             if (!Screen.fullScreen)
             {
                 Screen.SetResolution(1368, 768, Screen.fullScreen);
             }
         }
         else
         {
             screenSizeHighlight.text        = "x5";
             screenSizeHighlight.pixelOffset = new Vector2(258, 63);
             if (!Screen.fullScreen)
             {
                 Screen.SetResolution(1710, 960, Screen.fullScreen);
             }
         }
     }
     else if (selectedOption == 7)
     {
         if (selectedOptionIndex[selectedOption] == 0)
         {
             fullscreenHighlight.text        = "Off";
             fullscreenHighlight.pixelOffset = new Vector2(149, 47);
             Screen.SetResolution(342 * (selectedOptionIndex[6] + 1), 192 * (selectedOptionIndex[6] + 1), false);
         }
         else if (selectedOptionIndex[selectedOption] == 1)
         {
             fullscreenHighlight.text        = "Border";
             fullscreenHighlight.pixelOffset = new Vector2(180, 47);
             Screen.SetResolution(342 * (selectedOptionIndex[6] + 1), 192 * (selectedOptionIndex[6] + 1), true);
         }
         else if (selectedOptionIndex[selectedOption] == 2)
         {
             fullscreenHighlight.text        = "Stretch";
             fullscreenHighlight.pixelOffset = new Vector2(231, 47);
             Screen.SetResolution(342 * selectedOptionSize[6], 192 * selectedOptionSize[6], true);
         }
     }
 }
Example #40
0
    public IEnumerator Run(GraphicsTestCase testCase)
    {
        SceneManager.LoadScene(testCase.ScenePath);

        // Always wait one frame for scene load
        yield return(null);

        var cameras  = GameObject.FindGameObjectsWithTag("MainCamera").Select(x => x.GetComponent <Camera>());
        var settings = Object.FindObjectOfType <LWGraphicsTestSettings>();

        Assert.IsNotNull(settings, "Invalid test scene, couldn't find LWGraphicsTestSettings");

        // Stereo screen capture on Mac generates monoscopic images.
        Assume.That((Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.OSXPlayer), "Stereo tests do not run on MacOSX.");

        var referenceImage = testCase.ReferenceImage;

        // make sure we're rendering in the same size as the reference image, otherwise this is not really comparable.
        Screen.SetResolution(settings.ImageComparisonSettings.TargetWidth, settings.ImageComparisonSettings.TargetHeight, FullScreenMode.Windowed);

#if UNITY_2020_2_OR_NEWER
        // Ensure a valid XR display is active
        List <XRDisplaySubsystem> xrDisplays = new List <XRDisplaySubsystem>();
        SubsystemManager.GetInstances(xrDisplays);
        Assume.That(xrDisplays.Count > 0 && xrDisplays[0].running, "No XR display active!");

        // Set mirror view to side-by-side (both eyes)
        xrDisplays[0].SetPreferredMirrorBlitMode(XRMirrorViewBlitMode.SideBySide);
#else
        XRSettings.gameViewRenderMode = GameViewRenderMode.BothEyes;
#endif

        yield return(null);

        foreach (var camera in cameras)
        {
            camera.stereoTargetEye = StereoTargetEyeMask.Both;
        }

        var tempScreenshotFile = Path.ChangeExtension(Path.GetTempFileName(), ".png");
        // clean up previous file if it happens to exist at this point
        if (FileAvailable(tempScreenshotFile))
        {
            System.IO.File.Delete(tempScreenshotFile);
        }

        for (int i = 0; i < settings.WaitFrames; i++)
        {
            yield return(null);
        }

        // wait for rendering to complete
        yield return(new WaitForEndOfFrame());

        // take a screenshot here.
        // ScreenCapture.CaptureScreenshotAsTexture --> does not work since colorspace is wrong, would need colorspace change and thus color compression
        // ScreenCapture.CaptureScreenshotIntoRenderTexture --> does not work since texture is flipped, would need another pass
        // so we need to capture and reload the resulting file.
        ScreenCapture.CaptureScreenshot(tempScreenshotFile, ScreenCapture.StereoScreenCaptureMode.BothEyes);

        // NOTE: there's discussions around whether Unity has actually documented this correctly.
        // Unity says: next frame MUST have the file ready
        // Community says: not true, file write might take longer, so have to explicitly check the file handle before use
        // https://forum.unity.com/threads/how-to-wait-for-capturescreen-to-complete.172194/
        yield return(null);

        while (!FileAvailable(tempScreenshotFile))
        {
            yield return(null);
        }

        // load the screenshot back into memory and change to the same format as we want to compare with
        var actualImage = new Texture2D(settings.ImageComparisonSettings.TargetWidth, settings.ImageComparisonSettings.TargetHeight);
        actualImage.LoadImage(System.IO.File.ReadAllBytes(tempScreenshotFile));

        if (actualImage.width != settings.ImageComparisonSettings.TargetWidth || actualImage.height != settings.ImageComparisonSettings.TargetHeight)
        {
            Debug.LogWarning("[" + testCase.ScenePath + "] Image size differs (ref: " + referenceImage.width + "x" + referenceImage.height + " vs. actual: " + actualImage.width + "x" + actualImage.height + "). " + (Application.isEditor ? " is your GameView set to a different resolution than the reference images?" : "is your build size different than the reference images?"));
            actualImage = ChangeTextureSize(actualImage, settings.ImageComparisonSettings.TargetWidth, settings.ImageComparisonSettings.TargetHeight);
        }
        // ref is usually in RGB24 or RGBA32 while actual is in ARGB32, we need to convert formats
        if (actualImage.format != TextureFormat.RGB24)
        {
            actualImage = ChangeTextureFormat(actualImage, TextureFormat.RGB24);
        }

        // delete temporary file
        File.Delete(tempScreenshotFile);

        // for testing
        // File.WriteAllBytes("reference.png", referenceImage.EncodeToPNG());
        // File.WriteAllBytes("actual.png", actualImage.EncodeToPNG());

        ImageAssert.AreEqual(referenceImage, actualImage, settings.ImageComparisonSettings);
    }
Example #41
0
 public kmc()
 {
     InitializeComponent();
     this.MaximizedBounds = Screen.FromHandle(this.Handle).WorkingArea;
 }
Example #42
0
 static void OnRuntimeMethodLoad()
 {
     // Screen.SetResolution(650, 810, false); //完成サイズ
     Screen.SetResolution(660, 810, false);
 }
Example #43
0
    private void Start()
    {
        RTManager.Instance.SetModelRawImage1(this.ImageActor, false);
        EventTriggerListener expr_1C = EventTriggerListener.Get(this.ImageTouchPlace);

        expr_1C.onDrag = (EventTriggerListener.VoidDelegateData)Delegate.Combine(expr_1C.onDrag, new EventTriggerListener.VoidDelegateData(RTManager.Instance.OnDragImageTouchPlace1));
        this.ImageActor.GetComponent <RectTransform>().set_sizeDelta(new Vector2(1280f, (float)(1280 * Screen.get_height() / Screen.get_width())));
    }
        /// <summary>
        /// Displays the popup for a certain amount of time
        /// </summary>
        /// <param name="strTitle">The string which will be shown as the title of the popup</param>
        /// <param name="strContent">The string which will be shown as the content of the popup</param>
        /// <param name="nTimeToShow">Duration of the showing animation (in milliseconds)</param>
        /// <param name="nTimeToStay">Duration of the visible state before collapsing (in milliseconds)</param>
        /// <param name="nTimeToHide">Duration of the hiding animation (in milliseconds)</param>
        /// <returns>Nothing</returns>
        public void Show(string strTitle, string strContent, int nTimeToShow, int nTimeToStay, int nTimeToHide)
        {
            WorkAreaRectangle = Screen.GetWorkingArea(WorkAreaRectangle);
            titleText         = strTitle;
            contentText       = strContent;
            nVisibleEvents    = nTimeToStay;
            CalculateMouseRectangles();

            // We calculate the pixel increment and the timer value for the showing animation
            int nEvents;

            if (nTimeToShow > 10)
            {
                nEvents        = Math.Min((nTimeToShow / 10), this.Height);//BackgroundBitmap.Height
                nShowEvents    = nTimeToShow / nEvents;
                nIncrementShow = this.Height / nEvents;
            }
            else
            {
                nShowEvents    = 10;
                nIncrementShow = this.Height;
            }

            // We calculate the pixel increment and the timer value for the hiding animation
            if (nTimeToHide > 10)
            {
                nEvents        = Math.Min((nTimeToHide / 10), this.Height);
                nHideEvents    = nTimeToHide / nEvents;
                nIncrementHide = this.Height / nEvents;
            }
            else
            {
                nHideEvents    = 10;
                nIncrementHide = this.Height;
            }

            switch (taskbarState)
            {
            case TaskbarStates.hidden:
                taskbarState = TaskbarStates.appearing;
                SetBounds(Screen.PrimaryScreen.WorkingArea.Width - 17, Screen.PrimaryScreen.WorkingArea.Bottom - 1, BackgroundBitmap.Width, 0);
                timer.Interval = nShowEvents;
                timer.Start();
                // We Show the popup without stealing focus
                ShowWindow(this.Handle, 4);
                break;

            case TaskbarStates.appearing:
                Refresh();
                break;

            case TaskbarStates.visible:
                timer.Stop();
                timer.Interval = nVisibleEvents;
                timer.Start();
                Refresh();
                break;

            case TaskbarStates.disappearing:
                timer.Stop();
                taskbarState = TaskbarStates.visible;
                SetBounds(Screen.PrimaryScreen.WorkingArea.Width - 17, Screen.PrimaryScreen.WorkingArea.Bottom - Screen.PrimaryScreen.WorkingArea.Height - 1, Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
                timer.Interval = nVisibleEvents;
                timer.Start();
                Refresh();
                break;
            }
        }
 internal InputController(Screen screen)
 {
     this.Actions = new List <IAction>(30);
     this.Screen  = screen;
     //this.Manager = screen.Manager.Manager.InputManager; //legendaryManager.InputManager;
 }
Example #46
0
 public void SetWindowModeScreen()
 {
     Screen.SetResolution(1280, 720, FullScreenMode.Windowed);
 }
Example #47
0
 void DidTapMainMenuPlaySpecificMinigames()
 {
     currentScreen = Screen.PracticeMenu;
     StartCoroutine(ShowSceneWithTransition("Minigame Menu", Screen.PracticeMenu, CompleteMiniGameMenuSetup));
 }
Example #48
0
 public void UpdateResolution(int resolutionIndex)
 {
     Screen.SetResolution(resolutions[resolutionIndex].width, resolutions[resolutionIndex].height, Screen.fullScreen);
 }
Example #49
0
 public void SetFullModeScreen()
 {
     Screen.SetResolution(1920, 1080,
                          FullScreenMode.FullScreenWindow);
 }
Example #50
0
    public void SetResolution(int resolutionIndex)
    {
        Resolution resolution = resolutions[resolutionIndex];

        Screen.SetResolution(resolution.width, resolution.height, Screen.fullScreen);
    }
Example #51
0
        public ELS()
        {
            if (API.GetConvar("dev_server", "false") == "true" || API.GetConvar("test_server", "false") == "true")
            {
                Utils.IsDeveloper = true;
                Utils.ReleaseWriteLine("Debug logging enabled!");
            }
            bool Loaded = false;

            _controlConfiguration = new ElsConfiguration();
            _FileLoader           = new FileLoader(this);
            EventHandlers["onClientResourceStart"] += new Action <string>(async(string obj) =>
            {
                if (obj == CurrentResourceName())
                {
                    Utils.Debug = bool.Parse(API.GetConvar("elsplus_debug", "false"));
                    try
                    {
                        await Delay(100);
                        ServerId     = API.GetConvar("ElsServerId", null);
                        userSettings = new UserSettings();
                        await Delay(0);
                        Task settingsTask = new Task(() => userSettings.LoadUserSettings());
                        await Delay(0);
                        Utils.ReleaseWriteLine($"Welcome to ELS Plus on {ServerId} using version {Assembly.GetExecutingAssembly().GetName().Version}");
                        settingsTask.Start();
                        await Delay(250);
                        _FileLoader.RunLoader(obj);
                        await Delay(250);
                        SetupConnections();
                        await Delay(250);
                        VcfSync.CheckResources();
                        VCF.ParseVcfs(VcfSync.VcfData);
                        CustomPatterns.CheckCustomPatterns();
                        VCF.ParsePatterns(CustomPatterns.Patterns);
                        await Delay(250);
                        Tick -= Class1_Tick;
                        Tick += Class1_Tick;
                        await Delay(1000);
                        if (float.TryParse(API.GetResourceKvpString("daybrightness"), out var dayValue))
                        {
                            Function.Call((Hash)3520272001, "car.defaultlight.day.emissive.on", dayValue);
                        }
                        else
                        {
                            Function.Call((Hash)3520272001, "car.defaultlight.day.emissive.on", Global.DayLtBrightness);
                        }
                        if (float.TryParse(API.GetResourceKvpString("nightbrightness"), out var nightValue))
                        {
                            Function.Call((Hash)3520272001, "car.defaultlight.night.emissive.on", nightValue);
                        }
                        else
                        {
                            Function.Call((Hash)3520272001, "car.defaultlight.night.emissive.on", Global.NightLtBrightness);
                        }

                        API.RequestScriptAudioBank("DLC_WMSIRENS\\SIRENPACK_ONE", false);
                    }
                    catch (Exception e)
                    {
                        Screen.ShowNotification($"ERROR:{e.Message}");
                        Screen.ShowNotification($"ERROR:{e.StackTrace}");
                        Tick -= Class1_Tick;
                        Utils.ReleaseWriteLine($"ERROR:{e.StackTrace}");
                        Utils.ReleaseWriteLine($"Error: {e.Message}");
                    }
                }
            });
        }