Non-WinForms launcher with auto updater

This commit is contained in:
Regalis
2015-09-11 22:13:44 +03:00
parent ea15397725
commit 29a6260d0f
104 changed files with 46296 additions and 5638 deletions
@@ -29,7 +29,7 @@ namespace Subsurface
{
this.character = character;
if (icons == null) icons = Game1.TextureLoader.FromFile("Content/UI/inventoryIcons.png");
if (icons == null) icons = TextureLoader.FromFile("Content/UI/inventoryIcons.png");
slotPositions = new Vector2[limbSlots.Length];
@@ -216,7 +216,7 @@ namespace Subsurface.Items.Components
guiFrame = new GUIFrame(
new Rectangle((int)rect.X, (int)rect.Y, (int)rect.Z, (int)rect.W),
new Color(color.X, color.Y, color.Z, color.W), alignment, GUI.style);
new Color(color.X, color.Y, color.Z, color.W), alignment, GUI.Style);
//guiFrame.Alpha = color.W;
break;
+2 -2
View File
@@ -34,12 +34,12 @@ namespace Subsurface.Items.Components
{
if (textBox == null)
{
textBox = new GUITextBox(Rectangle.Empty, GUI.style, GuiFrame);
textBox = new GUITextBox(Rectangle.Empty, GUI.Style, GuiFrame);
textBox.Wrap = true;
textBox.OnTextChanged = TextChanged;
textBox.LimitText = true;
GUIButton button = new GUIButton(new Rectangle(0,0,100,15), "OK", null, Alignment.BottomRight, GUI.style, GuiFrame);
GUIButton button = new GUIButton(new Rectangle(0,0,100,15), "OK", null, Alignment.BottomRight, GUI.Style, GuiFrame);
button.OnClicked = Close;
}
@@ -104,7 +104,7 @@ namespace Subsurface.Items.Components
}
}
private bool SelectItem(object obj)
private bool SelectItem(GUIComponent component, object obj)
{
FabricableItem targetItem = obj as FabricableItem;
if (targetItem == null) return false;
@@ -134,7 +134,7 @@ namespace Subsurface.Items.Components
Alignment.Left, null,
selectedItemFrame);
GUIButton button = new GUIButton(new Rectangle(0,0,100,20), "Create", Color.White, Alignment.CenterX | Alignment.Bottom, GUI.style, selectedItemFrame);
GUIButton button = new GUIButton(new Rectangle(0,0,100,20), "Create", Color.White, Alignment.CenterX | Alignment.Bottom, GUI.Style, selectedItemFrame);
button.OnClicked = StartFabricating;
button.UserData = targetItem;
+5 -5
View File
@@ -82,11 +82,11 @@ namespace Subsurface
int width = 400, height = 500;
int x = 0, y = 0;
frame = new GUIFrame(new Rectangle(0, 0, width, height), Color.White * 0.8f, Alignment.Center, GUI.style);
frame = new GUIFrame(new Rectangle(0, 0, width, height), Color.White * 0.8f, Alignment.Center, GUI.Style);
frame.Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
frame.UserData = item;
new GUITextBlock(new Rectangle(0,0,200,20), "Attempting to fix " + item.Name, GUI.style, frame);
new GUITextBlock(new Rectangle(0,0,200,20), "Attempting to fix " + item.Name, GUI.Style, frame);
y = y + 40;
foreach (FixRequirement requirement in item.FixRequirements)
@@ -97,7 +97,7 @@ namespace Subsurface
reqFrame.UserData = requirement;
var fixButton = new GUIButton(new Rectangle(0, 0, 50, 20), "Fix", GUI.style, reqFrame);
var fixButton = new GUIButton(new Rectangle(0, 0, 50, 20), "Fix", GUI.Style, reqFrame);
fixButton.OnClicked = FixButtonPressed;
fixButton.UserData = requirement;
@@ -107,7 +107,7 @@ namespace Subsurface
int y2 = 20;
foreach (string itemName in requirement.requiredItems)
{
var itemBlock = new GUITextBlock(new Rectangle(30, y2, 200, 15), itemName, GUI.style, reqFrame);
var itemBlock = new GUITextBlock(new Rectangle(30, y2, 200, 15), itemName, GUI.Style, reqFrame);
itemBlock.Font = GUI.SmallFont;
itemBlock.UserData = itemName;
@@ -117,7 +117,7 @@ namespace Subsurface
y2 = 20;
foreach (Skill skill in requirement.requiredSkills)
{
var skillBlock = new GUITextBlock(new Rectangle(150, y2, 200, 15), skill.Name + " - " + skill.Level, GUI.style, Alignment.Right, Alignment.TopLeft, reqFrame);
var skillBlock = new GUITextBlock(new Rectangle(150, y2, 200, 15), skill.Name + " - " + skill.Level, GUI.Style, Alignment.Right, Alignment.TopLeft, reqFrame);
skillBlock.Font = GUI.SmallFont;
skillBlock.UserData = skill;
+6 -6
View File
@@ -635,11 +635,11 @@ namespace Subsurface
}
}
editingHUD = new GUIFrame(new Rectangle(x, y, width, 60 + (editableProperties.Count() + requiredItemCount) * 30), GUI.style);
editingHUD = new GUIFrame(new Rectangle(x, y, width, 60 + (editableProperties.Count() + requiredItemCount) * 30), GUI.Style);
editingHUD.Padding = new Vector4(10, 10, 0, 0);
editingHUD.UserData = this;
new GUITextBlock(new Rectangle(0, 0, 100, 20), prefab.Name, GUI.style,
new GUITextBlock(new Rectangle(0, 0, 100, 20), prefab.Name, GUI.Style,
Alignment.TopLeft, Alignment.TopLeft, editingHUD, false, GUI.LargeFont);
y += 20;
@@ -649,15 +649,15 @@ namespace Subsurface
if (prefab.IsLinkable)
{
new GUITextBlock(new Rectangle(0, 0, 0, 20), "Hold space to link to another item",
GUI.style, Alignment.TopLeft, Alignment.TopRight, editingHUD);
GUI.Style, Alignment.TopLeft, Alignment.TopRight, editingHUD);
y += 25;
}
foreach (ItemComponent ic in components)
{
foreach (RelatedItem relatedItem in ic.requiredItems)
{
new GUITextBlock(new Rectangle(0, y, 100, 20), ic.Name + ": " + relatedItem.Type.ToString() + " required", GUI.style, editingHUD);
GUITextBox namesBox = new GUITextBox(new Rectangle(0, y, 200, 20), Alignment.Right, GUI.style, editingHUD);
new GUITextBlock(new Rectangle(0, y, 100, 20), ic.Name + ": " + relatedItem.Type.ToString() + " required", GUI.Style, editingHUD);
GUITextBox namesBox = new GUITextBox(new Rectangle(0, y, 200, 20), Alignment.Right, GUI.Style, editingHUD);
PropertyDescriptorCollection properties = TypeDescriptor.GetProperties (relatedItem);
PropertyDescriptor property = properties.Find("JoinedNames", false);
@@ -681,7 +681,7 @@ namespace Subsurface
var editable = objectProperty.Attributes.OfType<Editable>().FirstOrDefault<Editable>();
if (editable != null) height = (int)(Math.Ceiling(editable.MaxLength / 20.0f) * 20.0f);
GUITextBox propertyBox = new GUITextBox(new Rectangle(100, y, 200, height), GUI.style, editingHUD);
GUITextBox propertyBox = new GUITextBox(new Rectangle(100, y, 200, height), GUI.Style, editingHUD);
if (height>20) propertyBox.Wrap = true;
object value = objectProperty.GetValue();