Skip to content

Commit

Permalink
update for multiplayer
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMasterCado committed Jan 1, 2021
1 parent 367dd90 commit 904edaa
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 12 deletions.
43 changes: 32 additions & 11 deletions Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace MoreRealism
{
public class Main : IMod
public class Main : AbstractMod
{
private GameObject _controllerGO;
private MoreRealismController _controllerPrefab;
Expand All @@ -13,7 +13,7 @@ public Main()
SetupKeyBinding();
}

public void onEnabled()
public override void onEnabled()
{
GameObject controllerPrefabGO = new GameObject();
_controllerPrefab = controllerPrefabGO.AddComponent<MoreRealismController>();
Expand All @@ -25,7 +25,7 @@ public void onEnabled()
EventManager.Instance.OnStartPlayingPark += MoreRealismController.Instance.Load;
}

public void onDisabled()
public override void onDisabled()
{
if (MoreRealismController.Instance != null)
{
Expand All @@ -38,8 +38,8 @@ public void onDisabled()

private void SetupKeyBinding()
{
KeyGroup group = new KeyGroup(Identifier);
group.keyGroupName = Name;
KeyGroup group = new KeyGroup(getIdentifier());
group.keyGroupName = getName();

InputManager.Instance.registerKeyGroup(group);

Expand All @@ -49,20 +49,41 @@ private void SetupKeyBinding()

private void RegisterKey(string identifier, KeyCode keyCode, string name, string description = "")
{
KeyMapping key = new KeyMapping(Identifier + "/" + identifier, keyCode, KeyCode.None);
key.keyGroupIdentifier = Identifier;
KeyMapping key = new KeyMapping(getIdentifier() + "/" + identifier, keyCode, KeyCode.None);
key.keyGroupIdentifier = getIdentifier();
key.keyName = name;
key.keyDescription = description;
InputManager.Instance.registerKeyMapping(key);
}

public override bool isMultiplayerModeCompatible()
{
return true;
}

public string Name => "More Realism";
public override bool isRequiredByAllPlayersInMultiplayerMode()
{
return true;
}

public string Description => "Add new mechanics to make the game more realistic";
public override string getName()
{
return "More Realism";
}

public string Identifier => "TheMasterCado@MoreRealism";
public override string getDescription()
{
return "Add new mechanics to make the game more realistic";
}

public override string getIdentifier()
{
return "TheMasterCado@MoreRealism";
}

public string Version => MoreRealismController.Version;
public override string getVersionNumber()
{
return MoreRealismController.Version;
}
}
}
2 changes: 1 addition & 1 deletion MoreRealismController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace MoreRealism
{
public class MoreRealismController : SerializedMonoBehaviour
{
public static string Version = "1.3";
public static string Version = "1.4";
public static MoreRealismController Instance;

public List<BaseWindow> windows = new List<BaseWindow>();
Expand Down
Binary file modified MoreRealism_debug/MoreRealism.dll
Binary file not shown.
Binary file modified MoreRealism_debug/MoreRealism.pdb
Binary file not shown.
Binary file modified TheMasterCado@MoreRealism/MoreRealism.dll
Binary file not shown.

0 comments on commit 904edaa

Please sign in to comment.