Skip to content

Commit

Permalink
Release v0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
my-th-os committed May 5, 2018
1 parent 9dbd4d6 commit 2f27bd5
Show file tree
Hide file tree
Showing 15 changed files with 112 additions and 38 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version 0.7.3 - in progress
Version 0.8 - 2018-05-05
- copy & paste nodes in the tree - thanks alot to pamidur's contribution
- delete parts that aren't parent of any other part - thanks to Kobymaru
- support KAS CPort parts as dock type (no repair abilities yet)
- additional sanity check for symmetry attributes pointing to invalid indices
Expand Down
Binary file removed KML.zip
Binary file not shown.
3 changes: 2 additions & 1 deletion KML/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version 0.7.3 - in progress
Version 0.8 - 2018-05-05
- copy & paste nodes in the tree - thanks alot to pamidur's contribution
- delete parts that aren't parent of any other part - thanks to Kobymaru
- support KAS CPort parts as dock type (no repair abilities yet)
- additional sanity check for symmetry attributes pointing to invalid indices
Expand Down
5 changes: 5 additions & 0 deletions KML/GUI/GuiIcons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ class GuiIcons
/// </summary>
public Image Node = new Image();

/// <summary>
/// The icon for menu items to paste content.
/// </summary>
public Image Paste = new Image();

/// <summary>
/// The icon for a vessel part in the KML tree or the vessels list.
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions KML/GUI/GuiIcons16.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public GuiIcons16()
KerbalScience.Source = new BitmapImage(new Uri("pack://application:,,,/KML;component/Images/Science16.png"));
KerbalCamera.Source = new BitmapImage(new Uri("pack://application:,,,/KML;component/Images/Camera16.png"));
Node.Source = new BitmapImage(new Uri("pack://application:,,,/KML;component/Images/Point16.png"));
Paste.Source = new BitmapImage(new Uri("pack://application:,,,/KML;component/Images/Paste16.png"));
Part.Source = new BitmapImage(new Uri("pack://application:,,,/KML;component/Images/Box16.png"));
PartDock.Source = new BitmapImage(new Uri("pack://application:,,,/KML;component/Images/Port16.png"));
PartGrapple.Source = new BitmapImage(new Uri("pack://application:,,,/KML;component/Images/GrapplingHook16.png"));
Expand Down
1 change: 1 addition & 0 deletions KML/GUI/GuiIcons48.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public GuiIcons48()
PartDock.Source = new BitmapImage(new Uri("pack://application:,,,/KML;component/Images/Port48.png"));
PartGrapple.Source = new BitmapImage(new Uri("pack://application:,,,/KML;component/Images/GrapplingHook48.png"));
PartKasCPort.Source = new BitmapImage(new Uri("pack://application:,,,/KML;component/Images/KasCPort48.png"));
Paste.Source = new BitmapImage(new Uri("pack://application:,,,/KML;component/Images/Paste48.png"));
Resource.Source = new BitmapImage(new Uri("pack://application:,,,/KML;component/Images/Battery48.png"));
Vessel.Source = new BitmapImage(new Uri("pack://application:,,,/KML;component/Images/ApolloCsm48.png"));
VesselBase.Source = new BitmapImage(new Uri("pack://application:,,,/KML;component/Images/Base48.png"));
Expand Down
63 changes: 47 additions & 16 deletions KML/GUI/GuiTreeNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -547,42 +547,53 @@ private void BuildContextMenu(bool withAddMenu, bool withDeleteMenu)
{
menu.Items.Add(new Separator());
}

MenuItem m = new MenuItem();
m.DataContext = DataNode;
m.Icon = Icons.CreateImage(Icons.Add);
m.Header = "Add _attribute...";
m.Click += NodeAddAttrib_Click;
m.Icon = Icons.CreateImage(Icons.Clipboard);
m.Header = "_Copy node";
m.Click += CopyNode_Click;
m.IsEnabled = DataNode.Parent != null;
menu.Items.Add(m);

