Skip to content

Commit

Permalink
Merge pull request #165 from MacTee/dev
Browse files Browse the repository at this point in the history
Dev merge - Version 2.3.0.9
  • Loading branch information
MacTee authored Apr 26, 2019
2 parents ec52a02 + cfe9995 commit 9d5884a
Show file tree
Hide file tree
Showing 27 changed files with 1,206 additions and 896 deletions.
1 change: 1 addition & 0 deletions KSPModAdmin.Core/Controller/MainController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using KSPModAdmin.Core.Utils;
using KSPModAdmin.Core.Utils.Localization;
using KSPModAdmin.Core.Utils.Logging;
using KSPModAdmin.Core.Utils.SiteHandler;
using KSPModAdmin.Core.Views;

namespace KSPModAdmin.Core.Controller
Expand Down
13 changes: 13 additions & 0 deletions KSPModAdmin.Core/Controller/ModSelectionController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using KSPModAdmin.Core.Model;
using KSPModAdmin.Core.Utils;
using KSPModAdmin.Core.Utils.Controls.Aga.Controls.Tree.Helper;
using KSPModAdmin.Core.Utils.SiteHandler;
using KSPModAdmin.Core.Views;
using SharpCompress.Archive;

Expand Down Expand Up @@ -95,6 +96,7 @@ internal static void Initialize(ucModSelection view)

View.AddActionKey(VirtualKey.VK_DELETE, DeleteMod);
View.AddActionKey(VirtualKey.VK_BACK, DeleteMod);
View.AddActionKey(VirtualKey.VK_A, AddMod, new ModifierKey[] { ModifierKey.AnyControl });
}


Expand Down Expand Up @@ -188,6 +190,17 @@ protected static bool DeleteMod(ActionKeyInfo keyState)
return true;
}

/// <summary>
/// ActionKey callback function to handle the keys control + a.
/// Opens the AddMod dialog.
/// </summary>
/// <returns>True, cause we have handled the key.</returns>
protected static bool AddMod(ActionKeyInfo keyState)
{
OpenAddModDialog();
return true;
}

#endregion


Expand Down
14 changes: 9 additions & 5 deletions KSPModAdmin.Core/Controller/OptionsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -642,12 +642,16 @@ private static void HandleAdminVersionWebResponse(WebResponse response)
updateDLG.PostDownloadAction = PostDownloadAction;
updateDLG.Message = GetDownloadMSG(parameter);

if (updateDLG.ShowDialog(View.ParentForm) != DialogResult.OK)
return;
View.InvokeIfRequired(() => {

DownloadPath = updateDLG.DownloadPath;
PostDownloadAction = updateDLG.PostDownloadAction;
DownloadNewAdminVersion();
if (updateDLG.ShowDialog(View.ParentForm) != DialogResult.OK)
return;

DownloadPath = updateDLG.DownloadPath;
PostDownloadAction = updateDLG.PostDownloadAction;
DownloadNewAdminVersion();

});
}
else
{
Expand Down
4 changes: 1 addition & 3 deletions KSPModAdmin.Core/KSPModAdmin.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,9 @@
<Compile Include="Utils\ModPackHandler.cs" />
<Compile Include="Utils\SiteHandler\CurseForgeHandler.cs" />
<Compile Include="Utils\SiteHandler\CurseHandler.cs" />
<Compile Include="Utils\SiteHandler\BitbucketHandler.cs" />
<Compile Include="Utils\SiteHandler\GitHubHandler.cs" />
<Compile Include="Utils\SiteHandler\SpacedockHandler.cs" />
<Compile Include="Utils\SiteHandler\KSPForumHandler.cs" />
<Compile Include="Utils\SiteHandler\GitHubHandler.cs" />
<Compile Include="Utils\SiteHandler\KerbalStuffHandler.cs" />
<Compile Include="Utils\SiteHandler\SiteHandlerManager.cs" />
<Compile Include="Utils\SiteHandler\ISiteHandler.cs" />
<Compile Include="Utils\ScanInfo.cs" />
Expand Down
1 change: 1 addition & 0 deletions KSPModAdmin.Core/Model/ModNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using KSPModAdmin.Core.Properties;
using KSPModAdmin.Core.Utils;
using KSPModAdmin.Core.Utils.Controls.Aga.Controls.Tree;
using KSPModAdmin.Core.Utils.SiteHandler;

namespace KSPModAdmin.Core.Model
{
Expand Down
11 changes: 5 additions & 6 deletions KSPModAdmin.Core/Utils/ActionKeyManager/ActionKeyManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,14 @@ public bool HandleKeyMessage(ref Message msg)
try
{
key = (VirtualKey)msg.WParam.ToInt32();
kdLPHelper = new KeyDownLParamHelper(msg.LParam.ToInt32());
}
catch (Exception)
{
return false;
}

if (msg.Msg == WM_KEYDOWN)
CaptureControlKeysState(key, true, kdLPHelper.Extended);
CaptureControlKeysState(key, true);

if (msg.Msg == WM_KEYDOWN && mActionKeys.ContainsKey(key))
{
Expand All @@ -147,7 +146,7 @@ public bool HandleKeyMessage(ref Message msg)
}
}
else if (msg.Msg == WM_KEYUP)
CaptureControlKeysState(key, false, kdLPHelper.Extended);
CaptureControlKeysState(key, false);

return false;
}
Expand Down Expand Up @@ -194,7 +193,7 @@ public void RemoveAllActionKeys()
/// </summary>
/// <param name="key">The control key to save the state for.</param>
/// <param name="pressState">The state of control key.</param>
private void CaptureControlKeysState(VirtualKey key, bool pressState, bool right = false)
private void CaptureControlKeysState(VirtualKey key, bool pressState) //, bool right = false)
{
switch (key)
{
Expand All @@ -211,9 +210,9 @@ private void CaptureControlKeysState(VirtualKey key, bool pressState, bool right
//// break;

case VirtualKey.VK_CONTROL:
if (right)
//if (right)
mControlKeysState.RControl = pressState;
else
//else
mControlKeysState.LControl = pressState;
break;

Expand Down
1 change: 1 addition & 0 deletions KSPModAdmin.Core/Utils/ModPackHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Xml;
using KSPModAdmin.Core.Controller;
using KSPModAdmin.Core.Model;
using KSPModAdmin.Core.Utils.SiteHandler;
using SharpCompress.Archive;
using SharpCompress.Archive.Zip;
using SharpCompress.Common;
Expand Down
1 change: 0 additions & 1 deletion KSPModAdmin.Core/Utils/SiteHandler/BitbucketHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using HtmlAgilityPack;
using KSPModAdmin.Core.Controller;
using KSPModAdmin.Core.Model;
Expand Down
Loading

0 comments on commit 9d5884a

Please sign in to comment.