Skip to content

Commit

Permalink
Fix warnings (#425)
Browse files Browse the repository at this point in the history
* Fix compiler warnings

- Pause locks were made obsolete, but moving from them would require extra work and time - disabling warning for it.
- Fields marked with `MpCompatSyncField` are considered never assigned to if private or internal. Can be fixed by making them public or protected (including private protected and internal protected). Both public and protected internal would allow them to be accessed from other types, while protected and private protected would be basically identical (due to us never needing to make a subtype of any of our patch types).

* Include SimpleSidearms change as well
  • Loading branch information
SokyranTheDragon authored Feb 6, 2024
1 parent 4478107 commit f6d2048
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Source/DialogUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ public static void InitializeDialogPauseLock()
{
if (isPauseLockInitialized) return;

#pragma warning disable CS0618 // Type or member is obsolete
MP.RegisterPauseLock(IsPausingDialogOpen);
#pragma warning restore CS0618 // Type or member is obsolete
isPauseLockInitialized = true;
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Mods/SimpleSidearms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class SimpleSidearmsCompat
{
// TODO: Suggest the author to encapsulate this, would simplify things so much
[MpCompatSyncField("SimpleSidearms.rimworld.CompSidearmMemory", "primaryWeaponMode")]
private static ISyncField primaryWeaponModeSyncField;
protected static ISyncField primaryWeaponModeSyncField;

public SimpleSidearmsCompat(ModContentPack mod)
{
Expand Down
4 changes: 2 additions & 2 deletions Source/Mods/VanillaFactionsTribal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ public VanillaFactionsTribal(ModContentPack mod)
// GameComponent_Tribals
private static AccessTools.FieldRef<GameComponent> tribalsGameCompInstance;
[MpCompatSyncField("VFETribals.GameComponent_Tribals", "ethos")]
private static ISyncField tribalsGameCompEthosField;
protected static ISyncField tribalsGameCompEthosField;
[MpCompatSyncField("VFETribals.GameComponent_Tribals", "ethosLocked")]
private static ISyncField tribalsGameCompEthosLockedField;
protected static ISyncField tribalsGameCompEthosLockedField;

// Window_CustomizeCornerstones
private static Type customizeCornerstonesWindowType;
Expand Down

0 comments on commit f6d2048

Please sign in to comment.