Skip to content

Commit

Permalink
UI Files: Many more components
Browse files Browse the repository at this point in the history
  • Loading branch information
Nenkai committed May 31, 2024
1 parent 2216658 commit 73775ce
Show file tree
Hide file tree
Showing 157 changed files with 2,851 additions and 131 deletions.
7 changes: 7 additions & 0 deletions GBFRDataTools.Files/UI/BulkReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ public UIObject ReadObject(List<UIPropertyTypeDef> validProperties)
prop = @byte;
}
break;
case FieldType.U32:
{
var uint32 = new UI_U32();
uint32.Value = this.ReadUInt32();
prop = uint32;
}
break;
case FieldType.Object:
prop = ReadObject(childProperties);
break;
Expand Down
8 changes: 8 additions & 0 deletions GBFRDataTools.Files/UI/BulkWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,14 @@ private long WriteScalar(BinaryStream bs, YamlScalarNode scalarNode, UIPropertyT
else
scalarOffset = _writtenIntegers[value];
}
else if (def.Type == FieldType.U32)
{
uint value = uint.Parse(scalarNode.Value);
if (_writtenIntegers.TryAdd((int)value, scalarOffset))
bs.WriteUInt32(value);
else
scalarOffset = _writtenIntegers[(int)value];
}
else if (def.Type == FieldType.CyanStringHash)
{
uint value = uint.Parse(scalarNode.Value, NumberStyles.HexNumber);
Expand Down
26 changes: 13 additions & 13 deletions GBFRDataTools.Files/UI/Components/Dissolve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ public class Dissolve // : Component
{
public static List<UIPropertyTypeDef> Properties { get; set; } = new()
{
new UIPropertyTypeDef("DissolveTexture", FieldType.ObjectRef,
new("DissolveTexture", FieldType.Object,
[
// ui::SpriteRef
new UIPropertyTypeDef("TexturePath", FieldType.String),
new UIPropertyTypeDef("SpriteName", FieldType.CyanStringHash),
new("TexturePath", FieldType.String),
new("SpriteName", FieldType.CyanStringHash),
]),
new UIPropertyTypeDef("Cutoff", FieldType.F32),
new UIPropertyTypeDef("AddColor1Enabled", FieldType.Bool),
new UIPropertyTypeDef("AddColor1", FieldType.CVec4),
new UIPropertyTypeDef("BorderWidth1", FieldType.F32),
new UIPropertyTypeDef("AddColor2Enabled", FieldType.Bool),
new UIPropertyTypeDef("AddColor2", FieldType.CVec4),
new UIPropertyTypeDef("BorderWidth2", FieldType.F32),
new UIPropertyTypeDef("TrailEnabled", FieldType.Bool),
new UIPropertyTypeDef("TrailWidth", FieldType.F32),
new UIPropertyTypeDef("RenderType", FieldType.S32),
new("Cutoff", FieldType.F32),
new("AddColor1Enabled", FieldType.Bool),
new("AddColor1", FieldType.CVec4),
new("BorderWidth1", FieldType.F32),
new("AddColor2Enabled", FieldType.Bool),
new("AddColor2", FieldType.CVec4),
new("BorderWidth2", FieldType.F32),
new("TrailEnabled", FieldType.Bool),
new("TrailWidth", FieldType.F32),
new("RenderType", FieldType.S32),
};

public static List<UIPropertyTypeDef> GetAllProperties()
Expand Down
26 changes: 26 additions & 0 deletions GBFRDataTools.Files/UI/Components/GaugeFill.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using GBFRDataTools.Hashing;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Components;

// ui::component::GaugeFill
public class GaugeFill // : Gauge
{
public static List<UIPropertyTypeDef> Properties { get; set; } =
[
new("Image", FieldType.ObjectRef),
];

public static List<UIPropertyTypeDef> GetAllProperties()
{
var list = new List<UIPropertyTypeDef>();
list.AddRange(Gauge.GetAllProperties());
list.AddRange(Properties);
return list;
}
}
10 changes: 5 additions & 5 deletions GBFRDataTools.Files/UI/Components/Gauss.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ public class Gauss // : Component
{
public static List<UIPropertyTypeDef> Properties { get; set; } =
[
new UIPropertyTypeDef("Sprite", FieldType.ObjectRef,
new("Sprite", FieldType.Object,
[
// ui::SpriteRef
new UIPropertyTypeDef("TexturePath", FieldType.String),
new UIPropertyTypeDef("SpriteName", FieldType.CyanStringHash),
new("TexturePath", FieldType.String),
new("SpriteName", FieldType.CyanStringHash),
]),
new UIPropertyTypeDef("Rate", FieldType.F32),
new UIPropertyTypeDef("IsFullscreen", FieldType.Bool)
new("Rate", FieldType.F32),
new("IsFullscreen", FieldType.Bool)
];

public static List<UIPropertyTypeDef> GetAllProperties()
Expand Down
2 changes: 1 addition & 1 deletion GBFRDataTools.Files/UI/Components/Image.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Image // : Component
new("FillCenter", FieldType.Bool),
new("FillMethod", FieldType.S32),
new("FillOrigin", FieldType.S32),
new("FillAmount", FieldType.S32),
new("FillAmount", FieldType.F32),
new("UvRect", FieldType.CVec4),
new("RawImage", FieldType.Bool),
new("Clockwise", FieldType.Bool),
Expand Down
2 changes: 1 addition & 1 deletion GBFRDataTools.Files/UI/Components/LanguageSetter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class LanguageSetter // : Component
new("MultiData", FieldType.Bool),
new("LanguageData", FieldType.String),
new("LanguageOverwriteData", FieldType.String),
new("ContainerData", FieldType.String),
new("ContainerData", FieldType.StringVector),

// ui::component::LanguageOverwrite
new("Overwrites", FieldType.ObjectArray,
Expand Down
12 changes: 6 additions & 6 deletions GBFRDataTools.Files/UI/Components/SelectEntranceMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ public class SelectEntranceMenu // : Component
{
public static List<UIPropertyTypeDef> Properties { get; set; } =
[
new("Base03ImageSetters", FieldType.ObjectRef),
new("Add01ImageSetters", FieldType.ObjectRef),
new("Add02ImageSetters", FieldType.ObjectRef),
new("Add03ImageSetters", FieldType.ObjectRef),
new("Add04ImageSetters", FieldType.ObjectRef),
new("ChangeColorImages", FieldType.ObjectRef),
new("Base03ImageSetters", FieldType.ObjectRefVector),
new("Add01ImageSetters", FieldType.ObjectRefVector),
new("Add02ImageSetters", FieldType.ObjectRefVector),
new("Add03ImageSetters", FieldType.ObjectRefVector),
new("Add04ImageSetters", FieldType.ObjectRefVector),
new("ChangeColorImages", FieldType.ObjectRefVector),
];

public static List<UIPropertyTypeDef> GetAllProperties()
Expand Down
2 changes: 1 addition & 1 deletion GBFRDataTools.Files/UI/Components/Shortcut.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class Shortcut // : Component
{
public static List<UIPropertyTypeDef> Properties { get; set; } =
[
new UIPropertyTypeDef("ButtonTypes", FieldType.StringVector),
new UIPropertyTypeDef("ButtonTypes", FieldType.S32Vector),
new UIPropertyTypeDef("ItemButton", FieldType.ObjectRef),
new UIPropertyTypeDef("Button", FieldType.ObjectRef),
new UIPropertyTypeDef("ButtonType", FieldType.S32),
Expand Down
13 changes: 12 additions & 1 deletion GBFRDataTools.Files/UI/Components/SoundContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,19 @@ public class SoundContainer // : Component
new("Other6", FieldType.String),
new("CursorUd", FieldType.String),
new("SelectCancel", FieldType.String),
new(0x7BD8E28E, FieldType.String),
new("TabLr", FieldType.String),
new("CursorLr", FieldType.String),
new("Choice", FieldType.String),
new("Sort", FieldType.String),
new("Remove", FieldType.String),
new("Index", FieldType.String),
new("SelectLock", FieldType.String),
new("Max", FieldType.String),
new(0x691BDEFB, FieldType.String),
new(0x8C106E4D, FieldType.String),
new(0xA033C91A, FieldType.String),
new(0xDA6FFB4E, FieldType.String),
new(0xFBBE3946, FieldType.String),
];

public static List<UIPropertyTypeDef> GetAllProperties()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Blacksmith;

// ui::component::ControllerBlacksmithResult
public class ControllerBlacksmithResult // : Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Blacksmith;

// ui::component::ControllerBlacksmithResult
public class ControllerBlacksmithWeaponList // : Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Common.CursorAction01;

// ui::component::ControllerCursorAction
public class ControllerCursorAction // : Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Common.CursorMission;

// ui::component::ControllerCursorMission01
public class ControllerCursorMission01 // : Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Common.Entrance;

// ui::component::ControllerBlacksmithTop
public class ControllerBlacksmithTop // : Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Common.Entrance;

// ui::component::ControllerQuestCounterMenu
public class ControllerQuestCounterMenu // : Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Common.Entrance;

// ui::component::ControllerSavePointTips
public class ControllerSavePointTips // : Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Common.Entrance;

// ui::component::ControllerTrialTips
public class ControllerTrialTips // : Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Common.Entrance;

// ui::component::ControllerTrialTop
public class ControllerTrialTop // : Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Common.InfoCmn;

// ui::component::ControllerInformationToast
public class ControllerInformationToast // : Controller
Expand All @@ -17,7 +17,7 @@ public class ControllerInformationToast // : Controller
new(0x3F3DDC33, FieldType.ObjectRefVector),
new(0x4A793E4F, FieldType.ObjectRefVector),
new(0x6C95FBA8, FieldType.ObjectRef),
new(0x849799EB, FieldType.ObjectRef),
new(0x849799EB, FieldType.ObjectRefVector),
new("Canvas", FieldType.ObjectRef),
new(0x9C794271, FieldType.ObjectRefVector),
new(0xB4B9959A, FieldType.ObjectRefVector),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Common.Subtitle01;

// ui::component::ControllerSubTitle01
public class ControllerSubTitle01 // : Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Common.Subtitle01;

// ui::component::ControllerSubTitleSkip
public class ControllerSubtitleSkip // : Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Common.Subtitle01;

// ui::component::ControllerSubtitleSkipGuide
public class ControllerSubtitleSkipGuide // : Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Common.Subtitle01;

// ui::component::ControllerSubtitleSkipWait
public class ControllerSubtitleSkipWait // : Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Common.WinCut;

// ui::component::ControllerWinCut
public class ControllerWinCut // : Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Common.WinCut;

// ui::component::ControllerWinCutChoice
public class ControllerWinCutChoice // : Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Common.WinCut;

// ui::component::ControllerWinCutLog
public class ControllerWinCutLog // : Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Common.WinCut;

// ui::component::ControllerWinCutWordList
public class ControllerWinCutWordList // : Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Common.WinCut;

// ui::component::ControllerWinCutWordListButton
public class ControllerWinCutWordListButton // : Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Common.WinCut;

// ui::component::ControllerWinCutWordListInfo01
public class ControllerWinCutWordListInfo01 // : Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Common.WinCut;

// ui::component::ControllerWinCutWordListInfo02
public class ControllerWinCutWordListInfo02 // : Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Common.WinTalk;

// ui::component::ControllerChallengeMissionIcon
public class ControllerChallengeMissionIcon // : Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Text;
using System.Threading.Tasks;

namespace GBFRDataTools.Files.UI.Controllers;
namespace GBFRDataTools.Files.UI.Controllers.Common.WinTalk;

// ui::component::ControllerWinTalk
public class ControllerWinTalk // : Controller
Expand Down
Loading

0 comments on commit 73775ce

Please sign in to comment.