-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
599 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
Mods/0-SCore/Features/SCoreOptions/Scripts/ProcessOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
19
Mods/0-SCore/Features/WeaponCameraSway/Harmony/vp_FPCamera.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
18
Mods/0-SCore/Features/WeaponCameraSway/Harmony/vp_FPWeapon.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
Mods/0-SCore/Features/WeaponCameraSway/Scripts/ConsoleCmdWeaponSway.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
12
Mods/0-SCore/Features/WeaponCameraSway/Scripts/SwayUtilities.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
||
|
Oops, something went wrong.