Commit 92c5602c authored by Archnoc's avatar Archnoc

rename launch option from title to name; bug fix

parent c23e56dd
MIT License
Copyright (c) 2020 Archnoc
Copyright (c) 2020 Sunrise Project
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
......@@ -33,8 +33,8 @@ namespace sunrise_launcher
public class LaunchOption
{
[JsonPropertyName("title")]
public string Title { get; set; }
[JsonPropertyName("name")]
public string Name { get; set; }
[JsonPropertyName("path")]
public string LaunchPath { get; set; }
[JsonPropertyName("env")]
......
......@@ -123,12 +123,13 @@ namespace sunrise_launcher
ShowMessage("Server add failed.");
return;
}
server.Metadata.Version = "";
Servers.Add(server);
Selected = server.ManifestURL;
this.ActivateSignal("update");
await UpdateAsync(server, false);
await UpdateAsync(server, true);
this.ActivateSignal("update");
ShowMessage(server.Error);
}
......@@ -250,9 +251,9 @@ namespace sunrise_launcher
}
//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)
......@@ -427,7 +428,7 @@ namespace sunrise_launcher
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)
{
Console.WriteLine("ERROR: launch option not found: {0}", server.Launch);
......
......@@ -61,7 +61,7 @@ namespace sunrise_launcher
foreach (var profile in TequilaRoot.Profiles)
{
var config = new LaunchOption();
config.Title = profile.Value;
config.Name = profile.Value;
config.LaunchPath = profile.Exec;
config.Args = profile.Params;
metadata.LaunchOptions.Add(config);
......
......@@ -120,7 +120,7 @@ function configOpen(manifestURL) {
function populateLaunchOptions(metadata) {
var options = [];
Net.listForEach(metadata.launchOptions, function (option) {
options.push(option.title);
options.push(option.name);
});
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