From c502062a6285512c95e86763a32c78713a15e9da Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 25 Feb 2017 10:30:52 -0500 Subject: [PATCH] fix calc upgrades --- ShiftOS.WinForms/Applications/Calculator.cs | 18 ++++++------------ ShiftOS.WinForms/Resources/Shiftorium.txt | 19 +++++++++++++++++++ ShiftOS_TheReturn/Resources/Shiftorium.txt | 7 +++++++ 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/ShiftOS.WinForms/Applications/Calculator.cs b/ShiftOS.WinForms/Applications/Calculator.cs index ac09567..66b959c 100644 --- a/ShiftOS.WinForms/Applications/Calculator.cs +++ b/ShiftOS.WinForms/Applications/Calculator.cs @@ -35,14 +35,12 @@ using ShiftOS.Engine; namespace ShiftOS.WinForms.Applications { - [Launcher("Calculator", true, "al_calculator", "Accessories")] + [Launcher("Calculator", false, null, "Accessories")] [RequiresUpgrade("calculator")] [WinOpen("calculator")] [DefaultIcon("iconCalculator")] public partial class Calculator : UserControl, IShiftOSWindow { - public bool justopened = false; - public Calculator() { InitializeComponent(); @@ -50,39 +48,35 @@ namespace ShiftOS.WinForms.Applications private void Template_Load(object sender, EventArgs e) { - justopened = true; - - prepareButtons(); } private void prepareButtons() { - if (!ShiftoriumFrontend.UpgradeInstalled("calc_equals_button")) buttonEquals.Visible = false; + buttonEquals.Visible = Shiftorium.UpgradeInstalled("calc_equals_button"); } public void OnLoad() { - throw new NotImplementedException(); + prepareButtons(); } public void OnSkinLoad() { - throw new NotImplementedException(); } public bool OnUnload() { - throw new NotImplementedException(); + return true; } public void OnUpgrade() { - throw new NotImplementedException(); + prepareButtons(); } private void button1_Click(object sender, EventArgs e) { - numBox.Text = "" + "1"; + numBox.Text = "1"; } } } diff --git a/ShiftOS.WinForms/Resources/Shiftorium.txt b/ShiftOS.WinForms/Resources/Shiftorium.txt index c75372e..7635ec6 100644 --- a/ShiftOS.WinForms/Resources/Shiftorium.txt +++ b/ShiftOS.WinForms/Resources/Shiftorium.txt @@ -1,4 +1,23 @@ [ +// CALCULATOR UPGRADES + { + Name: "Calculator", + Cost: 1000, + Dependencies: "wm_free_placement;desktop", + Description: "Crazy math problems getting you down? Well, this calculator will take care of that!" + }, + { + Name: "AL Calculator", + Cost: 350, + Dependencies: "calculator;app_launcher", + Description: "Add an App Launcher Entry for the Calculator!" + }, + { + Name: "Calc Equals Button", + Cost: 600, + Dependencies: "calculator", + Description: "Right now, you can only type numbers, but this equals button opens the door to solving equations!" + }, { Name: "MUD Fundamentals", Cost: 50, diff --git a/ShiftOS_TheReturn/Resources/Shiftorium.txt b/ShiftOS_TheReturn/Resources/Shiftorium.txt index d5951dc..1f365f8 100644 --- a/ShiftOS_TheReturn/Resources/Shiftorium.txt +++ b/ShiftOS_TheReturn/Resources/Shiftorium.txt @@ -1,3 +1,10 @@ +/* + * THIS IS AN EXAMPLE FILE + * + * Any Shiftorium upgrades placed in here won't be recognized by the main ShiftOS frontend + * (ShiftOS.WinForms). It uses its own Shiftorium definition file found in its Resources. + */ + [ { Name: "MUD Fundamentals",