Skip to content

Commit

Permalink
Merge pull request #153 from calibx/develop
Browse files Browse the repository at this point in the history
2.1.0
  • Loading branch information
calibx committed Oct 20, 2022
2 parents e3ae414 + 319ed4f commit 358b0dd
Show file tree
Hide file tree
Showing 11 changed files with 100 additions and 26 deletions.
5 changes: 4 additions & 1 deletion MsfsPlugin/MsfsPlugin/MsfsPlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\16.png" />
<EmbeddedResource Include="Resources\256.png" />
<EmbeddedResource Include="Resources\256.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Resources\32.png" />
<EmbeddedResource Include="Resources\48.png" />
</ItemGroup>
Expand All @@ -176,6 +178,7 @@ if $(ConfigurationName) == Release (
powershell Copy-Item 'SimConnect.dll' -Destination 'archive\bin\win'
powershell New-Item -Path 'archive\metadata' -ItemType Directory -Force
powershell Copy-Item 'Resources\LoupedeckPackage.yaml' -Destination 'archive\metadata'
powershell Copy-Item 'Resources\256.png' -Destination 'archive\metadata\Icon256x256.png'
powershell Compress-Archive -Path 'archive\*' -DestinationPath 'archive\MSFSPluginPackage.zip'
powershell Rename-Item -Path 'archive\MSFSPluginPackage.zip' -NewName MSFSPluginPackage.lplug4
) else (
Expand Down
2 changes: 1 addition & 1 deletion MsfsPlugin/MsfsPlugin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("4.3.0.7478")]
[assembly: AssemblyVersion("2.0.2")]
[assembly: AssemblyVersion("2.1.0")]
2 changes: 1 addition & 1 deletion MsfsPlugin/MsfsPlugin/Resources/LoupedeckPackage.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
type: plugin4
name: MSFS
displayName: Microsoft Flight Simulator
version: 2.0.2
version: 2.1.0
author: CaliBx
copyright: CaliBx

Expand Down
6 changes: 6 additions & 0 deletions MsfsPlugin/MsfsPlugin/event/BindingKeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public enum BindingKeys
LIGHT_WING_MULTI,
LIGHT_LOGO_MULTI,
LIGHT_CABIN_MULTI,
LIGHT_PEDESTRAL_MULTI,
LIGHT_GLARESHIELD_MULTI,
LIGHT_ALL_SWITCH_MULTI,
LIGHT_NAV_FOLDER,
LIGHT_BEACON_FOLDER,
LIGHT_LANDING_FOLDER,
Expand All @@ -77,6 +80,9 @@ public enum BindingKeys
LIGHT_WING_FOLDER,
LIGHT_LOGO_FOLDER,
LIGHT_CABIN_FOLDER,
LIGHT_PEDESTRAL_FOLDER,
LIGHT_GLARESHIELD_FOLDER,
LIGHT_ALL_SWITCH_FOLDER,
AP_ALT_AP_FOLDER,
ALT_AP_FOLDER,
AP_HEADING_AP_FOLDER,
Expand Down
8 changes: 4 additions & 4 deletions MsfsPlugin/MsfsPlugin/folder/APDynamicFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public APDynamicFolder()
{
this.DisplayName = "AP";
this.GroupName = "Folder";
this.Navigation = PluginDynamicFolderNavigation.None;
MsfsData.Instance.Register(this);

this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.AP_ALT_AP_FOLDER)));
Expand All @@ -34,7 +33,8 @@ public APDynamicFolder()
this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.AP_VSPEED_SWITCH_AP_FOLDER)));
}

public override IEnumerable<String> GetEncoderRotateActionNames()
public override PluginDynamicFolderNavigation GetNavigationArea(DeviceType _) => PluginDynamicFolderNavigation.None;
public override IEnumerable<String> GetEncoderRotateActionNames(DeviceType deviceType)
{
return new[]
{
Expand All @@ -45,7 +45,7 @@ public override IEnumerable<String> GetEncoderRotateActionNames()
};
}

public override IEnumerable<String> GetEncoderPressActionNames()
public override IEnumerable<String> GetEncoderPressActionNames(DeviceType deviceType)
{
return new[]
{
Expand All @@ -55,7 +55,7 @@ public override IEnumerable<String> GetEncoderPressActionNames()
this.CreateCommandName("VS Speed Reset"),
};
}
public override IEnumerable<String> GetButtonPressActionNames()
public override IEnumerable<String> GetButtonPressActionNames(DeviceType deviceType)
{
return new[]
{
Expand Down
5 changes: 3 additions & 2 deletions MsfsPlugin/MsfsPlugin/folder/ATCDynamicFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public ATCDynamicFolder()
{
this.DisplayName = "ATC";
this.GroupName = "Folder";
this.Navigation = PluginDynamicFolderNavigation.EncoderArea;
MsfsData.Instance.Register(this);
this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.ATC_ATC_FOLDER)));
this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.ATC_0_ATC_FOLDER)));
Expand All @@ -26,7 +25,9 @@ public ATCDynamicFolder()
this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.ATC_8_ATC_FOLDER)));
this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.ATC_9_ATC_FOLDER)));
}
public override IEnumerable<String> GetButtonPressActionNames()

