Hot Fix - fix speaker name in dialogue panel header
This commit is contained in:
parent
78405a418e
commit
ba894215fa
@ -12,15 +12,19 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 45b41589283138641ba006c2243b0637, type: 3}
|
||||
m_Name: BossThugDialPl
|
||||
m_EditorClassIdentifier:
|
||||
SpeakerName:
|
||||
CurrentDialogue: 0
|
||||
MultiWayDialogue:
|
||||
- Key: 0
|
||||
Value:
|
||||
- WasDisplayed: 0
|
||||
- Header:
|
||||
WasDisplayed: 0
|
||||
ListOfSentences:
|
||||
- Sentence: Who are you? Hod did you get past my guards?!
|
||||
- Header:
|
||||
Sentence: Who are you? Hod did you get past my guards?!
|
||||
Buttons: []
|
||||
- Sentence: Don't answer. I don't care anyway. You're dead to me/.
|
||||
- Header:
|
||||
Sentence: Don't answer. I don't care anyway. You're dead to me/.
|
||||
Buttons: []
|
||||
EndOfDialogueStepAction:
|
||||
m_PersistentCalls:
|
||||
|
@ -167,6 +167,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 2bd5e7fa2661ee649861ce0b80373740, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
SpeakerName: Thug Boss
|
||||
DialogueTemplate: {fileID: 11400000, guid: b47b2441f5e5f9e4ab687bf2a2fddbfa, type: 2}
|
||||
Dialogue: {fileID: 0}
|
||||
EndactionEventList:
|
||||
|
@ -39632,7 +39632,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 221b868deecf9a94c86d5e989abeb8a8, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
name: goldOre
|
||||
name: Gold Ore
|
||||
sprites:
|
||||
- {fileID: -2769473736760253650, guid: 707503ddc182f7e4aad33c5e3a9a56ba, type: 3}
|
||||
- {fileID: 2172676185572096100, guid: 1942087f81e48a6418d29c06a6482774, type: 3}
|
||||
|
@ -7,6 +7,9 @@ using UnityEngine;
|
||||
[CreateAssetMenu(fileName = "New Dialogue", menuName = "Dialogue/New Dialogue")]
|
||||
public class Dialogue : ScriptableObject
|
||||
{
|
||||
[SerializeField]
|
||||
public string SpeakerName;
|
||||
|
||||
[SerializeField]
|
||||
int CurrentDialogue = 0;
|
||||
|
||||
@ -64,15 +67,12 @@ public class Dialogue : ScriptableObject
|
||||
|
||||
foreach (var DialogueStep in dialogueStepsList)
|
||||
{
|
||||
Debug.Log($"List of dialogue count: {DialogueStep.DialogueController.listOfDialogue.Count}");
|
||||
if (!DialogueStep.WasDisplayed && DialogueStep.DialogueController.listOfDialogue.Count != 0)
|
||||
if (!DialogueStep.WasDisplayed && DialogueStep.DialogueController.CurrentPanel != null)
|
||||
{
|
||||
Debug.Log("Break Dialogue - close panel");
|
||||
DialogueStep.DialogueController.CloseCurrentPanel(); // close panel
|
||||
|
||||
break;
|
||||
}
|
||||
Debug.Log("a");
|
||||
}
|
||||
}
|
||||
|
||||
@ -182,6 +182,8 @@ public class Dialogue : ScriptableObject
|
||||
{
|
||||
foreach (var dialogueStep in Dialogue)
|
||||
{
|
||||
dialogueStep.Header = SpeakerName;
|
||||
|
||||
dialogueStep.Build();
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ public class DialogueController
|
||||
|
||||
public void Show(DialogueModel panelModel)
|
||||
{
|
||||
Panel panelDis = panelModel.Panel("Kabix", panelModel);
|
||||
Panel panelDis = panelModel.Panel(panelModel.Header, panelModel);
|
||||
panelDis.PanelInstance = panelDis.BuildPanel();
|
||||
|
||||
if(!(panelDis is QuestionPanel))
|
||||
@ -91,7 +91,6 @@ public class DialogueController
|
||||
|
||||
public void CloseCurrentPanel()
|
||||
{
|
||||
Debug.Log(CurrentPanel);
|
||||
MonoBehaviour.Destroy(CurrentPanel);
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,9 @@ using UnityEngine;
|
||||
[Serializable]
|
||||
public class DialogueModel //<TPanel> where TPanel : AbstractPanel
|
||||
{
|
||||
[NonSerialized]
|
||||
public string Header;
|
||||
|
||||
public Func<string, DialogueModel, Panel> Panel = PanelFactory.BasePanel;
|
||||
|
||||
[SerializeField]
|
||||
@ -22,10 +25,26 @@ public class DialogueModel //<TPanel> where TPanel : AbstractPanel
|
||||
Sentence = _sentence;
|
||||
}
|
||||
|
||||
public DialogueModel(string _sentence, string _header)
|
||||
{
|
||||
Sentence = _sentence;
|
||||
|
||||
Header = _header;
|
||||
}
|
||||
|
||||
public DialogueModel(string _sentence, List<PanelButtonStepModel> _buttonsModelsList)
|
||||
{
|
||||
Sentence = _sentence;
|
||||
|
||||
Buttons = _buttonsModelsList;
|
||||
}
|
||||
|
||||
public DialogueModel(string _sentence, string _header, List<PanelButtonStepModel> _buttonsModelsList)
|
||||
{
|
||||
Sentence = _sentence;
|
||||
|
||||
Header = _header;
|
||||
|
||||
Buttons = _buttonsModelsList;
|
||||
}
|
||||
}
|
@ -8,6 +8,9 @@ using UnityEngine.Events;
|
||||
[Serializable]
|
||||
public class DialogueStepModel
|
||||
{
|
||||
[SerializeField]
|
||||
public string Header;
|
||||
|
||||
[SerializeField] // this flag tell whatewer dialoge ware already display to user
|
||||
public bool WasDisplayed = false;
|
||||
|
||||
@ -43,6 +46,8 @@ public class DialogueStepModel
|
||||
foreach (DialogueModel DialogueModel in ListOfSentences)
|
||||
{
|
||||
// Pass data to builded panel (name, sentence, buttons)
|
||||
DialogueModel.Header = Header; // set header
|
||||
|
||||
DialogueController.AddSentence(DialogueModel);
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,9 @@ using UnityEngine.Events;
|
||||
[Serializable]
|
||||
public class NpcDialogueManager : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
public string SpeakerName;
|
||||
|
||||
[SerializeField]
|
||||
public Dialogue DialogueTemplate;
|
||||
|
||||
@ -21,6 +24,7 @@ public class NpcDialogueManager : MonoBehaviour
|
||||
public void Start()
|
||||
{
|
||||
Dialogue = Instantiate(DialogueTemplate);
|
||||
Dialogue.SpeakerName = SpeakerName;
|
||||
}
|
||||
|
||||
public void Update() { }
|
||||
|
@ -61,7 +61,6 @@ public class SceneChestDataManager : SceneBaseDataManager<ChestPrefabAsset>
|
||||
{
|
||||
if(OnMapAppearanceMethod.GameStatus == GameStatus.NewGame)
|
||||
{
|
||||
Debug.Log(OnMapAppearanceMethod.Gateway);
|
||||
if (OnMapAppearanceMethod.Gateway != OnMapAppearanceMethodEnum.NewGame)
|
||||
UseDynamicSettings(); // if there is nothing saved we will use UseDefaultSettings
|
||||
else
|
||||
@ -87,7 +86,6 @@ public class SceneChestDataManager : SceneBaseDataManager<ChestPrefabAsset>
|
||||
|
||||
protected override void UseDefaultSettings()
|
||||
{
|
||||
Debug.Log("Chestmanager - UseDefaultSettings");
|
||||
foreach (ChestPrefabAssetData asset in ElementsToBuildOnSceneList) { convertedData.Add((ChestPrefabAsset)asset.MapDataToPrefabAssetModel()); }
|
||||
|
||||
ChestBuilder.ElementsToBuildOnSceneList = convertedData;
|
||||
@ -109,7 +107,6 @@ public class SceneChestDataManager : SceneBaseDataManager<ChestPrefabAsset>
|
||||
// when chest detect player in near arrea and player press "c"
|
||||
// open panel -> chest controller handle Open panel in Scene Chest Manager passing info about what Chest Palyer want to open
|
||||
// Manager Build panel and pass info about chest content
|
||||
Debug.Log("Chestmanager - UseDynamicSettings");
|
||||
|
||||
LoadDynamicData();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user