Skip to content

Commit

Permalink
Update MainWin.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
CjangCjengh committed Nov 17, 2022
1 parent e0df124 commit 8bf9ed5
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions MoeGoe_GUI/MainWin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,13 @@ public MainWin()
SPEAKERS = new List<string>();
SYMBOLS = new List<string>();
SPEAKERIDDICT = new Dictionary<ComboBox, Dictionary<int, int>>();
SHOWLOG = true;
isSeeking = false;

if (DEFAULTS.ContainsKey("EXEPATHS"))
{
EXEPATH = EXEPath.Text = DEFAULTS["EXEPATHS"].Next();
modelControl.Enabled = true;
}
}

private CommandLine cmd;
Expand Down Expand Up @@ -84,7 +89,6 @@ public MainWin()
private readonly Dictionary<ComboBox, Dictionary<int, int>> SPEAKERIDDICT;

private bool USEF0;
private bool SHOWLOG;

private bool isSeeking;
private SoundPlayer player;
Expand All @@ -108,7 +112,6 @@ private void ClearVITS()
private void ClearMode()
{
consoleBox.Clear();
SHOWLOG = true;
textBox.Clear();
speakerBox.Items.Clear();
speakerBox.Text = "";
Expand Down Expand Up @@ -139,7 +142,6 @@ private void ClearHubertVITS()
private void ClearHubertMode()
{
consoleBox.Clear();
SHOWLOG = true;
HOriginPath.Clear();
ORIGINPATH = null;
HOpenOrigin.Enabled = false;
Expand Down Expand Up @@ -172,7 +174,6 @@ private void ClearW2V2VITS()
private void ClearW2V2Mode()
{
consoleBox.Clear();
SHOWLOG = true;
emotionPath.Clear();
EMOTIONPATH = null;
WTextBox.Clear();
Expand Down Expand Up @@ -367,8 +368,6 @@ private bool LoadJsonList(string json, string key, Action<string> action)
string speaker = Regex.Unescape(matches[i].Groups[1].Value);
action(speaker);
}
if (matches.Count > 100)
SHOWLOG = false;
}
return true;
}
Expand Down Expand Up @@ -430,8 +429,7 @@ private void AddSpeakers()
private void GetStart()
{
cmd = new CommandLine();
if (SHOWLOG)
cmd.OutputHandler += Cmd_OutputHandler;
cmd.OutputHandler += Cmd_OutputHandler;
cmd.Write($"\"{EXEPATH}\" --escape");
cmd.Write(MODELPATH);
cmd.Write(CONFIGPATH);
Expand Down Expand Up @@ -761,8 +759,7 @@ private void CleanButton_Click(object sender, EventArgs e)
CleanWin win = new CleanWin(box, cmd);
cmd.OutputHandler -= Cmd_OutputHandler;
win.ShowDialog();
if (SHOWLOG)
cmd.OutputHandler += Cmd_OutputHandler;
cmd.OutputHandler += Cmd_OutputHandler;
win.Dispose();
}

Expand Down

0 comments on commit 8bf9ed5

Please # to comment.