mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-10 03:40:01 +00:00
cleanup
This commit is contained in:
parent
d736d0fdf7
commit
c435ca4074
@ -4,7 +4,7 @@ using QSB.Utility;
|
||||
|
||||
namespace QSB.ConversationSync
|
||||
{
|
||||
class ConversationEvent : QSBEvent<ConversationMessage>
|
||||
public class ConversationEvent : QSBEvent<ConversationMessage>
|
||||
{
|
||||
public override EventType Type => EventType.Conversation;
|
||||
|
||||
|
@ -7,19 +7,19 @@ namespace QSB.ConversationSync
|
||||
{
|
||||
public static ConversationManager Instance { get; private set; }
|
||||
|
||||
void Start()
|
||||
private void Start()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
public void SendPlayerOption(string text)
|
||||
{
|
||||
GlobalMessenger<int, string, ConversationType>.FireEvent(EventNames.QSBConversation, -1, text, ConversationType.PLAYER);
|
||||
GlobalMessenger<int, string, ConversationType>.FireEvent(EventNames.QSBConversation, -1, text, ConversationType.Player);
|
||||
}
|
||||
|
||||
public void SendCharacterDialogue(int id, string text)
|
||||
{
|
||||
GlobalMessenger<int, string, ConversationType>.FireEvent(EventNames.QSBConversation, id, text, ConversationType.CHARACTER);
|
||||
GlobalMessenger<int, string, ConversationType>.FireEvent(EventNames.QSBConversation, id, text, ConversationType.Character);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,11 +14,13 @@ namespace QSB.ConversationSync
|
||||
|
||||
public static bool InputDialogueOption(int optionIndex, DialogueBoxVer2 ____currentDialogueBox)
|
||||
{
|
||||
if (optionIndex >= 0)
|
||||
if (optionIndex < 0)
|
||||
{
|
||||
var selectedOption = ____currentDialogueBox.OptionFromUIIndex(optionIndex);
|
||||
ConversationManager.Instance.SendPlayerOption(selectedOption.Text);
|
||||
return true;
|
||||
}
|
||||
|
||||
var selectedOption = ____currentDialogueBox.OptionFromUIIndex(optionIndex);
|
||||
ConversationManager.Instance.SendPlayerOption(selectedOption.Text);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
{
|
||||
public enum ConversationType
|
||||
{
|
||||
CHARACTER,
|
||||
PLAYER
|
||||
Character,
|
||||
Player
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ namespace QSB
|
||||
private GameObject _shipPrefab;
|
||||
private GameObject _cameraPrefab;
|
||||
private GameObject _probePrefab;
|
||||
public GameObject OrbPrefab { get; private set; }
|
||||
private GameObject _orbPrefab;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@ -63,13 +63,13 @@ namespace QSB
|
||||
spawnPrefabs.Add(_probePrefab);
|
||||
DebugLog.LogState("ProbePrefab", _probePrefab);
|
||||
|
||||
OrbPrefab = _assetBundle.LoadAsset<GameObject>("assets/networkorb.prefab");
|
||||
OrbPrefab.AddComponent<NomaiOrbTransformSync>();
|
||||
spawnPrefabs.Add(OrbPrefab);
|
||||
DebugLog.LogState("OrbPrefab", OrbPrefab);
|
||||
_orbPrefab = _assetBundle.LoadAsset<GameObject>("assets/networkorb.prefab");
|
||||
_orbPrefab.AddComponent<NomaiOrbTransformSync>();
|
||||
spawnPrefabs.Add(_orbPrefab);
|
||||
DebugLog.LogState("OrbPrefab", _orbPrefab);
|
||||
|
||||
ConfigureNetworkManager();
|
||||
QSBSceneManager.OnSceneLoaded += WorldRegistry.InitOnSceneLoaded;
|
||||
QSBSceneManager.OnSceneLoaded += (scene, b) => WorldRegistry.InitOnSceneLoaded(_orbPrefab);
|
||||
}
|
||||
|
||||
private void ConfigureNetworkManager()
|
||||
|
@ -16,12 +16,12 @@ namespace QSB.WorldSync
|
||||
public static List<NomaiInterfaceOrb> OldOrbList = new List<NomaiInterfaceOrb>();
|
||||
public static List<CharacterDialogueTree> OldDialogueTrees = new List<CharacterDialogueTree>();
|
||||
|
||||
public static void InitOnSceneLoaded(OWScene scene, bool inUniverse)
|
||||
public static void InitOnSceneLoaded(GameObject orbPrefab)
|
||||
{
|
||||
OldOrbList = Resources.FindObjectsOfTypeAll<NomaiInterfaceOrb>().ToList();
|
||||
if (NetworkServer.active)
|
||||
{
|
||||
OldOrbList.ForEach(x => NetworkServer.Spawn(UnityEngine.Object.Instantiate(QSBNetworkManager.Instance.OrbPrefab)));
|
||||
OldOrbList.ForEach(x => NetworkServer.Spawn(UnityEngine.Object.Instantiate(orbPrefab)));
|
||||
}
|
||||
|
||||
OldDialogueTrees = Resources.FindObjectsOfTypeAll<CharacterDialogueTree>().ToList();
|
||||
|
Loading…
x
Reference in New Issue
Block a user