Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staging #272

Merged
merged 36 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
cb06a45
[UnitTest] UnitTest_Perf for stackalloc array benchmark
lastbattle Nov 4, 2024
37a8d41
[HaCreator] fix app crash ExtractItemFile() -- sea v135
lastbattle Nov 5, 2024
eaf9787
[HaRepacker, HaCreator] enable native AOT deployment (tested)
lastbattle Nov 5, 2024
5d0dfed
.
lastbattle Nov 5, 2024
d599176
Update README.md
lastbattle Nov 5, 2024
13d0bce
[HaRepacker] remove copyrighted image
lastbattle Nov 9, 2024
2f545b6
[HaCreator] Fix issues with deleting quests
lastbattle Nov 10, 2024
ce53c56
rollback PublishAot due to issues
lastbattle Nov 17, 2024
5f3717d
[HaCreator] simulator: fix minimap bg 'c' drawing
lastbattle Nov 17, 2024
19f5892
[HaCreator] ITCG preview map
lastbattle Nov 18, 2024
24ffbba
[HaCreator] fix load map history list for maps without ID (MapLogin)
lastbattle Nov 18, 2024
3661c7a
[HaCreator] quest editor - sort quest list by area code
lastbattle Nov 22, 2024
7b8f2e5
[QuestEditor] Add CMS/TMS Potential Type
v3921358 Nov 22, 2024
f668816
Merge pull request #267 from v3921358/CMS-TMS-Potential-Type
lastbattle Nov 22, 2024
d9cfe19
[HaCreator] fix map initialisation for Japan MapleStory (tested v110,…
lastbattle Nov 23, 2024
d25ba19
Merge branch 'staging' of https://github.com/lastbattle/Harepacker-re…
lastbattle Nov 23, 2024
f5f54f4
[HaCreator] fix map simulator MTS button loader for Japan MapleStory …
lastbattle Nov 23, 2024
6315ea9
[HaCreator] quest editor: nebulites for GMS
lastbattle Nov 24, 2024
6230de5
[HaCreator] quest editor: fixed an issue adding new quest 'check' item
lastbattle Nov 24, 2024
fca7e4d
[HaCreator] quest editor: exclude chaos update related items from que…
lastbattle Nov 24, 2024
4aefed2
[HaCreator] quest editor: fix error logger for quests
lastbattle Nov 24, 2024
a701b11
[HaCreator] quest editor: handle 'autoAccept' info property
lastbattle Nov 24, 2024
bc8d952
-
lastbattle Nov 24, 2024
3172686
[HaCreator] quest editor: handle 'autoCompleteAction' info property
lastbattle Nov 24, 2024
58dc5a2
Exclude ".pubxml from gitignore
lastbattle Nov 24, 2024
17639be
[HaCreator] fix initialisation errors with MapleStoryU String,wz (TOD…
lastbattle Nov 24, 2024
e1dccfa
[HaCreator] quest editor: update QuestEditor.xaml.cs -- error log mis…
lastbattle Nov 24, 2024
76a1486
[HaCreator] map simulator: mob name and npc name tooltip rendering
lastbattle Nov 25, 2024
463fe11
[HaCreator] fix prior commit -- mob name tooltip uses white
lastbattle Nov 25, 2024
60b483f
[HaCreator] Start map simulator in a random spawnpoint 'sp'
lastbattle Nov 25, 2024
5f8ce69
[HaCreator] Refractoring MapSimulator (for higher clarity & maintaina…
lastbattle Nov 25, 2024
ca02951
[HaCreator] automatically navigate to the tileSet upon selecting a ne…
lastbattle Nov 25, 2024
e69dc4a
[HaCreator] fix prior commit 5f8ce69bb4dd3388448a512de84ed608ede25c50
lastbattle Nov 26, 2024
f2b6879
Update MapleLib
lastbattle Nov 26, 2024
f1ae893
[HaSharedLibrary] BaseDXDrawableItem performance improvement
lastbattle Nov 27, 2024
53335a9
Update MapleLib
lastbattle Dec 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ publish/
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
# *.pubxml
*.publishproj

# Microsoft Azure Web App publish settings. Comment the next line if you want to
Expand Down
7 changes: 5 additions & 2 deletions HaCreator/CustomControls/MapBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using MapleLib.WzLib.WzStructure;
using System.Data.SQLite;
using HaCreator.GUI.InstanceEditor;
using System.Diagnostics;

namespace HaCreator.CustomControls
{
Expand Down Expand Up @@ -145,6 +146,7 @@ public void InitializeMapsListboxItem(bool special)
if (special)
{
maps.Insert(0, "CashShopPreview");
maps.Insert(1, "ITCPreview");

foreach (string mapLogin in mapLogins)
maps.Insert(0, mapLogin.Replace(".img", ""));
Expand Down Expand Up @@ -186,9 +188,9 @@ public void InitialiseHistoryListboxItem() {
int i = 0;
while (reader.Read()) {
string OpenedMapName = (string)reader["OpenedMapName"];
Console.WriteLine("Entry [" + i + "] Name: '" + OpenedMapName + "'");
Debug.WriteLine("Entry [" + i + "] Name: '" + OpenedMapName + "'");

string mapid_str = OpenedMapName.Substring(0, 9);
string mapid_str = OpenedMapName.Substring(0, Math.Min(OpenedMapName.Length, 9));

if (Program.InfoManager.MapsCache.ContainsKey(mapid_str)) {
Tuple<WzImage, string, string, string, MapInfo> loadedMap = Program.InfoManager.MapsCache[mapid_str];
Expand Down Expand Up @@ -258,6 +260,7 @@ private void mapNamesBox_SelectedIndexChanged(object sender, EventArgs e)
selectedName == "MapLogin4" ||
selectedName == "MapLogin5" ||
selectedName == "CashShopPreview" ||
selectedName == "ITCPreview" ||
selectedName == null)
{
panel_linkWarning.Visible = false;
Expand Down
14 changes: 14 additions & 0 deletions HaCreator/GUI/EditorPanels/TilePanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ private void tileBrowse_Click(object sender, EventArgs e)
}
}

/// <summary>
/// Sets the currently selected tileSet, and refresh the list of tiles
/// </summary>
/// <param name="tileSet"></param>
public void SetSelectedTileSet(string tileSet)
{
if (!Program.InfoManager.TileSets.ContainsKey(tileSet))
return;
tileSetList.SelectedItem = tileSet;

LoadTileSetList();
}

private void tileSetList_SelectedIndexChanged(object sender, EventArgs e)
{
LoadTileSetList();
Expand All @@ -81,6 +94,7 @@ public void LoadTileSetList()
return;
WzImage tileSetImage = Program.InfoManager.TileSets[selectedSetName];
int? mag = InfoTool.GetOptionalInt(tileSetImage["info"]["mag"]);

foreach (WzSubProperty tCat in tileSetImage.WzProperties)
{
if (tCat.Name == "info")
Expand Down
24 changes: 16 additions & 8 deletions HaCreator/GUI/HaRibbon.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -409,20 +409,24 @@ private void UpdateLocalLayerInfo()
actualPlatform = platformBox.SelectedItem == null ? 0 : (int)platformBox.SelectedItem;
}

private void UpdateRemoteLayerInfo()
/// <summary>
///
/// </summary>
/// <param name="tileSet">The tileSet name</param>
private void UpdateRemoteLayerInfo(string tileSet)
{
if (LayerViewChanged != null)
LayerViewChanged.Invoke(actualLayerIndex, actualPlatform, layerCheckbox.IsChecked.Value, (layerCheckbox.IsChecked.Value || platformCheckbox.IsChecked.Value));
LayerViewChanged.Invoke(actualLayerIndex, actualPlatform, layerCheckbox.IsChecked.Value, (layerCheckbox.IsChecked.Value || platformCheckbox.IsChecked.Value), tileSet);
}

private void AllLayerView_Executed(object sender, ExecutedRoutedEventArgs e)
{
UpdateRemoteLayerInfo();
UpdateRemoteLayerInfo(null);
}

private void AllPlatformView_Executed(object sender, ExecutedRoutedEventArgs e)
{
UpdateRemoteLayerInfo();
UpdateRemoteLayerInfo(null);
}

private void LoadPlatformsForLayer(SortedSet<int> zms)
Expand All @@ -443,9 +447,13 @@ private void layerBox_SelectionChanged(object sender, SelectionChangedEventArgs
{
if (!isInternal)
{
LoadPlatformsForLayer(layers[layerBox.SelectedIndex].zMList);
Layer layer = layers[layerBox.SelectedIndex];
var zmList = layer.zMList;
string tileSet = layer.tS;

LoadPlatformsForLayer(zmList);
UpdateLocalLayerInfo();
UpdateRemoteLayerInfo();
UpdateRemoteLayerInfo(tileSet);
}
}

Expand All @@ -454,7 +462,7 @@ private void platformBox_SelectionChanged(object sender, SelectionChangedEventAr
if (!isInternal)
{
UpdateLocalLayerInfo();
UpdateRemoteLayerInfo();
UpdateRemoteLayerInfo(null);
}
}

Expand Down Expand Up @@ -511,7 +519,7 @@ public void SetLayer(Layer layer)
public delegate void EmptyEvent();
public delegate void ViewToggleEvent(bool? tiles, bool? objs, bool? npcs, bool? mobs, bool? reactors, bool? portals, bool? footholds, bool? ropes, bool? chairs, bool? tooltips, bool? backgrounds, bool? misc, bool? mirrorField);
public delegate void ToggleEvent(bool pressed);
public delegate void LayerViewChangedEvent(int layer, int platform, bool allLayers, bool allPlats);
public delegate void LayerViewChangedEvent(int layer, int platform, bool allLayers, bool allPlats, string tileSet);

public event EmptyEvent NewClicked;
public event EmptyEvent OpenClicked;
Expand Down
5 changes: 4 additions & 1 deletion HaCreator/GUI/InfoEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ public InfoEditor(Board board, MapInfo info, MultiBoard multiBoard, System.Windo
case MapType.MapLogin:
IDLabel.Text = "MapLogin";
break;
case MapType.ITCPreview:
IDLabel.Text = "ITCPreview";
break;
case MapType.RegularMap:
if (info.id == -1) IDLabel.Text = "";
else IDLabel.Text = info.id.ToString();
Expand Down Expand Up @@ -424,7 +427,7 @@ protected override void okButton_Click(object sender, EventArgs e)
{
lock (multiBoard)
{
if (info.mapType != MapType.CashShopPreview)
if (info.mapType != MapType.CashShopPreview && info.mapType != MapType.ITCPreview)
{
info.bgm = (string)bgmBox.SelectedItem;
info.mapMark = (string)markBox.SelectedItem;
Expand Down
110 changes: 69 additions & 41 deletions HaCreator/GUI/Initialization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ private void button2_Click(object sender, EventArgs e)
/// <param name="e"></param>
private void debugButton_Click(object sender, EventArgs e)
{
const string OUTPUT_ERROR_FILENAME = "Debug_errors.txt";
const string OUTPUT_ERROR_FILENAME = "Errors_MapDebug.txt";

// This function iterates over all maps in the game and verifies that we recognize all their props
// It is meant to use by the developer(s) to speed up the process of adjusting this program for different MapleStory versions
Expand Down Expand Up @@ -769,16 +769,19 @@ public void ExtractItemFile()
{
string itemId = itemImg.Name;
WzSubProperty itemProp = itemImg as WzSubProperty;
WzCanvasProperty icon = itemProp["info"]?["icon"] as WzCanvasProperty;
if (icon != null)
if (itemProp != null)
{
int intName = 0;
int.TryParse(itemId, out intName);

lock (Program.InfoManager.ItemIconCache)
WzCanvasProperty icon = itemProp?["info"]?["icon"] as WzCanvasProperty;
if (icon != null)
{
if (!Program.InfoManager.ItemIconCache.ContainsKey(intName))
Program.InfoManager.ItemIconCache.Add(intName, icon);
int intName = 0;
int.TryParse(itemId, out intName);

lock (Program.InfoManager.ItemIconCache)
{
if (!Program.InfoManager.ItemIconCache.ContainsKey(intName))
Program.InfoManager.ItemIconCache.Add(intName, icon);
}
}
}
}
Expand Down Expand Up @@ -1086,7 +1089,7 @@ public void ExtractStringFile(bool bIsBetaMapleStory)
{
// In non-beta, process each item within the category
eqpCategorySubProp.WzProperties
.Cast<WzSubProperty>()
//.Cast<WzSubProperty>()
.ToList()
.ForEach(itemProp => ExtractStringFile_ProcessEquipmentItem(
itemProp,
Expand All @@ -1101,22 +1104,30 @@ public void ExtractStringFile(bool bIsBetaMapleStory)
else
stringInsImg = ((WzImage)Program.WzManager.FindWzImageByName("string", "Ins.img")).WzProperties;

foreach (WzSubProperty insItemImg in stringInsImg) // String.wz/Ins.img/3010000
foreach (WzImageProperty insItemImage in stringInsImg) // String.wz/Ins.img/3010000
{
string itemId = insItemImg.Name;
const string itemCategory = "Ins";
string itemName = (insItemImg["name"] as WzStringProperty)?.Value ?? "NO NAME";
string itemDesc = (insItemImg["desc"] as WzStringProperty)?.Value ?? "NO DESC";
if (insItemImage is WzSubProperty insItemSubProp)
{
string itemId = insItemSubProp.Name;
const string itemCategory = "Ins";
string itemName = (insItemSubProp["name"] as WzStringProperty)?.Value ?? "NO NAME";
string itemDesc = (insItemSubProp["desc"] as WzStringProperty)?.Value ?? "NO DESC";

int intName = 0;
int.TryParse(itemId, out intName);
int intName = 0;
int.TryParse(itemId, out intName);

if (!Program.InfoManager.ItemNameCache.ContainsKey(intName))
Program.InfoManager.ItemNameCache[intName] = new Tuple<string, string, string>(itemCategory, itemName, itemDesc);
else
if (!Program.InfoManager.ItemNameCache.ContainsKey(intName))
Program.InfoManager.ItemNameCache[intName] = new Tuple<string, string, string>(itemCategory, itemName, itemDesc);
else
{
string error = string.Format("[Initialization] Duplicate [Ins] item name in String.wz. ItemId='{0}', Category={1}", itemId, insItemSubProp.Name);
ErrorLogger.Log(ErrorLevel.IncorrectStructure, error);
}
} else
{
string error = string.Format("[Initialization] Duplicate [Ins] item name in String.wz. ItemId='{0}', Category={1}", itemId, insItemImg.Name);
ErrorLogger.Log(ErrorLevel.IncorrectStructure, error);
// TOOD: Handle MapleStoryN related items
// WzUOLProperty? or is it a mistake
// Ins/3019381 Ins/3700770 Ins/3700771
}
}

Expand Down Expand Up @@ -1242,23 +1253,30 @@ private void ExtractStringFile_ProcessEtcItem(WzSubProperty itemProp, string par
ErrorLogger.Log(ErrorLevel.IncorrectStructure, error);
}
}
private void ExtractStringFile_ProcessEquipmentItem(WzSubProperty itemProp, string category)
private void ExtractStringFile_ProcessEquipmentItem(WzImageProperty itemImageProp, string category)
{
string itemId = itemProp.Name;
string itemName = (itemProp["name"] as WzStringProperty)?.Value ?? "NO NAME";
string itemDesc = (itemProp["desc"] as WzStringProperty)?.Value ?? "NO DESC";

if (int.TryParse(itemId, out int intName))
if (itemImageProp is WzSubProperty itemProp)
{
if (!Program.InfoManager.ItemNameCache.ContainsKey(intName))
{
Program.InfoManager.ItemNameCache[intName] = new Tuple<string, string, string>(category, itemName, itemDesc);
}
else
string itemId = itemProp.Name;
string itemName = (itemProp["name"] as WzStringProperty)?.Value ?? "NO NAME";
string itemDesc = (itemProp["desc"] as WzStringProperty)?.Value ?? "NO DESC";

if (int.TryParse(itemId, out int intName))
{
string error = $"[Initialization] Duplicate [Equip] item name in String.wz. ItemId='{itemId}', Category={category}";
ErrorLogger.Log(ErrorLevel.IncorrectStructure, error);
if (!Program.InfoManager.ItemNameCache.ContainsKey(intName))
{
Program.InfoManager.ItemNameCache[intName] = new Tuple<string, string, string>(category, itemName, itemDesc);
}
else
{
string error = $"[Initialization] Duplicate [Equip] item name in String.wz. ItemId='{itemId}', Category={category}";
ErrorLogger.Log(ErrorLevel.IncorrectStructure, error);
}
}
} else
{
// TODO: Handle MapleStoryN related equipments
// WzUOLProperty? or is it a mistake
}
}

Expand Down Expand Up @@ -1297,13 +1315,23 @@ public void ExtractMaps() {
streetName = mapNames.Item2;
categoryName = mapNames.Item3;
}
MapInfo info = new MapInfo(mapImage, mapName, streetName, categoryName);
if (mapImage["info"] != null)
{
MapInfo info = new MapInfo(mapImage, mapName, streetName, categoryName);

// Ensure thread safety when writing to the shared resource
lock (Program.InfoManager.MapsCache) {
Program.InfoManager.MapsCache[val.Key] = new Tuple<WzImage, string, string, string, MapInfo>(
mapImage, mapName, streetName, categoryName, info
);
// Ensure thread safety when writing to the shared resource
lock (Program.InfoManager.MapsCache)
{
Program.InfoManager.MapsCache[val.Key] = new Tuple<WzImage, string, string, string, MapInfo>(
mapImage, mapName, streetName, categoryName, info
);
}
} else
{
// Japan Maplestory
// MapID 100020100, 100020101, 120000100, 120000200, 120000201, 120000202, 120000300, 120000301, 120000101
// is missing of "info"
// it is an empty "map".img, likely pre-bb deleted
}
}
//}
Expand Down
30 changes: 24 additions & 6 deletions HaCreator/GUI/Load.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,29 +233,46 @@ private void OnLoadMap(bool bFromHistory) {
if (selectedItem.StartsWith("MapLogin")) // MapLogin, MapLogin1, MapLogin2, MapLogin3
{
List<WzDirectory> uiWzDirs = Program.WzManager.GetWzDirectoriesFromBase("ui");
foreach (WzDirectory uiWzDir in uiWzDirs) {
foreach (WzDirectory uiWzDir in uiWzDirs)
{
mapImage = (WzImage)uiWzDir?[selectedItem + ".img"];
if (mapImage != null)
break;
}
mapName = streetName = categoryName = selectedItem;
info = new MapInfo(mapImage, mapName, streetName, categoryName);
}
else if (selectedItem == "CashShopPreview") {
else if (selectedItem == "CashShopPreview")
{
List<WzDirectory> uiWzDirs = Program.WzManager.GetWzDirectoriesFromBase("ui");
foreach (WzDirectory uiWzDir in uiWzDirs) {
foreach (WzDirectory uiWzDir in uiWzDirs)
{
mapImage = (WzImage)uiWzDir?["CashShopPreview.img"];
if (mapImage != null)
break;
}
mapName = streetName = categoryName = "CashShopPreview";
info = new MapInfo(mapImage, mapName, streetName, categoryName);
}
else {
else if (selectedItem == "ITCPreview")
{
var uiWzDirs = Program.WzManager.GetWzDirectoriesFromBase("ui");
foreach (var uiWzDir in uiWzDirs)
{
mapImage = (WzImage)uiWzDir?["ITCPreview.img"];
if (mapImage != null)
break;
}
mapName = streetName = categoryName = "ITCPreview";
info = new MapInfo(mapImage, mapName, streetName, categoryName);
}
else
{
string mapid_str = selectedItem.Substring(0, 9);
int.TryParse(mapid_str, out mapid);

if (Program.InfoManager.MapsCache.ContainsKey(mapid_str)) {
if (Program.InfoManager.MapsCache.ContainsKey(mapid_str))
{
Tuple<WzImage, string, string, string, MapInfo> loadedMap = Program.InfoManager.MapsCache[mapid_str];

mapImage = loadedMap.Item1;
Expand All @@ -264,7 +281,8 @@ private void OnLoadMap(bool bFromHistory) {
categoryName = loadedMap.Item4;
info = loadedMap.Item5;
}
else {
else
{
MessageBox.Show("Map is missing.", "Error");
return; // map isnt available in Map.wz, despite it being listed on String.wz
}
Expand Down
Loading
Loading