public static void UpdateRes(ResolutionMode res) { switch ((int)res) { case 0: { var screenSize = Screen.PrimaryScreen.Bounds.Size; if (screenSize.Height >= 1440 && screenSize.Width >= 2560) { UIPlugin.Instance.Window.Size = new System.Drawing.Size(1600, 900); } else { UIPlugin.Instance.Window.Size = new System.Drawing.Size(1280, 720); } break; } case 1: UIPlugin.Instance.Window.Size = new System.Drawing.Size(1280, 720); break; case 2: UIPlugin.Instance.Window.Size = new System.Drawing.Size(1600, 900); break; } }
public static string GetTableInserter(Type type, string tableName = null, ResolutionMode onConflict = ResolutionMode.Abort) { var builder = new StringBuilder(); var values = new StringBuilder(); builder.Append("INSERT "); switch (onConflict) { case ResolutionMode.Abort: break; case ResolutionMode.Rollback: builder.Append("OR ROLLBACK "); break; case ResolutionMode.Fail: builder.Append("OR FAIL "); break; case ResolutionMode.Ignore: builder.Append("OR IGNORE "); break; case ResolutionMode.Replace: builder.Append("OR REPLACE "); break; default: throw new ArgumentOutOfRangeException("onConflict"); } builder.Append("INTO "); builder.Append(tableName ?? GetTableName(type)); builder.Append("("); values.Append(" VALUES "); values.Append("("); var first = true; foreach (var prop in type.GetProperties()) { var pk = prop.GetTypedCustomAttribute <DbPrimaryKeyAttribute>(); if (pk != null && pk.IsAutoIncrement) { // ignore auto increment primary key continue; } if (!first) { builder.Append(", "); values.Append(", "); } first = false; builder.Append(prop.GetDbNameOfProperty()); values.Append("@" + prop.Name); } builder.Append(")"); values.Append(");"); builder.Append(values); return(builder.ToString()); }
public CrudBase(string tableName, ResolutionMode onConflict) { this._tableName = tableName ?? SentenceGenerator.GetTableName <T>(); this._tableCreator = SentenceGenerator.GetTableCreator <T>(this._tableName); this._tableInserter = SentenceGenerator.GetTableInserter <T>(this._tableName, onConflict); this._tableUpdater = SentenceGenerator.GetTableUpdater <T>(this._tableName); this._tableDeleter = SentenceGenerator.GetTableDeleter <T>(this._tableName); }
public Game() { CurrentMode = new ResolutionMode(800, 600, WindowStyle.Windowed); Context = new GameContext(this); Timer = new Session.GameTime(); CreateInternalStates(); }
/// <summary> /// Initializes a new instance of the <see cref="Adic.InjectorBinder"/> class. /// </summary> /// <param name="cache">Reflection cache used to get type info.</param> /// <param name="binder">Binder used to resolved bindings.</param> public Injector(IReflectionCache cache, IBinder binder, ResolutionMode resolutionMode) { this.cache = cache; this.binder = binder; this.resolutionMode = resolutionMode; this.binder.beforeAddBinding += this.OnBeforeAddBinding; }
public void SetResolution(int width, int height, WindowStyle style) { this.CurrentMode = new ResolutionMode(width, height, style); if (MainWindow != null) { throw new NotImplementedException("Screen resize not implemented yet"); } }
void Reset() { resolutionMode = ResolutionMode.ConstantPixelSize; //resolution.x = Screen.width; //resolution.y = Screen.height; pixelSize = 3; opacity = 1; colormap = null; }
public InjectionContainer( object id, IReflectionCache cache, IBinder binder, ResolutionMode resolutionMode) : base(cache, binder, resolutionMode) { this.id = id; RegisterSelf(); }
/// <summary> /// Sets the preview resolution. /// </summary> /// <param name="width">Width.</param> /// <param name="height">Height.</param> public static void setPreviewResolution(ResolutionMode resolutionMode) { if (easyWebCamInterface != null) { int preWidth = 0; int preHeight = 0; resolutionMode.Dimensions(out preWidth, out preHeight); easyWebCamInterface.setPreviewResolution(preWidth, preHeight); } }
public Vector3 TranslateScale(Vector3 standardScale, ResolutionMode mode) { Vector2 scale = new Vector2(); scale.x = m_CanvasRoot.rect.width / m_CanvasScaler.referenceResolution.x; scale.y = m_CanvasRoot.rect.height / m_CanvasScaler.referenceResolution.y; if (mode == ResolutionMode.KeepRatio) { float scaleValue = Mathf.Min(scale.x, scale.y); scale.Set(scaleValue, scaleValue); } return(new Vector3(scale.x * standardScale.x, scale.y * standardScale.y)); }
public DependentBundle(XDependency metadata) { this.metadata = metadata; this.bundleSymblocName = metadata.BundleSymbolicName; this.bundleVersion = string.IsNullOrEmpty(metadata.BundleVersion.ToString()) ? new Version("1.0.0.0") : new Version(metadata.BundleVersion.ToString()); this.assemblyName = metadata.AssemblyName; this.assemlyVersion = string.IsNullOrEmpty(metadata.AssemblyVersion.ToString()) ? null : new Version(metadata.AssemblyVersion.ToString()); this.culture = string.IsNullOrEmpty(metadata.Culture.ToString()) ? "neutral" : metadata.Culture.ToString(); this.publicKeyToken = string.IsNullOrEmpty(metadata.PublicKeyToken.ToString()) ? "null" : metadata.PublicKeyToken.ToString(); this.resolution = metadata.Resolution; }
private void ChangeCurrentWindowResolutionMode(ResolutionMode newMode) { /* * Change the current resolution mode to the given newMode. If we succesfully change * the mode, inform the lineRenderer that the rendering mode has changed. */ if (newMode != currentResolutionMode && newMode != ResolutionMode.NULL) { currentResolutionMode = newMode; /* Update how the lines are rendered with this new window size */ if (gameController != null) { gameController.UpdateLineVertices(); } } }
public void AdapterResolution(RectTransform target, ResolutionMode mode) { Vector2 scale = new Vector2(); scale.x = m_CanvasRoot.rect.width / m_CanvasScaler.referenceResolution.x; scale.y = m_CanvasRoot.rect.height / m_CanvasScaler.referenceResolution.y; if (mode == ResolutionMode.KeepRatio) { float scaleValue = Mathf.Min(scale.x, scale.y); scale.Set(scaleValue, scaleValue); } Vector3 standardScale = target.localScale; target.localScale = new Vector3(standardScale.x * scale.x, standardScale.y * scale.y, standardScale.z); Vector2 anchoredPos = target.anchoredPosition; target.anchoredPosition = new Vector2(anchoredPos.x * scale.x, anchoredPos.y * scale.y); }
/// <summary> /// Initializes a new instance of the <see cref="Adic.InjectionContainer"/> class. /// </summary> /// <remarks> /// <param name="resolutionMode">Instance resolution mode.</param> public InjectionContainer(ResolutionMode resolutionMode) : this(GenerateIdentifier(), new ReflectionCache(), new Binder(), resolutionMode) { }
private static Size ResolutionToSize(ResolutionMode rm) { return rm == ResolutionMode.CLEYE_QVGA ? new Size(320, 240) : new Size(640, 480); }
public CrudBase(ResolutionMode onConflict) : this(null, onConflict) { }
public static string GetTableInserter <T>(string tableName = null, ResolutionMode onConflict = ResolutionMode.Abort) { return(GetTableInserter(typeof(T), tableName, onConflict)); }
public ImportBundleImpl(AbstractBundle bundle, ResolutionMode resolution) { this.bundle = bundle; this.resolution = resolution; }
public static void Initialize() { VisibilityRange = 128; m_resolutionMode = ResolutionMode.High; ViewAngleMode = ViewAngleMode.Normal; SkyRenderingMode = SkyRenderingMode.Full; TerrainMipmapsEnabled = false; ObjectsShadowsEnabled = true; m_soundsVolume = 0.5f; m_musicVolume = 0.5f; m_brightness = 0.5f; PresentationInterval = 1; ShowGuiInScreenshots = false; ShowLogoInScreenshots = true; ScreenshotSize = ScreenshotSize.ScreenSize; MoveControlMode = MoveControlMode.Pad; HideMoveLookPads = false; BlocksTextureFileName = string.Empty; LookControlMode = LookControlMode.EntireScreen; FlipVerticalAxis = false; MoveSensitivity = 0.5f; LookSensitivity = 0.5f; GamepadDeadZone = 0.16f; GamepadCursorSpeed = 1f; CreativeDigTime = 0.2f; CreativeReach = 7.5f; MinimumHoldDuration = 0.5f; MinimumDragDistance = 10f; AutoJump = true; HorizontalCreativeFlight = false; DropboxAccessToken = string.Empty; ScpboxAccessToken = string.Empty; MotdUpdateUrl = "https://scmod.aijiajia.xyz/com/motd?v={0}&l={1}"; MotdBackupUpdateUrl = "https://scmod.aijiajia.xyz/com/motd?v={0}&l={1}"; MotdUpdatePeriodHours = 12.0; MotdLastUpdateTime = DateTime.MinValue; MotdLastDownloadedData = string.Empty; UserId = string.Empty; LastLaunchedVersion = string.Empty; CommunityContentMode = CommunityContentMode.Normal; MultithreadedTerrainUpdate = true; NewYearCelebrationLastYear = 2020; ScreenLayout1 = ScreenLayout.Single; ScreenLayout2 = ScreenLayout.DoubleOpposite; ScreenLayout3 = (((float)Window.ScreenSize.X / (float)Window.ScreenSize.Y > 1.33333337f) ? ScreenLayout.TripleVertical : ScreenLayout.TripleHorizontal); ScreenLayout4 = ScreenLayout.Quadruple; GuiSize = ((!(ScreenResolutionManager.ApproximateScreenInches > 6.5f)) ? GuiSize.Normal : ((!(ScreenResolutionManager.ApproximateScreenInches > 9f)) ? GuiSize.Smaller : GuiSize.Smallest)); LoadSettings(); VersionsManager.CompareVersions(LastLaunchedVersion, "1.29"); _ = 0; if (VersionsManager.CompareVersions(LastLaunchedVersion, "2.1") < 0) { MinimumDragDistance = 10f; } if (VersionsManager.CompareVersions(LastLaunchedVersion, "2.2") < 0) { if (Utilities.GetTotalAvailableMemory() < 524288000) { VisibilityRange = MathUtils.Min(64, VisibilityRange); } else if (Utilities.GetTotalAvailableMemory() < 1048576000) { VisibilityRange = MathUtils.Min(112, VisibilityRange); } } Window.Deactivated += delegate { SaveSettings(); }; }
private Size3 GetBufferResolution(Texture fullResTarget, ResolutionMode mode) { return(new Size3(fullResTarget.Width / (int)mode, fullResTarget.Height / (int)mode, 1)); }
private static extern IntPtr CLEyeCreateCamera(Guid camUUID, ColorMode mode, ResolutionMode res, float frameRate);
/// <summary> /// Adds the specified container. /// </summary> /// <param name="identifier">The container identifier.</param> /// <param name="resolutionMode">Instance resolution mode.</param> /// <typeparam name="T">Container type.</typeparam> /// <returns>The injection container for chaining.</returns> public IInjectionContainer AddContainer <T>(object identifier, ResolutionMode resolutionMode) where T : IInjectionContainer { return(this.AddContainer <T>(new Type[] { typeof(object), typeof(ResolutionMode) }, new object[] { identifier, resolutionMode })); }
public static void Capture(int width, int height, string filename) { if (GameManager.Project != null) { using (RenderTarget2D renderTarget2D = new RenderTarget2D(width, height, 1, ColorFormat.Rgba8888, DepthFormat.Depth24Stencil8)) { RenderTarget2D renderTarget = Display.RenderTarget; Dictionary <ComponentGui, bool> dictionary = new Dictionary <ComponentGui, bool>(); ResolutionMode resolutionMode = ResolutionMode.High; try { if (!SettingsManager.ShowGuiInScreenshots) { foreach (ComponentPlayer componentPlayer in GameManager.Project.FindSubsystem <SubsystemPlayers>(throwOnError: true).ComponentPlayers) { dictionary[componentPlayer.ComponentGui] = componentPlayer.ComponentGui.ControlsContainerWidget.IsVisible; componentPlayer.ComponentGui.ControlsContainerWidget.IsVisible = false; } } resolutionMode = SettingsManager.ResolutionMode; SettingsManager.ResolutionMode = ResolutionMode.High; Display.RenderTarget = renderTarget2D; ScreensManager.Draw(); if (SettingsManager.ShowLogoInScreenshots) { PrimitivesRenderer2D primitivesRenderer2D = new PrimitivesRenderer2D(); Texture2D texture2D = ContentManager.Get <Texture2D>("Textures/Gui/ScreenCaptureOverlay"); Vector2 vector = new Vector2((width - texture2D.Width) / 2, 0f); Vector2 corner = vector + new Vector2(texture2D.Width, texture2D.Height); primitivesRenderer2D.TexturedBatch(texture2D, useAlphaTest: false, 0, DepthStencilState.None).QueueQuad(vector, corner, 0f, new Vector2(0f, 0f), new Vector2(1f, 1f), Engine.Color.White); primitivesRenderer2D.Flush(); } } finally { Display.RenderTarget = renderTarget; foreach (KeyValuePair <ComponentGui, bool> item in dictionary) { item.Key.ControlsContainerWidget.IsVisible = item.Value; } SettingsManager.ResolutionMode = resolutionMode; } if (!Storage.DirectoryExists(ModsManager.baseDir + "/ScreenCapture")) { Storage.CreateDirectory(ModsManager.baseDir + "/ScreenCapture"); } string path = Storage.CombinePaths(Storage.GetSystemPath(ModsManager.baseDir + "/ScreenCapture"), filename); using (FileStream stream = new FileStream(path, FileMode.Create)) { byte[] array = new byte[4 * renderTarget2D.Width * renderTarget2D.Height]; renderTarget2D.GetData(array, 0, new Rectangle(0, 0, renderTarget2D.Width, renderTarget2D.Height)); ByteBuffer src = ByteBuffer.Wrap(array); Bitmap bitmap = Bitmap.CreateBitmap(renderTarget2D.Width, renderTarget2D.Height, Bitmap.Config.Argb8888); bitmap.CopyPixelsFromBuffer(src); bitmap.Compress(Bitmap.CompressFormat.Png, 100, stream); } Intent intent = new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE"); intent.SetData(Android.Net.Uri.FromFile(new Java.IO.File(path))); Window.Activity.SendBroadcast(intent); } } }
/// <summary> /// Initializes a new instance of the <see cref="Adic.InjectionContainer"/> class. /// </summary> /// <remarks> /// <param name="identifier">Container identifier.</param> /// <param name="cache">Reflection cache used to get type info.</param> /// <param name="binder">Binder to be used on the container.</param> /// <param name="resolutionMode">Instance resolution mode.</param> public InjectionContainer(object identifier, IReflectionCache cache, IBinder binder, ResolutionMode resolutionMode) : base(cache, binder, resolutionMode) { this.identifier = identifier; this.RegisterItself(); }
public InjectionContainer(ResolutionMode resolutionMode) : base(new ReflectionCache(), new Binder(), resolutionMode) { RegisterSelf(); }
/// <summary> /// Initializes a new instance of the <see cref="Adic.InjectionContainer"/> class. /// </summary> /// <remarks> /// <param name="identifier">Container identifier.</param> /// <param name="resolutionMode">Instance resolution mode.</param> public InjectionContainer(object identifier, ResolutionMode resolutionMode) : this(identifier, new ReflectionCache(), new Binder(), resolutionMode) { }
public InjectionContainer(IReflectionCache cache, ResolutionMode resolutionMode) : base(cache, new Binder(), resolutionMode) { RegisterSelf(); }