@@ -66,14 +66,24 @@ public void SelectStreamer(string streamer)
6666 }
6767 }
6868
69- public void Activate ( )
69+ public StreamerInfo GetSelectedStreamerInfo ( )
7070 {
7171 var idx = cbStreamer . SelectedIndex ;
72- if ( idx < 0 )
72+ if ( idx < 0 || idx >= My . MyProject . Forms . frmMain . streamerInfos . Count )
7373 {
74- return ;
74+ return null ;
7575 }
7676
77+ return My . MyProject . Forms . frmMain . streamerInfos [ idx ] ;
78+ }
79+
80+ public void Activate ( )
81+ {
82+ var streamerInfo = GetSelectedStreamerInfo ( ) ;
83+ if ( streamerInfo is null )
84+ {
85+ return ;
86+ }
7787
7888 var streamIdx = Array . IndexOf ( My . MyProject . Forms . frmMain . streamerGroupBoxes , this ) ;
7989 if ( streamIdx < 0 )
@@ -82,7 +92,6 @@ public void Activate()
8292 }
8393
8494 string streamIdxStr = ( streamIdx + 1 ) . ToString ( "00" ) ;
85- var streamerInfo = My . MyProject . Forms . frmMain . streamerInfos [ idx ] ;
8695
8796
8897 var qualities = getStreamQuality ( streamerInfo . name ) ;
@@ -107,6 +116,11 @@ public void Activate()
107116 ResetScore ( ) ;
108117 updScore . Enabled = true ;
109118
119+ WriteFiles ( streamIdxStr , streamerInfo ) ;
120+ }
121+
122+ public void WriteFiles ( string streamIdxStr , StreamerInfo streamerInfo )
123+ {
110124 var pronouns = streamerInfo . pronouns ?? "" ;
111125 writePronounsToFile ( pronouns : pronouns , file : streamIdxStr ) ;
112126
@@ -126,6 +140,22 @@ public void Activate()
126140 }
127141 }
128142
143+ public void WritePlaceholders ( string streamIdxStr )
144+ {
145+ var pronouns = "They / Them" ;
146+ writePronounsToFile ( pronouns : pronouns , file : streamIdxStr ) ;
147+
148+ var outputName = "Placeholder " + streamIdxStr ;
149+ if ( Settings . Default . boolCombinedStreamerPronounFile )
150+ {
151+ writeNameAndPronounsToFile ( streamer : outputName , pronouns : pronouns , file : streamIdxStr ) ;
152+ }
153+ else
154+ {
155+ writeNameToFile ( streamer : outputName , file : streamIdxStr ) ;
156+ }
157+ }
158+
129159 public ( int , int , int , int ) GetWindowLocation ( )
130160 {
131161 var streamIdx = Array . IndexOf ( My . MyProject . Forms . frmMain . streamerGroupBoxes , this ) ;
@@ -313,12 +343,12 @@ private void btnLaunch_Click(object sender, EventArgs e)
313343 return ;
314344 }
315345
316- if ( cbStreamer . SelectedIndex < 0 || cbStreamer . SelectedIndex > My . MyProject . Forms . frmMain . streamerInfos . Count )
346+ var streamerInfo = GetSelectedStreamerInfo ( ) ;
347+ if ( streamerInfo == null )
317348 {
318349 return ;
319350 }
320351
321- var streamerInfo = My . MyProject . Forms . frmMain . streamerInfos [ cbStreamer . SelectedIndex ] ;
322352 if ( string . IsNullOrEmpty ( streamerInfo . name ) )
323353 {
324354 return ;
0 commit comments