180 lines
8.1 KiB
C++
180 lines
8.1 KiB
C++
|
|
#pragma once
|
||
|
|
|
||
|
|
#include <optional>
|
||
|
|
|
||
|
|
#include "UnrealWrapper.hpp"
|
||
|
|
#include "UmgTypes.hpp"
|
||
|
|
#include "Widget.hpp"
|
||
|
|
#include "UserWidget.hpp"
|
||
|
|
#include "WidgetTree.hpp"
|
||
|
|
#include "CanvasPanel.hpp"
|
||
|
|
#include "Overlay.hpp"
|
||
|
|
#include "TextBlock.hpp"
|
||
|
|
|
||
|
|
namespace PalUIExtension::Api
|
||
|
|
{
|
||
|
|
class PalCommonCharacterSlot : public UserWidget
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
static auto ClassPath() -> const TCHAR*
|
||
|
|
{
|
||
|
|
return STR("/Game/Pal/Blueprint/UI/Thumbnails/Character/WBP_PalCommonCharacterSlot.WBP_PalCommonCharacterSlot_C");
|
||
|
|
}
|
||
|
|
static auto DebugTag() -> const TCHAR* { return STR("PalCharacterSlot"); }
|
||
|
|
|
||
|
|
PalCommonCharacterSlot() = default;
|
||
|
|
explicit PalCommonCharacterSlot(UObject* Obj)
|
||
|
|
: UserWidget(Obj, ClassOf<PalCommonCharacterSlot>(), DebugTag()) {}
|
||
|
|
|
||
|
|
// ==============================================================
|
||
|
|
// ANCHORS
|
||
|
|
// ==============================================================
|
||
|
|
|
||
|
|
auto IconOverlay() -> Overlay
|
||
|
|
{
|
||
|
|
return Child<Overlay>(STR("Overlay_60"));
|
||
|
|
}
|
||
|
|
|
||
|
|
auto OverlayAwakening() const -> Overlay { return WrapOverlay(STR("Overlay_Awakening")); }
|
||
|
|
auto OverlayBan() const -> Overlay { return WrapOverlay(STR("Overlay_Ban")); }
|
||
|
|
auto OverlayDoping() const -> Overlay { return WrapOverlay(STR("Overlay_Doping")); }
|
||
|
|
auto OverlayRevive() const -> Overlay { return WrapOverlay(STR("Overlay_Revive")); }
|
||
|
|
|
||
|
|
auto IconWidget() const -> UObject* { return BoundObject(STR("WBP_PalCommonCharacterIcon")); }
|
||
|
|
|
||
|
|
|
||
|
|
auto ImageWorkIcon() const -> UObject* { return BoundObject(STR("Image_IconPalWork")); }
|
||
|
|
auto ImageExpedition() const -> UObject* { return BoundObject(STR("Image_Icon_Expedition")); }
|
||
|
|
auto ImageLocked() const -> UObject* { return BoundObject(STR("Image_Icon_Locked")); }
|
||
|
|
auto ImageGlobalImport() const -> UObject* { return BoundObject(STR("Image_Icon_GlobalInport")); } // engine spelling
|
||
|
|
auto ImageSleep() const -> UObject* { return BoundObject(STR("Image_PalSleep")); }
|
||
|
|
auto ImageMeal() const -> UObject* { return BoundObject(STR("Image_Meal")); }
|
||
|
|
auto ImageMutant() const -> UObject* { return BoundObject(STR("Image_Mutant")); }
|
||
|
|
auto ImageRare() const -> UObject* { return BoundObject(STR("Image_Rare")); }
|
||
|
|
auto ImageStrong() const -> UObject* { return BoundObject(STR("Image_Strong")); }
|
||
|
|
auto ImageLowHealth() const -> UObject* { return BoundObject(STR("Image_PalLowHealth")); }
|
||
|
|
auto ImageDying() const -> UObject* { return BoundObject(STR("Image_PalDying")); }
|
||
|
|
auto ImageBattle() const -> UObject* { return BoundObject(STR("Image_PalBattleImage")); }
|
||
|
|
|
||
|
|
auto TextHPPercent() const -> TextBlock { return WrapText(STR("Text_HPPercent")); }
|
||
|
|
auto TextReviveTimer() const -> TextBlock { return WrapText(STR("Text_ReviveTimer")); }
|
||
|
|
|
||
|
|
// ---- state ----------------------------------------------------
|
||
|
|
|
||
|
|
auto IsBattleModeDisplayed() const -> std::optional<bool> { return PropertyBoolValue(STR("isBattleModeDisplay")); }
|
||
|
|
auto IsLowHealthBlinking() const -> std::optional<bool> { return PropertyBoolValue(STR("isLowHealthBlink")); }
|
||
|
|
auto IsHealthPercentDisplayed()const -> std::optional<bool> { return PropertyBoolValue(STR("isDisplayHealthPercent")); }
|
||
|
|
auto IsRarityDisplayed() const -> std::optional<bool> { return PropertyBoolValue(STR("isDisplayRarity")); }
|
||
|
|
auto LastWorkDetail() const -> std::optional<bool> { return PropertyBoolValue(STR("lastWorkDetail")); }
|
||
|
|
auto IsDopingEffectDisplayed() const -> std::optional<bool> { return PropertyBoolValue(STR("bIsDisplayDopingEffect")); }
|
||
|
|
auto IsFavoriteMarkDisplayed() const -> std::optional<bool> { return PropertyBoolValue(STR("bIsDisplayFavoriteMark")); }
|
||
|
|
auto IsAwakeningMarkDisplayed()const -> std::optional<bool> { return PropertyBoolValue(STR("bIsDisplayAwakeningMark")); }
|
||
|
|
|
||
|
|
auto CachedLastHPPercent() const -> std::optional<double> { return PropertyValue<double>(STR("chachedLastHPPercent")); } // engine spelling
|
||
|
|
|
||
|
|
// ==============================================================
|
||
|
|
// HOOK TARGETS
|
||
|
|
// ==============================================================
|
||
|
|
|
||
|
|
static auto OnUpdateSlotBindedPath() -> const TCHAR*
|
||
|
|
{
|
||
|
|
return STR("/Game/Pal/Blueprint/UI/Thumbnails/Character/WBP_PalCommonCharacterSlot.WBP_PalCommonCharacterSlot_C:On Update Slot Binded");
|
||
|
|
}
|
||
|
|
|
||
|
|
static auto OnInitializedPath() -> const TCHAR*
|
||
|
|
{
|
||
|
|
return STR("/Game/Pal/Blueprint/UI/Thumbnails/Character/"
|
||
|
|
"WBP_PalCommonCharacterSlot.WBP_PalCommonCharacterSlot_C:OnInitialized");
|
||
|
|
}
|
||
|
|
|
||
|
|
static auto OnSetEmptyBindedPath() -> const TCHAR*
|
||
|
|
{
|
||
|
|
return STR("/Game/Pal/Blueprint/UI/Thumbnails/Character/WBP_PalCommonCharacterSlot.WBP_PalCommonCharacterSlot_C:On Set Empty Binded");
|
||
|
|
}
|
||
|
|
|
||
|
|
static auto OnNotifyWorkDetailBindedPath() -> const TCHAR*
|
||
|
|
{
|
||
|
|
return STR("/Game/Pal/Blueprint/UI/Thumbnails/Character/"
|
||
|
|
"WBP_PalCommonCharacterSlot.WBP_PalCommonCharacterSlot_C:OnNotifyWorkDetail_Binded");
|
||
|
|
}
|
||
|
|
static auto DisplayBanMarkPath() -> const TCHAR*
|
||
|
|
{
|
||
|
|
return STR("/Game/Pal/Blueprint/UI/Thumbnails/Character/"
|
||
|
|
"WBP_PalCommonCharacterSlot.WBP_PalCommonCharacterSlot_C:DisplayBanMark");
|
||
|
|
}
|
||
|
|
|
||
|
|
// ---- frames ---------------------------------------------------
|
||
|
|
|
||
|
|
struct UpdateSlotBindedFrame { UObject* TargetSlot; };
|
||
|
|
|
||
|
|
struct BoolFrame { bool bValue; };
|
||
|
|
|
||
|
|
struct RegisterIconWidgetFrame { UObject* IconWidget; };
|
||
|
|
struct UpdateFavoriteFrame { int32 NewIndex; };
|
||
|
|
|
||
|
|
struct UpdateHPFrame
|
||
|
|
{
|
||
|
|
int64 nowHP;
|
||
|
|
int64 nowMaxHP;
|
||
|
|
};
|
||
|
|
|
||
|
|
// On Set Rarity Binded: two adjacent bools.
|
||
|
|
struct SetRarityFrame
|
||
|
|
{
|
||
|
|
bool IsBoss; // 0x00
|
||
|
|
bool IsRare; // 0x01
|
||
|
|
};
|
||
|
|
|
||
|
|
private:
|
||
|
|
auto WrapOverlay(const TCHAR* Name) const -> Overlay
|
||
|
|
{
|
||
|
|
UObject* O = BoundObject(Name);
|
||
|
|
return O ? Overlay{ O } : Overlay{};
|
||
|
|
}
|
||
|
|
auto WrapText(const TCHAR* Name) const -> TextBlock
|
||
|
|
{
|
||
|
|
UObject* O = BoundObject(Name);
|
||
|
|
return O ? TextBlock{ O } : TextBlock{};
|
||
|
|
}
|
||
|
|
|
||
|
|
protected:
|
||
|
|
PalCommonCharacterSlot(UObject* Obj, UClass* Expected, const TCHAR* Tag)
|
||
|
|
: UserWidget(Obj, Expected, Tag) {}
|
||
|
|
};
|
||
|
|
|
||
|
|
|
||
|
|
class PalCommonCharacterIcon : public UserWidget
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
static auto ClassPath() -> const TCHAR*
|
||
|
|
{
|
||
|
|
return STR("/Game/Pal/Blueprint/UI/Thumbnails/Character/WBP_PalCommonCharacterIcon.WBP_PalCommonCharacterIcon_C");
|
||
|
|
}
|
||
|
|
|
||
|
|
static auto DebugTag() -> const TCHAR* { return STR("PalCharacterIcon"); }
|
||
|
|
|
||
|
|
PalCommonCharacterIcon() = default;
|
||
|
|
explicit PalCommonCharacterIcon(UObject* Obj) : UserWidget(Obj, ClassOf<PalCommonCharacterIcon>(), DebugTag()) {}
|
||
|
|
|
||
|
|
auto IconImage() const -> UObject* { return BoundObject(STR("iconImage")); }
|
||
|
|
auto Throbber() const -> UObject* { return BoundObject(STR("CircularThrobber_96")); }
|
||
|
|
auto DynamicMaterial() const -> UObject* { return BoundObject(STR("dynamicMaterial")); }
|
||
|
|
auto IsEmpty() const -> std::optional<bool> { return PropertyBoolValue(STR("IsEmpty")); }
|
||
|
|
auto SphereMaskRadius() const -> std::optional<double> { return PropertyValue<double>(STR("SphereMaskRadius")); }
|
||
|
|
|
||
|
|
|
||
|
|
static auto OnLoadedPath() -> const TCHAR*
|
||
|
|
{
|
||
|
|
return STR("/Game/Pal/Blueprint/UI/Thumbnails/Character/WBP_PalCommonCharacterIcon.WBP_PalCommonCharacterIcon_C:OnLoaded");
|
||
|
|
}
|
||
|
|
static auto OnEmptyPath() -> const TCHAR*
|
||
|
|
{
|
||
|
|
return STR("/Game/Pal/Blueprint/UI/Thumbnails/Character/WBP_PalCommonCharacterIcon.WBP_PalCommonCharacterIcon_C:OnEmpty");
|
||
|
|
}
|
||
|
|
|
||
|
|
protected:
|
||
|
|
PalCommonCharacterIcon(UObject* Obj, UClass* Expected, const TCHAR* Tag)
|
||
|
|
: UserWidget(Obj, Expected, Tag) {}
|
||
|
|
};
|
||
|
|
}
|