public MainWindow()
 {
     InitializeComponent();
     consoleRedirect = new ConsoleRedirect(WriteLineSafely);
     viewModel       = new MainWindowViewModel();
     DataContext     = viewModel;
 }
Beispiel #2
0
    public static void LoadArt()
    {
        var defaultFolderPath = EditorPrefs.GetString("textureExplorerUoFolder", Application.dataPath);
        var folderPath        = EditorUtility.OpenFolderPanel("Choose UO folder", defaultFolderPath, string.Empty);

        if (string.IsNullOrEmpty(folderPath))
        {
            return;
        }

        if (Directory.Exists(folderPath) == false)
        {
            return;
        }

        EditorPrefs.SetString("textureExplorerUoFolder", folderPath);

        ConsoleRedirect.Redirect();
        Log.Start(LogTypes.All);
        Settings.GlobalSettings = new Settings();
        Settings.GlobalSettings.UltimaOnlineDirectory = folderPath;
        Client.Game = new GameController();
        //Calling the getter to trigger the creation of GraphicsDevice
        var graphicsDevice = Client.Game.GraphicsDevice;

        ArtLoader.Instance.Load().Wait();
        GumpsLoader.Instance.Load().Wait();
        loaded = true;
    }
Beispiel #3
0
 // Start is called before the first frame update
 void Start()
 {
     ConsoleRedirect.Redirect();
     RioCommProtocol.startComm(4145, "10.41.45.2");
     lastSendingPacket = RioCommProtocol.getSending();
     lastSendingPacket.addJoystick(ref joy);
     lastRecievingPacket = RioCommProtocol.getRecieving();
 }
Beispiel #4
0
        public void cast_to_1_when_default_choice_is_selected()
        {
            var    sut       = new Choice("question");
            var    redirect  = new ConsoleRedirect();
            string typedText = "y";
            int    response  = 0;
            var    output    = redirect.Redirect(typedText, () => response = sut.Show <int>());

            Assert.Equal(1, response);
        }
Beispiel #5
0
        public void cast_to_true_when_default_choice_is_selected()
        {
            var    sut       = new Choice("question");
            var    redirect  = new ConsoleRedirect();
            string typedText = "y";
            bool   response  = false;
            var    output    = redirect.Redirect(typedText, () => response = sut.Show <bool>());

            Assert.True(response);
        }
    public static void LoadArt()
    {
        ConsoleRedirect.Redirect();
        Log.Start(LogTypes.All);
        Settings.GlobalSettings = JsonConvert.DeserializeObject <Settings>(Resources.Load <TextAsset>("settings").text);
        Client.Game             = new GameController();
        //Calling the getter to trigger the creation of GraphicsDevice
        var graphicsDevice = Client.Game.GraphicsDevice;

        ArtLoader.Instance.Load().Wait();
        loaded = true;
    }
Beispiel #7
0
    private void Awake()
    {
        ConsoleRedirect.Redirect();
        Application.targetFrameRate = 60;

        StateManager.AddState(new BootState());
        StateManager.AddState(new ServerConfigurationState(serverConfigurationUiParent));
        StateManager.AddState(new DownloadState(downloadPresenter));
        StateManager.AddState(new GameState(unityMain));

        ServerConfigurationModel.Initialize();

        StateManager.GoToState <BootState>();
    }
Beispiel #8
0
        public void menu_with_default_options_shows_numbers()
        {
            var          items    = new string[] { "one", "two" };
            const string response = "2";

            var menu   = new Menu(items);
            var format = new MenuOptions().NumerationFormat;

            var redirect = new ConsoleRedirect();
            var output   = redirect.Redirect(response, () => menu.Show());

            using (var reader = new StreamReader(output)) {
                var choices = reader.ReadToEnd().Split(Environment.NewLine);
                Assert.Collection(choices.Take(2),  //Ignore the last line with the user prompt
                                  x => Assert.Equal(string.Format(format, 1) + items[0], x),
                                  x => Assert.Equal(string.Format(format, 2) + items[1], x)
                                  );
            }
        }
Beispiel #9
0
    private void Awake()
    {
        ConsoleRedirect.Redirect();

        UserPreferences.Initialize();

        StateManager.AddState(new BootState());
        StateManager.AddState(new ServerConfigurationState(serverConfigurationUiParent));
        StateManager.AddState(new DownloadState(downloadPresenter, inGameDebugConsoleCanvas));
        StateManager.AddState(new GameState(clientRunner, errorPresenter, inGameDebugConsoleCanvas));

        Input.simulateMouseWithTouches = false;

        ServerConfigurationModel.Initialize(supportedServerConfigurations);

        StateManager.GoToState <BootState>();

        ExternalStoragePath = GetAndroidExternalFilesDir();
    }
