Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions com.rlabrecque.steamworks.net/Editor/RedistInstall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,30 @@
// This copies various files into their required locations when Unity is launched to make installation a breeze.
[InitializeOnLoad]
public class RedistInstall {

const string STEAMWORKS_AUTOFIX_DISABLED_MENU_ITEM = "Steamworks.NET/Disable Autofix";
const string STEAMWORKS_AUTOFIX_DISABLED = "STEAMWORKS_AUTOFIX_DISABLED";

[MenuItem(STEAMWORKS_AUTOFIX_DISABLED_MENU_ITEM)]
static void SwitchAutofixDisabled() {
var autofixDisabled = !IsAutofixDisabled();
EditorPrefs.SetBool(STEAMWORKS_AUTOFIX_DISABLED, autofixDisabled);
UpdateMenuItems();
}

static bool IsAutofixDisabled(){
return EditorPrefs.GetBool(STEAMWORKS_AUTOFIX_DISABLED, true);
}

static void UpdateMenuItems() {
Menu.SetChecked(STEAMWORKS_AUTOFIX_DISABLED_MENU_ITEM, IsAutofixDisabled());
}

static RedistInstall() {
WriteSteamAppIdTxtFile();
AddDefineSymbols();
CheckForOldDlls();
UpdateMenuItems();
}

static void WriteSteamAppIdTxtFile() {
Expand Down Expand Up @@ -57,6 +77,9 @@ static void CheckForOldDlls() {
}

static void AddDefineSymbols() {
if (IsAutofixDisabled())
return;

string currentDefines = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
HashSet<string> defines = new HashSet<string>(currentDefines.Split(';')) {
"STEAMWORKS_NET"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ public static uint GetIPCCallCount() {
/// <para> 'const char *' is the text of the message</para>
/// <para> callbacks will occur directly after the API function is called that generated the warning or message.</para>
/// </summary>
[AOT.MonoPInvokeCallback(typeof(SteamAPIWarningMessageHook_t))]
public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction) {
InteropHelp.TestIfAvailableClient();
NativeMethods.ISteamClient_SetWarningMessageHook(CSteamAPIContext.GetSteamClient(), pFunction);
Expand Down