Skip to content

Commit

Permalink
Updated the launcher to check for DirectInput devices if no XInput de…
Browse files Browse the repository at this point in the history
…vices are found, when checking for connected controllers.
  • Loading branch information
TulioAdriano committed Jan 12, 2017
1 parent 5f0947e commit 8397d6a
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 9 deletions.
6 changes: 3 additions & 3 deletions PsoWindowSize/App.config
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="PsoWindowSize.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="PsoWindowSize.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections>
<startup>

<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/></startup>
<userSettings>
<PsoWindowSize.Properties.Settings>
<setting name="KeyboardFix" serializeAs="String">
Expand Down
4 changes: 2 additions & 2 deletions PsoWindowSize/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.2.0")]
[assembly: AssemblyFileVersion("1.4.2.0")]
[assembly: AssemblyVersion("1.4.3.0")]
[assembly: AssemblyFileVersion("1.4.3.0")]
2 changes: 1 addition & 1 deletion PsoWindowSize/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion PsoWindowSize/PsoWindowSize.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PsoWindowSize</RootNamespace>
<AssemblyName>PsoWindowSize</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<IsWebBootstrapper>false</IsWebBootstrapper>
Expand Down Expand Up @@ -37,6 +37,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -46,6 +47,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Icon1.ico</ApplicationIcon>
Expand All @@ -58,6 +60,7 @@
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
Expand All @@ -67,12 +70,21 @@
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="EasyHook, Version=2.7.4761.0, Culture=neutral, PublicKeyToken=4b580fca19d0b0c5, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Yggdrasill\EasyHook.dll</HintPath>
</Reference>
<Reference Include="SharpDX, Version=3.1.1.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<HintPath>..\packages\SharpDX.3.1.1\lib\net45\SharpDX.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SharpDX.DirectInput, Version=3.1.1.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<HintPath>..\packages\SharpDX.DirectInput.3.1.1\lib\net45\SharpDX.DirectInput.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
Expand Down Expand Up @@ -127,6 +139,7 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down
3 changes: 3 additions & 0 deletions PsoWindowSize/Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ I'm a member of the dcemulation forum, and you can PM me there if you'd like to
6. CHANGE HISTORY
=================

1.4.3
= Updated the launcher to check for DirectInput devices if no XInput devices are found, when checking for connected controllers.

1.4.2
= Small update to try to enforce PSO full screen to go over the taskbar on Windows 7.

Expand Down
11 changes: 9 additions & 2 deletions PsoWindowSize/frmResizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ You should have received a copy of the GNU General Public License
//using System.Threading.Tasks;
using System.Windows.Forms;
using Yggdrasill;
using SharpDX.DirectInput;

namespace PsoWindowSize
{
Expand Down Expand Up @@ -641,9 +642,15 @@ private void cmdLaunch_Click(object sender, EventArgs e)
XInputState controller = new XInputState();
if (XInput.XInputGetState(0, ref controller).Equals(ERROR_DEVICE_NOT_CONNECTED))
{
if (MessageBox.Show(this, "There are no controllers connected. Do you wish to start anyway?", "No controller found", MessageBoxButtons.YesNo, MessageBoxIcon.Question).Equals(DialogResult.No))
DirectInput dinput = new DirectInput();
IList<DeviceInstance> joysticks = dinput.GetDevices(DeviceType.Gamepad, DeviceEnumerationFlags.AllDevices);

if (joysticks.Count == 0)
{
return;
if (MessageBox.Show(this, "There are no controllers connected. Do you wish to start anyway?", "No controller found", MessageBoxButtons.YesNo, MessageBoxIcon.Question).Equals(DialogResult.No))
{
return;
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions PsoWindowSize/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="SharpDX" version="3.1.1" targetFramework="net452" />
<package id="SharpDX.DirectInput" version="3.1.1" targetFramework="net452" />
</packages>

0 comments on commit 8397d6a

Please sign in to comment.