Skip to content

Commit

Permalink
1.0.64.2041
Browse files Browse the repository at this point in the history
  • Loading branch information
SphereII committed Aug 28, 2024
1 parent dc34dc6 commit 38904f0
Show file tree
Hide file tree
Showing 37 changed files with 599 additions and 56 deletions.
5 changes: 5 additions & 0 deletions Mods/0-SCore/0-SCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,14 @@
<Compile Include="Features\RemoteCrafting\Scripts\BlockDropBoxContainer.cs" />
<Compile Include="Features\RemoteCrafting\Scripts\RemoteCraftingUtils.cs" />
<Compile Include="Features\RemoteCrafting\Scripts\XUiC\XUiC_BroadcastButton.cs" />
<Compile Include="Features\SCoreOptions\Scripts\ProcessOptions.cs" />
<Compile Include="Features\Signs\Scripts\Blocks\BlockSCoreSign.cs" />
<Compile Include="Features\Signs\Scripts\Blocks\SCoreVideo.cs" />
<Compile Include="Features\Signs\Scripts\TileEntity\TileEntitySCoreSign.cs" />
<Compile Include="Features\WeaponCameraSway\Harmony\vp_FPCamera.cs" />
<Compile Include="Features\WeaponCameraSway\Harmony\vp_FPWeapon.cs" />
<Compile Include="Features\WeaponCameraSway\Scripts\ConsoleCmdWeaponSway.cs" />
<Compile Include="Features\WeaponCameraSway\Scripts\SwayUtilities.cs" />
<Compile Include="Harmony\AIDirectorBloodMoon\AiDirectorBloodMoonParty.cs" />
<Compile Include="Harmony\Animation\AnimalAvatarController.cs" />
<Compile Include="Harmony\Animation\AnimatorMapper.cs" />
Expand Down
8 changes: 7 additions & 1 deletion Mods/0-SCore/Config/Localization.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,10 @@ buffFreshnessSCoreName,"Fresh Food",""
buffFreshnessSCore,"Fresh Food!",""
buffFreshnessSCoreDesc,"Warm food and drink warms the soul!",""
TooDamagedToSharpen,"This item is too worn out to be resharpened.",""
NotDamagedEnoughToSharpen,"This item is still in pretty good shape.",""
NotDamagedEnoughToSharpen,"This item is still in pretty good shape.",""
xuiSCoreUtilsWeaponSway,"Disable Weapon Sway",""
xuiSCoreUtilsWeaponSwayToolTip,"Toggles weapon and camera bob and sway to help against motion sickness",""
xuiSCoreUtilsMemoryBudget,"Run GFX st budget 0 on game load",""
xuiSCoreUtilsMemoryBudgetToolTip,"Automatically sets the GFX st budget 0 when you enter a game. Effective on next game start.",""
xuiSCoreUtilsPPEnable,"Run GFX pp enable 0 on game load",""
xuiSCoreUtilsPPEnableToolTip,"Automatically sets the GFX pp enable 0 when you enter a game. Effective on next game start.",""
22 changes: 22 additions & 0 deletions Mods/0-SCore/Config/XUi/windows.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,28 @@
depth="3" font_size="24" crispness="OnDesktop" effect="Outline8"
effect_distance="1,1" effect_color="20,20,20,230"/>

<togglebuttonCVar name="toggleToggleWeaponSway"
cvar="WeaponSway"
caption_key="xuiSCoreUtilsWeaponSway"
tooltip_key="xuiSCoreUtilsWeaponSwayToolTip" width="290" height="32"
depth="3" font_size="24" crispness="OnDesktop" effect="Outline8"
effect_distance="1,1" effect_color="20,20,20,230"/>

<togglebuttonCVar name="toggleToggleMemoryBudget"
cvar="$SCoreUtils_MemoryBudget"
caption_key="xuiSCoreUtilsMemoryBudget"
tooltip_key="xuiSCoreUtilsMemoryBudgetToolTip" width="290" height="32"
depth="3" font_size="24" crispness="OnDesktop" effect="Outline8"
effect_distance="1,1" effect_color="20,20,20,230"/>

<togglebuttonCVar name="toggleToggleMemoryBudget"
cvar="$SCoreUtils_PPEnable"
caption_key="xuiSCoreUtilsPPEnable"
tooltip_key="xuiSCoreUtilsPPEnableToolTip" width="290" height="32"
depth="3" font_size="24" crispness="OnDesktop" effect="Outline8"
effect_distance="1,1" effect_color="20,20,20,230"/>


