Transfer Commit

This commit is contained in:
Viaron
2014-08-06 20:29:53 -04:00
parent e3324de2ad
commit 64543d398d
25 changed files with 1799 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectSWGScriptEditor", "ProjectSWGScriptEditor\ProjectSWGScriptEditor.csproj", "{BDF562E6-942A-4E0B-BD6F-6FABC0465DC2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BDF562E6-942A-4E0B-BD6F-6FABC0465DC2}.Debug|x86.ActiveCfg = Debug|x86
{BDF562E6-942A-4E0B-BD6F-6FABC0465DC2}.Debug|x86.Build.0 = Debug|x86
{BDF562E6-942A-4E0B-BD6F-6FABC0465DC2}.Release|x86.ActiveCfg = Release|x86
{BDF562E6-942A-4E0B-BD6F-6FABC0465DC2}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

BIN
ProjectSWGScriptEditor.suo Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

View File

@@ -0,0 +1,75 @@
using System;
using System.IO;
using System.Collections.Generic;
namespace ProjectSWGScriptEditor
{
public class Config
{
static public String returnValue(string key)
{
var config = File.OpenText("./pswgse.cfg");
while (config.BaseStream.CanSeek)
{
String[] entry = config.ReadLine().Split('=');
if (entry[0].Equals(key))
{
config.Close();
return entry[1].ToString();
}
}
config.Close();
return null;
}
static public Boolean containsKey(string key)
{
var config = File.OpenText("./pswgse.cfg");
while (config.BaseStream.CanSeek)
{
string line = config.ReadLine();
if (line == null)
{
config.Close();
return false;
}
String[] entry = line.Split('=');
if (entry[0].Equals(key))
{
config.Close();
return true;
}
}
config.Close();
return false;
}
static public void setValue(string key, object value)
{
var config = File.OpenText("./pswgse.cfg");
SortedList<string, string> entries = new SortedList<string, string>();
while (config.Peek() >= 0)
{
string temp = config.ReadLine();
if (temp != null)
{
string[] entry = temp.Split('=');
entries.Add(entry[0], entry[1]);
}
}
config.Close();
if (!entries.ContainsKey(key)) entries.Add(key, value.ToString());
else entries[key] = value.ToString();
List<string> listToSave = new List<string>();
for (int i = 0; i < entries.Count; i++) listToSave.Add(entries.Keys[i] + "=" + entries.Values[i]);
File.WriteAllLines("./pswgse.cfg", listToSave);
}
}
}

View File

