Esempio n. 1
0
            void SetValues(AppConfig config)
            {
                MHUrhoApp.InvokeOnMainSafe(SetValuesImpl);

                void SetValuesImpl()
                {
                    UnitDrawDistance.Value = config.UnitDrawDistance;

                    ProjectileDrawDistance.Value = config.ProjectileDrawDistance;

                    TerrainDrawDistance.Value = config.TerrainDrawDistance;

                    Resolutions.Selection = (uint)Game.Config.SupportedResolutions.IndexOf(Game.Config.Resolution);

                    WindowTypes.Selection = (uint)FullscreenAndBorderlessToWindowType(config.Fullscreen, config.Borderless);

                    HighDPI.Checked = config.HighDPI;

                    TripleBuffer.Checked = config.TripleBuffer;

                    VSync.Checked = config.VSync;

                    DebugHUD.Checked = config.DebugHUD;

                    MultiSample.Text = config.Multisample.ToString();

                    RefreshRate.Text = config.RefreshRateCap.ToString();

                    CameraScroll.Value = config.CameraScrollSensitivity;

                    CameraRotation.Value = config.CameraRotationSensitivity;

                    MouseCamRotation.Value = config.MouseRotationSensitivity;

                    ZoomSpeed.Value = config.ZoomSensitivity;

                    BorderMovement.Checked = config.MouseBorderCameraMovement;

                    PathFindingVisualization.Selection =
                        (uint)Game.Config.SupportedPathFindingVisualizations.IndexOf(Game.Config.PathFindingVisualization);
                }
            }
Esempio n. 2
0
 void OnTextUpdate(string newText)
 {
     //Update UI text, must be called from main thread
     MHUrhoApp.InvokeOnMainSafe(() => { text.Value = newText;; });
 }
Esempio n. 3
0
 void OnLoadingFailed(IProgressNotifier failed, string message)
 {
     //Update UI text, must be called from main thread
     MHUrhoApp.InvokeOnMainSafe(() => { text.Value = "Loading failed"; });
 }
Esempio n. 4
0
 void OnLoadingFinished(IProgressNotifier finished)
 {
     //Update UI text, must be called from main thread
     MHUrhoApp.InvokeOnMainSafe(() => { text.Value = "Loading finished"; });
 }
Esempio n. 5
0
 public Material GetMaterialFromImage(string image, string normals)
 {
     return(MHUrhoApp.InvokeOnMainSafe(() => Material.FromImage(image, normals)));
 }
Esempio n. 6
0
 public Material GetMaterialFromImage(Image image)
 {
     return(MHUrhoApp.InvokeOnMainSafe(() => Material.FromImage(image)));
 }
Esempio n. 7
0
        public XmlFile GetXmlFile(string name, bool throwOnFailure = false)
        {
            var resource = MHUrhoApp.InvokeOnMainSafe(() => resourceCache.GetXmlFile(name));

            return(!throwOnFailure ? resource : resource ?? throw new ResourceLoadingException(name));
        }
Esempio n. 8
0
        public ParticleEffect2D GetParticleEffect2D(string name, bool throwOnFailure = false)
        {
            var resource = MHUrhoApp.InvokeOnMainSafe(() => resourceCache.GetParticleEffect2D(name));

            return(!throwOnFailure ? resource : resource ?? throw new ResourceLoadingException(name));
        }
Esempio n. 9
0
 public bool Exists(string name)
 {
     return(MHUrhoApp.InvokeOnMainSafe(() => resourceCache.Exists(name)));
 }
Esempio n. 10
0
 public override void Send(SendOrPostCallback d, object state)
 {
     MHUrhoApp.InvokeOnMainSafe(() => d(state));
 }