Skip to content

Commit

Permalink
Changelog
Browse files Browse the repository at this point in the history
- Removed dataRate modification since it was removed from Valheim with the latest patch, we might reintroduce this feature with the next version.
- Added support to display a banner of our hosting partner. There is also a option to turn this off inside the configuration file.
  • Loading branch information
nxPublic committed Mar 23, 2021
1 parent de08ec8 commit de21feb
Show file tree
Hide file tree
Showing 12 changed files with 70 additions and 39 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
A HarmonyX Mod aimed at improving the gameplay quality of Valheim. The mod includes several different main features that allow users to modify the stats of players, buildings and entities. V+ also offers players the ability to build and place objects with very high precision through a sophisticated system, as well as tweaking and modifying already placed objects with equal precision. The goal is to provide V+ as a base modification for Valheim to increase quality of life, tweak the game's difficulty, and in general, improve the player's experience. V+ also comes with a version and configuration control system for servers and users, enabling server owners to ensure that only players with the same configuration are able to join the server.

# ValheimPlus Server Hosting
Below you can find a list of hosting companies that are supporting ValheimPlus with very competitive pricing and ease of use.
We teamed up with one of the best game hosting companies out there to make sure we can offer you the best quality dedicated game server hosting at affordable good prices.
We work together closely to make sure all our features are integrated and working at all times. We even have a full time dedicated Zap-Hosting support team to help you out in our [discord](https://discord.gg/valheimPlus) in addition.

[![GPortal](https://imgur.com/L46GT7q.png)](https://www.g-portal.com/valheim)
[![ZapHosting](https://i.imgur.com/4ZB1xHU.jpg)](https://zap-hosting.com/valheimplus)
[![GFXHosting](https://www.gtxgaming.co.uk/wp-content/uploads/2021/02/valheim_plus_banner-3.png)](https://www.gtxgaming.co.uk/clientarea/aff.php?aff=2096)




Expand Down Expand Up @@ -205,7 +203,6 @@ Below you can find a list of hosting companies that are supporting ValheimPlus w
# Server
* Remove password requirement for the server.
* Modify the maximum amount of players on a server.
* Modify server data rate in kilobytes.
* Modify number of seconds it takes for items to despawn after being dropped on the ground. (default is 3600 seconds).
* *Note: Items on ground will retain base game functionality which ensures that drops don't disappear if a player is nearby or there is a "player base" nearby*
* Automatically sync V+ configuration of players joining a server to match the server's configuration.
Expand Down
Binary file added ValheimPlus/Assets/ZapHosting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ValheimPlus/Assets/ZapHosting_hover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion ValheimPlus/Configurations/Sections/ServerConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ public class ServerConfiguration : BaseConfig<ServerConfiguration>
public bool enforceMod { get; internal set; } = true;
public bool serverSyncsConfig { get; internal set; } = true;
public bool serverSyncHotkeys { get; internal set; } = true;
public int dataRate { get; internal set; } = 60; // Code that applies this multiplies by 1024, so the default is 60(KB)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
public class ValheimPlusConfiguration : BaseConfig<ValheimPlusConfiguration>
{
public bool mainMenuLogo { get; internal set; } = true;
public bool serverBrowserAdvertisement { get; internal set; } = true;
}
}
36 changes: 36 additions & 0 deletions ValheimPlus/GameClasses/FejdStartup.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using HarmonyLib;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using ValheimPlus.Configurations;
using ValheimPlus.UI;
Expand Down Expand Up @@ -44,6 +45,41 @@ private static void Postfix(ref FejdStartup __instance)
__instance.m_versionLabel.fontSize = 14;
string gameVersion = Version.CombineVersion(global::Version.m_major, global::Version.m_minor, global::Version.m_patch);
__instance.m_versionLabel.text = "version " + gameVersion + "\n" + "ValheimPlus " + ValheimPlusPlugin.version;


if(Configuration.Current.ValheimPlus.IsEnabled && Configuration.Current.ValheimPlus.serverBrowserAdvertisement)
{
DefaultControls.Resources uiResources = new DefaultControls.Resources();
GameObject joinpanel = GameObjectAssistant.GetChildComponentByName<Transform>("JoinPanel", __instance.m_startGamePanel).gameObject;
if (joinpanel)
{
foreach (Transform panel in joinpanel.transform)
{
if (panel.gameObject.name == "Server help")
{
GameObject serverHelpObj = panel.gameObject;
GameObject banner = GameObject.Instantiate(serverHelpObj);
banner.transform.SetParent(joinpanel.transform, false);
banner.transform.localPosition = banner.transform.localPosition + new Vector3(0, -300);
banner.GetComponent<RectTransform>().sizeDelta = new Vector2(315, 315);
banner.transform.GetChild(0).GetComponent<Text>().text = "";
banner.transform.GetChild(1).gameObject.SetActive(false);
GameObject bannerButton = DefaultControls.CreateButton(uiResources);
bannerButton.transform.SetParent(banner.transform, false);
bannerButton.GetComponentInChildren<Text>().text = "";
bannerButton.GetComponent<RectTransform>().sizeDelta = new Vector2(315, 315);
bannerButton.GetComponent<Button>().image.sprite = VPlusMainMenu.VPlusBannerSprite;
bannerButton.GetComponent<Button>().transition = Selectable.Transition.SpriteSwap;
SpriteState ss = new SpriteState();
ss.highlightedSprite = VPlusMainMenu.VPlusBannerHoverSprite;
bannerButton.GetComponent<Button>().spriteState = ss;
bannerButton.GetComponent<Button>().onClick.AddListener(delegate { Application.OpenURL("http://zap-hosting-banner.valheim.plus"); });
}
}
}

}

}
}

Expand Down
23 changes: 0 additions & 23 deletions ValheimPlus/GameClasses/ZDOMan.cs

This file was deleted.

15 changes: 14 additions & 1 deletion ValheimPlus/UI/VPlusMainMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,27 @@ namespace ValheimPlus.UI
public static class VPlusMainMenu
{
public static Sprite VPlusLogoSprite;

public static Sprite VPlusBannerSprite;
public static Sprite VPlusBannerHoverSprite;
public static void Load()
{
//Load the logo from embedded asset
Stream logoStream = EmbeddedAsset.LoadEmbeddedAsset("Assets.logo.png");
Texture2D logoTexture = Helper.LoadPng(logoStream);
VPlusLogoSprite = Sprite.Create(logoTexture, new Rect(0, 0, logoTexture.width, logoTexture.height), new Vector2(0.5f, 0.5f));
logoStream.Dispose();

//Load the banner from embedded asset
Stream bannerStream = EmbeddedAsset.LoadEmbeddedAsset("Assets.ZapHosting.png");
Texture2D bannerTexture = Helper.LoadPng(bannerStream);
VPlusBannerSprite = Sprite.Create(bannerTexture, new Rect(0, 0, bannerTexture.width, bannerTexture.height), new Vector2(0.5f, 0.5f));
bannerStream.Dispose();

//Load the bannerfrom embedded asset
Stream bannerHoverStream = EmbeddedAsset.LoadEmbeddedAsset("Assets.ZapHosting_hover.png");
Texture2D bannerHoverTexture = Helper.LoadPng(bannerHoverStream);
VPlusBannerHoverSprite = Sprite.Create(bannerHoverTexture, new Rect(0, 0, bannerHoverTexture.width, bannerHoverTexture.height), new Vector2(0.5f, 0.5f));
bannerStream.Dispose();
}
}
}
12 changes: 12 additions & 0 deletions ValheimPlus/Utility/GameObjectAssistant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,17 @@ private static float GetGameObjectPosHash(GameObject o)
{
return (1000f * o.transform.position.x) + o.transform.position.y + (.001f * o.transform.position.z);
}

public static T GetChildComponentByName<T>(string name, GameObject objected) where T : Component
{
foreach (T component in objected.GetComponentsInChildren<T>(true))
{
if (component.gameObject.name == name)
{
return component;
}
}
return null;
}
}
}
3 changes: 2 additions & 1 deletion ValheimPlus/ValheimPlus.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,6 @@
<Compile Include="GameClasses\Fermenter.cs" />
<Compile Include="GameClasses\Inventory.cs" />
<Compile Include="GameClasses\Console.cs" />
<Compile Include="GameClasses\ZDOMan.cs" />
<Compile Include="GameClasses\ZNet.cs" />
<Compile Include="GameClasses\Skills.cs" />
<Compile Include="GameClasses\ItemDrop.cs" />
Expand Down Expand Up @@ -428,6 +427,8 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Assets\logo.png" />
<EmbeddedResource Include="Assets\ZapHosting.png" />
<EmbeddedResource Include="Assets\ZapHosting_hover.png" />
<Content Include="FodyWeavers.xml" />
</ItemGroup>
<ItemGroup />
Expand Down
6 changes: 3 additions & 3 deletions valheim_plus.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ enabled=true
; Display the Valheim Plus logo in the main menu
mainMenuLogo=true

; Display the advertisement of our server hosting partner on the server browser menu
serverBrowserAdvertisement=true

[AdvancedBuildingMode]
; https://docs.unity3d.com/ScriptReference/KeyCode.html <- a list of keycodes

Expand Down Expand Up @@ -508,9 +511,6 @@ serverSyncsConfig=true
; If false allows you to keep your own defined hotkeys instead of synchronising the ones declared for the server. Sections need to be enabled in your local configuration to load hotkeys. This is a client side setting and not affected by server settings.
serverSyncHotkeys=false

; The total amount of data that the server and client can send per second in kilobyte, do not set this value higher than 200-300 if you don't exactly know what you are doing.
dataRate=60


[Stamina]
; Each of these values allow for - values, 50 will increase the stamina cost by 50%, -50 will reduce the stamina cost by 50%
Expand Down
5 changes: 0 additions & 5 deletions vplusconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -1065,11 +1065,6 @@
"description": "If false allows you to keep your own defined hotkeys instead of synchronising the ones declared for the server. Sections need to be enabled in your local configuration to load hotkeys. This is a client side setting and not affected by server settings.",
"defaultValue": "false",
"defaultType": "bool"
},
"dataRate": {
"description": "The total amount of data that the server and client can send per second in kilobyte",
"defaultValue": "60",
"defaultType": "int"
}
}
},
Expand Down

0 comments on commit de21feb

Please sign in to comment.