Skip to content

Commit

Permalink
v2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
TuTAH1 committed Apr 21, 2023
1 parent 6209231 commit 4814a3b
Show file tree
Hide file tree
Showing 7 changed files with 407 additions and 244 deletions.
546 changes: 312 additions & 234 deletions Forms/SettingsForm.Designer.cs

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion Forms/SettingsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public void InitializeControls()
Text = LocalizationStrings.SettingsForm_Title;
SetStyle(ControlStyles.SupportsTransparentBackColor, true);

gbUpdate.Visible = false; //: Autoupdate not ready yet

#region Functions group

lbSteamVRDisableMethod.Text = LocalizationStrings.SettingsForm_lbSteamVRDisableMethod;
Expand Down Expand Up @@ -58,7 +60,8 @@ public void InitializeControls()

#region Interface group

gbInterface.Left = gbFunctions.Right + gbFunctions.Margin.Right + gbInterface.Margin.Left;

gbInterface.Left = Math.Max(gbFunctions.Right + gbFunctions.Margin.Right, gbUpdate.Right + gbUpdate.Margin.Right) + gbInterface.Margin.Left; //: gbInterface Left position

picLanguage.Image = GetImage("Settings", "language");
lbLanguage.Text = LocalizationStrings.SettingsForm_lbLanguage;
Expand Down
47 changes: 47 additions & 0 deletions Logic/Langauge.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SteamVR_OculusDash_Switcher.Logic
{
public class Language
{
public CultureInfo Culture;

public override string ToString()
{
return Culture.NativeName;
}

public Language(CultureInfo Culture)
{
this.Culture = Culture;
}
}

public static class LanguageFunctions
{
public static Language GetCurrentLanguage(this Language[] Languages)
{
foreach (var lang in Languages)
{
if (CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == lang.Culture.TwoLetterISOLanguageName) return lang;
}

return null;
}

public static int? GetCurrentLanguageIndex(this Language[] Languages)
{
for (int i = 0; i < Languages.Length; i++)
{
if (CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == Languages[i].Culture.TwoLetterISOLanguageName) return i;
}

return null;
}
}
}
15 changes: 10 additions & 5 deletions Logic/SteamVR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,23 @@ public bool LocateSteamVR()
if (json.ContainsKey("runtime"))
{
var item = (JArray)json["runtime"];
if (item != null && item.Contains("SteamVR"))
if (item != null && item.First.ToString().Contains("SteamVR"))
{
_steamVrFolderPath = item.First.ToString();
}
}
}

if (!Directory.Exists(_steamVrFolderPath) && Directory.Exists(_steamVrFolderPath.ReplaceFromLast("SteamVR", "SteamVR_")))
if (!Directory.Exists(_steamVrFolderPath))
{
Method = BreakMethod.RenameFolder;
methodFound = true;
} else throw new DirectoryNotFoundException("SteamVR Folder not found");
if (Directory.Exists(_steamVrFolderPath.ReplaceFromLast("SteamVR", "SteamVR_", false)))
{
Method = BreakMethod.RenameFolder;
methodFound = true;
}
else throw new DirectoryNotFoundException("SteamVR Folder not found");
}

}
return !methodFound;
}
Expand Down
22 changes: 20 additions & 2 deletions Properties/Localization/LocalizationStrings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions Properties/Localization/LocalizationStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@
<value>Realistic icons</value>
</data>
<data name="IconRealismLevel_3_Discription" xml:space="preserve">
<value>Yes, I know what "icon" means.
It'o photo, but transparent</value>
<value>Yes, I know what "icon" means.
It's a photo, but transparent</value>
</data>
<data name="IconRealismLevel_Unknown_Discription" xml:space="preserve">
<value>I don't know how did you set the impossible value</value>
Expand Down Expand Up @@ -292,4 +292,10 @@
<data name="SettingsForm_RealismLevel_Max_Error" xml:space="preserve">
<value>Can't play amazing song</value>
</data>
<data name="ErrorTaskDialog__Title" xml:space="preserve">
<value>Error</value>
</data>
<data name="ErrorTaskDialog__Open_Callstack" xml:space="preserve">
<value>Open call stack</value>
</data>
</root>
6 changes: 6 additions & 0 deletions Properties/Localization/LocalizationStrings.ru.resx
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,10 @@
<data name="SettingsForm_RealismLevel_Max_Error" xml:space="preserve">
<value>Не получается воспроизвести замечательную песню</value>
</data>
<data name="ErrorTaskDialog__Title" xml:space="preserve">
<value>Ошибка</value>
</data>
<data name="ErrorTaskDialog__Open_Callstack" xml:space="preserve">
<value>Открыть стек вызовов</value>
</data>
</root>

0 comments on commit 4814a3b

Please sign in to comment.