-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust speech selector to allow selecting speeches in YR
- Loading branch information
Showing
7 changed files
with
106 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,4 +100,4 @@ AI=INI/AI.ini | |
AIE=INI/AIE.ini | ||
Tutorial=INI/Tutorial.ini | ||
Theme=INI/Theme.ini | ||
|
||
EVA= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using System.Collections.Generic; | ||
using TSMapEditor.Extensions; | ||
|
||
namespace TSMapEditor.Models | ||
{ | ||
public struct EvaSpeech | ||
{ | ||
public EvaSpeech(int index, string name, string text) | ||
{ | ||
Index = index; | ||
Name = name; | ||
Text = text; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return $"{Name} {Text}"; | ||
} | ||
|
||
public int Index; | ||
public string Name; | ||
public string Text; | ||
} | ||
|
||
public class EvaSpeeches | ||
{ | ||
public EvaSpeeches(IniFileEx evaIni) | ||
{ | ||
Initialize(evaIni); | ||
} | ||
|
||
private List<EvaSpeech> speeches; | ||
public List<EvaSpeech> Speeches => new(speeches); | ||
|
||
|
||
private void Initialize(IniFileEx evaIni) | ||
{ | ||
speeches = new List<EvaSpeech>(); | ||
|
||
const string speechSectionName = "DialogList"; | ||
|
||
evaIni.DoForEveryValueInSection(speechSectionName, name => | ||
{ | ||
if (string.IsNullOrEmpty(name)) | ||
return; | ||
var speechSection = evaIni.GetSection(name); | ||
string text = string.Empty; | ||
if (speechSection != null) | ||
{ | ||
text = speechSection.GetStringValue("Text", text); | ||
} | ||
speeches.Add(new EvaSpeech(speeches.Count, name, text)); | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters