aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn
diff options
context:
space:
mode:
Diffstat (limited to 'ShiftOS_TheReturn')
-rw-r--r--ShiftOS_TheReturn/App.config24
-rw-r--r--ShiftOS_TheReturn/Desktop.cs9
-rw-r--r--ShiftOS_TheReturn/Localization.cs105
-rw-r--r--ShiftOS_TheReturn/Properties/Resources.Designer.cs23
-rw-r--r--ShiftOS_TheReturn/Properties/Settings.Designer.cs26
-rw-r--r--ShiftOS_TheReturn/ShiftOS.Engine.csproj3
-rw-r--r--ShiftOS_TheReturn/Skinning.cs6
7 files changed, 96 insertions, 100 deletions
diff --git a/ShiftOS_TheReturn/App.config b/ShiftOS_TheReturn/App.config
index b899c11..4765378 100644
--- a/ShiftOS_TheReturn/App.config
+++ b/ShiftOS_TheReturn/App.config
@@ -1,27 +1,27 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
- <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
+ <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<runtime>
- <loadFromRemoteSources enabled="true" />
+ <loadFromRemoteSources enabled="true"/>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
- <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
+ <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
+ <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
- <assemblyIdentity name="System.Interactive.Async" publicKeyToken="94bc3704cddfc263" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-3.0.1000.0" newVersion="3.0.1000.0" />
+ <assemblyIdentity name="System.Interactive.Async" publicKeyToken="94bc3704cddfc263" culture="neutral"/>
+ <bindingRedirect oldVersion="0.0.0.0-3.0.1000.0" newVersion="3.0.1000.0"/>
</dependentAssembly>
<dependentAssembly>
- <assemblyIdentity name="Microsoft.Scripting" publicKeyToken="7f709c5b713576e1" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-1.1.2.22" newVersion="1.1.2.22" />
+ <assemblyIdentity name="Microsoft.Scripting" publicKeyToken="7f709c5b713576e1" culture="neutral"/>
+ <bindingRedirect oldVersion="0.0.0.0-1.1.2.22" newVersion="1.1.2.22"/>
</dependentAssembly>
<dependentAssembly>
- <assemblyIdentity name="IronPython" publicKeyToken="7f709c5b713576e1" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-2.7.7.0" newVersion="2.7.7.0" />
+ <assemblyIdentity name="IronPython" publicKeyToken="7f709c5b713576e1" culture="neutral"/>
+ <bindingRedirect oldVersion="0.0.0.0-2.7.7.0" newVersion="2.7.7.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
-</configuration> \ No newline at end of file
+</configuration>
diff --git a/ShiftOS_TheReturn/Desktop.cs b/ShiftOS_TheReturn/Desktop.cs
index fac5e6b..714d457 100644
--- a/ShiftOS_TheReturn/Desktop.cs
+++ b/ShiftOS_TheReturn/Desktop.cs
@@ -246,7 +246,14 @@ namespace ShiftOS.Engine
public static void InvokeOnWorkerThread(Action act)
{
- _desktop.InvokeOnWorkerThread(act);
+ try
+ {
+ _desktop.InvokeOnWorkerThread(act);
+ }
+ catch
+ {
+ act?.Invoke();
+ }
}
public static void ResetPanelButtons()
diff --git a/ShiftOS_TheReturn/Localization.cs b/ShiftOS_TheReturn/Localization.cs
index 8adfa5a..2414bd9 100644
--- a/ShiftOS_TheReturn/Localization.cs
+++ b/ShiftOS_TheReturn/Localization.cs
@@ -99,63 +99,65 @@ namespace ShiftOS.Engine
public static string Parse(string original, Dictionary<string, string> replace)
{
- Dictionary<string, string> localizationStrings = new Dictionary<string, string>();
-
-
try
{
- localizationStrings = JsonConvert.DeserializeObject<Dictionary<string, string>>(_provider.GetCurrentTranscript());
- }
- catch
- {
- localizationStrings = JsonConvert.DeserializeObject<Dictionary<string, string>>(Utils.ReadAllText(Paths.GetPath("english.local"))); //if no provider fall back to english
- }
-
- foreach (var kv in localizationStrings.Where(x=>original.Contains(x.Key)))
- {
- original = original.Replace(kv.Key, kv.Value); // goes through and replaces all the localization blocks
- }
+ Dictionary<string, string> localizationStrings = new Dictionary<string, string>();
- //string original2 = Parse(original);
- string usernameReplace = "";
- string domainReplace = "";
-
- // if the user has saved then store their username and systemname in these string variables please
- if (SaveSystem.CurrentSave != null)
- {
try
{
- usernameReplace = SaveSystem.CurrentUser.Username;
+ localizationStrings = JsonConvert.DeserializeObject<Dictionary<string, string>>(_provider.GetCurrentTranscript());
}
catch
{
- usernameReplace = "user";
+ localizationStrings = JsonConvert.DeserializeObject<Dictionary<string, string>>(Utils.ReadAllText(Paths.GetPath("english.local"))); //if no provider fall back to english
}
- try
+ foreach (var kv in localizationStrings.Where(x => original.Contains(x.Key)))
{
- domainReplace = SaveSystem.CurrentSave.SystemName;
+ original = original.Replace(kv.Key, kv.Value); // goes through and replaces all the localization blocks
}
- catch
+
+ //string original2 = Parse(original);
+
+ string usernameReplace = "";
+ string domainReplace = "";
+
+ // if the user has saved then store their username and systemname in these string variables please
+ if (SaveSystem.CurrentSave != null)
{
- domainReplace = "system";
+ try
+ {
+ usernameReplace = SaveSystem.CurrentUser.Username;
+ }
+ catch
+ {
+ usernameReplace = "user";
+ }
+
+ try
+ {
+ domainReplace = SaveSystem.CurrentSave.SystemName;
+ }
+ catch
+ {
+ domainReplace = "system";
+ }
+
}
-
- }
- string namespaceReplace = "";
- string commandReplace = "";
+ string namespaceReplace = "";
+ string commandReplace = "";
- // if the user did a command in the terminal and it had a period in it then split it up into the part before the period and the part after and then store them into these two string variables please
- if (TerminalBackend.latestCommmand != "" && TerminalBackend.latestCommmand.IndexOf('.') > -1)
- {
- namespaceReplace = TerminalBackend.latestCommmand.Split('.')[0];
- commandReplace = TerminalBackend.latestCommmand.Split('.')[1];
- }
+ // if the user did a command in the terminal and it had a period in it then split it up into the part before the period and the part after and then store them into these two string variables please
+ if (TerminalBackend.latestCommmand != "" && TerminalBackend.latestCommmand.IndexOf('.') > -1)
+ {
+ namespaceReplace = TerminalBackend.latestCommmand.Split('.')[0];
+ commandReplace = TerminalBackend.latestCommmand.Split('.')[1];
+ }
- // if you see these then replace them with what you need to
- Dictionary<string, string> defaultReplace = new Dictionary<string, string>() {
+ // if you see these then replace them with what you need to
+ Dictionary<string, string> defaultReplace = new Dictionary<string, string>() {
{"%username", usernameReplace},
{"%domain", domainReplace},
{"%ns", namespaceReplace},
@@ -165,19 +167,24 @@ namespace ShiftOS.Engine
#endif
};
- // actually do the replacement
- foreach (KeyValuePair<string, string> replacement in replace.Where(x => original.Contains(x.Key)))
- {
- original = original.Replace(replacement.Key, Parse(replacement.Value));
- }
+ // actually do the replacement
+ foreach (KeyValuePair<string, string> replacement in replace.Where(x => original.Contains(x.Key)))
+ {
+ original = original.Replace(replacement.Key, Parse(replacement.Value));
+ }
+
+ // do the replacement but default
+ foreach (KeyValuePair<string, string> replacement in defaultReplace.Where(x => original.Contains(x.Key)))
+ {
+ original = original.Replace(replacement.Key, replacement.Value);
+ }
- // do the replacement but default
- foreach (KeyValuePair<string, string> replacement in defaultReplace.Where(x => original.Contains(x.Key)))
+ return original; // returns the now replaced string
+ }
+ catch
{
- original = original.Replace(replacement.Key, replacement.Value);
+ return original;
}
-
- return original; // returns the now replaced string
}
// a few things are defined here
diff --git a/ShiftOS_TheReturn/Properties/Resources.Designer.cs b/ShiftOS_TheReturn/Properties/Resources.Designer.cs
index 85b350f..bfadf74 100644
--- a/ShiftOS_TheReturn/Properties/Resources.Designer.cs
+++ b/ShiftOS_TheReturn/Properties/Resources.Designer.cs
@@ -82,7 +82,17 @@ namespace ShiftOS.Engine.Properties {
}
/// <summary>
- /// Looks up a localized string similar to .
+ /// Looks up a localized string similar to /*
+ /// * MIT License
+ /// *
+ /// * Copyright (c) 2017 Michael VanOverbeek and ShiftOS devs
+ /// *
+ /// * Permission is hereby granted, free of charge, to any person obtaining a copy
+ /// * of this software and associated documentation files (the &quot;Software&quot;), to deal
+ /// * in the Software without restriction, including without limitation the rights
+ /// * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ /// * copies of the Software, and to permit persons to whom the Software is
+ /// * furnished to do so, sub [rest of string was truncated]&quot;;.
/// </summary>
internal static string pywintemplate {
get {
@@ -108,8 +118,7 @@ namespace ShiftOS.Engine.Properties {
/// {
/// Name: &quot;WM 4 Windows&quot;,
/// Cost: 150,
- /// Description: &quot;Display up to 4 simultaneous windows on-screen in a 2x2 grid.&quot;,
- /// [rest of string was truncated]&quot;;.
+ /// Description: &quot;Display up to 4 simultaneous windows on-screen i [rest of string was truncated]&quot;;.
/// </summary>
internal static string Shiftorium {
get {
@@ -138,8 +147,7 @@ namespace ShiftOS.Engine.Properties {
///Eine kurze Erklärung wie du das Terminal benutzt lautet wiefolgt. Du kannst das command &apos;sos.help&apos; benutzen um eine Liste aller commands aufzurufen. Schreib es
///einfach in das Terminal und drücke &lt;enter&gt; um alle commands anzuzeigen.
///
- ///Commands können mit argumenten versehen werden, indem du ein key-value Paar in einem {} Block hinter dem command angibst. Zum Beispiel:
- /// [rest of string was truncated]&quot;;.
+ ///Commands können mit argumenten versehen werden, indem du ein key-value Paar in einem {} Block hinter dem command angibst. Zum Be [rest of string was truncated]&quot;;.
/// </summary>
internal static string strings_de {
get {
@@ -158,8 +166,7 @@ namespace ShiftOS.Engine.Properties {
///Commands can be sent arguments by specifying a key-value pair inside a {} block at the end of the command. For example:
///
///some.command{print:\&quot;hello\&quot;}
- ///math.add{op1:1,op2:2}
- /// [rest of string was truncated]&quot;;.
+ ///math.add{op1 [rest of string was truncated]&quot;;.
/// </summary>
internal static string strings_en {
get {
@@ -177,7 +184,7 @@ namespace ShiftOS.Engine.Properties {
/// &quot;Before you can begin with ShiftOS, you&apos;ll need to know a few things about it.&quot;,
/// &quot;One: Terminal command syntax.&quot;,
/// &quot;Inside ShiftOS, the bulk of your time is going to be spent within the Terminal.&quot;,
- /// &quot;The Terminal is an application that starts up when you turn on your computer. It allows you to execute system commands, open program [rest of string was truncated]&quot;;.
+ /// &quot;The Terminal is an application that starts up when you turn on your computer. It allows you to execute system commands, ope [rest of string was truncated]&quot;;.
/// </summary>
internal static string sys_shiftoriumstory {
get {
diff --git a/ShiftOS_TheReturn/Properties/Settings.Designer.cs b/ShiftOS_TheReturn/Properties/Settings.Designer.cs
index 3d7c7cd..a1e2e32 100644
--- a/ShiftOS_TheReturn/Properties/Settings.Designer.cs
+++ b/ShiftOS_TheReturn/Properties/Settings.Designer.cs
@@ -1,28 +1,4 @@
-/*
- * MIT License
- *
- * Copyright (c) 2017 Michael VanOverbeek and ShiftOS devs
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
diff --git a/ShiftOS_TheReturn/ShiftOS.Engine.csproj b/ShiftOS_TheReturn/ShiftOS.Engine.csproj
index f1946ad..02a5eeb 100644
--- a/ShiftOS_TheReturn/ShiftOS.Engine.csproj
+++ b/ShiftOS_TheReturn/ShiftOS.Engine.csproj
@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ShiftOS.Engine</RootNamespace>
<AssemblyName>ShiftOS.Engine</AssemblyName>
- <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<PublishUrl>publish\</PublishUrl>
@@ -27,6 +27,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
+ <TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
diff --git a/ShiftOS_TheReturn/Skinning.cs b/ShiftOS_TheReturn/Skinning.cs
index 59c7132..d8549f6 100644
--- a/ShiftOS_TheReturn/Skinning.cs
+++ b/ShiftOS_TheReturn/Skinning.cs
@@ -203,10 +203,8 @@ namespace ShiftOS.Engine
{
LoadSkin();
}
- if (SaveSystem.CurrentSave != null)
- {
- SkinLoaded?.Invoke();
- }
+ SkinLoaded?.Invoke();
+
}
/// <summary>