public override PluginDynamicFolderNavigation GetNavigationArea(DeviceType _) => PluginDynamicFolderNavigation.EncoderArea;
public override IEnumerable<String> GetButtonPressActionNames(DeviceType deviceType)
{
return new[]
{
Expand Down
8 changes: 4 additions & 4 deletions MsfsPlugin/MsfsPlugin/folder/AirlinerDynamicFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public AirlinerDynamicFolder()
{
this.DisplayName = "Airliner";
this.GroupName = "Folder";
this.Navigation = PluginDynamicFolderNavigation.None;
MsfsData.Instance.Register(this);

this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.AP_ALT_AL_FOLDER)));
Expand All @@ -38,7 +37,8 @@ public AirlinerDynamicFolder()

}

public override IEnumerable<String> GetEncoderRotateActionNames()
public override PluginDynamicFolderNavigation GetNavigationArea(DeviceType _) => PluginDynamicFolderNavigation.None;
public override IEnumerable<String> GetEncoderRotateActionNames(DeviceType deviceType)
{
return new[]
{
Expand All @@ -49,7 +49,7 @@ public override IEnumerable<String> GetEncoderRotateActionNames()
};
}

public override IEnumerable<String> GetEncoderPressActionNames()
public override IEnumerable<String> GetEncoderPressActionNames(DeviceType deviceType)
{
return new[]
{
Expand All @@ -59,7 +59,7 @@ public override IEnumerable<String> GetEncoderPressActionNames()
this.CreateCommandName("VS Speed Reset"),
};
}
public override IEnumerable<String> GetButtonPressActionNames()
public override IEnumerable<String> GetButtonPressActionNames(DeviceType deviceType)
{
return new[]
{
Expand Down
12 changes: 6 additions & 6 deletions MsfsPlugin/MsfsPlugin/folder/ComDynamicFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public ComDynamicFolder()
{
this.DisplayName = "COM";
this.GroupName = "Folder";
this.Navigation = PluginDynamicFolderNavigation.None;

this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.COM1_ACTIVE_FREQUENCY)));
this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.COM2_ACTIVE_FREQUENCY)));
Expand All @@ -38,7 +37,9 @@ public ComDynamicFolder()
MsfsData.Instance.Register(this);

}
public override IEnumerable<String> GetButtonPressActionNames()

public override PluginDynamicFolderNavigation GetNavigationArea(DeviceType _) => PluginDynamicFolderNavigation.None;
public override IEnumerable<String> GetButtonPressActionNames(DeviceType deviceType)
{
return new[]
{
Expand All @@ -53,7 +54,7 @@ public override IEnumerable<String> GetButtonPressActionNames()
PluginDynamicFolder.NavigateUpActionName,
};
}
public override IEnumerable<String> GetEncoderRotateActionNames()
public override IEnumerable<String> GetEncoderRotateActionNames(DeviceType deviceType)
{
return new[]
{
Expand All @@ -65,16 +66,15 @@ public override IEnumerable<String> GetEncoderRotateActionNames()
};
}

public override IEnumerable<String> GetEncoderPressActionNames()
public override IEnumerable<String> GetEncoderPressActionNames(DeviceType deviceType)
{
return new[]
{
this.CreateCommandName("COM1 Int Reset"),
this.CreateCommandName("COM2 Int Reset"),
//this.CreateCommandName("COM3 Int Reset"),
this.CreateCommandName (""),
this.CreateCommandName("COM1 Float Reset"),
this.CreateCommandName("COM2 Float Reset"),
//this.CreateCommandName("COM3 Float Reset"),
};
}
public override String GetAdjustmentDisplayName(String actionParameter, PluginImageSize imageSize)
Expand Down
33 changes: 28 additions & 5 deletions MsfsPlugin/MsfsPlugin/folder/LightsDynamicFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public LightsDynamicFolder()
{
this.DisplayName = "Lights";
this.GroupName = "Folder";
this.Navigation = PluginDynamicFolderNavigation.None;

this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.LIGHT_NAV_FOLDER)));
this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.LIGHT_BEACON_FOLDER)));
Expand All @@ -24,15 +23,18 @@ public LightsDynamicFolder()
this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.LIGHT_WING_FOLDER)));
this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.LIGHT_LOGO_FOLDER)));
this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.LIGHT_CABIN_FOLDER)));

this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.LIGHT_PEDESTRAL_FOLDER)));
this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.LIGHT_GLARESHIELD_FOLDER)));
this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.LIGHT_ALL_SWITCH_FOLDER)));
MsfsData.Instance.Register(this);

}
public override IEnumerable<String> GetButtonPressActionNames()

