fix calc upgrades

This commit is contained in:
Michael 2017-02-25 10:30:52 -05:00
parent 413a7da898
commit c502062a62
3 changed files with 32 additions and 12 deletions

View file

@ -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";
}
}
}

View file

@ -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,

View file

@ -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",