@@ -0,0 +1,114 @@
namespace ProjectSWGScriptEditor.Editors
{
partial class BonusSetEditor
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.scriptPathLbl = new System.Windows.Forms.Label();
this.scriptTreeView = new System.Windows.Forms.TreeView();
this.objectTemplateTb = new System.Windows.Forms.TextBox();
this.addRequiredItemBtn = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// scriptPathLbl
//
this.scriptPathLbl.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.scriptPathLbl.AutoSize = true;
this.scriptPathLbl.Location = new System.Drawing.Point(12, 271);
this.scriptPathLbl.Name = "scriptPathLbl";
this.scriptPathLbl.Size = new System.Drawing.Size(59, 13);
this.scriptPathLbl.TabIndex = 0;
this.scriptPathLbl.Text = "Script Path";
//
// scriptTreeView
//
this.scriptTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.scriptTreeView.Location = new System.Drawing.Point(12, 12);
this.scriptTreeView.Name = "scriptTreeView";
this.scriptTreeView.Size = new System.Drawing.Size(372, 256);
this.scriptTreeView.TabIndex = 1;
//
// objectTemplateTb
//
this.objectTemplateTb.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.objectTemplateTb.Location = new System.Drawing.Point(390, 12);
this.objectTemplateTb.Name = "objectTemplateTb";
this.objectTemplateTb.Size = new System.Drawing.Size(232, 20);
this.objectTemplateTb.TabIndex = 4;
this.objectTemplateTb.Text = "Object STF Name or Object Template";
//
// addRequiredItemBtn
//
this.addRequiredItemBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.addRequiredItemBtn.Location = new System.Drawing.Point(390, 38);
this.addRequiredItemBtn.Name = "addRequiredItemBtn";
this.addRequiredItemBtn.Size = new System.Drawing.Size(232, 23);
this.addRequiredItemBtn.TabIndex = 5;
this.addRequiredItemBtn.Text = "Add Required Item";
this.addRequiredItemBtn.UseVisualStyleBackColor = true;
this.addRequiredItemBtn.Click += new System.EventHandler(this.addRequiredItemBtn_Click);
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.label1.Location = new System.Drawing.Point(390, 64);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(232, 204);
this.label1.TabIndex = 6;
this.label1.Text = "Warning:\r\nThis editor automically saves changes - please do not make a change wit" +
"hout being positive of the changes. \r\n\r\nThis is temporary.\r\n";
//
// BonusSetEditor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(634, 293);
this.Controls.Add(this.label1);
this.Controls.Add(this.addRequiredItemBtn);
this.Controls.Add(this.objectTemplateTb);
this.Controls.Add(this.scriptTreeView);
this.Controls.Add(this.scriptPathLbl);
this.Name = "BonusSetEditor";
this.Text = "Bonus Set Editor";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label scriptPathLbl;
private System.Windows.Forms.TreeView scriptTreeView;
private System.Windows.Forms.TextBox objectTemplateTb;
private System.Windows.Forms.Button addRequiredItemBtn;
private System.Windows.Forms.Label label1;
}
}

View File