public override PluginDynamicFolderNavigation GetNavigationArea(DeviceType _) => PluginDynamicFolderNavigation.None;
public override IEnumerable<String> GetButtonPressActionNames(DeviceType deviceType)
{
return new[]
{
PluginDynamicFolder.NavigateUpActionName,
this.CreateCommandName("Navigation"),
this.CreateCommandName("Beacon"),
this.CreateCommandName("Landing"),
Expand All @@ -42,7 +44,10 @@ public override IEnumerable<String> GetButtonPressActionNames()
this.CreateCommandName("Recognition"),
this.CreateCommandName("Wing"),
this.CreateCommandName("Logo"),
this.CreateCommandName("Cabin")
this.CreateCommandName("Cabin"),
this.CreateCommandName("Pedestral"),
this.CreateCommandName("Glareshield"),
this.CreateCommandName("All")
};
}
public override BitmapImage GetCommandImage(String actionParameter, PluginImageSize imageSize)
Expand Down Expand Up @@ -80,6 +85,14 @@ public override BitmapImage GetCommandImage(String actionParameter, PluginImageS
case "Cabin":
bitmapBuilder.SetBackgroundImage(this._bindings[9].ControllerValue == 1 ? EmbeddedResources.ReadImage(this._imageOnResourcePath) : EmbeddedResources.ReadImage(this._imageOffResourcePath));
break;
case "Pedestral":
bitmapBuilder.SetBackgroundImage(this._bindings[10].ControllerValue == 1 ? EmbeddedResources.ReadImage(this._imageOnResourcePath) : EmbeddedResources.ReadImage(this._imageOffResourcePath));
break;
case "Glareshield":
bitmapBuilder.SetBackgroundImage(this._bindings[11].ControllerValue == 1 ? EmbeddedResources.ReadImage(this._imageOnResourcePath) : EmbeddedResources.ReadImage(this._imageOffResourcePath));
break;
case "All":
break;
}
bitmapBuilder.DrawText(actionParameter);

Expand Down Expand Up @@ -120,6 +133,16 @@ public override void RunCommand(String actionParameter)
case "Cabin":
this._bindings[9].SetControllerValue(1);
break;
case "Pedestral":
this._bindings[10].SetControllerValue(1);
break;
case "Glareshield":
this._bindings[11].SetControllerValue(1);
break;
case "All":
this._bindings[12].SetControllerValue(1);
break;

}
}

Expand Down
23 changes: 23 additions & 0 deletions MsfsPlugin/MsfsPlugin/input/light/LightsMultiInputs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public LightsMultiInputs() : base()
this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.LIGHT_WING_MULTI)));
this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.LIGHT_LOGO_MULTI)));
this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.LIGHT_CABIN_MULTI)));
this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.LIGHT_PEDESTRAL_MULTI)));
this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.LIGHT_GLARESHIELD_MULTI)));
this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.LIGHT_ALL_SWITCH_MULTI)));

this.AddParameter("Navigation", "Navigation light", "Lights");
this.AddParameter("Beacon", "Beacon light", "Lights");
Expand All @@ -32,6 +35,9 @@ public LightsMultiInputs() : base()
this.AddParameter("Wing", "Wing light", "Lights");
this.AddParameter("Logo", "Logo light", "Lights");
this.AddParameter("Cabin", "Cabin light", "Lights");
this.AddParameter("Pedestral", "Pedestral light", "Lights");
this.AddParameter("Glareshield", "Glareshield light", "Lights");
this.AddParameter("All lights", "All lights", "Lights");

MsfsData.Instance.Register(this);

Expand Down Expand Up @@ -71,6 +77,14 @@ protected override BitmapImage GetCommandImage(String actionParameter, PluginIma
case "Cabin":
bitmapBuilder.SetBackgroundImage(this._bindings[9].ControllerValue == 1 ? EmbeddedResources.ReadImage(this._imageOnResourcePath) : EmbeddedResources.ReadImage(this._imageOffResourcePath));
break;
case "Pedestral":
bitmapBuilder.SetBackgroundImage(this._bindings[10].ControllerValue == 1 ? EmbeddedResources.ReadImage(this._imageOnResourcePath) : EmbeddedResources.ReadImage(this._imageOffResourcePath));
break;
case "Glareshield":
bitmapBuilder.SetBackgroundImage(this._bindings[11].ControllerValue == 1 ? EmbeddedResources.ReadImage(this._imageOnResourcePath) : EmbeddedResources.ReadImage(this._imageOffResourcePath));
break;
case "All":
break;
}
bitmapBuilder.DrawText(actionParameter);
return bitmapBuilder.ToImage();
Expand Down Expand Up @@ -109,6 +123,15 @@ protected override void RunCommand(String actionParameter)
case "Cabin":
this._bindings[9].SetControllerValue(1);
break;
case "Pedestral":
this._bindings[10].SetControllerValue(1);
break;
case "Glareshield":
this._bindings[11].SetControllerValue(1);
break;
case "All":
this._bindings[12].SetControllerValue(1);
break;
}
}
public void Notify()
Expand Down
Loading

0 comments on commit 358b0dd

Please sign in to comment.