From 2fa52dc4c3503d12c644439ff35ea3af89c15073 Mon Sep 17 00:00:00 2001 From: rudderbucky Date: Sun, 21 Apr 2019 18:12:00 -0500 Subject: [PATCH] Ship builder bugfixes --- .../Ability Prefabs/backgroundbox.prefab | 3 +- Assets/Prefabs/HUD Prefabs/DialogueBox.prefab | 6 +- Assets/Prefabs/HUD Prefabs/OutpostUI.prefab | 4 +- .../HUD Prefabs/TemporaryJSONLoader.prefab | 4 +- Assets/Scenes/MainMenu.unity | 50 +++-- Assets/Scenes/SampleScene.unity | 174 +++++++++++------- .../Interaction Definitions/DialogueSystem.cs | 23 ++- .../HUD Scripts/ProximityInteractScript.cs | 2 +- Assets/Scripts/HUD Scripts/ReticleScript.cs | 2 +- .../ShipBuilderCursorScript.cs | 7 +- .../Ship Builder Scripts/TipsFromTheYard.cs | 1 + .../SFX Scripts/RectangleEffectScript.cs | 2 +- Assets/Sector Creator Assets/SecCrCamera.cs | 2 +- .../SectorCreatorMouse.cs | 2 +- 14 files changed, 172 insertions(+), 110 deletions(-) diff --git a/Assets/Prefabs/Ability Prefabs/backgroundbox.prefab b/Assets/Prefabs/Ability Prefabs/backgroundbox.prefab index fc67869ad..00800347d 100644 --- a/Assets/Prefabs/Ability Prefabs/backgroundbox.prefab +++ b/Assets/Prefabs/Ability Prefabs/backgroundbox.prefab @@ -132,7 +132,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: clicked: 0 - tooltipPrefab: {fileID: 0} + tooltipPrefab: {fileID: 1488837556019592, guid: 415e283b683408a41913b01ebeaee6e1, + type: 3} abilityInfo: --- !u!1 &1815503395701426 GameObject: diff --git a/Assets/Prefabs/HUD Prefabs/DialogueBox.prefab b/Assets/Prefabs/HUD Prefabs/DialogueBox.prefab index 5f64b4359..c2704bbd1 100644 --- a/Assets/Prefabs/HUD Prefabs/DialogueBox.prefab +++ b/Assets/Prefabs/HUD Prefabs/DialogueBox.prefab @@ -148,11 +148,11 @@ MonoBehaviour: m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Name: m_EditorClassIdentifier: - m_UiScaleMode: 0 + m_UiScaleMode: 1 m_ReferencePixelsPerUnit: 100 m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 1 m_MatchWidthOrHeight: 0 m_PhysicalUnit: 3 m_FallbackScreenDPI: 96 diff --git a/Assets/Prefabs/HUD Prefabs/OutpostUI.prefab b/Assets/Prefabs/HUD Prefabs/OutpostUI.prefab index c3d519c90..cff6bc214 100644 --- a/Assets/Prefabs/HUD Prefabs/OutpostUI.prefab +++ b/Assets/Prefabs/HUD Prefabs/OutpostUI.prefab @@ -361,11 +361,11 @@ MonoBehaviour: m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Name: m_EditorClassIdentifier: - m_UiScaleMode: 0 + m_UiScaleMode: 1 m_ReferencePixelsPerUnit: 100 m_ScaleFactor: 1 m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 + m_ScreenMatchMode: 1 m_MatchWidthOrHeight: 0 m_PhysicalUnit: 3 m_FallbackScreenDPI: 96 diff --git a/Assets/Prefabs/HUD Prefabs/TemporaryJSONLoader.prefab b/Assets/Prefabs/HUD Prefabs/TemporaryJSONLoader.prefab index 9b9c2acc0..4d06ea8b7 100644 --- a/Assets/Prefabs/HUD Prefabs/TemporaryJSONLoader.prefab +++ b/Assets/Prefabs/HUD Prefabs/TemporaryJSONLoader.prefab @@ -834,11 +834,11 @@ MonoBehaviour: m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Name: m_EditorClassIdentifier: - m_UiScaleMode: 0 + m_UiScaleMode: 1 m_ReferencePixelsPerUnit: 100 m_ScaleFactor: 1 m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 + m_ScreenMatchMode: 1 m_MatchWidthOrHeight: 0 m_PhysicalUnit: 3 m_FallbackScreenDPI: 96 diff --git a/Assets/Scenes/MainMenu.unity b/Assets/Scenes/MainMenu.unity index a57ce2800..40f78bcc8 100644 --- a/Assets/Scenes/MainMenu.unity +++ b/Assets/Scenes/MainMenu.unity @@ -1913,11 +1913,11 @@ MonoBehaviour: m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Name: m_EditorClassIdentifier: - m_UiScaleMode: 0 + m_UiScaleMode: 1 m_ReferencePixelsPerUnit: 100 m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 1 m_MatchWidthOrHeight: 0 m_PhysicalUnit: 3 m_FallbackScreenDPI: 96 @@ -2334,6 +2334,24 @@ PrefabInstance: propertyPath: m_Pivot.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 114208071816305392, guid: 1db7935a54b01634a952418d692ea5be, + type: 3} + propertyPath: m_Text + value: 'Settings: + + +' + objectReference: {fileID: 0} + - target: {fileID: 224749461034504562, guid: 1db7935a54b01634a952418d692ea5be, + type: 3} + propertyPath: m_SizeDelta.y + value: 250 + objectReference: {fileID: 0} + - target: {fileID: 224749461034504562, guid: 1db7935a54b01634a952418d692ea5be, + type: 3} + propertyPath: m_SizeDelta.x + value: 400 + objectReference: {fileID: 0} - target: {fileID: 114773807705464322, guid: 1db7935a54b01634a952418d692ea5be, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size @@ -2374,23 +2392,15 @@ PrefabInstance: propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName value: CloseUI objectReference: {fileID: 0} - - target: {fileID: 114208071816305392, guid: 1db7935a54b01634a952418d692ea5be, - type: 3} - propertyPath: m_Text - value: 'Settings: - - -' - objectReference: {fileID: 0} - - target: {fileID: 224749461034504562, guid: 1db7935a54b01634a952418d692ea5be, + - target: {fileID: 114770138115523030, guid: 1db7935a54b01634a952418d692ea5be, type: 3} - propertyPath: m_SizeDelta.y - value: 250 + propertyPath: m_ReferenceResolution.x + value: 1920 objectReference: {fileID: 0} - - target: {fileID: 224749461034504562, guid: 1db7935a54b01634a952418d692ea5be, + - target: {fileID: 114770138115523030, guid: 1db7935a54b01634a952418d692ea5be, type: 3} - propertyPath: m_SizeDelta.x - value: 400 + propertyPath: m_ReferenceResolution.y + value: 1080 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 1db7935a54b01634a952418d692ea5be, type: 3} @@ -4001,11 +4011,11 @@ MonoBehaviour: m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Name: m_EditorClassIdentifier: - m_UiScaleMode: 0 + m_UiScaleMode: 1 m_ReferencePixelsPerUnit: 100 m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 1 m_MatchWidthOrHeight: 0 m_PhysicalUnit: 3 m_FallbackScreenDPI: 96 diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 41bce1af4..8744230cf 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -574,6 +574,7 @@ GameObject: - component: {fileID: 130642047} - component: {fileID: 130642048} - component: {fileID: 130642050} + - component: {fileID: 130642049} m_Layer: 0 m_Name: Status Menu m_TagString: Untagged @@ -622,6 +623,28 @@ Canvas: m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 +--- !u!114 &130642049 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 130642046} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 1 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 --- !u!114 &130642050 MonoBehaviour: m_ObjectHideFlags: 0 @@ -3025,11 +3048,11 @@ MonoBehaviour: m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Name: m_EditorClassIdentifier: - m_UiScaleMode: 0 + m_UiScaleMode: 1 m_ReferencePixelsPerUnit: 100 m_ScaleFactor: 2 m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 + m_ScreenMatchMode: 1 m_MatchWidthOrHeight: 0 m_PhysicalUnit: 3 m_FallbackScreenDPI: 96 @@ -3598,7 +3621,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: -0.00074768} - m_SizeDelta: {x: 800, y: 394.91} + m_SizeDelta: {x: 800, y: 600} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &791875254 MonoBehaviour: @@ -5051,11 +5074,11 @@ MonoBehaviour: m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Name: m_EditorClassIdentifier: - m_UiScaleMode: 0 + m_UiScaleMode: 1 m_ReferencePixelsPerUnit: 100 m_ScaleFactor: 2 - m_ReferenceResolution: {x: 1012, y: 505} - m_ScreenMatchMode: 0 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 1 m_MatchWidthOrHeight: 0 m_PhysicalUnit: 3 m_FallbackScreenDPI: 96 @@ -5516,7 +5539,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: -22.800781} + m_AnchoredPosition: {x: 0, y: -22.796875} m_SizeDelta: {x: -340.00006, y: 24} m_Pivot: {x: 0.5, y: 1} --- !u!114 &1163400263 @@ -7543,6 +7566,29 @@ PrefabInstance: propertyPath: m_Pivot.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 114208071816305392, guid: 1db7935a54b01634a952418d692ea5be, + type: 3} + propertyPath: m_Text + value: 'Settings: + + +' + objectReference: {fileID: 0} + - target: {fileID: 224749461034504562, guid: 1db7935a54b01634a952418d692ea5be, + type: 3} + propertyPath: m_SizeDelta.y + value: 250 + objectReference: {fileID: 0} + - target: {fileID: 224749461034504562, guid: 1db7935a54b01634a952418d692ea5be, + type: 3} + propertyPath: m_SizeDelta.x + value: 400 + objectReference: {fileID: 0} + - target: {fileID: 224749461034504562, guid: 1db7935a54b01634a952418d692ea5be, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} - target: {fileID: 114773807705464322, guid: 1db7935a54b01634a952418d692ea5be, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size @@ -7573,29 +7619,6 @@ PrefabInstance: propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[1].m_Arguments.m_ObjectArgumentAssemblyTypeName value: UnityEngine.Object, UnityEngine objectReference: {fileID: 0} - - target: {fileID: 114208071816305392, guid: 1db7935a54b01634a952418d692ea5be, - type: 3} - propertyPath: m_Text - value: 'Settings: - - -' - objectReference: {fileID: 0} - - target: {fileID: 224749461034504562, guid: 1db7935a54b01634a952418d692ea5be, - type: 3} - propertyPath: m_SizeDelta.y - value: 250 - objectReference: {fileID: 0} - - target: {fileID: 224749461034504562, guid: 1db7935a54b01634a952418d692ea5be, - type: 3} - propertyPath: m_SizeDelta.x - value: 400 - objectReference: {fileID: 0} - - target: {fileID: 224749461034504562, guid: 1db7935a54b01634a952418d692ea5be, - type: 3} - propertyPath: m_RootOrder - value: 0 - objectReference: {fileID: 0} - target: {fileID: 9159509489203113411, guid: 1db7935a54b01634a952418d692ea5be, type: 3} propertyPath: m_RootOrder @@ -8764,16 +8787,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 114773807705464322, guid: 1db7935a54b01634a952418d692ea5be, - type: 3} - propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target - value: - objectReference: {fileID: 609587432} - - target: {fileID: 114773807705464322, guid: 1db7935a54b01634a952418d692ea5be, - type: 3} - propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName - value: CloseUI - objectReference: {fileID: 0} - target: {fileID: 114208071816305392, guid: 1db7935a54b01634a952418d692ea5be, type: 3} propertyPath: m_Text @@ -8790,6 +8803,16 @@ PrefabInstance: propertyPath: m_SizeDelta.y value: 150 objectReference: {fileID: 0} + - target: {fileID: 114773807705464322, guid: 1db7935a54b01634a952418d692ea5be, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target + value: + objectReference: {fileID: 609587432} + - target: {fileID: 114773807705464322, guid: 1db7935a54b01634a952418d692ea5be, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName + value: CloseUI + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 1db7935a54b01634a952418d692ea5be, type: 3} --- !u!224 &1885681987 stripped @@ -9101,16 +9124,6 @@ PrefabInstance: propertyPath: m_LocalScale.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 114773807705464322, guid: 1db7935a54b01634a952418d692ea5be, - type: 3} - propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target - value: - objectReference: {fileID: 248087496} - - target: {fileID: 114773807705464322, guid: 1db7935a54b01634a952418d692ea5be, - type: 3} - propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName - value: CloseUI - objectReference: {fileID: 0} - target: {fileID: 114208071816305392, guid: 1db7935a54b01634a952418d692ea5be, type: 3} propertyPath: m_Text @@ -9132,6 +9145,16 @@ PrefabInstance: propertyPath: m_RootOrder value: 0 objectReference: {fileID: 0} + - target: {fileID: 114773807705464322, guid: 1db7935a54b01634a952418d692ea5be, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target + value: + objectReference: {fileID: 248087496} + - target: {fileID: 114773807705464322, guid: 1db7935a54b01634a952418d692ea5be, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName + value: CloseUI + objectReference: {fileID: 0} - target: {fileID: 9159509489203113411, guid: 1db7935a54b01634a952418d692ea5be, type: 3} propertyPath: m_RootOrder @@ -10100,7 +10123,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: -0.000030517578} m_SizeDelta: {x: 0, y: 52.499996} m_Pivot: {x: 0, y: 1} --- !u!114 &1725152188754413155 @@ -12958,7 +12981,7 @@ MonoBehaviour: m_HandleRect: {fileID: 1725152188945092450} m_Direction: 2 m_Value: 0 - m_Size: 1 + m_Size: 0.9999998 m_NumberOfSteps: 0 m_OnValueChanged: m_PersistentCalls: @@ -13655,7 +13678,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 100, y: 100} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1725152189974137738 CanvasRenderer: @@ -14047,12 +14070,12 @@ MonoBehaviour: m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Name: m_EditorClassIdentifier: - m_UiScaleMode: 0 + m_UiScaleMode: 1 m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 + m_ScaleFactor: 0.8 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 1 + m_MatchWidthOrHeight: 0.5 m_PhysicalUnit: 3 m_FallbackScreenDPI: 96 m_DefaultSpriteDPI: 96 @@ -14069,7 +14092,7 @@ Canvas: m_RenderMode: 0 m_Camera: {fileID: 0} m_PlaneDistance: 100 - m_PixelPerfect: 0 + m_PixelPerfect: 1 m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 @@ -15715,8 +15738,8 @@ RectTransform: m_Father: {fileID: 1725152189135650471} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} + m_AnchorMin: {x: 0, y: 0.000000059604645} + m_AnchorMax: {x: 1, y: 0.99999994} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 20, y: 20} m_Pivot: {x: 0.5, y: 0.5} @@ -15882,10 +15905,10 @@ RectTransform: m_Father: {fileID: 1725152189947553119} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 100, y: 100} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 50, y: 50} + m_SizeDelta: {x: 25, y: 25} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1725152190506865365 MonoBehaviour: @@ -15922,6 +15945,7 @@ GameObject: m_Component: - component: {fileID: 1725152190506865364} - component: {fileID: 1725152190506865365} + - component: {fileID: 1725152190506865369} m_Layer: 0 m_Name: Cursor m_TagString: Untagged @@ -15929,6 +15953,14 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!222 &1725152190506865369 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1725152190506865367} + m_CullTransparentMesh: 0 --- !u!114 &1725152190532781816 MonoBehaviour: m_ObjectHideFlags: 0 @@ -16920,7 +16952,7 @@ MonoBehaviour: m_HandleRect: {fileID: 1725152190471945757} m_Direction: 2 m_Value: 0 - m_Size: 1 + m_Size: 0.99999994 m_NumberOfSteps: 0 m_OnValueChanged: m_PersistentCalls: @@ -17584,5 +17616,15 @@ PrefabInstance: propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target value: objectReference: {fileID: 1863658736} + - target: {fileID: 8912477443618520542, guid: 1dd6c2ea206daae48b2691f5666a949e, + type: 3} + propertyPath: m_ReferenceResolution.x + value: 1920 + objectReference: {fileID: 0} + - target: {fileID: 8912477443618520542, guid: 1dd6c2ea206daae48b2691f5666a949e, + type: 3} + propertyPath: m_ReferenceResolution.y + value: 1080 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 1dd6c2ea206daae48b2691f5666a949e, type: 3} diff --git a/Assets/Scripts/Functional Definitions/Interaction Definitions/DialogueSystem.cs b/Assets/Scripts/Functional Definitions/Interaction Definitions/DialogueSystem.cs index 189078dc3..f672de046 100644 --- a/Assets/Scripts/Functional Definitions/Interaction Definitions/DialogueSystem.cs +++ b/Assets/Scripts/Functional Definitions/Interaction Definitions/DialogueSystem.cs @@ -43,9 +43,9 @@ private void Update() } } - public static void StartDialogue(Dialogue dialogue, Vector3? speakerPos = null, PlayerCore player = null) + public static void StartDialogue(Dialogue dialogue, Entity speaker = null, PlayerCore player = null) { - Instance.startDialogue(dialogue, speakerPos, player); + Instance.startDialogue(dialogue, speaker, player); } public static void ShowPopup(string text) @@ -85,11 +85,11 @@ private void showPopup(string text) buttons[0] = button.gameObject; } - private void startDialogue(Dialogue dialogue, Vector3? speakerPos, PlayerCore player) + private void startDialogue(Dialogue dialogue, Entity speaker, PlayerCore player) { if(window) endDialogue(); playerTransform = player ? player.transform : null; - this.speakerPos = speakerPos; + speakerPos = speaker.transform.position; //create window window = Instantiate(dialogueBoxPrefab).GetComponentInChildren(); window.Activate(); @@ -98,15 +98,15 @@ private void startDialogue(Dialogue dialogue, Vector3? speakerPos, PlayerCore pl textRenderer = background.transform.Find("Text").GetComponent(); textRenderer.font = shellcorefont; - next(dialogue, 0, speakerPos, player); + next(dialogue, 0, speaker, player); } - public static void Next(Dialogue dialogue, int ID, Vector3? speakerPos, PlayerCore player) + public static void Next(Dialogue dialogue, int ID, Entity speaker, PlayerCore player) { - Instance.next(dialogue, ID, speakerPos, player); + Instance.next(dialogue, ID, speaker, player); } - public void next(Dialogue dialogue, int ID, Vector3? speakerPos, PlayerCore player) + public void next(Dialogue dialogue, int ID, Entity speaker, PlayerCore player) { if(dialogue.nodes.Count == 0) { @@ -139,6 +139,11 @@ public void next(Dialogue dialogue, int ID, Vector3? speakerPos, PlayerCore play //Do nothing and continue after this check break; case Dialogue.DialogueAction.Outpost: + if(speaker.faction != player.faction) { + endDialogue(); + ResourceManager.PlayClipByID(null); + return; + } if(((Vector3)speakerPos - player.transform.position).magnitude < dialogue.vendingBlueprint.range) { vendorUI.blueprint = dialogue.vendingBlueprint; vendorUI.outpostPosition = (Vector3)speakerPos; @@ -191,7 +196,7 @@ public void next(Dialogue dialogue, int ID, Vector3? speakerPos, PlayerCore play RectTransform button = Instantiate(dialogueButtonPrefab).GetComponent(); button.SetParent(background, false); button.anchoredPosition = new Vector2(0, 24 + 16 * (current.nextNodes.Count - (i + 1))); - button.GetComponent