@@ -0,0 +1,79 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace ProjectSWGScriptEditor.Editors
{
public partial class BonusSetEditor : Form
{
public BonusSetEditor(string scriptPath)
{
InitializeComponent();
scriptPathLbl.Text = scriptPath;
loadScriptIntoForm();
if (!this.IsDisposed) this.Show();
}
private void loadScriptIntoForm()
{
scriptTreeView.Nodes.Clear();
string[] file = File.ReadAllLines(scriptPathLbl.Text);
TreeNode bonusSetNameNode = scriptTreeView.Nodes.Add("Set Name: ");
TreeNode requiredItemsNode = scriptTreeView.Nodes.Add("Required Items");
TreeNode bonusesNode = scriptTreeView.Nodes.Add("Bonuses");
try
{
for (int i = 0; i < file.Length; i++)
{
if (file[i].Contains("bonusSet = BonusSetTemplate"))
{
bonusSetNameNode.Text = "Set Name: " + file[i].Split('"')[1];
}
else if (file[i].Contains("bonusSet.addRequiredItem"))
{
requiredItemsNode.Nodes.Add(file[i].Split('"')[1]);
}
else if (file[i].Contains("if wornItems == "))
{
string requiredItemCount = file[i].Split('=')[2];
TreeNode bonusNode = bonusesNode.Nodes.Add(requiredItemCount);
int temp = i + 1;
while (!(file[temp].Contains("elif wornItems == ") || file[temp].Contains("else:")))
{
bonusNode.Nodes.Add(file[temp]);
temp++;
}
}
}
}
catch (Exception ex)
{
MessageBox.Show("The editor has encountered an error while trying to parse the selected script.");
this.Close();
}
}
private void addRequiredItemBtn_Click(object sender, EventArgs e)
{
List<String> file = File.ReadAllLines(scriptPathLbl.Text).ToList<String>();
foreach (string line in file)
{
if (line.Contains("bonusSet.addRequiredItem"))
{
file.Insert(file.IndexOf(line) + 1, "\tbonusSet.addRequiredItem(\"" + objectTemplateTb.Text + "\")");
File.WriteAllLines(scriptPathLbl.Text, file);
loadScriptIntoForm();
return;
}
}
}
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,220 @@
namespace ProjectSWGScriptEditor.Editors
{
partial class LootEditor
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.lootPoolListbox = new System.Windows.Forms.ListBox();
this.lootPoolContentsDataView = new System.Windows.Forms.DataGridView();
this.itemName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.itemChance = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.listBox1 = new System.Windows.Forms.ListBox();
this.createLootPool = new System.Windows.Forms.Button();
this.deleteLootPool = new System.Windows.Forms.Button();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.lootPoolContentsDataView)).BeginInit();
this.tabPage2.SuspendLayout();
this.SuspendLayout();
//
// tabControl1
//
this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Location = new System.Drawing.Point(12, 12);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(714, 491);
this.tabControl1.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.splitContainer1);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(706, 465);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Loot Pools";
this.tabPage1.UseVisualStyleBackColor = true;
//
// splitContainer1
//
this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.splitContainer1.Location = new System.Drawing.Point(6, 6);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.deleteLootPool);
this.splitContainer1.Panel1.Controls.Add(this.createLootPool);
this.splitContainer1.Panel1.Controls.Add(this.lootPoolListbox);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.lootPoolContentsDataView);
this.splitContainer1.Size = new System.Drawing.Size(694, 453);
this.splitContainer1.SplitterDistance = 230;
this.splitContainer1.TabIndex = 2;
//
// lootPoolListbox
//
this.lootPoolListbox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lootPoolListbox.FormattingEnabled = true;
this.lootPoolListbox.Location = new System.Drawing.Point(3, 46);
this.lootPoolListbox.Name = "lootPoolListbox";
this.lootPoolListbox.Size = new System.Drawing.Size(224, 407);
this.lootPoolListbox.TabIndex = 0;
this.lootPoolListbox.SelectedIndexChanged += new System.EventHandler(this.lootPoolListbox_SelectedIndexChanged);
//
// lootPoolContentsDataView
//
this.lootPoolContentsDataView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.lootPoolContentsDataView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.lootPoolContentsDataView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.itemName,
this.itemChance});
this.lootPoolContentsDataView.Dock = System.Windows.Forms.DockStyle.Fill;
this.lootPoolContentsDataView.Location = new System.Drawing.Point(0, 0);
this.lootPoolContentsDataView.Name = "lootPoolContentsDataView";
this.lootPoolContentsDataView.Size = new System.Drawing.Size(460, 453);
this.lootPoolContentsDataView.TabIndex = 1;
this.lootPoolContentsDataView.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.lootPoolContentsDataView_CellValueChanged);
this.lootPoolContentsDataView.RowsRemoved += new System.Windows.Forms.DataGridViewRowsRemovedEventHandler(this.lootPoolContentsDataView_RowsRemoved);
//
// itemName
//
this.itemName.HeaderText = "Item";
this.itemName.Name = "itemName";
this.itemName.ReadOnly = true;
//
// itemChance
//
this.itemChance.HeaderText = "Item Chance";
this.itemChance.Name = "itemChance";
//
// tabPage2
//
this.tabPage2.Controls.Add(this.listBox1);
this.tabPage2.Controls.Add(this.comboBox1);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(707, 415);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Loot Items";
this.tabPage2.UseVisualStyleBackColor = true;
//
// comboBox1
//
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Location = new System.Drawing.Point(6, 6);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(121, 21);
this.comboBox1.TabIndex = 0;
//
// listBox1
//
this.listBox1.FormattingEnabled = true;
this.listBox1.Location = new System.Drawing.Point(7, 33);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(120, 95);
this.listBox1.TabIndex = 1;
//
// createLootPool
//
this.createLootPool.Dock = System.Windows.Forms.DockStyle.Top;
this.createLootPool.Location = new System.Drawing.Point(0, 0);
this.createLootPool.Name = "createLootPool";
this.createLootPool.Size = new System.Drawing.Size(230, 23);
this.createLootPool.TabIndex = 1;
this.createLootPool.Text = "Create";
this.createLootPool.UseVisualStyleBackColor = true;
this.createLootPool.Click += new System.EventHandler(this.createLootPool_Click);
//
// deleteLootPool
//
this.deleteLootPool.Dock = System.Windows.Forms.DockStyle.Top;
this.deleteLootPool.Location = new System.Drawing.Point(0, 23);
this.deleteLootPool.Name = "deleteLootPool";
this.deleteLootPool.Size = new System.Drawing.Size(230, 23);
this.deleteLootPool.TabIndex = 2;
this.deleteLootPool.Text = "Delete";
this.deleteLootPool.UseVisualStyleBackColor = true;
//
// LootEditor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(738, 515);
this.Controls.Add(this.tabControl1);
this.Name = "LootEditor";
this.Text = "LootEditor";
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.lootPoolContentsDataView)).EndInit();
this.tabPage2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.DataGridView lootPoolContentsDataView;
private System.Windows.Forms.ListBox lootPoolListbox;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.DataGridViewTextBoxColumn itemName;
private System.Windows.Forms.DataGridViewTextBoxColumn itemChance;
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.Button deleteLootPool;
private System.Windows.Forms.Button createLootPool;
}
}

