@@ -37,10 +37,10 @@ public MainForm()
3737 // Обновление настроек
3838 if ( Settings . Default . firstLaunch )
3939 {
40- SendToInfoTextBox ( "Обновление настроек при первом запуске" ) ;
4140 Settings . Default . Upgrade ( ) ;
4241 Settings . Default . firstLaunch = false ;
4342 Settings . Default . Save ( ) ;
43+ SendToInfoTextBox ( "Первый запуск. Обновление настроек завершено" ) ;
4444 }
4545
4646 // Установка версии программы
@@ -53,7 +53,9 @@ public MainForm()
5353 {
5454 version = version [ ..5 ] ;
5555 if ( version . EndsWith ( ".0" , StringComparison . OrdinalIgnoreCase ) )
56+ {
5657 version = version [ ..^ 2 ] ;
58+ }
5759 }
5860 VersionLabel . Text = "Версия " + version ;
5961
@@ -167,6 +169,7 @@ private void UpdateButton_Click(object sender, EventArgs e)
167169 else
168170 {
169171 SendToInfoTextBox ( "Доступна новая версия программы. Её можно скачать на GitHub по ссылке справа" ) ;
172+ SendToInfoTextBox ( $ "{ json . name } . Что нового?{ Environment . NewLine } { json . body } ") ;
170173 UpdateButton . BackgroundImage = Properties . Resources . warn_c ;
171174 LinkLabelGithub . Visible = true ;
172175 }
@@ -200,7 +203,7 @@ private void LinkLabelInfo_LinkClicked(object sender, LinkLabelLinkClickedEventA
200203
201204 private void ButtonDarkMode_Click ( object sender , EventArgs e )
202205 {
203- if ( Settings . Default . darkTheme == true )
206+ if ( Settings . Default . darkTheme )
204207 {
205208 Settings . Default [ "darkTheme" ] = false ;
206209 SendToInfoTextBox ( "Хе-хе бой. Это светлая тема. Чтобы развидеть тёмную тему, перезапусти приложение." ) ;
@@ -228,10 +231,13 @@ private void AdditionalFolderButton_Click(object sender, EventArgs e)
228231 private void SendToInfoTextBox ( string text )
229232 {
230233 if ( Settings . Default . lastTab == 0 )
234+ {
231235 InfoTextBox . AppendText ( $ "{ Environment . NewLine } { text } ") ;
236+ }
232237 else
238+ {
233239 InfoTextBox2 . AppendText ( $ "{ Environment . NewLine } { text } ") ;
234-
240+ }
235241 }
236242
237243 private void MainTabs_IndexChange ( object sender , EventArgs e )
@@ -288,7 +294,9 @@ private void ActionHandler(string name, string mask, string code)
288294
289295 InfoTextBox . AppendText ( $ "{ Environment . NewLine } { TimeSetter . PlaceTime ( ) } Завершено. Обработано файлов - { count } ") ;
290296 if ( errCount != 0 )
297+ {
291298 InfoTextBox . AppendText ( $ "{ Environment . NewLine } Пропущено файлов - { errCount } ") ;
299+ }
292300
293301 // Постобработка
294302 switch ( code )
@@ -324,12 +332,14 @@ private void FindChangesButton_Click(object sender, EventArgs e)
324332 string [ ] allFiles = Directory . GetFiles ( DirectoryPath , "*.xml" , SearchOption . AllDirectories ) ;
325333 int count = 0 ;
326334 int errCount = 0 ;
327- ( bool , string ) result = ( false , string . Empty ) ;
335+ ( bool , string ) result ;
328336 foreach ( string tempFile in allFiles )
329337 {
330338 result = ChangesFinder . GetTranslationData ( tempFile ) ;
331339 if ( result . Item1 )
340+ {
332341 count ++ ;
342+ }
333343 else
334344 {
335345 errCount ++ ;
@@ -345,7 +355,9 @@ private void FindChangesButton_Click(object sender, EventArgs e)
345355 {
346356 result = ChangesFinder . GetModData ( tempFile ) ;
347357 if ( result . Item1 )
358+ {
348359 count ++ ;
360+ }
349361 else
350362 {
351363 errCount ++ ;
@@ -365,19 +377,10 @@ private void CaseCreatorButton_Click(object sender, EventArgs e)
365377 string [ ] defTypeList = [ "AbilityDef" , "BodyDef" , "BodyPartDef" , "BodyPartGroupDef" , "ChemicalDef" , "FactionDef" , "HediffDef" , "MemeDef" , "MentalBreakDef" , "MentalFitDef" , "MentalStateDef" , "OrderedTakeGroupDef" , "PawnCapacityDef" , "PawnKindDef" , "ScenarioDef" , "SitePartDef" , "SkillDef" , "StyleCategoryDef" , "ThingDef" , "ToolCapacityDef" , "WorldObjectDef" , "XenotypeDef" ] ;
366378 //Получение списка всех файлов в заданой директории и во всех вложенных подпапках за счёт SearchOption
367379 string [ ] allFiles = Directory . GetFiles ( DirectoryPath , "*.xml" , SearchOption . AllDirectories ) ;
368- Dictionary < string , string > words = new ( ) ;
380+ Dictionary < string , string > words = [ ] ;
369381
370382 // Поиск подходящей директории
371- string directory ;
372- if ( Directory . Exists ( DirectoryPath + "\\ Common" ) )
373- {
374- directory = DirectoryPath + "\\ Common" ;
375- }
376- else
377- {
378- directory = DirectoryPath ;
379- }
380-
383+ string directory = Directory . Exists ( DirectoryPath + "\\ Common" ) ? DirectoryPath + "\\ Common" : DirectoryPath ;
381384 int typeCount = 0 ;
382385 // Проверяется каждый подходящий DefType из списка
383386 foreach ( string defType in defTypeList )
@@ -451,16 +454,18 @@ private void PreTranslatorButton_Click(object sender, EventArgs e)
451454 }
452455 result = PreTranslator . BuildDatabase ( tempFile ) ;
453456 if ( result . Item1 )
457+ {
454458 count ++ ;
459+ }
455460 else
456461 {
457462 errCount ++ ;
458463 InfoTextBox . AppendText ( $ "{ Environment . NewLine } { TimeSetter . PlaceTime ( ) } { result . Item2 } ({ tempFile } )") ;
459464 }
460465 }
461466 InfoTextBox . AppendText ( $ "{ Environment . NewLine } { TimeSetter . PlaceTime ( ) } Собрано { result . Item2 } пар перевода. Обработано файлов - { count } . Пропущено файлов - { errCount } .") ;
462-
463-
467+
468+
464469 InfoTextBox . AppendText ( $ "{ Environment . NewLine } { TimeSetter . PlaceTime ( ) } Начат предварительный перевод") ;
465470 allFiles = Directory . GetFiles ( DirectoryPath , "*.xml" , SearchOption . AllDirectories ) ;
466471 count = 0 ;
@@ -469,7 +474,9 @@ private void PreTranslatorButton_Click(object sender, EventArgs e)
469474 {
470475 result = PreTranslator . Translation ( tempFile ) ;
471476 if ( result . Item1 )
477+ {
472478 count ++ ;
479+ }
473480 else
474481 {
475482 errCount ++ ;
0 commit comments