diff --git a/Eve-O-Preview/Configuration/ConfigurationStorage.cs b/Eve-O-Preview/Configuration/ConfigurationStorage.cs index f6452db..e378dbf 100644 --- a/Eve-O-Preview/Configuration/ConfigurationStorage.cs +++ b/Eve-O-Preview/Configuration/ConfigurationStorage.cs @@ -1,4 +1,5 @@ -using System.IO; +using System; +using System.IO; using Newtonsoft.Json; namespace EveOPreview.Configuration @@ -36,8 +37,16 @@ public void Load() public void Save() { string rawData = JsonConvert.SerializeObject(this._thumbnailConfig, Formatting.Indented); + string filename = this.GetConfigFileName(); - File.WriteAllText(this.GetConfigFileName(), rawData); + try + { + File.WriteAllText(filename, rawData); + } + catch (IOException) + { + // Ignore error if for some reason the updated config cannot be written down + } } private string GetConfigFileName() diff --git a/Eve-O-Preview/Presentation/MainPresenter.cs b/Eve-O-Preview/Presentation/MainPresenter.cs index eaf55ab..c83bb40 100644 --- a/Eve-O-Preview/Presentation/MainPresenter.cs +++ b/Eve-O-Preview/Presentation/MainPresenter.cs @@ -9,7 +9,7 @@ namespace EveOPreview.UI public class MainPresenter : Presenter { #region Private constants - private const string ForumUrl = @"https://forums.eveonline.com/default.aspx?g=posts&t=484927"; + private const string ForumUrl = @"https://meta.eveonline.com/t/4202"; #endregion #region Private fields diff --git a/Eve-O-Preview/Presentation/ThumbnailManager.cs b/Eve-O-Preview/Presentation/ThumbnailManager.cs index 01f957c..10f64d1 100644 --- a/Eve-O-Preview/Presentation/ThumbnailManager.cs +++ b/Eve-O-Preview/Presentation/ThumbnailManager.cs @@ -10,6 +10,9 @@ namespace EveOPreview.UI public class ThumbnailManager : IThumbnailManager { #region Private constants + private const int WindowPositionThreshold = -5000; + private const int WindowSizeThreshold = -5000; + private const string ClientProcessName = "ExeFile"; private const string DefaultClientTitle = "EVE"; #endregion @@ -360,23 +363,12 @@ private void ThumbnailActivated(IntPtr id) private void ThumbnailDeactivated(IntPtr id) { IThumbnailView view; - this._thumbnailViews.TryGetValue(id, out view); - - - if (view?.Id == this._activeClientHandle) + if (!this._thumbnailViews.TryGetValue(id, out view)) { - WindowManagerNativeMethods.SendMessage(view.Id, WindowManagerNativeMethods.WM_SYSCOMMAND, WindowManagerNativeMethods.SC_MINIMIZE, 0); - } - else - { - int style = WindowManagerNativeMethods.GetWindowLong(id, WindowManagerNativeMethods.GWL_STYLE); - // If the window is not already minimized then minimize it - if ((style & WindowManagerNativeMethods.WS_MINIMIZE) != WindowManagerNativeMethods.WS_MINIMIZE) - { - WindowManagerNativeMethods.ShowWindowAsync(id, WindowManagerNativeMethods.SW_SHOWMINIMIZED); - } + return; } + WindowManagerNativeMethods.SendMessage(view.Id, WindowManagerNativeMethods.WM_SYSCOMMAND, WindowManagerNativeMethods.SC_MINIMIZE, 0); this.RefreshThumbnails(); } @@ -473,13 +465,13 @@ private void UpdateClientLayouts() RECT rect; WindowManagerNativeMethods.GetWindowRect(process.MainWindowHandle, out rect); - int left = Math.Abs(rect.Left); - int right = Math.Abs(rect.Right); - int clientWidth = Math.Abs(left - right); + int clientWidth = Math.Abs(rect.Right - rect.Left); + int clientHeight = Math.Abs(rect.Bottom - rect.Top); - int top = Math.Abs(rect.Top); - int bottom = Math.Abs(rect.Bottom); - int clientHeight = Math.Abs(top - bottom); + if (!this.IsManageableWindow(rect.Left, rect.Top, clientWidth, clientHeight)) + { + continue; + } ClientLayout clientLayout = new ClientLayout(); clientLayout.X = rect.Left; @@ -496,5 +488,16 @@ private bool IsManageableThumbnail(IThumbnailView view) { return view.Title != ThumbnailManager.DefaultClientTitle; } + + // Quick sanity check + // EVE Online client can create a window on a really weird position outside of the screen for some reason + // In this case we need to just skip such clients + private bool IsManageableWindow(int letf, int top, int width, int height) + { + return (letf >= ThumbnailManager.WindowPositionThreshold) + && (top >= ThumbnailManager.WindowPositionThreshold) + && (width >= ThumbnailManager.WindowSizeThreshold) + && (height >= ThumbnailManager.WindowSizeThreshold); + } } } \ No newline at end of file diff --git a/Eve-O-Preview/Properties/AssemblyInfo.cs b/Eve-O-Preview/Properties/AssemblyInfo.cs index 85dc7c2..5988898 100644 --- a/Eve-O-Preview/Properties/AssemblyInfo.cs +++ b/Eve-O-Preview/Properties/AssemblyInfo.cs @@ -12,7 +12,7 @@ [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("04f08f8d-9e98-423b-acdb-4effb31c0d35")] -[assembly: AssemblyVersion("3.0.0.0")] -[assembly: AssemblyFileVersion("3.0.0.0")] +[assembly: AssemblyVersion("3.0.0.1")] +[assembly: AssemblyFileVersion("3.0.0.1")] [assembly: CLSCompliant(true)] \ No newline at end of file diff --git a/Eve-O-Preview/UI/Implementation/MainForm.Designer.cs b/Eve-O-Preview/UI/Implementation/MainForm.Designer.cs index 9276f1e..50698c1 100644 --- a/Eve-O-Preview/UI/Implementation/MainForm.Designer.cs +++ b/Eve-O-Preview/UI/Implementation/MainForm.Designer.cs @@ -755,7 +755,8 @@ private void InitializeComponent() DocumentationLinkLabel.AutoSize = true; DocumentationLinkLabel.Location = new System.Drawing.Point(0, 157); DocumentationLinkLabel.Name = "DocumentationLinkLabel"; - DocumentationLinkLabel.Size = new System.Drawing.Size(206, 13); + DocumentationLinkLabel.Padding = new System.Windows.Forms.Padding(8, 3, 8, 3); + DocumentationLinkLabel.Size = new System.Drawing.Size(222, 19); DocumentationLinkLabel.TabIndex = 6; DocumentationLinkLabel.Text = "For more information visit our forum thread:"; // @@ -763,7 +764,8 @@ private void InitializeComponent() // DescriptionLabel.Location = new System.Drawing.Point(0, 41); DescriptionLabel.Name = "DescriptionLabel"; - DescriptionLabel.Size = new System.Drawing.Size(261, 108); + DescriptionLabel.Padding = new System.Windows.Forms.Padding(8, 3, 8, 3); + DescriptionLabel.Size = new System.Drawing.Size(261, 116); DescriptionLabel.TabIndex = 5; DescriptionLabel.Text = resources.GetString("DescriptionLabel.Text"); // @@ -790,7 +792,9 @@ private void InitializeComponent() // DocumentationLink // this.DocumentationLink.Location = new System.Drawing.Point(0, 173); + this.DocumentationLink.Margin = new System.Windows.Forms.Padding(30, 3, 3, 3); this.DocumentationLink.Name = "DocumentationLink"; + this.DocumentationLink.Padding = new System.Windows.Forms.Padding(8, 3, 8, 3); this.DocumentationLink.Size = new System.Drawing.Size(262, 33); this.DocumentationLink.TabIndex = 2; this.DocumentationLink.TabStop = true; diff --git a/Eve-O-Preview/UI/Implementation/MainForm.resx b/Eve-O-Preview/UI/Implementation/MainForm.resx index fddb21e..137ad30 100644 --- a/Eve-O-Preview/UI/Implementation/MainForm.resx +++ b/Eve-O-Preview/UI/Implementation/MainForm.resx @@ -135,24 +135,6 @@ False - - False - - - False - - - False - - - False - - - False - - - False - False @@ -162,18 +144,6 @@ False - - False - - - False - - - False - - - False - False @@ -186,15 +156,6 @@ False - - False - - - False - - - False - False @@ -207,21 +168,12 @@ False - - False - False False - - False - - - False - False @@ -231,18 +183,6 @@ False - - False - - - False - - - False - - - False - False diff --git a/README.md b/README.md index a837bf2..de37c01 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,11 @@ The purpose of this application is to provide a simple way to keep an eye on sev It's essentially a task switcher, it does not relay any keyboard/mouse events and suchlike. The app works with EVE, EVE through Steam, or any combination thereof. The program does NOT (and will NOT ever) do the following things: + * modify EVE Online interface * display modified EVE Online interface * broadcast any keyboard or mouse events -* anyhow interact with EVE Online except of bringing its main window to foreground or resizing it +* anyhow interact with EVE Online except of bringing its main window to foreground or resizing/minimizing it **Under any conditions you should NOT use EVE-O Preview for any actions that break EULA or ToS of EVE Online.** @@ -24,13 +25,13 @@ If you have find out that some of the features or their combination of EVE-O Pre # How To Install & Use 1. Download and extract the contents of the .zip archive to a location of your choice (ie: Desktop, CCP folder, etc) -..* **Note**: Please do not install the program into the *Program Files* or *Program files (x86)* folders. These folders in general do not allow applications to write anything there while EVE-O Preview now stores its configuration file next to its executable, thus requiring the write access to the folder it is installed into. +..* **Note**: Please do not install the application into the *Program Files* or *Program files (x86)* folders. These folders in general do not allow applications to write anything there while EVE-O Preview now stores its configuration file next to its executable, thus requiring the write access to the folder it is installed into. 2. Start up both EVE-O Preview and your EVE Clients (the order does not matter) 3. Adjust settings as you see fit. Program options are described below # EVE Online EULA/ToS -This program is legal under the EULA/ToS: +This application is legal under the EULA/ToS: CCP FoxFour wrote: > Please keep the discussion on topic. The legitimacy of this software has already been discussed @@ -74,12 +75,14 @@ CCP FoxFour wrote: | Overlay | Color | Color used to highlight the active client's thumbnail in case the corresponding option is set | | **Active Clients** | Thumbnails list | List of currently active EVE client thumbnails. Checking an element in this list will hide the corresponding thumbnail. However these checks are not persisted and on the next EVE client or EVE-O Preview run the thumbnail will be visible again | -## Mouse Gestures +## Mouse Gestures and Actions Mouse gestures are applied to the thumbnail window currently being hovered over. | Action | Gesture | | --- | --- | +| Activate the EVE Online client and bring it to front | Click the thumbnail | +| Minimize the EVE Online client | Hold Control key and click the thumbnail | | Move thumbnail to a new position | Press right mouse button and move the mouse | | Adjust thumbnail height | Press both left and right mouse buttons and move the mouse up or down | | Adjust thumbnail width | Press both left and right mouse buttons and move the mouse left or right | @@ -137,6 +140,9 @@ The following hotkey is described as `modifier+key` where `modifier` can be **Co ## Maintained by * Phrynohyas Tig-Rah + + +## Previous maintainers * Makari Aeron @@ -150,7 +156,7 @@ The following hotkey is described as `modifier+key` where `modifier` can be **Co ## Forum thread -https://forums.eveonline.com/default.aspx?g=posts&t=484927 +https://meta.eveonline.com/t/4202 ## Original threads @@ -159,6 +165,8 @@ https://forums.eveonline.com/default.aspx?g=posts&t=484927 * https://forums.eveonline.com/default.aspx?g=posts&t=246157 +* https://forums.eveonline.com/default.aspx?g=posts&t=484927 + ## Original repository