mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-04-16 05:42:52 +00:00
make it work
This commit is contained in:
parent
86a8ffd3dd
commit
e7ec23d4ad
Binary file not shown.
@ -1,16 +1,22 @@
|
|||||||
ManifestFileVersion: 0
|
ManifestFileVersion: 0
|
||||||
CRC: 2169759651
|
CRC: 674027210
|
||||||
Hashes:
|
Hashes:
|
||||||
AssetFileHash:
|
AssetFileHash:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
Hash: 15a4033bba58538c184c71c4d9f2799c
|
Hash: 207385c19798113635f73bd17e7c2e5c
|
||||||
TypeTreeHash:
|
TypeTreeHash:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
Hash: 6ce89620af51ba381c9e4f226a2ebb1b
|
Hash: 27971550fda62b1a0371f7196924aa6c
|
||||||
HashAppended: 0
|
HashAppended: 0
|
||||||
ClassTypes:
|
ClassTypes:
|
||||||
- Class: 1
|
- Class: 1
|
||||||
Script: {instanceID: 0}
|
Script: {instanceID: 0}
|
||||||
|
- Class: 21
|
||||||
|
Script: {instanceID: 0}
|
||||||
|
- Class: 28
|
||||||
|
Script: {instanceID: 0}
|
||||||
|
- Class: 48
|
||||||
|
Script: {instanceID: 0}
|
||||||
- Class: 114
|
- Class: 114
|
||||||
Script: {fileID: 1741964061, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
Script: {fileID: 1741964061, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||||
- Class: 114
|
- Class: 114
|
||||||
@ -21,6 +27,8 @@ ClassTypes:
|
|||||||
Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||||
- Class: 115
|
- Class: 115
|
||||||
Script: {instanceID: 0}
|
Script: {instanceID: 0}
|
||||||
|
- Class: 128
|
||||||
|
Script: {instanceID: 0}
|
||||||
- Class: 222
|
- Class: 222
|
||||||
Script: {instanceID: 0}
|
Script: {instanceID: 0}
|
||||||
- Class: 223
|
- Class: 223
|
||||||
|
@ -28,11 +28,16 @@ namespace QSB.ConversationSync
|
|||||||
{
|
{
|
||||||
case ConversationType.Character:
|
case ConversationType.Character:
|
||||||
var translated = TextTranslation.Translate(message.Message).Trim();
|
var translated = TextTranslation.Translate(message.Message).Trim();
|
||||||
DebugLog.DebugWrite($"CHARACTER id [{message.ObjectId}] text [{translated}]");
|
ConversationManager.Instance.DisplayCharacterConversationBox(message.ObjectId, translated);
|
||||||
break;
|
break;
|
||||||
case ConversationType.Player:
|
case ConversationType.Player:
|
||||||
ConversationManager.Instance.DisplayPlayerConversationBox((uint)message.ObjectId, message.Message);
|
ConversationManager.Instance.DisplayPlayerConversationBox((uint)message.ObjectId, message.Message);
|
||||||
break;
|
break;
|
||||||
|
case ConversationType.EndCharacter:
|
||||||
|
break;
|
||||||
|
case ConversationType.EndPlayer:
|
||||||
|
UnityEngine.Object.Destroy(PlayerRegistry.GetPlayer((uint)message.ObjectId).CurrentDialogueBox);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using OWML.Common;
|
using OWML.Common;
|
||||||
|
using OWML.ModHelper.Events;
|
||||||
using QSB.Events;
|
using QSB.Events;
|
||||||
using QSB.Utility;
|
using QSB.Utility;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@ -39,6 +40,16 @@ namespace QSB.ConversationSync
|
|||||||
GlobalMessenger<uint, string, ConversationType>.FireEvent(EventNames.QSBConversation, (uint)id, text, ConversationType.Character);
|
GlobalMessenger<uint, string, ConversationType>.FireEvent(EventNames.QSBConversation, (uint)id, text, ConversationType.Character);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void EndConversationPlayer()
|
||||||
|
{
|
||||||
|
GlobalMessenger<uint, string, ConversationType>.FireEvent(EventNames.QSBConversation, PlayerRegistry.LocalPlayerId, "", ConversationType.EndPlayer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void EndConversationCharacter(int id)
|
||||||
|
{
|
||||||
|
GlobalMessenger<uint, string, ConversationType>.FireEvent(EventNames.QSBConversation, (uint)id, "", ConversationType.EndCharacter);
|
||||||
|
}
|
||||||
|
|
||||||
public void DisplayPlayerConversationBox(uint playerId, string text)
|
public void DisplayPlayerConversationBox(uint playerId, string text)
|
||||||
{
|
{
|
||||||
Destroy(PlayerRegistry.GetPlayer(playerId).CurrentDialogueBox);
|
Destroy(PlayerRegistry.GetPlayer(playerId).CurrentDialogueBox);
|
||||||
@ -48,12 +59,24 @@ namespace QSB.ConversationSync
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var newBox = Instantiate(BoxPrefab);
|
var newBox = Instantiate(BoxPrefab);
|
||||||
|
newBox.SetActive(false);
|
||||||
newBox.transform.parent = PlayerRegistry.GetPlayer(playerId).Body.transform;
|
newBox.transform.parent = PlayerRegistry.GetPlayer(playerId).Body.transform;
|
||||||
newBox.transform.localPosition = Vector3.zero;
|
newBox.transform.localPosition = new Vector3(0, 25, 0);
|
||||||
newBox.transform.LookAt(PlayerRegistry.LocalPlayer.Camera.transform);
|
newBox.transform.rotation = PlayerRegistry.GetPlayer(playerId).Body.transform.rotation;
|
||||||
|
//newBox.transform.LookAt(PlayerRegistry.LocalPlayer.Camera.transform, PlayerRegistry.GetPlayer(playerId).Body.transform.up);
|
||||||
|
var lookAt = newBox.AddComponent<FaceActiveCamera>();
|
||||||
|
lookAt.SetValue("_useLookAt", false);
|
||||||
|
lookAt.SetValue("_localFacingVector", Vector3.back);
|
||||||
|
lookAt.SetValue("_localRotationAxis", Vector3.up);
|
||||||
newBox.GetComponent<Text>().text = text;
|
newBox.GetComponent<Text>().text = text;
|
||||||
|
newBox.SetActive(true);
|
||||||
|
|
||||||
PlayerRegistry.GetPlayer(playerId).CurrentDialogueBox = newBox;
|
PlayerRegistry.GetPlayer(playerId).CurrentDialogueBox = newBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void DisplayCharacterConversationBox(int index, string text)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ namespace QSB.ConversationSync
|
|||||||
public static void EndConversation()
|
public static void EndConversation()
|
||||||
{
|
{
|
||||||
PlayerRegistry.LocalPlayer.CurrentDialogueID = -1;
|
PlayerRegistry.LocalPlayer.CurrentDialogueID = -1;
|
||||||
|
ConversationManager.Instance.EndConversationPlayer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool InputDialogueOption(int optionIndex, DialogueBoxVer2 ____currentDialogueBox)
|
public static bool InputDialogueOption(int optionIndex, DialogueBoxVer2 ____currentDialogueBox)
|
||||||
@ -23,6 +24,8 @@ namespace QSB.ConversationSync
|
|||||||
if (optionIndex < 0)
|
if (optionIndex < 0)
|
||||||
{
|
{
|
||||||
// in a page where there is no selectable options
|
// in a page where there is no selectable options
|
||||||
|
PlayerRegistry.LocalPlayer.CurrentDialogueID = -1;
|
||||||
|
ConversationManager.Instance.EndConversationPlayer();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
public enum ConversationType
|
public enum ConversationType
|
||||||
{
|
{
|
||||||
Character,
|
Character,
|
||||||
Player
|
Player,
|
||||||
|
EndCharacter,
|
||||||
|
EndPlayer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,4 +93,4 @@ namespace QSB.TransformSync
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -69,7 +69,7 @@ MonoBehaviour:
|
|||||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||||
m_FontData:
|
m_FontData:
|
||||||
m_Font: {fileID: 12800000, guid: 58199d5bdd1dec045bcdd0a15a8dc780, type: 2}
|
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
m_FontSize: 1
|
m_FontSize: 1
|
||||||
m_FontStyle: 0
|
m_FontStyle: 0
|
||||||
m_BestFit: 0
|
m_BestFit: 0
|
||||||
@ -94,7 +94,7 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_Material: {fileID: 0}
|
m_Material: {fileID: 0}
|
||||||
m_Color: {r: 0, g: 0, b: 0, a: 0.841}
|
m_Color: {r: 0, g: 0, b: 0, a: 0.50980395}
|
||||||
m_RaycastTarget: 1
|
m_RaycastTarget: 1
|
||||||
m_OnCullStateChanged:
|
m_OnCullStateChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
@ -196,7 +196,7 @@ RectTransform:
|
|||||||
m_GameObject: {fileID: 1531056750600734}
|
m_GameObject: {fileID: 1531056750600734}
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 0.13, y: 0.13, z: 1}
|
m_LocalScale: {x: 0.1, y: 0.1, z: 1}
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 224902966460615240}
|
- {fileID: 224902966460615240}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user