aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-02-19 19:23:11 -0500
committerMichael <[email protected]>2017-02-19 19:23:11 -0500
commit55c1fbeaa215fd2b2e65c51d0cd2aae53892f135 (patch)
tree3954b81c18253b415f1caf66d8d3a5fb55fdb755
parent762bd11cdf023e5340197b1a1438b5212f360a7d (diff)
downloadshiftos_thereturn-55c1fbeaa215fd2b2e65c51d0cd2aae53892f135.tar.gz
shiftos_thereturn-55c1fbeaa215fd2b2e65c51d0cd2aae53892f135.tar.bz2
shiftos_thereturn-55c1fbeaa215fd2b2e65c51d0cd2aae53892f135.zip
Make title text back color transparent
-rw-r--r--ShiftOS.WinForms/WindowBorder.cs2
-rw-r--r--ShiftOS_TheReturn/Scripting.cs36
-rw-r--r--ShiftOS_TheReturn/Skinning.cs2
3 files changed, 35 insertions, 5 deletions
diff --git a/ShiftOS.WinForms/WindowBorder.cs b/ShiftOS.WinForms/WindowBorder.cs
index e6d972e..0308f8a 100644
--- a/ShiftOS.WinForms/WindowBorder.cs
+++ b/ShiftOS.WinForms/WindowBorder.cs
@@ -262,7 +262,7 @@ namespace ShiftOS.WinForms
pnltitleright.BackgroundImageLayout = GetImageLayout("titleright");
pnltitle.BackgroundImageLayout = GetImageLayout("titlebar"); //RETARD ALERT. WHY WASN'T THIS THERE WHEN IMAGELAYOUTS WERE FIRST IMPLEMENTED?
- lbtitletext.BackColor = LoadedSkin.TitleBackgroundColor;
+ lbtitletext.BackColor = (pnltitle.BackgroundImage != null) ? Color.Transparent : LoadedSkin.TitleBackgroundColor;
lbtitletext.ForeColor = LoadedSkin.TitleTextColor;
lbtitletext.Font = LoadedSkin.TitleFont;
diff --git a/ShiftOS_TheReturn/Scripting.cs b/ShiftOS_TheReturn/Scripting.cs
index eca94fc..cfa1549 100644
--- a/ShiftOS_TheReturn/Scripting.cs
+++ b/ShiftOS_TheReturn/Scripting.cs
@@ -38,6 +38,26 @@ using System.Net;
namespace ShiftOS.Engine.Scripting
{
+ [Exposed("strutils")]
+ public class StringUtils
+ {
+ public bool endswith(string operand, string value)
+ {
+ return operand.EndsWith(value);
+ }
+
+ public bool startswith(string operand, string value)
+ {
+ return operand.StartsWith(value);
+ }
+
+ public bool contains(string operand, string value)
+ {
+ return operand.Contains(value);
+ }
+ }
+
+
public class LuaInterpreter
{
public dynamic Lua = new DynamicLua.DynamicLua();
@@ -81,13 +101,23 @@ end");
public void SetupAPIs()
{
-
+ Lua.random = new Func<int, int, int>((min, max) =>
+ {
+ return new Random().Next(min, max);
+ });
Lua.registerEvent = new Action<string, Action<object>>((eventName, callback) =>
{
LuaEvent += (e, s) =>
{
- if(e == eventName)
- callback?.Invoke(s);
+ if (e == eventName)
+ try
+ {
+ callback?.Invoke(s);
+ }
+ catch(Exception ex)
+ {
+ Infobox.Show("Event propagation error.", "An error occurred while propagating the " + eventName + " event. " + ex.Message);
+ }
};
});
//This temporary proxy() method will be used by the API prober.
diff --git a/ShiftOS_TheReturn/Skinning.cs b/ShiftOS_TheReturn/Skinning.cs
index 3a32c9f..e3512d8 100644
--- a/ShiftOS_TheReturn/Skinning.cs
+++ b/ShiftOS_TheReturn/Skinning.cs
@@ -40,7 +40,7 @@ namespace ShiftOS.Engine {
[Exposed("skinning")]
public class SkinFunctions
{
- public void reload()
+ public void loadSkin()
{
SkinEngine.LoadSkin();
}