m = new MenuItem();
m.DataContext = DataNode;
m.Icon = Icons.CreateImage(Icons.Add);
m.Header = "Add _child node...";
m.Click += NodeAddChild_Click;
m.Icon = Icons.CreateImage(Icons.Paste);
m.Header = "_Paste child node(s)";
m.Click += PasteNode_Click;
m.IsEnabled = Clipboard.ContainsText(TextDataFormat.UnicodeText);
menu.Items.Add(m);

m = new MenuItem();
m.DataContext = DataNode;
m.Icon = Icons.CreateImage(Icons.Paste);
m.Header = "Paste inserting node(s) before";
m.Click += PasteBeforeNode_Click;
m.IsEnabled = Clipboard.ContainsText(TextDataFormat.UnicodeText);
menu.Items.Add(m);

menu.Items.Add(new Separator());

m = new MenuItem();
m.DataContext = DataNode;
m.Icon = Icons.CreateImage(Icons.Add);
m.Header = "_Insert node...";
m.Click += NodeInsertBefore_Click;
m.IsEnabled = DataNode.Parent != null;
m.Header = "Add _attribute...";
m.Click += NodeAddAttrib_Click;
menu.Items.Add(m);

m = new MenuItem();
m.DataContext = DataNode;
m.Icon = Icons.CreateImage(Icons.Clipboard);
m.Header = "_Copy node...";
m.Click += CopyNode_Click;
m.IsEnabled = DataNode.Parent != null;
m.Icon = Icons.CreateImage(Icons.Add);
m.Header = "Add _child node...";
m.Click += NodeAddChild_Click;
menu.Items.Add(m);

m = new MenuItem();
m.DataContext = DataNode;
m.Icon = Icons.CreateImage(Icons.Add);
m.Header = "_Paste child items(s)...";
m.Click += PasteNode_Click;
m.IsEnabled = Clipboard.ContainsText(TextDataFormat.UnicodeText);
m.Header = "_Insert node before...";
m.Click += NodeInsertBefore_Click;
m.IsEnabled = DataNode.Parent != null;
menu.Items.Add(m);
}
if (withDeleteMenu)
Expand Down Expand Up @@ -639,6 +650,26 @@ private void PasteNode_Click(object sender, RoutedEventArgs e)
node.AddRange(items);
}

private void PasteBeforeNode_Click(object sender, RoutedEventArgs e)
{
KmlNode node = ((sender as MenuItem).DataContext as KmlNode);
if (node.Parent != null)
{
var textNode = Clipboard.GetText(TextDataFormat.UnicodeText);

var items = KmlItem.ParseItems(new StringReader(textNode)).Where(i => i is KmlNode || i is KmlAttrib).ToList();

if (!items.Any())
DlgMessage.Show("Can not paste node from clipboard", "Paste node", Icons.Warning);

node.Parent.InsertBeforeRange(node, items);
}
else
{
DlgMessage.Show("Can not insert, node has no parent", "Paste node", Icons.Warning);
}
}

private void CopyNode_Click(object sender, RoutedEventArgs e)
{
KmlNode node = ((sender as MenuItem).DataContext as KmlNode);
Expand Down
Binary file added KML/Images/Paste16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added KML/Images/Paste48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion KML/KML.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>0.7.3.%2a</ApplicationVersion>
<ApplicationVersion>0.8.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
Expand Down Expand Up @@ -327,6 +327,10 @@
<Resource Include="Images\KasCPort16.png" />
<Resource Include="Images\KasCPort48.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\Paste16.png" />
<Resource Include="Images\Paste48.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>if $(ConfigurationName) == Release "C:\Program Files\7-Zip\7z.exe" a "$(SolutionDir)$(SolutionName).zip" "$(TargetPath)"
Expand Down
14 changes: 14 additions & 0 deletions KML/KML/KmlNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,20 @@ public void InsertBefore(KmlItem beforeItem, KmlItem newItem)
Add(beforeItem, newItem);
}