View File

@@ -0,0 +1,150 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace ProjectSWGScriptEditor.Editors
{
public partial class LootEditor : Form
{
string scriptPath;
bool ready = false;
public LootEditor(string scriptPath)
{
InitializeComponent();
this.scriptPath = scriptPath;
loadScriptIntoForm();
if (!this.IsDisposed) this.Show();
this.Activate();
}
private void loadScriptIntoForm()
{
string[] files = Directory.GetFiles(scriptPath + "/lootPools");
for (int i = 0; i < files.Length; i++)
{
lootPoolListbox.Items.Add(Path.GetFileNameWithoutExtension(files[i]));
}
}
private void parseLootGroup(string filepath)
{
lootPoolContentsDataView.Rows.Clear();
try
{
string[] file = File.ReadAllLines(filepath);
for (int i = 0; i < file.Length; i++)
{
string line = file[i].TrimStart();
if (line.Contains("itemNames()"))
{
line = file[i + 1];
line = line.Replace("return [", "");
line = line.Replace("]", "");
line = line.Replace("'", "");
string[] lineContents = line.Split(',');
for (int a = 0; a < lineContents.Length; a++)
{
lootPoolContentsDataView.Rows.Add(lineContents[a]);
}
}
if (line.Contains("itemChances()"))
{
line = file[i + 1];
line = line.Replace("return [", "");
line = line.Replace("]", "");
string[] lineContents = line.Split(',');
for (int a = 0; a < lineContents.Length; a++)
{
lootPoolContentsDataView.Rows[a].Cells[1].Value = lineContents[a];
}
}
}
int totalChance = 0;
for (int i = 0; i < lootPoolContentsDataView.Rows.Count - 1; i++)
{
totalChance += Int32.Parse((string) lootPoolContentsDataView.Rows[i].Cells[1].Value);
}
ready = true;
//lootPoolContentsDataView.Rows.Add("Total Items: " + (lootPoolContentsDataView.Rows.Count - 1), "Total Chance: " + totalChance);
}
catch (Exception ex)
{
MessageBox.Show("The editor has encountered an error while trying to parse the selected loot pool.");
}
}
public void saveLootGroupData()
{
string filePath = scriptPath + "/lootPools/" + lootPoolListbox.Text + ".py";
StringBuilder sbuilder = new StringBuilder();
sbuilder.AppendLine("def itemNames():");
sbuilder.Append("\treturn [");
for (int i = 0; i < lootPoolContentsDataView.Rows.Count - 1; i++)
{
if (lootPoolContentsDataView.Rows[i].Cells[0].Value == null) continue;
sbuilder.Append("'" + ((String)lootPoolContentsDataView.Rows[i].Cells[0].Value).TrimStart() + "'");
if (i < lootPoolContentsDataView.Rows.Count - 2) sbuilder.Append(",");
}
sbuilder.Append("]");
sbuilder.AppendLine();
sbuilder.AppendLine("def itemChances():");
sbuilder.Append("\treturn [");
for (int i = 0; i < lootPoolContentsDataView.Rows.Count - 1; i++)
{
if (lootPoolContentsDataView.Rows[i].Cells[1].Value == null) continue;
sbuilder.Append(((String)lootPoolContentsDataView.Rows[i].Cells[1].Value).TrimStart());
if (i < lootPoolContentsDataView.Rows.Count - 2) sbuilder.Append(",");
}
sbuilder.Append("]");
Console.WriteLine(filePath);
File.WriteAllText(filePath, sbuilder.ToString());
}
private void lootPoolListbox_SelectedIndexChanged(object sender, EventArgs e)
{
ready = false;
parseLootGroup(scriptPath + "/lootPools/" + lootPoolListbox.Text + ".py");
}
private void lootPoolContentsDataView_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
if(ready) saveLootGroupData();
}
private void lootPoolContentsDataView_RowsRemoved(object sender, DataGridViewRowsRemovedEventArgs e)
{
if (ready) saveLootGroupData();
}
private void createLootPool_Click(object sender, EventArgs e)
{
}
}
}

View File

@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="itemName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="itemChance.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="itemName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="itemChance.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ProjectSWGScriptEditor.FileReaders.STF
{
public class StfEntry
{
public string key;
public string value;
public StfEntry() { }
}
}

View File

@@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Collections;
namespace ProjectSWGScriptEditor.FileReaders.STF
{
static public class StfReader
{
static public StfEntry[] read(String stfPath)
{
FileStream stream = File.Open(stfPath,FileMode.Open);
stream.Position = 9;
int entryCount = readLittleEndianInt(stream);
StfEntry[] entries = new StfEntry[entryCount];
for (int i = 0; i < entryCount; i++)
{
int entryNumber = readLittleEndianInt(stream);
stream.Position += 4;
int characters = readLittleEndianInt(stream);
byte[] characterBuffer = new byte[characters];
for (int a = 0; a < characters; a++)
{
characterBuffer[a] = (byte) stream.ReadByte();
stream.Position++;
}
string value = System.Text.Encoding.Default.GetString(characterBuffer);
StfEntry entry = new StfEntry();
entry.value = value;
entries[i] = entry;
}
for (int i = 0; i < entryCount; i++)
{
int entryNumber = readLittleEndianInt(stream);
int characters = readLittleEndianInt(stream);
byte[] characterBuffer = new byte[characters];
for (int a = 0; a < characters; a++)
{
characterBuffer[a] = (byte)stream.ReadByte();
}
string value = System.Text.Encoding.Default.GetString(characterBuffer);
entries[i].key = value;
}
return entries;
}
static private int readLittleEndianInt(FileStream stream)
{
byte[] endianBuffer = new byte[4];
stream.Read(endianBuffer, 0, 4);
endianBuffer.Reverse();
return BitConverter.ToInt32(endianBuffer, 0);
}
}
}

View File

@@ -0,0 +1,172 @@
namespace ProjectSWGScriptEditor
{
partial class MainForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.treeView1 = new System.Windows.Forms.TreeView();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton();
this.setScriptPathToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.scriptViewerTb = new System.Windows.Forms.TextBox();
this.editorNameLbl = new System.Windows.Forms.Label();
this.setClientdataPathToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.toolStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.SuspendLayout();
//
// treeView1
//
this.treeView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.treeView1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.treeView1.Location = new System.Drawing.Point(3, 3);
this.treeView1.Name = "treeView1";
this.treeView1.Size = new System.Drawing.Size(157, 319);
this.treeView1.TabIndex = 0;
this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
//
// toolStrip1
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripDropDownButton1});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(606, 25);
this.toolStrip1.TabIndex = 2;
this.toolStrip1.Text = "toolStrip1";
//
// toolStripDropDownButton1
//
this.toolStripDropDownButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.setScriptPathToolStripMenuItem,
this.setClientdataPathToolStripMenuItem});
this.toolStripDropDownButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton1.Image")));
this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripDropDownButton1.Name = "toolStripDropDownButton1";
this.toolStripDropDownButton1.Size = new System.Drawing.Size(62, 22);
this.toolStripDropDownButton1.Text = "Settings";
//
// setScriptPathToolStripMenuItem
//
this.setScriptPathToolStripMenuItem.Name = "setScriptPathToolStripMenuItem";
this.setScriptPathToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
this.setScriptPathToolStripMenuItem.Text = "Set script path";
this.setScriptPathToolStripMenuItem.Click += new System.EventHandler(this.setScriptPathToolStripMenuItem_Click);
//
// scriptViewerTb
//
this.scriptViewerTb.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.scriptViewerTb.Location = new System.Drawing.Point(6, 16);
this.scriptViewerTb.Multiline = true;
this.scriptViewerTb.Name = "scriptViewerTb";
this.scriptViewerTb.ReadOnly = true;
this.scriptViewerTb.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.scriptViewerTb.Size = new System.Drawing.Size(406, 306);
this.scriptViewerTb.TabIndex = 5;
this.scriptViewerTb.Text = "Script Viewer";
this.scriptViewerTb.WordWrap = false;
//
// editorNameLbl
//
this.editorNameLbl.AutoSize = true;
this.editorNameLbl.Location = new System.Drawing.Point(3, 0);
this.editorNameLbl.Name = "editorNameLbl";
this.editorNameLbl.Size = new System.Drawing.Size(65, 13);
this.editorNameLbl.TabIndex = 4;
this.editorNameLbl.Text = "Editor Name";
//
// setClientdataPathToolStripMenuItem
//
this.setClientdataPathToolStripMenuItem.Name = "setClientdataPathToolStripMenuItem";
this.setClientdataPathToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
this.setClientdataPathToolStripMenuItem.Text = "Set clientdata path";
this.setClientdataPathToolStripMenuItem.Click += new System.EventHandler(this.setClientdataPathToolStripMenuItem_Click);
//
// splitContainer1
//
this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.splitContainer1.Location = new System.Drawing.Point(12, 28);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.treeView1);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.editorNameLbl);
this.splitContainer1.Panel2.Controls.Add(this.scriptViewerTb);
this.splitContainer1.Size = new System.Drawing.Size(582, 325);
this.splitContainer1.SplitterDistance = 163;
this.splitContainer1.TabIndex = 6;
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(606, 365);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.toolStrip1);
this.Name = "MainForm";
this.Text = "ProjectSWG Script Editor";
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TreeView treeView1;
private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton1;
private System.Windows.Forms.ToolStripMenuItem setScriptPathToolStripMenuItem;
private System.Windows.Forms.TextBox scriptViewerTb;
private System.Windows.Forms.Label editorNameLbl;
private System.Windows.Forms.ToolStripMenuItem setClientdataPathToolStripMenuItem;
private System.Windows.Forms.SplitContainer splitContainer1;
}
}

View File

@@ -0,0 +1,108 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace ProjectSWGScriptEditor
{
public partial class MainForm : Form
{
static String scriptsDirectory = "./";
static String clientdataDirectory = "./";
public MainForm()
{
if (!Config.containsKey("scriptsDirectory")) Config.setValue("scriptsDirectory", scriptsDirectory);
else scriptsDirectory = Config.returnValue("scriptsDirectory");
if (!Config.containsKey("clientdataDirectory")) Config.setValue("clientdataDirectory", scriptsDirectory);
else clientdataDirectory = Config.returnValue("clientdataDirectory");
InitializeComponent();
loadContentToTreeView();
}
private void loadContentToTreeView()
{
string[] directories = Directory.GetDirectories(scriptsDirectory);
string[] files = Directory.GetFiles(scriptsDirectory);
for (int i = 0; i < directories.Length; i++) treeView1.Nodes.Add(directories[i].Replace(scriptsDirectory, ""));
for (int i = 0; i < files.Length; i++) treeView1.Nodes.Add(files[i].Replace(scriptsDirectory, ""));
}
private void setScriptPathToolStripMenuItem_Click(object sender, EventArgs e)
{
using (FolderBrowserDialog dialog = new FolderBrowserDialog())
{
if (dialog.ShowDialog() == DialogResult.OK) scriptsDirectory = dialog.SelectedPath;
}
Config.setValue("scriptsDirectory", scriptsDirectory);
treeView1.Nodes.Clear();
loadContentToTreeView();
}
private void setClientdataPathToolStripMenuItem_Click(object sender, EventArgs e)
{
using (FolderBrowserDialog dialog = new FolderBrowserDialog())
{
if (dialog.ShowDialog() == DialogResult.OK) clientdataDirectory = dialog.SelectedPath;
}
Config.setValue("clientdataDirectory", clientdataDirectory);
}
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
{
string directory = scriptsDirectory + getNodeFilePath(treeView1.SelectedNode);
string childDirectory = getNodeFilePath(treeView1.SelectedNode);
Console.WriteLine(childDirectory);
if (!treeView1.SelectedNode.Text.EndsWith(".py"))
{
string[] directories = Directory.GetDirectories(directory);
string[] files = Directory.GetFiles(directory);
treeView1.SelectedNode.Nodes.Clear();
for (int i = 0; i < directories.Length; i++) treeView1.SelectedNode.Nodes.Add(directories[i].Replace(directory, ""));
for (int i = 0; i < files.Length; i++) treeView1.SelectedNode.Nodes.Add(files[i].Replace(directory, ""));
if (childDirectory.Equals(@"\loot"))
{
editorNameLbl.Text = "Loot Editor";
Editors.LootEditor editor = new Editors.LootEditor(directory);
}
}
else if (treeView1.SelectedNode.Text.EndsWith(".py"))
{
scriptViewerTb.Text = File.ReadAllText(directory);
if (childDirectory.StartsWith(@"\equipment\bonus_sets\"))
{
editorNameLbl.Text = "Bonus Set Editor";
Editors.BonusSetEditor editor = new Editors.BonusSetEditor(directory);
}
else if (childDirectory == "")
{
}
else editorNameLbl.Text = "Unknown script type";
}
}
private string getNodeFilePath(TreeNode node)
{
if(node.Parent == null) return node.Text;
return getNodeFilePath(node.Parent) + node.Text;
}
}
}

View File

@@ -0,0 +1,139 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="toolStripDropDownButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
</root>

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace ProjectSWGScriptEditor
{
static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}

View File

@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{BDF562E6-942A-4E0B-BD6F-6FABC0465DC2}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ProjectSWGScriptEditor</RootNamespace>
<AssemblyName>ProjectSWGScriptEditor</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.DirectoryServices" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Config.cs" />
<Compile Include="Editors\BonusSetEditor.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Editors\BonusSetEditor.Designer.cs">
<DependentUpon>BonusSetEditor.cs</DependentUpon>
</Compile>
<Compile Include="Editors\LootEditor.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Editors\LootEditor.Designer.cs">
<DependentUpon>LootEditor.cs</DependentUpon>
</Compile>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="FileReaders\STF\StfEntry.cs" />
<Compile Include="FileReaders\STF\StfReader.cs" />
<EmbeddedResource Include="Editors\BonusSetEditor.resx">
<DependentUpon>BonusSetEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Editors\LootEditor.resx">
<DependentUpon>LootEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ProjectSWG Script Editor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("ProjectSWG")]
[assembly: AssemblyProduct("ProjectSWGScriptEditor.Properties")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("d183721b-3d4e-4c4a-8585-838fd58e200d")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.1008
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ProjectSWGScriptEditor.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SLManager.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.1008
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ProjectSWGScriptEditor.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@@ -0,0 +1,2 @@
clientdataDirectory=C:\NGECore2\clientdata
scriptsDirectory=C:\NGECore2\scripts