</grid>
</panel>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
// This index is not the index of the instruction list, which would include a listing of all the opcodes / operands,
// rather, this is the 32nd local variable defined. We don't know what it is, or where it's at in the instructions,
// but the variableInformation will contain the operand fingerprint
var index = 32;
var index = 31;
var variableInformation = ILUtilities.FindLocalVariable(method, index);

// Grab all the instructions
Expand Down
28 changes: 28 additions & 0 deletions Mods/0-SCore/Features/SCoreOptions/Scripts/ProcessOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using UnityEngine;

public class ProcessSCoreOptions {
public static void ProcessCVars(string cvar) {
if (string.IsNullOrEmpty(cvar)) return;
var player = GameManager.Instance.World.GetPrimaryPlayer();

var cvarValue = player.Buffs.GetCustomVar(cvar);
switch (cvar)
{
case "$SCoreUtils_MemoryBudget":
if (cvarValue > 0)
{
Log.Out("Setting Streaming Memory Budget to 0");
QualitySettings.streamingMipmapsMemoryBudget = 0;
}
break;
case "$SCoreUtils_PPEnable":
if (cvarValue > 0)
{
Log.Out("Setting PP Enable to 0");
var command = new ConsoleCmdGfx();
command.SetPostProcessing("enable", 0, 0);
}
break;
}
}
}
19 changes: 19 additions & 0 deletions Mods/0-SCore/Features/WeaponCameraSway/Harmony/vp_FPCamera.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.Collections.Generic;
using System.Reflection;
using HarmonyLib;