/// <summary>
/// Adds each KmlItem in the list before KmlItem like InsertBefore(KmlItem, KmlItem) does.
/// <see cref="KML.KmlNode.InsertBefore(KML.KmlItem, KML.KmlItem)"/>
/// </summary>
/// <param name="beforeItem">The KmlItem where the new item should be inserted before</param>
/// <param name="list">A List of KmlItem to add</param>
public void InsertBeforeRange(KmlItem beforeItem, List<KmlItem> list)
{
foreach (KmlItem item in list)
{
Add(beforeItem, item);
}
}

/// <summary>
/// Deletes a KmlItem from this nodes lists.
/// Result will be false if item was not in the lists or couldn't be deleted
Expand Down
4 changes: 2 additions & 2 deletions KML/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@
<StatusBar Height="23" VerticalAlignment="Bottom" Background="Gray">
<Label Content="KML - Kerbal Markup Lister" Padding="0"/>
<Separator/>
<Label Content="Version 0.7.3" Padding="0"/>
<Label Content="Version 0.8" Padding="0"/>
<Separator/>
<Label Content="© 2017 Oliver Pola (Mythos)" Padding="0"/>
<Label Content="© 2018 Oliver Pola (Mythos)" Padding="0"/>
<Separator/>
<Hyperlink NavigateUri="http://www.gnu.org/licenses/gpl.html" RequestNavigate="Hyperlink_RequestNavigate">GPL License</Hyperlink>
<Separator/>
Expand Down
6 changes: 3 additions & 3 deletions KML/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("KML - Kerbal Markup Lister")]
[assembly: AssemblyCopyright("Copyright © 2017 Oliver Pola (Mythos)")]
[assembly: AssemblyCopyright("Copyright © 2018 Oliver Pola (Mythos)")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down Expand Up @@ -51,5 +51,5 @@
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.7.3.0")]
[assembly: AssemblyFileVersion("0.7.3.0")]
[assembly: AssemblyVersion("0.8.0.0")]
[assembly: AssemblyFileVersion("0.8.0.0")]
22 changes: 15 additions & 7 deletions KML/README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
KML - Kerbal Markup Lister v0.7.2 - 2017-01-15 (WIP) - A persistence file editor for Kerbal Space Program
KML - Kerbal Markup Lister v0.8 - 2018-05-05 (WIP) - A persistence file editor for Kerbal Space Program
KSP Forum: http://forum.kerbalspaceprogram.com/index.php?/topic/133971-win-kml-persistence-file-editor/

Do you face a problem with broken docking ports or need just a little fuel-cheating? Do you got tired of editing save games in a text editor with long loading time and so much scrolling to compare different parts and vessels? So did I and decided to make a more helpful external editor to display the XML-like structure (the "KML" - Kerbal Markup Language) in a tree view and pick out vessels, kerbals and parts to be displayed in more eye-candy way.
Expand All @@ -8,10 +8,13 @@ The current version is not feature-complete but so far functional and already he
Any feedback, more testing, bug reports and suggestions are very welcome.

New Features
• new vessel types plane and relay
• reset docking on one-sided same vessel docking errors - thanks to schneida
• report only crew assignment problems for kerbals from roster
• tested with KSP 1.2.2
• copy & paste nodes in the tree - thanks alot to pamidur's contribution
• delete parts that aren't parent of any other part - thanks to Kobymaru
• support KAS CPort parts as dock type (no repair abilities yet)
• test for program files dir and being admin - thanks to EwingKang
• vessel / kerbal list filter right click (incl. un-single-select on second right click)
• search dialog can now load further items (only 100 are loaded first)
• previous and next buttons navigate through search results

Features
• open SFS and CRAFT files
Expand All @@ -33,14 +36,15 @@ Features
• change vessel flag in all its parts - for Enceos
• refill part resources
• repair broken docking ports and grappling devices
• tested with KSP 1.0, 1.1 and 1.2
• tested with KSP 1.0 to 1.3
(newest KML version should still work with at least all these KSP versions)

TODO
• copy nodes and attributes
• copy attributes
• identify add-on part connections (KAS)
• change position of nodes and attributes
• more testing (uncommon vessel builds I didn't think of?)
• support multiple docking ports per part
• documentation
• a lot of source code TODOs

Expand All @@ -62,3 +66,7 @@ Instructions, Hints, FAQ
• Sometimes there appears a warnings tab, what do these warnings mean? Some KML elements are more heavily inspected than others, like vessel parts and especially docking or grappling devices. If something is not as expected there is a warning generated.
• There is a warning but my save game works fine! If the problem is related to stock parts please send me feedback about this problem. If KML has warnings about add-on parts not connected (e.g. KAS): That's ok for now, KML does not support that add-on and can't understand what it has written to the save file. KML just expects all parts to be somehow connected and gives a warning otherwise.
• Don't fear about saving a file with warnings, unknown add-ons, missing part-connections, etc. KML will save the file as it was read and only apply the changes you made. All unknown data will be kept as it was.

Developers
• Mythos (initiator, maintainer)
• pamidur (contributor)
22 changes: 15 additions & 7 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
KML - Kerbal Markup Lister v0.7.2 - 2017-01-15 (WIP) - A persistence file editor for Kerbal Space Program
KML - Kerbal Markup Lister v0.8 - 2018-05-05 (WIP) - A persistence file editor for Kerbal Space Program
KSP Forum: http://forum.kerbalspaceprogram.com/index.php?/topic/133971-win-kml-persistence-file-editor/

Do you face a problem with broken docking ports or need just a little fuel-cheating? Do you got tired of editing save games in a text editor with long loading time and so much scrolling to compare different parts and vessels? So did I and decided to make a more helpful external editor to display the XML-like structure (the "KML" - Kerbal Markup Language) in a tree view and pick out vessels, kerbals and parts to be displayed in more eye-candy way.
Expand All @@ -8,10 +8,13 @@ The current version is not feature-complete but so far functional and already he
Any feedback, more testing, bug reports and suggestions are very welcome.

New Features
• new vessel types plane and relay
• reset docking on one-sided same vessel docking errors - thanks to schneida
• report only crew assignment problems for kerbals from roster
• tested with KSP 1.2.2
• copy & paste nodes in the tree - thanks alot to pamidur's contribution
• delete parts that aren't parent of any other part - thanks to Kobymaru
• support KAS CPort parts as dock type (no repair abilities yet)
• test for program files dir and being admin - thanks to EwingKang
• vessel / kerbal list filter right click (incl. un-single-select on second right click)
• search dialog can now load further items (only 100 are loaded first)
• previous and next buttons navigate through search results

Features
• open SFS and CRAFT files
Expand All @@ -33,14 +36,15 @@ Features
• change vessel flag in all its parts - for Enceos
• refill part resources
• repair broken docking ports and grappling devices
• tested with KSP 1.0, 1.1 and 1.2
• tested with KSP 1.0 to 1.3
(newest KML version should still work with at least all these KSP versions)

TODO
• copy nodes and attributes
• copy attributes
• identify add-on part connections (KAS)
• change position of nodes and attributes
• more testing (uncommon vessel builds I didn't think of?)
• support multiple docking ports per part
• documentation
• a lot of source code TODOs

Expand All @@ -62,3 +66,7 @@ Instructions, Hints, FAQ
• Sometimes there appears a warnings tab, what do these warnings mean? Some KML elements are more heavily inspected than others, like vessel parts and especially docking or grappling devices. If something is not as expected there is a warning generated.
• There is a warning but my save game works fine! If the problem is related to stock parts please send me feedback about this problem. If KML has warnings about add-on parts not connected (e.g. KAS): That's ok for now, KML does not support that add-on and can't understand what it has written to the save file. KML just expects all parts to be somehow connected and gives a warning otherwise.
• Don't fear about saving a file with warnings, unknown add-ons, missing part-connections, etc. KML will save the file as it was read and only apply the changes you made. All unknown data will be kept as it was.

Developers
• Mythos (initiator, maintainer)
• pamidur (contributor)

0 comments on commit 2f27bd5

Please sign in to comment.