Skip to content

Commit

Permalink
[PR] Fix "disable Borderless" option
Browse files Browse the repository at this point in the history
Updated to patch 7.0 and new API, fixed the "disable Borderless" option not being actually implemented. Closes #2.
  • Loading branch information
PrincessRTFM committed Jul 6, 2024
1 parent 7713fb4 commit 5273dd3
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 26 deletions.
2 changes: 1 addition & 1 deletion AutoMountBgm/AutoMountBgm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Product>AutoMountBGM</Product>
<Version>2.2.0</Version>
<Version>2.2.1</Version>
<Description>Automatically enables/disables mount BGM depending on the mount you use</Description>
<Copyright>Copyleft VariableVixen 2023</Copyright>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion AutoMountBgm/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class Configuration: IPluginConfiguration {
public int Version { get; set; } = 1;

public HashSet<ushort> BgmDisabledMounts { get; set; } = [];
public bool DisableBorderlessBgm = true;
public bool DisableBorderlessBgm { get; set; } = true;

public void Save() => Plugin.Interface.SavePluginConfig(this);

Expand Down
15 changes: 12 additions & 3 deletions AutoMountBgm/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
using Dalamud.Plugin;
using Dalamud.Plugin.Services;

using FFXIVClientStructs.FFXIV.Client.Game.Character;

using Lumina.Excel.GeneratedSheets;

using Character = FFXIVClientStructs.FFXIV.Client.Game.Character.Character;
Expand All @@ -25,7 +27,7 @@ public class Plugin: IDalamudPlugin {
public const string Name = "AutoMountBGM";
public static string Command => $"/{Name.ToLower()}";

[PluginService] public static DalamudPluginInterface Interface { get; private set; } = null!;
[PluginService] public static IDalamudPluginInterface Interface { get; private set; } = null!;
[PluginService] public static IClientState ClientState { get; private set; } = null!;
[PluginService] public static ICommandManager CommandManager { get; private set; } = null!;
[PluginService] public static IChatGui ChatGui { get; private set; } = null!;
Expand Down Expand Up @@ -107,15 +109,15 @@ public static unsafe bool CheckMountUnlocked(ushort mountId) {

private unsafe ushort mountId {
get {
GameObject? player = ClientState.LocalPlayer;
IGameObject? player = ClientState.LocalPlayer;
if (player is null)
return 0;
Character* native = (Character*)player.Address;
if (native is null)
return 0;
if (!native->IsMounted()) // just in case
return 0;
Character.MountContainer? mount = native->Mount;
MountContainer? mount = native->Mount;
return mount?.MountId ?? 0;
}
}
Expand All @@ -129,6 +131,13 @@ private void onConditionChanged(ConditionFlag flag, bool value) {
return;
}

if (Config.DisableBorderlessBgm) {
if (mountData[mount].BgmId == BgmIdBorderless) {
GameConfig.Set(SystemConfigOption.SoundChocobo, false);
return;
}
}

if ((Config.DisableBorderlessBgm && mountData[mount].BgmId == BgmIdBorderless) || Config.BgmDisabledMounts.Contains(mount))
GameConfig.Set(SystemConfigOption.SoundChocobo, false);
else
Expand Down
6 changes: 5 additions & 1 deletion AutoMountBgm/dalamud.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Import Project="framework.props" />

<ItemGroup>
<PackageReference Include="DalamudPackager" Version="2.1.12" />
<PackageReference Include="DalamudPackager" Version="2.1.13" />
<Reference Include="Newtonsoft.Json">
<HintPath>$(DalamudLibPath)Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
Expand Down Expand Up @@ -44,6 +44,10 @@
<HintPath>$(DalamudLibPath)FFXIVClientStructs.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="InteropGenerator.Runtime">
<HintPath>$(DalamudLibPath)InteropGenerator.Runtime.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions AutoMountBgm/framework.props
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
-->

<PropertyGroup Condition=" '$(Product)' != '' ">
<AssemblyName Condition=" '$(AssemblyName)' == '' ">$(Product)</AssemblyName>
<PackageId Condition=" '$(PackageId)' == '' ">$(Product)</PackageId>
<AssemblyName Condition=" '$(AssemblyName)' == '' ">$(Product.Replace("-", "."))</AssemblyName>
<PackageId Condition=" '$(PackageId)' == '' ">$(Product.Replace("-", "."))</PackageId>
<Title Condition=" '$(Title)' == '' ">$(Product)</Title>
<PackageProjectUrl Condition=" '$(PackageProjectUrl)' == '' ">https://github.com/PrincessRTFM/$(Product)</PackageProjectUrl>
</PropertyGroup>
Expand Down
36 changes: 18 additions & 18 deletions AutoMountBgm/packages.lock.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"version": 1,
"dependencies": {
"net8.0-windows7.0": {
"DalamudPackager": {
"type": "Direct",
"requested": "[2.1.12, )",
"resolved": "2.1.12",
"contentHash": "Sc0PVxvgg4NQjcI8n10/VfUQBAS4O+Fw2pZrAqBdRMbthYGeogzu5+xmIGCGmsEZ/ukMOBuAqiNiB5qA3MRalg=="
},
"XivCommon": {
"type": "Direct",
"requested": "[9.0.0, )",
"resolved": "9.0.0",
"contentHash": "avaBp3FmSCi/PiQhntCeBDYOHejdyTWmFtz4pRBVQQ8vHkmRx+YTk1la9dkYBMlXxRXKckEdH1iI1Fu61JlE7w=="
}
}
}
}
"version": 1,
"dependencies": {
"net8.0-windows7.0": {
"DalamudPackager": {
"type": "Direct",
"requested": "[2.1.13, )",
"resolved": "2.1.13",
"contentHash": "rMN1omGe8536f4xLMvx9NwfvpAc9YFFfeXJ1t4P4PE6Gu8WCIoFliR1sh07hM+bfODmesk/dvMbji7vNI+B/pQ=="
},
"XivCommon": {
"type": "Direct",
"requested": "[9.0.0, )",
"resolved": "9.0.0",
"contentHash": "avaBp3FmSCi/PiQhntCeBDYOHejdyTWmFtz4pRBVQQ8vHkmRx+YTk1la9dkYBMlXxRXKckEdH1iI1Fu61JlE7w=="
}
}
}
}

0 comments on commit 5273dd3

Please sign in to comment.