Beispiel #10
0
    private void Awake()
    {
        ConsoleRedirect.Redirect();

        UserPreferences.TargetFrameRateChanged  += OnTargetFrameRateChanged;
        UserPreferences.TextureFilteringChanged += UpdateTextureFiltering;
        UserPreferences.Initialize();

        StateManager.AddState(new BootState());
        StateManager.AddState(new ServerConfigurationState(serverConfigurationUiParent));
        StateManager.AddState(new DownloadState(downloadPresenter, forceDownloadsInEditor, inGameDebugConsoleCanvas));
        StateManager.AddState(new GameState(unityMain, errorPresenter, inGameDebugConsoleCanvas));

        inGameDebugConsoleCanvas.enabled = false;

        ServerConfigurationModel.Initialize();

        StateManager.GoToState <BootState>();
    }
Beispiel #11
0
        public void menu_with_accelerator_key_numeration_format()
        {
            var          items    = new string[] { "&one", "&two" };
            const string response = "t";

            var menu = new Menu(items, new MenuOptions {
                NumerationStyle = MenuNumeration.AcceleratorKey
            });
            var format = menu.Options.NumerationFormat;

            var redirect = new ConsoleRedirect();
            var output   = redirect.Redirect(response, () => menu.Show());

            using (var reader = new StreamReader(output)) {
                var choices = reader.ReadToEnd().Split(Environment.NewLine);
                Assert.Collection(choices.Take(2),  //Ignore the last line with the user prompt
                                  x => Assert.Equal(items[0].Substring(1), x),
                                  x => Assert.Equal(items[1].Substring(1), x)
                                  );
            }
        }
Beispiel #12
0
        public void menu_with_upper_letter_numeration_format()
        {
            var          items    = new string[] { "one", "two" };
            const string response = "A";

            var menu = new Menu(items, new MenuOptions {
                NumerationStyle = MenuNumeration.AlphabeticUpper
            });
            var format = menu.Options.NumerationFormat;

            var redirect = new ConsoleRedirect();
            var output   = redirect.Redirect(response, () => menu.Show());

            using (var reader = new StreamReader(output)) {
                var choices = reader.ReadToEnd().Split(Environment.NewLine);
                Assert.Collection(choices.Take(2),  //Ignore the last line with the user prompt
                                  x => Assert.Equal(string.Format(format, 'A') + items[0], x),
                                  x => Assert.Equal(string.Format(format, 'B') + items[1], x)
                                  );
            }
        }
Beispiel #13
0
    private void Awake()
    {
        ConsoleRedirect.Redirect();

        UserPreferences.Initialize();

        StateManager.AddState(new BootState());
        StateManager.AddState(new ServerConfigurationState(serverConfigurationUiParent));
        StateManager.AddState(new DownloadState(downloadPresenter, forceDownloadsInEditor, inGameDebugConsoleCanvas));
        StateManager.AddState(new GameState(clientRunner, errorPresenter, inGameDebugConsoleCanvas));

        if (hideInGameDebugConsoleOnAwake)
        {
            inGameDebugConsoleCanvas.enabled = false;
        }

        Input.simulateMouseWithTouches = false;

        ServerConfigurationModel.Initialize(supportedServerConfigurations);

        StateManager.GoToState <BootState>();
    }
Beispiel #14
0
    private void Awake()
    {
        ConsoleRedirect.Redirect();

        UserPreferences.Initialize();
        UserPreferences.ShowDebugConsole.ValueChanged += OnShowDebugConsoleChanged;
        OnShowDebugConsoleChanged(UserPreferences.ShowDebugConsole.CurrentValue);

        StateManager.AddState(new BootState());
        StateManager.AddState(new ServerConfigurationState(serverConfigurationUiParent));
        StateManager.AddState(new DownloadState(downloadPresenter, inGameDebugConsoleCanvas));
        StateManager.AddState(new GameState(clientRunner, errorPresenter, inGameDebugConsoleCanvas));

        Input.simulateMouseWithTouches = false;

        ServerConfigurationModel.Initialize(supportedServerConfigurations);

        StateManager.GoToState <BootState>();

        //Commented out for now, will be used later once I have an SD card to test with
        //GetAndroidExternalFilesDir();
    }
 public static void Write(string s)
 {
     ConsoleRedirect.Write(s);
 }
Beispiel #16
0
    }     // End of Awake().

    private void Start()
    {
        ConsoleRedirect.Redirect();
        Assembly.onCreation += OnAssemblyCreation;
        colony = Colony.Create(size);
    } // End of Start().