Skip to content

Commit

Permalink
2023.5.2 hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenlucerne committed May 16, 2023
1 parent 8247846 commit 5508128
Show file tree
Hide file tree
Showing 37 changed files with 544 additions and 772 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# mod.io Unity Plugin v2023.5.12
[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/modio/modio-unity/blob/master/LICENSE)
[![Discord](https://img.shields.io/discord/389039439487434752.svg?label=Discord&logo=discord&color=7289DA&labelColor=2C2F33)](https://discord.mod.io)
[![Master docs](https://img.shields.io/badge/docs-master-green.svg)](https://github.com/modio/modio-unity-v2/wiki)
[![Master docs](https://img.shields.io/badge/docs-master-green.svg)](https://go.mod.io/unity-docs)
[![Unity 3D](https://img.shields.io/badge/Unity-2019.4+-lightgrey.svg)](https://unity3d.com)

Welcome to the mod.io Unity Engine plugin repository. It allows game developers to host and automatically install user-created mods in their games which use **Unity 2019.4** or newer. It provides a UI for mod discovery, installation and collection management, and a C# interface which connects to the [mod.io REST API](https://docs.mod.io).
Expand All @@ -16,10 +16,10 @@ Welcome to the mod.io Unity Engine plugin repository. It allows game developers
| ------------- | ------- |
|Windows ||
|Windows (GDK) |[Contact us](#game-studios-and-publishers) |
|Nintendo Switch|[Contact us](#game-studios-and-publishers) |
|XBox (GDK) |[Contact us](#game-studios-and-publishers) |
|PlayStation 4 |[Contact us](#game-studios-and-publishers) |
|PlayStation 5 |[Contact us](#game-studios-and-publishers) |
|Nintendo Switch|[Contact us](#game-studios-and-publishers) |
|Linux ||
|macOS ||

Expand Down Expand Up @@ -272,4 +272,3 @@ Our Unity plugin is public and open source. Game developers are welcome to utili

## Other Repositories
Our aim with [mod.io](https://mod.io), is to provide an [open modding API](https://docs.mod.io). You are welcome to [view, fork and contribute to our other codebases](https://github.com/modio) in use.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using UnityEngine;
using System.Linq;
using ModIO.Implementation.API.Requests;
using UnityEngine.Profiling;

namespace ModIO.Implementation
{
Expand All @@ -20,8 +19,6 @@ namespace ModIO.Implementation
/// </summary>
internal static class ModIOUnityImplementation
{
// REVIEW @Jackson Not sure if this should go into mod management or just here. It doesnt
// really belong anywhere in particular.
/// <summary>
/// A cached reference to the current upload operation handle.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
namespace ModIO.Implementation.API.Requests
{

internal static class AuthenticateViaEmail
{
public static WebRequestConfig Request(string emailaddress)
{
var request = new WebRequestConfig()
{
Url = $"{Settings.server.serverURL}{@"/oauth/emailrequest"}?",
RequestMethodType = "POST",
};
internal static class AuthenticateViaEmail
{
public static WebRequestConfig Request(string emailaddress)
{
var request = new WebRequestConfig()
{
Url = $"{Settings.server.serverURL}{@"/oauth/emailrequest"}?",
RequestMethodType = "POST",
};

request.AddField("email", emailaddress);
request.AddField("email", emailaddress);

return request;
}
}
return request;
}
}
}
7 changes: 6 additions & 1 deletion Runtime/Utility/SelfInstancingMonoSingleton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ public class SelfInstancingMonoSingleton<T> : MonoBehaviour, ISimpleMonoSingleto
public static T Instance
{
get {
if(!Application.isPlaying)
{
throw new UnityException($"Attempted to get singleton when application was not playing (This can happen when exiting Playmode. It's safe to ignore)");
}
if(_instance == null)
{
_instance = (T)FindObjectOfType(typeof(T));
Expand Down Expand Up @@ -58,7 +62,8 @@ protected virtual void OnDestroy()
}

protected virtual void OnApplicationQuit()
{
{
Destroy(_instance.gameObject);
Destroy(gameObject);
_instance = null;
}
Expand Down
4 changes: 2 additions & 2 deletions UI/Color Scheme/ColorApplierImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ private void Start()

private bool Apply()
{
if(colorScheme == null && !Browser.SingletonIsInstantiated())
if(colorScheme == null || SharedUi.colorScheme == null)
{
return false;
}

var scheme = colorScheme == null ? Browser.Instance.colorScheme : colorScheme;
var scheme = colorScheme == null ? SharedUi.colorScheme : colorScheme;
if(scheme != null)
{
graphic.color = scheme.GetSchemeColor(color);
Expand Down
4 changes: 2 additions & 2 deletions UI/Color Scheme/ColorSetter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ internal class ColorSetter : MonoBehaviour

void OnEnable()
{
if(Browser.SingletonIsInstantiated())
if(SharedUi.colorScheme != null)
{
Refresh(Browser.Instance.colorScheme);
Refresh(SharedUi.colorScheme);
}
}

Expand Down
2 changes: 1 addition & 1 deletion UI/Examples.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

102 changes: 101 additions & 1 deletion UI/Examples/Example.unity
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,49 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &35804558
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 35804560}
- component: {fileID: 35804559}
m_Layer: 0
m_Name: ExampleGlyphSetter
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &35804559
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 35804558}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a9f68958c42874b36b342c2129c39e64, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &35804560
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 35804558}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &768429225
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -401,12 +444,69 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1519110690}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 795.73627, y: 549.2372, z: 3.6627884}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &4826167439654112296
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4826167439654112297}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f95d137321812dd41a3ac7750adf5684, type: 3}
m_Name:
m_EditorClassIdentifier:
Cancel: 331
Alternate: 332
Options: 333
TabLeft: 334
TabRight: 335
Search: 339
Menu: 337
controllerAndKeyboardInput:
- Horizontal
- Vertical
mouseInput:
- Mouse X
- Mouse Y
verticalControllerInput: Vertical
--- !u!1 &4826167439654112297
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4826167439654112299}
- component: {fileID: 4826167439654112296}
m_Layer: 0
m_Name: ExampleInputCapture
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4826167439654112299
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4826167439654112297}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &7183562815888032899
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
using System.Collections;
using ModIOBrowser;
using ModIOBrowser.Implementation;
using UnityEngine;

namespace Plugins.mod.io.UI.Examples
{
public class ExmapleGlyphSetter : MonoBehaviour
public class ExampleGlyphSetter : MonoBehaviour
{
private bool connected = false;
bool connected;

void Awake()
{
this.StartCoroutine(this.CheckForControllers());
StartCoroutine(CheckForControllers());
}

IEnumerator CheckForControllers()
Expand All @@ -20,9 +19,9 @@ IEnumerator CheckForControllers()
{
var controllers = Input.GetJoystickNames();

if (!this.connected && controllers.Length > 0)
if (!connected && controllers.Length > 0)
{
this.connected = true;
connected = true;
if(controllers[0].Contains("Microsoft"))
{
Glyphs.Instance.ChangeGlyphs(GlyphPlatforms.XBOX);
Expand All @@ -39,9 +38,9 @@ IEnumerator CheckForControllers()
Debug.Log("Connected");

}
else if (this.connected && controllers.Length == 0)
else if (connected && controllers.Length == 0)
{
this.connected = false;
connected = false;
Glyphs.Instance.ChangeGlyphs(GlyphPlatforms.PC);
Debug.Log("Disconnected");
}
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions UI/Examples/ExampleInputCapture.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using ModIOBrowser;
using ModIOBrowser.Implementation;
using UnityEngine;
using UnityEngine.EventSystems;

/// <summary>
/// An Example script on how to setup the key/button bindings for the ModIO Browser. Inputs such as
Expand Down Expand Up @@ -47,6 +45,8 @@ public class ExampleInputCapture : MonoBehaviour

void Update()
{
if(!Browser.IsOpen) return;

// This is a basic example of one way to capture inputs and inform the UI browser what
// action that that input should perform.
//
Expand All @@ -62,7 +62,7 @@ void Update()
HandleControllerInput();
}

private void HandleInputReceiver()
void HandleInputReceiver()
{
if(Input.GetKeyDown(Cancel))
{
Expand Down Expand Up @@ -94,7 +94,7 @@ private void HandleInputReceiver()
}
}

private void HandleControllerInput()
void HandleControllerInput()
{
// Handle controller scrolling
// For now, this is only used in the mod details view, and may clash with "regular" navigation
Expand Down
Loading

0 comments on commit 5508128

Please sign in to comment.