Commit 92c5602c authored by Archnoc's avatar Archnoc
Browse files

rename launch option from title to name; bug fix

parent c23e56dd
MIT License MIT License
Copyright (c) 2020 Archnoc Copyright (c) 2020 Sunrise Project
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
......
...@@ -33,8 +33,8 @@ namespace sunrise_launcher ...@@ -33,8 +33,8 @@ namespace sunrise_launcher
public class LaunchOption public class LaunchOption
{ {
[JsonPropertyName("title")] [JsonPropertyName("name")]
public string Title { get; set; } public string Name { get; set; }
[JsonPropertyName("path")] [JsonPropertyName("path")]
public string LaunchPath { get; set; } public string LaunchPath { get; set; }
[JsonPropertyName("env")] [JsonPropertyName("env")]
......
...@@ -123,12 +123,13 @@ namespace sunrise_launcher ...@@ -123,12 +123,13 @@ namespace sunrise_launcher
ShowMessage("Server add failed."); ShowMessage("Server add failed.");
return; return;
} }
server.Metadata.Version = "";
Servers.Add(server); Servers.Add(server);
Selected = server.ManifestURL; Selected = server.ManifestURL;
this.ActivateSignal("update"); this.ActivateSignal("update");
await UpdateAsync(server, false); await UpdateAsync(server, true);
this.ActivateSignal("update"); this.ActivateSignal("update");
ShowMessage(server.Error); ShowMessage(server.Error);
} }
...@@ -250,9 +251,9 @@ namespace sunrise_launcher ...@@ -250,9 +251,9 @@ namespace sunrise_launcher
} }
//if update occurs which removes the selected launch option, default to first option available //if update occurs which removes the selected launch option, default to first option available
if (metadata.LaunchOptions.All(x => x.Title != server.Launch)) if (metadata.LaunchOptions.All(x => x.Name != server.Launch))
{ {
server.Launch = metadata.LaunchOptions[0].Title; server.Launch = metadata.LaunchOptions[0].Name;
} }
} }
catch (Exception ex) catch (Exception ex)
...@@ -427,7 +428,7 @@ namespace sunrise_launcher ...@@ -427,7 +428,7 @@ namespace sunrise_launcher
try try
{ {
var launch = server.Metadata.LaunchOptions.FirstOrDefault(x => x.Title == server.Launch); var launch = server.Metadata.LaunchOptions.FirstOrDefault(x => x.Name == server.Launch);
if (launch == null) if (launch == null)
{ {
Console.WriteLine("ERROR: launch option not found: {0}", server.Launch); Console.WriteLine("ERROR: launch option not found: {0}", server.Launch);
......
...@@ -61,7 +61,7 @@ namespace sunrise_launcher ...@@ -61,7 +61,7 @@ namespace sunrise_launcher
foreach (var profile in TequilaRoot.Profiles) foreach (var profile in TequilaRoot.Profiles)
{ {
var config = new LaunchOption(); var config = new LaunchOption();
config.Title = profile.Value; config.Name = profile.Value;
config.LaunchPath = profile.Exec; config.LaunchPath = profile.Exec;
config.Args = profile.Params; config.Args = profile.Params;
metadata.LaunchOptions.Add(config); metadata.LaunchOptions.Add(config);
......
...@@ -120,7 +120,7 @@ function configOpen(manifestURL) { ...@@ -120,7 +120,7 @@ function configOpen(manifestURL) {
function populateLaunchOptions(metadata) { function populateLaunchOptions(metadata) {
var options = []; var options = [];
Net.listForEach(metadata.launchOptions, function (option) { Net.listForEach(metadata.launchOptions, function (option) {
options.push(option.title); options.push(option.name);
}); });
combobox_launch.model = options; combobox_launch.model = options;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment