upload w4editor code
This commit is contained in:
parent
b3a9d0a2ac
commit
fcd47415f5
|
@ -0,0 +1,86 @@
|
|||
using LibW4M.Data.Teams;
|
||||
using LibXom.Data;
|
||||
using LibXom.Streams;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LibW4M.Data.Stats
|
||||
{
|
||||
public class StatsCollective : SaveDataCollective
|
||||
{
|
||||
private List<StatsContainerData> teamStats = new List<StatsContainerData>();
|
||||
private List<XomString> teamNames = new List<XomString>();
|
||||
public StatsCollective(W4SaveFile fileBelongs, XomContainer mainContainer) : base(fileBelongs, mainContainer)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
int[] decompressedCollective = mainContainer.Decompress();
|
||||
int numStats = decompressedCollective[0];
|
||||
for (int i = 0; i < numStats; i++)
|
||||
{
|
||||
StatsContainerData stat = new StatsContainerData(this.fileBelongs, this.fileBelongs.LookupContainerById(decompressedCollective[i + 1]));
|
||||
this.collectiveEntries.Add(stat);
|
||||
}
|
||||
|
||||
int teamStatsStart = (1 + numStats) + 1;
|
||||
int numTeamStats = decompressedCollective[(1 + numStats)];
|
||||
for (int i = 0; i < numTeamStats; i++)
|
||||
{
|
||||
StatsContainerData teamStat = new StatsContainerData(this.fileBelongs, this.fileBelongs.LookupContainerById(decompressedCollective[i + (teamStatsStart)]));
|
||||
this.teamStats.Add(teamStat);
|
||||
}
|
||||
|
||||
int teamNamesStart = ((((1 + numStats) + 1) + numTeamStats) + 1);
|
||||
int numTeamNames = decompressedCollective[(((1 + numStats) + 1) + numTeamStats)];
|
||||
for (int i = 0; i < numTeamNames; i++)
|
||||
{
|
||||
this.teamNames.Add(this.fileBelongs.LookupStringFromId(decompressedCollective[i + (teamNamesStart)]));
|
||||
}
|
||||
}
|
||||
|
||||
public override void Save()
|
||||
{
|
||||
int numStats = this.collectiveEntries.Count;
|
||||
int numTeamStats = this.teamStats.Count;
|
||||
int numTeamNames = this.teamNames.Count;
|
||||
|
||||
|
||||
// Save regular stats
|
||||
int statsStart = 1;
|
||||
int[] collective = new int[(numStats + 1) + (numTeamStats + 1) + (numTeamNames + 1)];
|
||||
collective[statsStart - 1] = numStats;
|
||||
|
||||
for(int i = 0; i < numStats; i++)
|
||||
{
|
||||
this.collectiveEntries[i].Save();
|
||||
collective[statsStart + i] = this.collectiveEntries[i].containerId;
|
||||
}
|
||||
|
||||
// Save team stats
|
||||
int teamStatsStart = (1 + numStats) + 1;
|
||||
collective[teamStatsStart-1] = numTeamStats;
|
||||
|
||||
for (int i = 0; i < numTeamStats; i++)
|
||||
{
|
||||
this.teamStats[i].Save();
|
||||
|
||||
collective[teamStatsStart + i] = this.teamStats[i].containerId;
|
||||
}
|
||||
|
||||
// Save team names
|
||||
int teamNamesStart = ((1 + numStats) + (1 + numTeamStats) + 1);
|
||||
collective[teamNamesStart - 1] = numTeamNames;
|
||||
for (int i = 0; i < numTeamStats; i++)
|
||||
{
|
||||
collective[teamNamesStart + i] = this.teamNames[i].Id;
|
||||
}
|
||||
|
||||
mainContainer.CompressAndUpdate(collective);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
using LibXom.Data;
|
||||
using LibXom.Streams;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LibW4M.Data.Stats
|
||||
{
|
||||
public class StatsContainerData : SaveDataEntry
|
||||
{
|
||||
int[] Values;
|
||||
public StatsContainerData(W4SaveFile fileBelongs, XomContainer mainContainer) : base(fileBelongs, mainContainer)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
using (XomStreamReader reader = new XomStreamReader(new MemoryStream(this.mainContainer.GetData())))
|
||||
{
|
||||
reader.Skip(3);
|
||||
|
||||
Values = reader.ReadInt32Array();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Save()
|
||||
{
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
using (XomStreamWriter writer = new XomStreamWriter(ms))
|
||||
{
|
||||
writer.Skip(3);
|
||||
|
||||
writer.WriteInt32Array(Values);
|
||||
|
||||
ms.Seek(0x00, SeekOrigin.Begin);
|
||||
mainContainer.SetData(ms.ToArray());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -117,6 +117,7 @@ namespace LibW4M.Data.Teams
|
|||
using (XomStreamWriter writer = new XomStreamWriter(ms))
|
||||
{
|
||||
writer.Skip(3);
|
||||
|
||||
writer.WriteCompressedInt(this.Name.Id);
|
||||
writer.WriteCompressedIntArray(this.fileBelongs.XomStringArrayToIntArray(this.Worms));
|
||||
writer.WriteInt32(this.TutorialsDone);
|
||||
|
|
|
@ -18,6 +18,8 @@ namespace LibW4M.Data.WXFE.UnlockableItem
|
|||
public XomString[] UnlockRequirements;
|
||||
public bool UnlockRequirementsMet;
|
||||
|
||||
internal string? nameOverride;
|
||||
|
||||
public UnlockableItemData(W4SaveFile fileBelongs, XomContainer mainContainer) : base(fileBelongs, mainContainer)
|
||||
{
|
||||
}
|
||||
|
@ -25,6 +27,7 @@ namespace LibW4M.Data.WXFE.UnlockableItem
|
|||
{
|
||||
get
|
||||
{
|
||||
if (this.nameOverride is not null) return nameOverride;
|
||||
return this.DescriptionName.Value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<_LastSelectedProfileId>C:\Users\Li\Documents\git\Worms4Editor\LibW4M\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Any CPU</Platform>
|
||||
<PublishDir>bin\Release\net7.0\publish\win-x86\</PublishDir>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<_TargetId>Folder</_TargetId>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
|
||||
<SelfContained>true</SelfContained>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<PublishReadyToRun>true</PublishReadyToRun>
|
||||
<PublishTrimmed>false</PublishTrimmed>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<History>False|2023-02-18T17:31:12.6646298Z;</History>
|
||||
<LastFailureDetails />
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -1,27 +1,47 @@
|
|||
using LibW4M.Data;
|
||||
using LibW4M.Data.Highscores;
|
||||
using LibW4M.Data.Schemes;
|
||||
using LibW4M.Data.Stats;
|
||||
using LibW4M.Data.Teams;
|
||||
using LibW4M.Data.WeaponFactory;
|
||||
using LibW4M.Data.WXFE;
|
||||
using LibW4M.Data.WXFE.UnlockableItem;
|
||||
using LibW4M.Data.X;
|
||||
using LibXom;
|
||||
using LibXom.Blocks;
|
||||
using LibXom.Data;
|
||||
using LibXom.Exceptions;
|
||||
using LibXom.Streams;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Xml.XPath;
|
||||
|
||||
namespace LibW4M
|
||||
{
|
||||
public class W4SaveFile
|
||||
{
|
||||
public const int PS2_MAX_SZ = 0x20000;
|
||||
|
||||
private List<UnlockableItemData> unlockableItems;
|
||||
private XomFile xomFile;
|
||||
|
||||
public DataBank XDataBank;
|
||||
|
||||
|
||||
public WeaponsCollective WeaponFactoryCollective;
|
||||
public TeamsCollective TeamDataColective;
|
||||
public SchemesCollective SchemesCollective;
|
||||
public HighscoreCollective HighscoreCollective;
|
||||
public StatsCollective StatsCollective;
|
||||
|
||||
|
||||
public UnlockableItemData[] UnlockableItems
|
||||
{
|
||||
get
|
||||
{
|
||||
return unlockableItems.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal WeaponData findWeaponWithContainerId(int containerId)
|
||||
{
|
||||
|
@ -40,6 +60,7 @@ namespace LibW4M
|
|||
|
||||
public void Load()
|
||||
{
|
||||
unlockableItems = new List<UnlockableItemData>();
|
||||
XDataBank = new DataBank(this, this.xomFile.GetTypeByName("XDataBank").Containers.First());
|
||||
|
||||
foreach(ContainerResourceDetail containerResourceDetail in XDataBank.ContainerResourceDetails)
|
||||
|
@ -56,24 +77,98 @@ namespace LibW4M
|
|||
case "DATA.Schemes":
|
||||
SchemesCollective = new SchemesCollective(this, containerResourceDetail.Value);
|
||||
break;
|
||||
case "PersistStats":
|
||||
StatsCollective = new StatsCollective(this, containerResourceDetail.Value);
|
||||
break;
|
||||
|
||||
default:
|
||||
Console.Error.WriteLine("Unknown container resource: " + containerResourceDetail.Value);
|
||||
|
||||
// stupid hack; the only other option is manually hardcoding every unlockable item in the game
|
||||
// but this way atleast allows for it to be more generic incase for some reason not all (or more) are present.
|
||||
|
||||
// Team17, why isnt there a collective for this?
|
||||
if (containerResourceDetail.Value.Type.Name.Equals("WXFE_UnlockableItem", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
UnlockableItemData itemData = new UnlockableItemData(this, containerResourceDetail.Value);
|
||||
itemData.nameOverride = containerResourceDetail.Name.Value;
|
||||
|
||||
unlockableItems.Add(itemData);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Error.WriteLine("Unknown container resource: " + containerResourceDetail.Value);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Save(string newXom)
|
||||
private void saveData()
|
||||
{
|
||||
|
||||
XDataBank.Save();
|
||||
|
||||
WeaponFactoryCollective.Save();
|
||||
TeamDataColective.Save();
|
||||
HighscoreCollective.Save();
|
||||
SchemesCollective.Save();
|
||||
StatsCollective.Save();
|
||||
|
||||
foreach (UnlockableItemData unlockableItem in UnlockableItems)
|
||||
unlockableItem.Save();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void SavePS2(string newXom)
|
||||
{
|
||||
// Remove all stats ...
|
||||
foreach(StatsContainerData stat in StatsCollective.ToArray())
|
||||
StatsCollective.Delete(stat);
|
||||
|
||||
// Save changes
|
||||
saveData();
|
||||
|
||||
using(FileStream fs = File.OpenWrite(newXom))
|
||||
{
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
using (XomStreamReader reader = new XomStreamReader(ms))
|
||||
{
|
||||
using (XomStreamWriter writer = new XomStreamWriter(ms))
|
||||
{
|
||||
XomWriter.WriteXom(xomFile, ms);
|
||||
|
||||
// Set size to ps2 save size.
|
||||
|
||||
ms.SetLength(PS2_MAX_SZ);
|
||||
ms.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
// Calculate checksum
|
||||
|
||||
Int64 chk = 0;
|
||||
|
||||
for (int i = 0; i < (PS2_MAX_SZ - 4); i += 4)
|
||||
{
|
||||
int c = reader.ReadInt32();
|
||||
chk = (chk + c) & UInt32.MaxValue;
|
||||
}
|
||||
|
||||
writer.WriteUInt32(Convert.ToUInt32(chk));
|
||||
|
||||
|
||||
ms.Seek(0, SeekOrigin.Begin);
|
||||
ms.CopyTo(fs);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public void Save(string newXom)
|
||||
{
|
||||
saveData();
|
||||
|
||||
XomWriter.WriteXom(xomFile, newXom);
|
||||
}
|
||||
|
@ -153,6 +248,7 @@ namespace LibW4M
|
|||
this.xomFile = w4Save;
|
||||
|
||||
Load();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -46,6 +46,11 @@ namespace LibXom
|
|||
return new CtnrBlock(buffer.ToArray());
|
||||
}
|
||||
}
|
||||
|
||||
// remove last 2 for EOF
|
||||
buffer.RemoveAt(buffer.Count-1);
|
||||
buffer.RemoveAt(buffer.Count-1);
|
||||
|
||||
return new CtnrBlock(buffer.ToArray());
|
||||
}
|
||||
|
||||
|
|
|
@ -75,19 +75,34 @@ namespace LibXom
|
|||
if (block is CtnrBlock) writeCtnr(block as CtnrBlock);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static void WriteXom(XomFile xfile, Stream output)
|
||||
{
|
||||
XomWriter writer = new XomWriter(output, xfile);
|
||||
writer.writeBlocks(xfile.generateBlocks());
|
||||
|
||||
output.WriteByte(0);
|
||||
output.WriteByte(0);
|
||||
}
|
||||
public static byte[] WriteXom(XomFile xfile)
|
||||
{
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
WriteXom(xfile, ms);
|
||||
|
||||
ms.Seek(0, SeekOrigin.Begin);
|
||||
return ms.ToArray();
|
||||
}
|
||||
}
|
||||
public static void WriteXom(XomFile xfile, string filename)
|
||||
{
|
||||
using(FileStream fs = File.OpenWrite(filename))
|
||||
{
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
XomWriter writer = new XomWriter(ms, xfile);
|
||||
writer.writeBlocks(writer.xomFile.generateBlocks());
|
||||
ms.Seek(0, SeekOrigin.Begin);
|
||||
ms.CopyTo(fs);
|
||||
}
|
||||
byte[] xData = WriteXom(xfile);
|
||||
fs.Write(xData, 0, xData.Length);
|
||||
}
|
||||
}
|
||||
internal XomWriter(Stream xomStream, XomFile xomFile)
|
||||
|
|
|
@ -15,6 +15,7 @@ namespace W4Gui.Components
|
|||
{
|
||||
this.SelectedIndexChanged += selectedIndexChanged;
|
||||
}
|
||||
private int totalUntitled = 0;
|
||||
private int lastSelected = -1;
|
||||
public int LastSelected
|
||||
{
|
||||
|
@ -89,9 +90,20 @@ namespace W4Gui.Components
|
|||
this.Items.RemoveAt(idx);
|
||||
}
|
||||
|
||||
private string processName(string name)
|
||||
{
|
||||
if(name == "")
|
||||
{
|
||||
totalUntitled++;
|
||||
return "Untitled " + totalUntitled.ToString();
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
public void UpdateName(int idx, string name)
|
||||
{
|
||||
this.Items[idx] = name;
|
||||
if(name != "")
|
||||
this.Items[idx] = name;
|
||||
}
|
||||
|
||||
public void LoadArray(SaveDataEntry[] arr)
|
||||
|
@ -101,7 +113,7 @@ namespace W4Gui.Components
|
|||
for (int i = 0; i < arr.Length; i++)
|
||||
{
|
||||
string name = arr[i].FriendlyName;
|
||||
this.Items.Add(name);
|
||||
this.Items.Add(processName(name));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -112,7 +124,7 @@ namespace W4Gui.Components
|
|||
for (int i = 0; i < collective.Length; i++)
|
||||
{
|
||||
string name = collective[i].FriendlyName;
|
||||
this.Items.Add(name);
|
||||
this.Items.Add(processName(name));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,272 @@
|
|||
namespace W4Gui.Components
|
||||
{
|
||||
partial class UnlockableItemsPanel
|
||||
{
|
||||
/// <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 Component 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.schemeTabControl = new System.Windows.Forms.TabControl();
|
||||
this.generalTab = new System.Windows.Forms.TabPage();
|
||||
this.tblUnlockableItemDetails = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.lblType = new System.Windows.Forms.Label();
|
||||
this.lblState = new System.Windows.Forms.Label();
|
||||
this.lblDescriptionName = new System.Windows.Forms.Label();
|
||||
this.lblUnlockRequirements = new System.Windows.Forms.Label();
|
||||
this.selType = new W4Gui.Components.IntUpDown();
|
||||
this.selState = new W4Gui.Components.IntUpDown();
|
||||
this.selDescriptionName = new System.Windows.Forms.TextBox();
|
||||
this.selUnlockRequirements = new W4Gui.Components.ListAddUpdateDel();
|
||||
this.lblDescription = new System.Windows.Forms.Label();
|
||||
this.selValue = new W4Gui.Components.IntUpDown();
|
||||
this.tblUnlockRequirementsMet = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.selUnlockRequirementsMet = new System.Windows.Forms.CheckBox();
|
||||
this.schemeTabControl.SuspendLayout();
|
||||
this.generalTab.SuspendLayout();
|
||||
this.tblUnlockableItemDetails.SuspendLayout();
|
||||
this.tblUnlockRequirementsMet.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// schemeTabControl
|
||||
//
|
||||
this.schemeTabControl.Controls.Add(this.generalTab);
|
||||
this.schemeTabControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.schemeTabControl.HotTrack = true;
|
||||
this.schemeTabControl.Location = new System.Drawing.Point(0, 0);
|
||||
this.schemeTabControl.Name = "schemeTabControl";
|
||||
this.schemeTabControl.SelectedIndex = 0;
|
||||
this.schemeTabControl.Size = new System.Drawing.Size(817, 469);
|
||||
this.schemeTabControl.TabIndex = 1;
|
||||
//
|
||||
// generalTab
|
||||
//
|
||||
this.generalTab.AutoScroll = true;
|
||||
this.generalTab.BackColor = System.Drawing.Color.Transparent;
|
||||
this.generalTab.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.generalTab.Controls.Add(this.tblUnlockRequirementsMet);
|
||||
this.generalTab.Controls.Add(this.tblUnlockableItemDetails);
|
||||
this.generalTab.Location = new System.Drawing.Point(4, 24);
|
||||
this.generalTab.Name = "generalTab";
|
||||
this.generalTab.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.generalTab.Size = new System.Drawing.Size(809, 441);
|
||||
this.generalTab.TabIndex = 0;
|
||||
this.generalTab.Text = "General";
|
||||
//
|
||||
// tblUnlockableItemDetails
|
||||
//
|
||||
this.tblUnlockableItemDetails.AutoSize = true;
|
||||
this.tblUnlockableItemDetails.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Inset;
|
||||
this.tblUnlockableItemDetails.ColumnCount = 2;
|
||||
this.tblUnlockableItemDetails.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.tblUnlockableItemDetails.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tblUnlockableItemDetails.Controls.Add(this.lblDescription, 0, 2);
|
||||
this.tblUnlockableItemDetails.Controls.Add(this.lblUnlockRequirements, 0, 4);
|
||||
this.tblUnlockableItemDetails.Controls.Add(this.lblDescriptionName, 0, 3);
|
||||
this.tblUnlockableItemDetails.Controls.Add(this.lblState, 0, 1);
|
||||
this.tblUnlockableItemDetails.Controls.Add(this.lblType, 0, 0);
|
||||
this.tblUnlockableItemDetails.Controls.Add(this.selType, 1, 0);
|
||||
this.tblUnlockableItemDetails.Controls.Add(this.selState, 1, 1);
|
||||
this.tblUnlockableItemDetails.Controls.Add(this.selDescriptionName, 1, 2);
|
||||
this.tblUnlockableItemDetails.Controls.Add(this.selUnlockRequirements, 1, 4);
|
||||
this.tblUnlockableItemDetails.Controls.Add(this.selValue, 1, 3);
|
||||
this.tblUnlockableItemDetails.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.tblUnlockableItemDetails.Location = new System.Drawing.Point(3, 3);
|
||||
this.tblUnlockableItemDetails.Name = "tblUnlockableItemDetails";
|
||||
this.tblUnlockableItemDetails.RowCount = 5;
|
||||
this.tblUnlockableItemDetails.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tblUnlockableItemDetails.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tblUnlockableItemDetails.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tblUnlockableItemDetails.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tblUnlockableItemDetails.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tblUnlockableItemDetails.Size = new System.Drawing.Size(782, 435);
|
||||
this.tblUnlockableItemDetails.TabIndex = 0;
|
||||
//
|
||||
// lblType
|
||||
//
|
||||
this.lblType.AutoSize = true;
|
||||
this.lblType.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblType.Location = new System.Drawing.Point(5, 2);
|
||||
this.lblType.Name = "lblType";
|
||||
this.lblType.Size = new System.Drawing.Size(123, 29);
|
||||
this.lblType.TabIndex = 0;
|
||||
this.lblType.Text = "Type:";
|
||||
this.lblType.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// lblState
|
||||
//
|
||||
this.lblState.AutoSize = true;
|
||||
this.lblState.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblState.Location = new System.Drawing.Point(5, 33);
|
||||
this.lblState.Name = "lblState";
|
||||
this.lblState.Size = new System.Drawing.Size(123, 29);
|
||||
this.lblState.TabIndex = 1;
|
||||
this.lblState.Text = "State:";
|
||||
this.lblState.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// lblDescriptionName
|
||||
//
|
||||
this.lblDescriptionName.AutoSize = true;
|
||||
this.lblDescriptionName.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblDescriptionName.Location = new System.Drawing.Point(5, 95);
|
||||
this.lblDescriptionName.Name = "lblDescriptionName";
|
||||
this.lblDescriptionName.Size = new System.Drawing.Size(123, 29);
|
||||
this.lblDescriptionName.TabIndex = 2;
|
||||
this.lblDescriptionName.Text = "Value:";
|
||||
this.lblDescriptionName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// lblUnlockRequirements
|
||||
//
|
||||
this.lblUnlockRequirements.AutoSize = true;
|
||||
this.lblUnlockRequirements.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblUnlockRequirements.Location = new System.Drawing.Point(5, 126);
|
||||
this.lblUnlockRequirements.Name = "lblUnlockRequirements";
|
||||
this.lblUnlockRequirements.Size = new System.Drawing.Size(123, 307);
|
||||
this.lblUnlockRequirements.TabIndex = 3;
|
||||
this.lblUnlockRequirements.Text = "Unlock Requirements:";
|
||||
this.lblUnlockRequirements.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// selType
|
||||
//
|
||||
this.selType.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.selType.Location = new System.Drawing.Point(136, 5);
|
||||
this.selType.Name = "selType";
|
||||
this.selType.Size = new System.Drawing.Size(641, 23);
|
||||
this.selType.TabIndex = 4;
|
||||
this.selType.Text = "0";
|
||||
this.selType.Value = 0;
|
||||
//
|
||||
// selState
|
||||
//
|
||||
this.selState.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.selState.Location = new System.Drawing.Point(136, 36);
|
||||
this.selState.Name = "selState";
|
||||
this.selState.Size = new System.Drawing.Size(641, 23);
|
||||
this.selState.TabIndex = 5;
|
||||
this.selState.Text = "0";
|
||||
this.selState.Value = 0;
|
||||
//
|
||||
// selDescriptionName
|
||||
//
|
||||
this.selDescriptionName.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.selDescriptionName.Location = new System.Drawing.Point(136, 67);
|
||||
this.selDescriptionName.Name = "selDescriptionName";
|
||||
this.selDescriptionName.PlaceholderText = "Unlock Item Description/Name";
|
||||
this.selDescriptionName.Size = new System.Drawing.Size(641, 23);
|
||||
this.selDescriptionName.TabIndex = 6;
|
||||
//
|
||||
// selUnlockRequirements
|
||||
//
|
||||
this.selUnlockRequirements.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.selUnlockRequirements.Location = new System.Drawing.Point(136, 129);
|
||||
this.selUnlockRequirements.Name = "selUnlockRequirements";
|
||||
this.selUnlockRequirements.Size = new System.Drawing.Size(641, 301);
|
||||
this.selUnlockRequirements.TabIndex = 7;
|
||||
//
|
||||
// lblDescription
|
||||
//
|
||||
this.lblDescription.AutoSize = true;
|
||||
this.lblDescription.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblDescription.Location = new System.Drawing.Point(5, 64);
|
||||
this.lblDescription.Name = "lblDescription";
|
||||
this.lblDescription.Size = new System.Drawing.Size(123, 29);
|
||||
this.lblDescription.TabIndex = 8;
|
||||
this.lblDescription.Text = "Description/Name:";
|
||||
this.lblDescription.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// selValue
|
||||
//
|
||||
this.selValue.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.selValue.Location = new System.Drawing.Point(136, 98);
|
||||
this.selValue.Name = "selValue";
|
||||
this.selValue.Size = new System.Drawing.Size(641, 23);
|
||||
this.selValue.TabIndex = 9;
|
||||
this.selValue.Text = "0";
|
||||
this.selValue.Value = 0;
|
||||
//
|
||||
// tblUnlockRequirementsMet
|
||||
//
|
||||
this.tblUnlockRequirementsMet.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Inset;
|
||||
this.tblUnlockRequirementsMet.ColumnCount = 1;
|
||||
this.tblUnlockRequirementsMet.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tblUnlockRequirementsMet.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
|
||||
this.tblUnlockRequirementsMet.Controls.Add(this.selUnlockRequirementsMet, 0, 0);
|
||||
this.tblUnlockRequirementsMet.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.tblUnlockRequirementsMet.Location = new System.Drawing.Point(3, 435);
|
||||
this.tblUnlockRequirementsMet.Name = "tblUnlockRequirementsMet";
|
||||
this.tblUnlockRequirementsMet.RowCount = 1;
|
||||
this.tblUnlockRequirementsMet.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tblUnlockRequirementsMet.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
|
||||
this.tblUnlockRequirementsMet.Size = new System.Drawing.Size(782, 26);
|
||||
this.tblUnlockRequirementsMet.TabIndex = 1;
|
||||
//
|
||||
// selUnlockRequirementsMet
|
||||
//
|
||||
this.selUnlockRequirementsMet.AutoSize = true;
|
||||
this.selUnlockRequirementsMet.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.selUnlockRequirementsMet.Location = new System.Drawing.Point(5, 5);
|
||||
this.selUnlockRequirementsMet.Name = "selUnlockRequirementsMet";
|
||||
this.selUnlockRequirementsMet.Size = new System.Drawing.Size(772, 16);
|
||||
this.selUnlockRequirementsMet.TabIndex = 0;
|
||||
this.selUnlockRequirementsMet.Text = "Unlock Requirements Met";
|
||||
this.selUnlockRequirementsMet.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// UnlockableItemsPanel
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.LightGray;
|
||||
this.Controls.Add(this.schemeTabControl);
|
||||
this.Name = "UnlockableItemsPanel";
|
||||
this.Size = new System.Drawing.Size(817, 469);
|
||||
this.schemeTabControl.ResumeLayout(false);
|
||||
this.generalTab.ResumeLayout(false);
|
||||
this.generalTab.PerformLayout();
|
||||
this.tblUnlockableItemDetails.ResumeLayout(false);
|
||||
this.tblUnlockableItemDetails.PerformLayout();
|
||||
this.tblUnlockRequirementsMet.ResumeLayout(false);
|
||||
this.tblUnlockRequirementsMet.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private TabControl schemeTabControl;
|
||||
private TabPage generalTab;
|
||||
private TableLayoutPanel tblUnlockableItemDetails;
|
||||
private Label lblType;
|
||||
private TableLayoutPanel tblUnlockRequirementsMet;
|
||||
private CheckBox selUnlockRequirementsMet;
|
||||
private Label lblDescription;
|
||||
private Label lblUnlockRequirements;
|
||||
private Label lblDescriptionName;
|
||||
private Label lblState;
|
||||
private IntUpDown selType;
|
||||
private IntUpDown selState;
|
||||
private TextBox selDescriptionName;
|
||||
private ListAddUpdateDel selUnlockRequirements;
|
||||
private IntUpDown selValue;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
using LibW4M.Data.Highscores;
|
||||
using LibW4M.Data.Schemes;
|
||||
using LibW4M.Data.Teams;
|
||||
using LibW4M.Data.WeaponFactory;
|
||||
using LibW4M.Data.WXFE.UnlockableItem;
|
||||
using W4Gui.Dialogs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Forms.VisualStyles;
|
||||
|
||||
namespace W4Gui.Components
|
||||
{
|
||||
public partial class UnlockableItemsPanel : UserControl
|
||||
{
|
||||
public UnlockableItemsPanel()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void LoadUnlockableItem(UnlockableItemData unlockableItem)
|
||||
{
|
||||
this.selType.Value = unlockableItem.Type;
|
||||
this.selState.Value = unlockableItem.State;
|
||||
this.selDescriptionName.Text = unlockableItem.DescriptionName.Value;
|
||||
this.selValue.Value = unlockableItem.Value;
|
||||
this.selUnlockRequirements.LoadData(DataManager.SaveFile.XomStringArrayToStringArray(unlockableItem.UnlockRequirements));
|
||||
this.selUnlockRequirementsMet.Checked = unlockableItem.UnlockRequirementsMet;
|
||||
}
|
||||
|
||||
public void SaveUnlockableItem(ref UnlockableItemData unlockableItem)
|
||||
{
|
||||
unlockableItem.Type = this.selType.Value;
|
||||
unlockableItem.State = this.selState.Value;
|
||||
unlockableItem.DescriptionName = DataManager.SaveFile.LookupString(this.selDescriptionName.Text);
|
||||
unlockableItem.Value = this.selValue.Value;
|
||||
unlockableItem.UnlockRequirements = DataManager.SaveFile.StringArrayToXomStringArray(this.selUnlockRequirements.Items);
|
||||
unlockableItem.UnlockRequirementsMet = this.selUnlockRequirementsMet.Checked;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
<root>
|
||||
<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>
|
|
@ -49,7 +49,10 @@ namespace W4Gui
|
|||
this.highscoreTab = new System.Windows.Forms.TabPage();
|
||||
this.highscoresPage = new W4Gui.Tabs.HighscoresTab();
|
||||
this.unlockItemsTab = new System.Windows.Forms.TabPage();
|
||||
this.unlockableItemsPanel = new W4Gui.Tabs.UnlockableItemsTab();
|
||||
this.inputTab = new System.Windows.Forms.TabPage();
|
||||
this.persistStatsTab = new System.Windows.Forms.TabPage();
|
||||
this.awardsTab = new System.Windows.Forms.TabPage();
|
||||
this.variablesTab = new System.Windows.Forms.TabPage();
|
||||
this.variablesPage = new W4Gui.Tabs.VariablesTab.VariablesTabs();
|
||||
this.mainMenuStrip.SuspendLayout();
|
||||
|
@ -58,6 +61,7 @@ namespace W4Gui
|
|||
this.teamTab.SuspendLayout();
|
||||
this.schemeTab.SuspendLayout();
|
||||
this.highscoreTab.SuspendLayout();
|
||||
this.unlockItemsTab.SuspendLayout();
|
||||
this.variablesTab.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
|
@ -114,6 +118,7 @@ namespace W4Gui
|
|||
this.convertToPS2ToolStripMenuItem.Name = "convertToPS2ToolStripMenuItem";
|
||||
this.convertToPS2ToolStripMenuItem.Size = new System.Drawing.Size(211, 22);
|
||||
this.convertToPS2ToolStripMenuItem.Text = "Convert to PS2";
|
||||
this.convertToPS2ToolStripMenuItem.Click += new System.EventHandler(this.convertToPS2ToolStripMenuItem_Click);
|
||||
//
|
||||
// convertToXboxToolStripMenuItem
|
||||
//
|
||||
|
@ -136,6 +141,8 @@ namespace W4Gui
|
|||
this.mainTabControl.Controls.Add(this.highscoreTab);
|
||||
this.mainTabControl.Controls.Add(this.unlockItemsTab);
|
||||
this.mainTabControl.Controls.Add(this.inputTab);
|
||||
this.mainTabControl.Controls.Add(this.persistStatsTab);
|
||||
this.mainTabControl.Controls.Add(this.awardsTab);
|
||||
this.mainTabControl.Controls.Add(this.variablesTab);
|
||||
this.mainTabControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.mainTabControl.Enabled = false;
|
||||
|
@ -230,6 +237,7 @@ namespace W4Gui
|
|||
// unlockItemsTab
|
||||
//
|
||||
this.unlockItemsTab.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.unlockItemsTab.Controls.Add(this.unlockableItemsPanel);
|
||||
this.unlockItemsTab.Location = new System.Drawing.Point(4, 24);
|
||||
this.unlockItemsTab.Name = "unlockItemsTab";
|
||||
this.unlockItemsTab.Padding = new System.Windows.Forms.Padding(3);
|
||||
|
@ -238,6 +246,14 @@ namespace W4Gui
|
|||
this.unlockItemsTab.Text = "Unlockable Items";
|
||||
this.unlockItemsTab.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// unlockableItemsPanel
|
||||
//
|
||||
this.unlockableItemsPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.unlockableItemsPanel.Location = new System.Drawing.Point(3, 3);
|
||||
this.unlockableItemsPanel.Name = "unlockableItemsPanel";
|
||||
this.unlockableItemsPanel.Size = new System.Drawing.Size(182, 62);
|
||||
this.unlockableItemsPanel.TabIndex = 0;
|
||||
//
|
||||
// inputTab
|
||||
//
|
||||
this.inputTab.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
|
@ -248,6 +264,28 @@ namespace W4Gui
|
|||
this.inputTab.Text = "Input Settings";
|
||||
this.inputTab.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// persistStatsTab
|
||||
//
|
||||
this.persistStatsTab.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.persistStatsTab.Location = new System.Drawing.Point(4, 24);
|
||||
this.persistStatsTab.Name = "persistStatsTab";
|
||||
this.persistStatsTab.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.persistStatsTab.Size = new System.Drawing.Size(192, 72);
|
||||
this.persistStatsTab.TabIndex = 7;
|
||||
this.persistStatsTab.Text = "Persistant Statistics";
|
||||
this.persistStatsTab.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// awardsTab
|
||||
//
|
||||
this.awardsTab.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.awardsTab.Location = new System.Drawing.Point(4, 24);
|
||||
this.awardsTab.Name = "awardsTab";
|
||||
this.awardsTab.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.awardsTab.Size = new System.Drawing.Size(192, 72);
|
||||
this.awardsTab.TabIndex = 8;
|
||||
this.awardsTab.Text = "Awards";
|
||||
this.awardsTab.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// variablesTab
|
||||
//
|
||||
this.variablesTab.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
|
@ -255,18 +293,18 @@ namespace W4Gui
|
|||
this.variablesTab.Location = new System.Drawing.Point(4, 24);
|
||||
this.variablesTab.Name = "variablesTab";
|
||||
this.variablesTab.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.variablesTab.Size = new System.Drawing.Size(905, 509);
|
||||
this.variablesTab.Size = new System.Drawing.Size(192, 72);
|
||||
this.variablesTab.TabIndex = 5;
|
||||
this.variablesTab.Text = "Variables";
|
||||
this.variablesTab.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// variablesPage
|
||||
//
|
||||
this.variablesPage.BackColor = System.Drawing.Color.LightGray;
|
||||
this.variablesPage.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.variablesPage.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.variablesPage.Location = new System.Drawing.Point(3, 3);
|
||||
this.variablesPage.Name = "variablesPage";
|
||||
this.variablesPage.Size = new System.Drawing.Size(895, 499);
|
||||
this.variablesPage.Size = new System.Drawing.Size(182, 62);
|
||||
this.variablesPage.TabIndex = 0;
|
||||
//
|
||||
// Main
|
||||
|
@ -289,6 +327,7 @@ namespace W4Gui
|
|||
this.teamTab.ResumeLayout(false);
|
||||
this.schemeTab.ResumeLayout(false);
|
||||
this.highscoreTab.ResumeLayout(false);
|
||||
this.unlockItemsTab.ResumeLayout(false);
|
||||
this.variablesTab.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
@ -318,5 +357,8 @@ namespace W4Gui
|
|||
private SchemeTab schemesPage;
|
||||
private TabPage unlockItemsTab;
|
||||
private VariablesTabs variablesPage;
|
||||
private UnlockableItemsTab unlockableItemsPanel;
|
||||
private TabPage persistStatsTab;
|
||||
private TabPage awardsTab;
|
||||
}
|
||||
}
|
|
@ -114,5 +114,22 @@ namespace W4Gui
|
|||
|
||||
lastTabIndex = this.mainTabControl.SelectedIndex;
|
||||
}
|
||||
|
||||
private void convertToPS2ToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
SaveFileDialog fd = new SaveFileDialog();
|
||||
fd.Filter = "Worms 4: Mayhem PlayStation 2 Save File|*";
|
||||
fd.Title = "Save Worms 4 PlayStation 2 Save File";
|
||||
fd.FileName = "BESLES-53096W4MA";
|
||||
if (fd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
this.mainTabControl.Enabled = false;
|
||||
|
||||
DataManager.SaveAll();
|
||||
DataManager.SaveFile.SavePS2(fd.FileName);
|
||||
|
||||
this.mainTabControl.Enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
|||
-->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<History>True|2023-01-19T07:41:26.7371208Z;True|2023-01-14T20:06:35.5919106-08:00;True|2023-01-13T16:57:56.0824690-08:00;True|2023-01-11T01:22:28.8737310-08:00;True|2023-01-11T01:16:55.3469226-08:00;</History>
|
||||
<History>True|2023-02-20T10:18:32.2496478Z;True|2023-02-19T06:40:54.2502643+13:00;False|2023-02-16T17:57:46.9563146+13:00;True|2023-01-19T20:41:26.7371208+13:00;True|2023-01-15T17:06:35.5919106+13:00;True|2023-01-14T13:57:56.0824690+13:00;True|2023-01-11T22:22:28.8737310+13:00;True|2023-01-11T22:16:55.3469226+13:00;</History>
|
||||
<LastFailureDetails />
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,98 @@
|
|||
namespace W4Gui.Tabs
|
||||
{
|
||||
partial class UnlockableItemsTab
|
||||
{
|
||||
/// <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 Component 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.unlockableItemsSplitContainer = new System.Windows.Forms.SplitContainer();
|
||||
this.unlockableItemsPanel = new W4Gui.Components.UnlockableItemsPanel();
|
||||
this.unlockableItemsList = new W4Gui.Components.CollectiveListAddDelete();
|
||||
((System.ComponentModel.ISupportInitialize)(this.unlockableItemsSplitContainer)).BeginInit();
|
||||
this.unlockableItemsSplitContainer.Panel1.SuspendLayout();
|
||||
this.unlockableItemsSplitContainer.Panel2.SuspendLayout();
|
||||
this.unlockableItemsSplitContainer.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// unlockableItemsSplitContainer
|
||||
//
|
||||
this.unlockableItemsSplitContainer.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.unlockableItemsSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.unlockableItemsSplitContainer.Location = new System.Drawing.Point(0, 0);
|
||||
this.unlockableItemsSplitContainer.Name = "unlockableItemsSplitContainer";
|
||||
//
|
||||
// unlockableItemsSplitContainer.Panel1
|
||||
//
|
||||
this.unlockableItemsSplitContainer.Panel1.Controls.Add(this.unlockableItemsList);
|
||||
//
|
||||
// unlockableItemsSplitContainer.Panel2
|
||||
//
|
||||
this.unlockableItemsSplitContainer.Panel2.Controls.Add(this.unlockableItemsPanel);
|
||||
this.unlockableItemsSplitContainer.Size = new System.Drawing.Size(797, 464);
|
||||
this.unlockableItemsSplitContainer.SplitterDistance = 265;
|
||||
this.unlockableItemsSplitContainer.TabIndex = 0;
|
||||
//
|
||||
// unlockableItemsPanel
|
||||
//
|
||||
this.unlockableItemsPanel.BackColor = System.Drawing.Color.LightGray;
|
||||
this.unlockableItemsPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.unlockableItemsPanel.Location = new System.Drawing.Point(0, 0);
|
||||
this.unlockableItemsPanel.Name = "unlockableItemsPanel";
|
||||
this.unlockableItemsPanel.Size = new System.Drawing.Size(524, 460);
|
||||
this.unlockableItemsPanel.TabIndex = 0;
|
||||
//
|
||||
// unlockableItemsList
|
||||
//
|
||||
this.unlockableItemsList.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.unlockableItemsList.Location = new System.Drawing.Point(3, 3);
|
||||
this.unlockableItemsList.Name = "teamsList";
|
||||
this.unlockableItemsList.Size = new System.Drawing.Size(261, 460);
|
||||
this.unlockableItemsList.TabIndex = 0;
|
||||
this.unlockableItemsList.NewButton += new System.EventHandler<System.EventArgs>(this.unlockableItemsList_NewButton);
|
||||
this.unlockableItemsList.DeleteButton += new System.EventHandler<System.EventArgs>(this.unlockableItemsList_DeleteButton);
|
||||
//
|
||||
// UnlockableItemsTab
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.unlockableItemsSplitContainer);
|
||||
this.Name = "UnlockableItemsTab";
|
||||
this.Size = new System.Drawing.Size(797, 464);
|
||||
this.unlockableItemsSplitContainer.Panel1.ResumeLayout(false);
|
||||
this.unlockableItemsSplitContainer.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.unlockableItemsSplitContainer)).EndInit();
|
||||
this.unlockableItemsSplitContainer.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private SplitContainer unlockableItemsSplitContainer;
|
||||
private Components.UnlockableItemsPanel unlockableItemsPanel;
|
||||
private Components.CollectiveListAddDelete unlockableItemsList;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
using LibW4M.Data.Highscores;
|
||||
using LibW4M.Data.Teams;
|
||||
using LibW4M.Data.WXFE.UnlockableItem;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace W4Gui.Tabs
|
||||
{
|
||||
public partial class UnlockableItemsTab : TabEntry
|
||||
{
|
||||
public UnlockableItemsTab()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.unlockableItemsList.List.Selected += unlockableItemsList_Selected;
|
||||
this.unlockableItemsList.List.Unselected += unlockableItemsList_Unselected;
|
||||
|
||||
}
|
||||
|
||||
public override void SaveFromControl()
|
||||
{
|
||||
if (this.unlockableItemsList.List.IsItemSelected)
|
||||
unlockableItemsList_Unselected(null, null);
|
||||
}
|
||||
|
||||
public override void LoadIntoControl()
|
||||
{
|
||||
this.unlockableItemsList.List.LoadArray(DataManager.SaveFile.UnlockableItems);
|
||||
unlockableItemsPanel.Enabled = false;
|
||||
}
|
||||
|
||||
private void unlockableItemsList_Unselected(object? sender, EventArgs? e)
|
||||
{
|
||||
UnlockableItemData itemData = DataManager.SaveFile.UnlockableItems[unlockableItemsList.List.LastSelected] as UnlockableItemData;
|
||||
unlockableItemsPanel.SaveUnlockableItem(ref itemData);
|
||||
unlockableItemsList.List.UpdateName(unlockableItemsList.List.LastSelected, itemData.FriendlyName);
|
||||
}
|
||||
|
||||
private void unlockableItemsList_Selected(object? sender, EventArgs? e)
|
||||
{
|
||||
UnlockableItemData itemData = DataManager.SaveFile.UnlockableItems[unlockableItemsList.List.CurrentlySelected] as UnlockableItemData;
|
||||
unlockableItemsPanel.LoadUnlockableItem(itemData);
|
||||
unlockableItemsPanel.Enabled = true;
|
||||
}
|
||||
|
||||
private void unlockableItemsList_NewButton(object sender, EventArgs e)
|
||||
{
|
||||
throw new NotImplementedException("Adding new unlockableItems from here not implemented yet ;)");
|
||||
}
|
||||
|
||||
private void unlockableItemsList_DeleteButton(object sender, EventArgs e)
|
||||
{
|
||||
throw new NotImplementedException("Removing unlockableItems from here not implemented yet ;)");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
<root>
|
||||
<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>
|
|
@ -55,6 +55,7 @@
|
|||
this.varTypeTabControl.Controls.Add(this.stringVariablesTab);
|
||||
this.varTypeTabControl.Controls.Add(this.vectorVariablesTab);
|
||||
this.varTypeTabControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.varTypeTabControl.HotTrack = true;
|
||||
this.varTypeTabControl.Location = new System.Drawing.Point(0, 0);
|
||||
this.varTypeTabControl.Name = "varTypeTabControl";
|
||||
this.varTypeTabControl.SelectedIndex = 0;
|
||||
|
@ -88,7 +89,7 @@
|
|||
this.uIntVariablesTab.Location = new System.Drawing.Point(4, 24);
|
||||
this.uIntVariablesTab.Name = "uIntVariablesTab";
|
||||
this.uIntVariablesTab.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.uIntVariablesTab.Size = new System.Drawing.Size(192, 72);
|
||||
this.uIntVariablesTab.Size = new System.Drawing.Size(877, 474);
|
||||
this.uIntVariablesTab.TabIndex = 2;
|
||||
this.uIntVariablesTab.Text = "UInt32";
|
||||
this.uIntVariablesTab.UseVisualStyleBackColor = true;
|
||||
|
@ -98,7 +99,7 @@
|
|||
this.uintVarsPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.uintVarsPanel.Location = new System.Drawing.Point(3, 3);
|
||||
this.uintVarsPanel.Name = "uintVarsPanel";
|
||||
this.uintVarsPanel.Size = new System.Drawing.Size(182, 62);
|
||||
this.uintVarsPanel.Size = new System.Drawing.Size(867, 464);
|
||||
this.uintVarsPanel.TabIndex = 0;
|
||||
//
|
||||
// floatVariablesTab
|
||||
|
@ -108,7 +109,7 @@
|
|||
this.floatVariablesTab.Location = new System.Drawing.Point(4, 24);
|
||||
this.floatVariablesTab.Name = "floatVariablesTab";
|
||||
this.floatVariablesTab.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.floatVariablesTab.Size = new System.Drawing.Size(192, 72);
|
||||
this.floatVariablesTab.Size = new System.Drawing.Size(877, 474);
|
||||
this.floatVariablesTab.TabIndex = 3;
|
||||
this.floatVariablesTab.Text = "Float";
|
||||
this.floatVariablesTab.UseVisualStyleBackColor = true;
|
||||
|
@ -118,7 +119,7 @@
|
|||
this.floatVarsPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.floatVarsPanel.Location = new System.Drawing.Point(3, 3);
|
||||
this.floatVarsPanel.Name = "floatVarsPanel";
|
||||
this.floatVarsPanel.Size = new System.Drawing.Size(182, 62);
|
||||
this.floatVarsPanel.Size = new System.Drawing.Size(867, 464);
|
||||
this.floatVarsPanel.TabIndex = 0;
|
||||
//
|
||||
// stringVariablesTab
|
||||
|
@ -128,7 +129,7 @@
|
|||
this.stringVariablesTab.Location = new System.Drawing.Point(4, 24);
|
||||
this.stringVariablesTab.Name = "stringVariablesTab";
|
||||
this.stringVariablesTab.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.stringVariablesTab.Size = new System.Drawing.Size(192, 72);
|
||||
this.stringVariablesTab.Size = new System.Drawing.Size(877, 474);
|
||||
this.stringVariablesTab.TabIndex = 4;
|
||||
this.stringVariablesTab.Text = "String";
|
||||
this.stringVariablesTab.UseVisualStyleBackColor = true;
|
||||
|
@ -138,7 +139,7 @@
|
|||
this.stringVarsPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.stringVarsPanel.Location = new System.Drawing.Point(3, 3);
|
||||
this.stringVarsPanel.Name = "stringVarsPanel";
|
||||
this.stringVarsPanel.Size = new System.Drawing.Size(182, 62);
|
||||
this.stringVarsPanel.Size = new System.Drawing.Size(867, 464);
|
||||
this.stringVarsPanel.TabIndex = 0;
|
||||
//
|
||||
// vectorVariablesTab
|
||||
|
@ -148,7 +149,7 @@
|
|||
this.vectorVariablesTab.Location = new System.Drawing.Point(4, 24);
|
||||
this.vectorVariablesTab.Name = "vectorVariablesTab";
|
||||
this.vectorVariablesTab.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.vectorVariablesTab.Size = new System.Drawing.Size(192, 72);
|
||||
this.vectorVariablesTab.Size = new System.Drawing.Size(877, 474);
|
||||
this.vectorVariablesTab.TabIndex = 5;
|
||||
this.vectorVariablesTab.Text = "Vector";
|
||||
this.vectorVariablesTab.UseVisualStyleBackColor = true;
|
||||
|
@ -158,7 +159,7 @@
|
|||
this.vectorVarsPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.vectorVarsPanel.Location = new System.Drawing.Point(3, 3);
|
||||
this.vectorVarsPanel.Name = "vectorVarsPanel";
|
||||
this.vectorVarsPanel.Size = new System.Drawing.Size(182, 62);
|
||||
this.vectorVarsPanel.Size = new System.Drawing.Size(867, 464);
|
||||
this.vectorVarsPanel.TabIndex = 0;
|
||||
//
|
||||
// VariablesTabs
|
||||
|
|
|
@ -9,6 +9,9 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Components\UnlockableItemsPanel.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Components\VariablePanel\VectorVariablePanel.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
|
@ -32,6 +35,7 @@
|
|||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="Tabs\UnlockableItemsTab.cs" />
|
||||
<Compile Update="Tabs\IntVariablesTab.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
|
|
|
@ -67,6 +67,9 @@
|
|||
<Compile Update="Tabs\TeamsTab.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Tabs\UnlockableItemsTab.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Tabs\VariablesTab\IntVariablesTab.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
|
|
Loading…
Reference in New Issue