namespace SphereII_CameraSway {

[HarmonyPatch]
public class SCorevp_FPCameraPatches {

[HarmonyTargetMethod]
static IEnumerable<MethodBase> TargetMethods() {
yield return typeof(vp_FPCamera).GetMethod("UpdateSwaying");
yield return typeof(vp_FPCamera).GetMethod("UpdateBob");
}
public static bool Prefix() {
return SwayUtilities.CanSway(false);
}
}
}
18 changes: 18 additions & 0 deletions Mods/0-SCore/Features/WeaponCameraSway/Harmony/vp_FPWeapon.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.Collections.Generic;
using System.Reflection;
using HarmonyLib;
namespace SphereII_WeaponSway {

[HarmonyPatch]
public class SCorevp_FPWeaponPatches {

[HarmonyTargetMethod]
static IEnumerable<MethodBase> TargetMethods() {
yield return typeof(vp_FPWeapon).GetMethod("UpdateSwaying");
yield return typeof(vp_FPWeapon).GetMethod("UpdateBob");
}
public static bool Prefix() {
return SwayUtilities.CanSway(false);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System.Collections.Generic;

public class ConsoleCmdWeaponSway : ConsoleCmdAbstract {
public override bool IsExecuteOnClient {
get { return true; }
}

public override string[] getCommands() {
return new string[] {
"weaponsway"
};
}

public override void Execute(List<string> @params, CommandSenderInfo senderInfo) {
if (!senderInfo.IsLocalGame)
{
SingletonMonoBehaviour<SdtdConsole>.Instance.Output("Command can only be used on clients.");
return;
}

if (@params.Count == 1)
{
if (StringParsers.TryParseBool(@params[0], out var swayOn))
{
EntityPlayer primaryPlayer = GameManager.Instance.World.GetPrimaryPlayer();
if (primaryPlayer == null) return;
primaryPlayer.Buffs.AddCustomVar("$WeaponSway", swayOn ? 1 : 0);
SingletonMonoBehaviour<SdtdConsole>.Instance.Output($"Weapon Sway is {swayOn}");
return;
}
}

SingletonMonoBehaviour<SdtdConsole>.Instance.Output("Syntax: weaponsway <true/false>");
}

public override string getDescription() {
return "SCore: Sets a CVar on the primary player";
}
}
12 changes: 12 additions & 0 deletions Mods/0-SCore/Features/WeaponCameraSway/Scripts/SwayUtilities.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
public class SwayUtilities {
public static bool CanSway(bool force = false) {
if (force)
return true;
var player = GameManager.Instance.World.GetPrimaryPlayer();
if (player == null) return true;
if (!player.Buffs.HasCustomVar("$WeaponSway")) return true;
var sway = player.Buffs.GetCustomVar("$WeaponSway");
return sway < 1f;
}

}
8 changes: 6 additions & 2 deletions Mods/0-SCore/Harmony/ModEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ public static void Init() {
ModletChecks();
ModEvents.GameStartDone.RegisterHandler(CheckExternalParticles);
ModEvents.GameStartDone.RegisterHandler(EntityPool);


ModEvents.PlayerSpawnedInWorld.RegisterHandler(CheckGraphicSettings);
// When player starts a game
// ModEvents.GameShutdown.RegisterHandler(new Action(FireManager.Instance.CleanUp));
// ModEvents.PlayerSpawnedInWorld.RegisterHandler(new Action<ClientInfo, RespawnType, Vector3i>(FireManager.Instance.Init));
}

private static void CheckGraphicSettings(ClientInfo arg1, RespawnType arg2, Vector3i arg3) {
ProcessSCoreOptions.ProcessCVars("$SCoreUtils_MemoryBudget");
ProcessSCoreOptions.ProcessCVars("$SCoreUtils_PPEnable");
}

public static Shader GetStandardShader() {
if (_defaultShader == null)
{
Expand Down
2 changes: 1 addition & 1 deletion Mods/0-SCore/Harmony/ZombieFeatures/Transmogrifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static void Postfix(global::EntityAlive __instance, ref int ___walkType)


// Distribution of Walk Types in an array. Adjust the numbers as you want for distribution.
var numbers = new int[] {1, 2, 2, 3, 21,22,5, 6, 7, 7};
var numbers = new int[] {1, 2, 2, 3, 5, 6, 7, 7};

// Randomly generates a number between 0 and the maximum number of elements in the numbers.
var randomNumber = random.Next(0, numbers.Length);
Expand Down
2 changes: 1 addition & 1 deletion Mods/0-SCore/ModInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<Description value="SCore Mod" />
<DisplayName value="0-SCore" />
<Website value="" />
<Version value="1.0.60.1616" />
<Version value="1.0.64.2041" />
</xml>
4 changes: 2 additions & 2 deletions Mods/0-SCore/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@
// [assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("20.0.*")]

[assembly: AssemblyVersion("1.0.60.1616")]
[assembly: AssemblyFileVersion("1.0.60.1616")]
[assembly: AssemblyVersion("1.0.64.2041")]
[assembly: AssemblyFileVersion("1.0.64.2041")]
31 changes: 31 additions & 0 deletions Mods/0-SCore/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,37 @@ Direct Download to the 0-SCore.zip available on gitlab mirror:
### Change Logs

[ Change Log ]
Version: 1.0.64.2041
[ SCore Options ]
- Added toggle for WeaponSway
- Added Toggle for gfx st set 0
- Game needs to be restarted after checked.
- Every start after will have that automatically running.
- Added Toggle for gfx pp enable 0
- Game needs to be restarted after checked.
- Every start after will have that automatically running.

[ Weapon Sway ]
- Added patches to vp_Weapon / vp_Camera to block swaying and bob code from running.
- This feature is configured via a cvar called "$WeaponSway".
- Value of 0 will enable sway.
- Value of 1 or more will disable sway.
- This is included into 0-SCore, and as a standalone mod.
- The standalone mod disables it completely, with no option to toggle it back on.
- This feature can be toggled using the SCore Utilities, or through a console command
- Added new console Command weaponsway
- "weaponsway true" will turn on weapon and camera sway.
- "weaponsway false" will turn off weapon and camera sway.

[ Zombie Random Walk Type ]
- Removed default Spider / Crawler walk types
- Spider's head position look wonky, and crawlers were too slow.

[ A Better Life ]
- Added notrample tag on fish
- Merged in new plants from blue name.

Version: 1.0.60.1241
[ MinEvent ]
- Added a new MinEvent to allow changing local transform / rotation on a particular transform on an entity.
Expand Down
Binary file modified Mods/0-SCore/SCore.dll
Binary file not shown.
Binary file modified Mods/0-SCore/SCore.pdb
Binary file not shown.
7 changes: 3 additions & 4 deletions Mods/0-SCore/Scripts/XUiC/Controls/XUiC_ToggleButtonCVar.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@

// <togglebuttonCVar name="toggleLockPick" cvar="LegacyLockPick" caption_key="xuiLockPicking" tooltip_key="xuiLockPickingToolTip" width="290" height="32" depth="3" font_size="24" crispness="OnDesktop" effect="Outline8" effect_distance="1,1" effect_color="20,20,20,230" />

using UnityEngine;

public class XUiC_ToggleButtonCVar : XUiC_ToggleButton {
public string CVarName;


public delegate void XUiEvent_ToggleButtonCVarValueChanged(XUiC_ToggleButtonCVar _sender, bool _newValue);

public delegate void XUiEvent_ToggleButtonCVarValueChanged(XUiC_ToggleButtonCVar _sender, bool _newValue);
public event XUiEvent_ToggleButtonCVarValueChanged OnValueChanged;

public override bool ParseAttribute(string name, string value, XUiController _parent) {
Expand Down
2 changes: 0 additions & 2 deletions Mods/Blooms Family Farming/Config/blocks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<!-- Turning on Crops-->
<set xpath="/blocks/block[@name='ConfigFeatureBlock']/property[@class='CropManagement']/property[@name='CropEnable']/@value">true</set>

<set xpath="/blocks/block[@name='ConfigFeatureBlock']/property[@class='CropManagement']/property[@name='CropEnable']/@value">true</set>

<!-- Change interval to every 5 minutes -->
<set xpath="/blocks/block[@name='ConfigFeatureBlock']/property[@class='CropManagement']/property[@name='CheckInterval']/@value">60</set>
<set xpath="/blocks/block[@name='ConfigFeatureBlock']/property[@class='CropManagement']/property[@name='RequirePipesForSprinklers']/@value">true</set>
Expand Down
2 changes: 1 addition & 1 deletion Mods/SampleProject/ModInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<Description value="Sample Project Mod"/>
<DisplayName value="Sample Project"/>
<Website value=""/>
<Version value="1.0.0.19717"/>
<Version value="1.0.0.37172"/>
</xml>
Binary file modified Mods/SampleProject/SampleProject.dll
Binary file not shown.
Binary file modified Mods/SampleProject/SampleProject.pdb
Binary file not shown.
3 changes: 2 additions & 1 deletion Mods/SphereII A Better Life/Config/Localization.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ Raw Fish,items,Item Food,KgNone,Raw Fish,,,,
rawFishDesc,items,Item Food,KgNone,"Fish can be eaten raw but is better when charred, grilled, boiled or made into stews at a campfire. Can attract zombies if carried.",,,,
Grilled Fish,items,Item Food,KgNone,Grilled Fish,,,,
Boiled Fish,items,Item Food,KgNone,Boiled Fish,,,,
Charred Fish,items,Item Food,KgNone,Charred Fish,,,,
Charred Fish,items,Item Food,KgNone,Charred Fish,,,,
fishBabyShark,,,,Baby Shark Doo Doo Doo,,,,
18 changes: 17 additions & 1 deletion Mods/SphereII A Better Life/Config/biomes.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
<configs>
<append xpath="//biomes/biome[@name='underwater']//decorations" >
<decoration type="block" blockname="terrWaterSpawner" prob="0.001" rotatemax="4" />
<decoration type="block" blockname="terrWaterSpawner" prob="0.001" rotatemax="4" />
<decoration type="block" blockname="PondWeed" prob=".04" rotatemax="7"/>
<decoration type="block" blockname="Starfish" prob=".07" rotatemax="7"/>
<decoration type="block" blockname="TubeSponge" prob=".09" rotatemax="7"/>
</append>

<!--
<append xpath="//biomes/biome[@name='water']//decorations" >
<decoration type="block" blockname="Broadleafplantain" prob=".05" rotatemax="7"/>
<decoration type="block" blockname="Cosmos1" prob=".0.001" rotatemax="7"/>
<decoration type="block" blockname="Cosmos2" prob=".0.001" rotatemax="7"/>
<decoration type="block" blockname="LotusFlower" prob=".0.001" rotatemax="7"/>
<decoration type="block" blockname="PampasGrass" prob=".0.001" rotatemax="7"/>
<decoration type="block" blockname="VioletEtsorrel" prob=".0.001" rotatemax="7"/>
<decoration type="block" blockname="Waterlily" prob=".0.001" rotatemax="7"/>
<decoration type="block" blockname="Woodsorrel" prob=".0.001" rotatemax="7"/>
</append>
-->
</configs>


Loading

0 comments on commit 38904f0

Please sign in to comment.