Skip to content

Commit

Permalink
disable gamepad stuff to stop JVL warning spam
Browse files Browse the repository at this point in the history
  • Loading branch information
jpw1991 committed Aug 1, 2024
1 parent 1ebf413 commit 6307d65
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion ChebsMercenaries/BasePlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class BasePlugin : BaseUnityPlugin
{
public const string PluginGuid = "com.chebgonaz.chebsmercenaries";
public const string PluginName = "ChebsMercenaries";
public const string PluginVersion = "2.5.0";
public const string PluginVersion = "3.0.0";
private const string ConfigFileName = PluginGuid + ".cfg";
private static readonly string ConfigFileFullPath = Path.Combine(Paths.ConfigPath, ConfigFileName);

Expand Down
2 changes: 1 addition & 1 deletion ChebsMercenaries/ChebsMercenaries.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<AssemblyCulture>$(NeutralLanguage)</AssemblyCulture>

<!-- Version Information -->
<Version>2.5.0.0</Version>
<Version>3.0.0.0</Version>
<FileVersion>$(Version)</FileVersion>
<AssemblyVersion>$(Version)</AssemblyVersion>

Expand Down
6 changes: 3 additions & 3 deletions ChebsMercenaries/Items/WeaponOfCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public virtual void CreateButtons()
{
Name = ItemName + "Follow",
Config = FollowConfig,
GamepadConfig = FollowGamepadConfig,
// GamepadConfig = FollowGamepadConfig,
HintToken = "$chebsmercenaries_weaponofcommand_follow",
BlockOtherInputs = true
};
Expand All @@ -111,7 +111,7 @@ public virtual void CreateButtons()
{
Name = ItemName + "Wait",
Config = WaitConfig,
GamepadConfig = WaitGamepadConfig,
// GamepadConfig = WaitGamepadConfig,
HintToken = "$chebsmercenaries_weaponofcommand_wait",
BlockOtherInputs = true
};
Expand All @@ -124,7 +124,7 @@ public virtual void CreateButtons()
{
Name = ItemName + "Teleport",
Config = TeleportConfig,
GamepadConfig = TeleportGamepadConfig,
// GamepadConfig = TeleportGamepadConfig,
HintToken = "$chebsmercenaries_weaponofcommand_teleport",
BlockOtherInputs = true
};
Expand Down
2 changes: 1 addition & 1 deletion ChebsMercenaries/Package/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ChebsMercenaries",
"description": "Cheb's Mercenaries adds mercenaries to Valheim that you can purchase with gold and upgrade with materials to fight (warriors, archers) or perform work (lumberjacks, miners).",
"version_number": "2.5.0",
"version_number": "3.0.0",
"website_url": "https://github.com/jpw1991/chebs-mercenaries",
"dependencies": [
"ValheimModding-Jotunn-2.20.1"
Expand Down
18 changes: 9 additions & 9 deletions ChebsMercenaries/PvPOptions/PvPOptionsGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ public static void CreateConfigs(BaseUnityPlugin plugin, string pluginGuid)
{
const string client = "PvP Options (Client)";

OptionsKeyConfigEntry = plugin.Config.Bind(client, "OpenOptions",
OptionsKeyConfigEntry = plugin.Config.Bind(client, "PvPOpenOptions",
new KeyboardShortcut(KeyCode.F7), new ConfigDescription("Open the mod PvP options window."));

OptionsButton = new ButtonConfig
{
Name = "OptionsButton",
Name = "PvPOpenOptions",
ShortcutConfig = OptionsKeyConfigEntry,
HintToken = "OptionsButton"
HintToken = "PvPOpenOptions"
};
InputManager.Instance.AddButton(pluginGuid, OptionsButton);
}
Expand Down Expand Up @@ -81,14 +81,14 @@ public static void TogglePanel()
var allies = PvPManager.GetPlayerFriends();
GUIManager.Instance.CreateText("PvP Allies:", parent: _panel.transform,
anchorMin: new Vector2(0.5f, 1f), anchorMax: new Vector2(0.5f, 1f),
position: new Vector2(-250f, -210f),
position: new Vector2(-250f, -100f),
font: GUIManager.Instance.AveriaSerifBold, fontSize: 16, color: GUIManager.Instance.ValheimOrange,
outline: true, outlineColor: Color.black,
width: 200f, height: 30f, addContentSizeFitter: false);

var textObject = GUIManager.Instance.CreateText(string.Join(", ", allies), parent: _panel.transform,
anchorMin: new Vector2(0.5f, 1f), anchorMax: new Vector2(0.5f, 1f),
position: new Vector2(0f, -210f),
position: new Vector2(0f, -100f),
font: GUIManager.Instance.AveriaSerifBold, fontSize: 16, color: GUIManager.Instance.ValheimOrange,
outline: true, outlineColor: Color.black,
width: 400f, height: 30f, addContentSizeFitter: false);
Expand All @@ -97,15 +97,15 @@ public static void TogglePanel()
// add/remove ally
GUIManager.Instance.CreateText("Ally (case sensitive):", parent: _panel.transform,
anchorMin: new Vector2(0.5f, 1f), anchorMax: new Vector2(0.5f, 1f),
position: new Vector2(-250f, -240f),
position: new Vector2(-250f, -140f),
font: GUIManager.Instance.AveriaSerifBold, fontSize: 16, color: GUIManager.Instance.ValheimOrange,
outline: true, outlineColor: Color.black,
width: 200f, height: 30f, addContentSizeFitter: false);

_allyInput = GUIManager.Instance.CreateInputField(parent: _panel.transform,
anchorMin: new Vector2(0.5f, 0.5f),
anchorMax: new Vector2(0.5f, 0.5f),
position: new Vector2(0f, 60f),
position: new Vector2(0f, 170f),
contentType: InputField.ContentType.Standard,
placeholderText: "player",
fontSize: 16,
Expand All @@ -115,7 +115,7 @@ public static void TogglePanel()

GUIManager.Instance.CreateButton("+", parent: _panel.transform,
anchorMin: new Vector2(0.5f, 0.5f), anchorMax: new Vector2(0.5f, 0.5f),
position: new Vector2(200f, 60f),
position: new Vector2(200f, 170f),
width: 30f, height: 30f).GetComponent<Button>().onClick.AddListener(() =>
{
if (_allyInput.text != string.Empty)
Expand All @@ -134,7 +134,7 @@ public static void TogglePanel()

GUIManager.Instance.CreateButton("-", parent: _panel.transform,
anchorMin: new Vector2(0.5f, 0.5f), anchorMax: new Vector2(0.5f, 0.5f),
position: new Vector2(260f, 60f),
position: new Vector2(260f, 170f),
width: 30f, height: 30f).GetComponent<Button>().onClick.AddListener(() =>
{
if (_allyInput.text != string.Empty)
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ Cheb's Mercenaries adds mercenaries to Valheim that you can purchase with gold a

It is related to my other mod called [Cheb's Necromancy](https://github.com/jpw1991/chebs-necromancy) and shares a lot of concepts and functionality. It's basically for people that want living human minions rather than the undead.

**Attention:** PvP is a new feature in 2.2.3 and needs testing. By default, it is disabled. To turn it on, set `PvPAllowed` to true in the config. Your minions should now be hostile to other players. Please report problems [here](https://github.com/jpw1991/chebs-mercenaries/pull/44).

## About Me

[![image1](https://imgur.com/Fahi6sP.png)](https://necrobase.chebgonaz.com)
Expand Down Expand Up @@ -148,6 +146,7 @@ You can find the github [here](https://github.com/jpw1991/chebs-mercenaries).

Date | Version | Notes
--- | --- | ---
29/09/2024 | 3.0.0 | Overhaul of asset bundle and aesthetics
10/06/2024 | 2.4.1 | Implement spawning of catapult; add console command to spawn mercenaries in with armor
06/02/2024 | 2.4.0 | Add catapult
07/01/2024 | 2.3.0 | PvP with friends as exceptions implemented via console commands.
Expand Down

0 comments on commit 6307d65

Please sign in to comment.