-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #262 from lastbattle/staging
Quest editor, image upscaling for obj+bg, .NET 8.0
- Loading branch information
Showing
288 changed files
with
29,637 additions
and
18,756 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
[submodule "spine-runtimes"] | ||
path = spine-runtimes | ||
url = https://github.com/EsotericSoftware/spine-runtimes | ||
[submodule "MapleLib"] | ||
path = MapleLib | ||
url = https://github.com/lastbattle/MapleLib | ||
branch = main | ||
[submodule "dockpanelsuite"] | ||
path = dockpanelsuite | ||
url = https://github.com/lastbattle/dockpanelsuiteCore | ||
branch = main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Data; | ||
|
||
namespace HaCreator.Converter | ||
{ | ||
public class BoolToTemplateConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value is bool boolValue && parameter is DataTemplate[] templates && templates.Length == 2) | ||
{ | ||
return boolValue ? templates[0] : templates[1]; | ||
} | ||
return null; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
HaCreator/Converter/CharacterJobTypeToCharacterJobStrConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using MapleLib.WzLib.WzStructure.Data.CharacterStructure; | ||
using MapleLib.WzLib.WzStructure.Data.QuestStructure; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Data; | ||
using System.Windows.Media; | ||
|
||
namespace HaCreator.Converter | ||
{ | ||
public class CharacterJobTypeToCharacterJobStrConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value is CharacterClassType job) | ||
{ | ||
return job.ToString(); | ||
} | ||
return CharacterClassType.NULL.ToString(); | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value is string jobName) | ||
{ | ||
CharacterClassType job = (CharacterClassType)Enum.Parse(typeof(CharacterClassType), jobName); | ||
|
||
return job; | ||
} | ||
return CharacterClassType.NULL; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using MapleLib.WzLib.WzStructure.Data.CharacterStructure; | ||
using System; | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
|
||
namespace HaCreator.Converter | ||
{ | ||
public class CharacterSubJobTypeConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value is long subJob) | ||
{ | ||
return CharacterSubJobFlagTypeExt.ToEnum((int) subJob); | ||
} | ||
return CharacterSubJobFlagType.Adventurer.ToString(); | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value is CharacterSubJobFlagType jobType) | ||
{ | ||
return (long)jobType; | ||
} | ||
return (long) CharacterSubJobFlagType.Adventurer; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Data; | ||
|
||
namespace HaCreator.Converter | ||
{ | ||
public class EnumNameIntValueConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value is Enum enumValue) | ||
{ | ||
string name = enumValue.ToString().Replace("_", " "); | ||
int intValue = System.Convert.ToInt32(enumValue); | ||
|
||
return $"{name} ({intValue})"; | ||
} | ||
return string.Empty; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Data; | ||
|
||
namespace HaCreator.Converter | ||
{ | ||
public class EnumToIntHexValueConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value == null) | ||
return 0; | ||
|
||
Type enumType = value.GetType(); | ||
if (!enumType.IsEnum) | ||
throw new ArgumentException("Value must be an enum", nameof(value)); | ||
|
||
Type underlyingType = Enum.GetUnderlyingType(enumType); | ||
if (underlyingType == typeof(int)) | ||
{ | ||
int intValue = System.Convert.ToInt32(value); | ||
|
||
return string.Format("0x{0:X}", intValue); // Uppercase hex | ||
} | ||
|
||
// If the enum is not based on int, return the original value | ||
return value; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
// Implement if needed, or throw NotImplementedException | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using MapleLib.WzLib.WzStructure.Data.QuestStructure; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Data; | ||
|
||
namespace HaCreator.Converter | ||
{ | ||
public class EnumToIntValueConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value == null) | ||
return 0; | ||
|
||
Type enumType = value.GetType(); | ||
if (!enumType.IsEnum) | ||
throw new ArgumentException("Value must be an enum", nameof(value)); | ||
|
||
Type underlyingType = Enum.GetUnderlyingType(enumType); | ||
if (underlyingType == typeof(int)) | ||
{ | ||
return System.Convert.ToInt32(value); | ||
} | ||
|
||
// If the enum is not based on int, return the original value | ||
return value; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
// Implement if needed, or throw NotImplementedException | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Data; | ||
using System.Windows; | ||
|
||
namespace HaCreator.Converter | ||
{ | ||
public class EnumToVisibilityConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value == null || parameter == null) | ||
return Visibility.Collapsed; | ||
|
||
return value.Equals(parameter) ? Visibility.Visible : Visibility.Collapsed; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Data; | ||
|
||
namespace HaCreator.Converter | ||
{ | ||
|
||
public class ItemIdToItemNameConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value == null) | ||
return string.Empty; | ||
|
||
int itemId = 0; | ||
if (value is int) | ||
{ | ||
itemId = (int)value; | ||
} else | ||
{ | ||
itemId = (int) ((long)value); | ||
} | ||
|
||
const string NO_NAME = "NO NAME"; | ||
|
||
if (!Program.InfoManager.ItemNameCache.ContainsKey(itemId)) | ||
{ | ||
return NO_NAME; | ||
} | ||
Tuple<string, string, string> nameCache = Program.InfoManager.ItemNameCache[itemId]; // // itemid, <item category, item name, item desc> | ||
if (nameCache != null) | ||
{ | ||
return nameCache.Item2; | ||
} | ||
return NO_NAME; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using MapleLib.WzLib.WzStructure.Data.CharacterStructure; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Data; | ||
|
||
namespace HaCreator.Converter | ||
{ | ||
public class JobBitfieldToJobNamesConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
long bitfield = (long)value; | ||
|
||
IEnumerable<string> classNames = Enum.GetValues(typeof(CharacterJobPreBBType)) | ||
.Cast<CharacterJobPreBBType>() | ||
.Where(c => c != CharacterJobPreBBType.None) | ||
.Where(c => ((CharacterJobPreBBType)bitfield).HasFlag(c)) | ||
.Select(c => | ||
{ | ||
string jobName = c.ToString(); | ||
|
||
// Add spaces between words | ||
string ret = string.Concat(jobName.Select(x => char.IsUpper(x) ? " " + x : x.ToString())).Trim(); | ||
return ret; | ||
}); | ||
|
||
if (classNames.Count() == 0) | ||
{ | ||
return string.Empty; | ||
} | ||
return string.Join(", ", classNames); | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
} | ||
} | ||
|
38 changes: 38 additions & 0 deletions
38
HaCreator/Converter/JobClassBitfieldToClassNamesConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using MapleLib.WzLib.WzStructure.Data.CharacterStructure; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Data; | ||
|
||
namespace HaCreator.Converter | ||
{ | ||
public class JobClassBitfieldToClassNamesConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
int bitfield = (int)value; | ||
|
||
IEnumerable<string> classNames = Enum.GetValues(typeof(CharacterClassType)) | ||
.Cast<CharacterClassType>() | ||
.Where(c => c != CharacterClassType.NULL && c != CharacterClassType.UltimateAdventurer) | ||
.Where(c => (bitfield & (1 << (int)c)) != 0) | ||
.Select(c => c.ToString()); | ||
|
||
if (classNames.Count() == 0) | ||
{ | ||
return "ALL CLASSES"; | ||
} | ||
return string.Join(", ", classNames); | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
} | ||
} | ||
|
Oops, something went wrong.