Skip to content

Commit

Permalink
Update 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeenobit committed Jun 27, 2015
1 parent d909dae commit 305717f
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 10 deletions.
Binary file modified GameData/KSEA/Historian/Historian.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion Source/Historian.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>copy $(TargetDir)Historian.dll "C:\Games\Kerbal Space Program\KSP Development (1.0.2)\GameData\KSEA\Historian" /Y</PostBuildEvent>
<PostBuildEvent>copy $(TargetDir)Historian.dll "C:\Games\Kerbal Space Program\KSP Development (1.0.4)\GameData\KSEA\Historian" /Y</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
8 changes: 8 additions & 0 deletions Source/Historian/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public Editor(Configuration configuration)
{
m_ToolbarButton.OnTrue += Button_OnTrue;
m_ToolbarButton.OnFalse += Button_OnFalse;
m_ToolbarButton.OnAlternateClick += Button_OnAlternateClick;

m_ToolbarButton.Register();
}
Expand Down Expand Up @@ -202,5 +203,12 @@ private void Button_OnFalse()
{
Close();
}

private void Button_OnAlternateClick()
{
var historian = Historian.Instance;

historian.Suppressed = !historian.Suppressed;
}
}
}
2 changes: 1 addition & 1 deletion Source/Historian/LauncherButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void Register()
ApplicationLauncher.AppScenes.TRACKSTATION |
ApplicationLauncher.AppScenes.VAB;

m_Button = launcher.AddModApplication(Button_OnTrue, Button_OnFalse, null, null, null, null, scenes, m_NormalTexture);
m_Button = launcher.AddModApplication(Button_OnTrue, Button_OnFalse, null, null, null, null, scenes, m_NormalTexture);

Update();

Expand Down
36 changes: 28 additions & 8 deletions Source/Historian/ToolbarButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class ToolbarButton

public event Callback OnTrue = delegate { };
public event Callback OnFalse = delegate { };
public event Callback OnAlternateClick = delegate { };

public bool IsRegistered
{
Expand Down Expand Up @@ -65,15 +66,34 @@ public void Update()

public void Button_OnClick(ClickEvent e)
{
m_State = !m_State;

if (m_State)
{
OnTrue();
}
else
switch (e.MouseButton)
{
OnFalse();
case 0: // Left Click

m_State = !m_State;

if (m_State)
{
OnTrue();
}
else
{
OnFalse();
}

break;

case 1: // Right Click

OnAlternateClick();
Update();

break;

case 2: // Middle Click
default:

break;
}
}
}
Expand Down

0 comments on commit 305717f

Please sign in to comment.