mirror of
https://github.com/kwsch/pkNX.git
synced 2026-04-25 23:36:55 -05:00
Add map tweaker beginnings
Document fields k?
This commit is contained in:
parent
5aad953121
commit
4d7645026c
|
|
@ -15,6 +15,8 @@ public class PlacementArea8_F24
|
|||
[FlatBufferItem(00)] public byte Field_00 { get; set; }
|
||||
[FlatBufferItem(01)] public PlacementAreaUnknownTiny8 Field_01 { get; set; }
|
||||
[FlatBufferItem(02)] public float Field_02 { get; set; }
|
||||
|
||||
public override string ToString() => $"{Field_00}, {Field_02}: {Field_01}";
|
||||
}
|
||||
|
||||
[FlatBufferTable, TypeConverter(typeof(ExpandableObjectConverter))]
|
||||
|
|
@ -23,5 +25,7 @@ public class PlacementAreaUnknownTiny8
|
|||
[FlatBufferItem(00)] public float Field_00 { get; set; }
|
||||
[FlatBufferItem(01)] public float Field_01 { get; set; }
|
||||
[FlatBufferItem(02)] public float Field_02 { get; set; }
|
||||
|
||||
public override string ToString() => $"{Field_00}, {Field_01}, {Field_02}";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
|
@ -692,5 +693,33 @@ public void EditMasterDump()
|
|||
using var md = new DumperSWSH((GameManagerSWSH)ROM);
|
||||
md.ShowDialog();
|
||||
}
|
||||
|
||||
public void EditPlacement()
|
||||
{
|
||||
var placement = new GFPack(ROM.GetFile(GameFile.Placement)[0]);
|
||||
var area_names = new AHTB(placement.GetDataFileName("AreaNameHashTable.tbl")).ToDictionary();
|
||||
|
||||
List<PlacementArea8Archive> areas = new();
|
||||
List<string> names = new();
|
||||
foreach (var area in area_names)
|
||||
{
|
||||
var areaName = area.Value;
|
||||
var fileName = $"{areaName}.bin";
|
||||
if (placement.GetIndexFileName(fileName) < 0)
|
||||
continue;
|
||||
|
||||
var bin = placement.GetDataFileName(fileName);
|
||||
var data = FlatBufferConverter.DeserializeFrom<PlacementArea8Archive>(bin);
|
||||
|
||||
names.Add(areaName);
|
||||
areas.Add(data);
|
||||
}
|
||||
|
||||
var arr = areas.ToArray();
|
||||
var nameArr = names.ToArray();
|
||||
var cache = new DataCache<PlacementArea8Archive>(arr);
|
||||
var gen = new GenericEditor<PlacementArea8Archive>(cache, nameArr, "Placement", canSave: false);
|
||||
gen.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace pkNX.WinForms
|
|||
{
|
||||
public sealed partial class GenericEditor<T> : Form where T : class
|
||||
{
|
||||
public GenericEditor(DataCache<T> cache, string[] names, string title, Action? randomize = null)
|
||||
public GenericEditor(DataCache<T> cache, string[] names, string title, Action? randomize = null, bool canSave = true)
|
||||
{
|
||||
InitializeComponent();
|
||||
Cache = cache;
|
||||
|
|
@ -16,6 +16,8 @@ public GenericEditor(DataCache<T> cache, string[] names, string title, Action? r
|
|||
|
||||
CB_EntryName.Items.AddRange(names);
|
||||
CB_EntryName.SelectedIndex = 0;
|
||||
if (!canSave)
|
||||
B_Save.Enabled = false;
|
||||
|
||||
if (randomize == null)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user