XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFEEDToolBox

【WinUI】XFE精英危险工具箱

公开
关注 0 Fork 0 Star 0
UTF-8
namespace XFEEDToolBox.Core.Galaxy;

/// <summary>A verified original movie frame. The path is relative to the app package.</summary>
public sealed record GalaxyOriginalIcon(string FrameName,string AssetPath,int SpriteId,int Frame,bool UsesFallback=false);

/// <summary>
/// Original galaxy UI icon mapping. Bookmark IDs come from 26020A0 and the
/// 261F820 decoder's row+4C field, independently of cockpit location-type IDs.
/// Assets and hashes are recorded in Assets/GalaxyIcons/source.json.
/// </summary>
public static partial class GalaxyOriginalIcons
{
    /// <summary>The exact name returned by the original bookmark conversion function.</summary>
    public static string BookmarkFrameName(uint icon)=>icon switch
    {
        2=>"station_bernal",3=>"station_coriolis",4=>"station_orbis",5=>"station_outpost",
        6=>"surface_port",7=>"surface_settlement",8=>"planet_landable",9=>"planet",10=>"star",
        11=>"asteroid",12=>"system",13=>"megaShip_dockable",14=>"megaShip_undockable",17=>"station_dodec",
        _=>"default"
    };

    /// <summary>Original legacy bookmark-button artwork; this does not select a current world-map marker.</summary>
    public static GalaxyOriginalIcon Bookmark(uint icon)=>icon switch
    {
        2=>Svg("station_bernal","BookmarkBernal",304,31),
        3=>Svg("station_coriolis","BookmarkCoriolis",304,21),
        4=>Svg("station_orbis","BookmarkOrbis",304,41),
        5=>Svg("station_outpost","BookmarkOutpost",304,51),
        6=>Svg("surface_port","BookmarkSurfacePort",304,61),
        7=>Svg("surface_settlement","BookmarkSurfaceSettlement",304,71),
        8=>Svg("planet_landable","BookmarkLandablePlanet",304,81),
        9=>Svg("planet","BookmarkPlanet",304,1),
        10=>Svg("star","BookmarkStar",304,101),
        11=>Svg("asteroid","BookmarkAsteroid",304,111),
        12=>Svg("system","BookmarkSystem",304,11),
        13=>Svg("megaShip_dockable","BookmarkDockableMegaship",304,121),
        14=>Svg("megaShip_undockable","BookmarkUndockableMegaship",304,130),
        // Original conversion recognises this name, but the installed movie
        // has no corresponding frame. Keep an explicit fallback, not a guessed station.
        17=>Svg("station_dodec","BookmarkDefault",304,91) with{UsesFallback=true},
        _=>Svg("default","BookmarkDefault",304,91)
    };

    /// <summary>
    /// Snapshot of ItemMarker.setType in the older labels movie. Its nested
    /// 55-frame pulse keeps playing after the selector stops; these static
    /// exports do not reproduce that animation or the parent's 0.2 scale.
    /// These are rings, not bookmark/category pins or the current world cursor.
    /// </summary>
    public static GalaxyOriginalIcon? ItemMarker(uint type,bool thin=false)=>(type,thin) switch
    {
        (0,false)=>Png("focused","MarkerFocus",9),(0,true)=>Png("focusedThin","MarkerFocusThin",58),
        (1,false)=>Png("selection","MarkerSelection",19),(1,true)=>Png("selectionThin","MarkerSelectionThin",68),
        (2,false)=>Png("location","MarkerLocation",29),(2,true)=>Png("locationThin","MarkerLocationThin",78),
        (3,false)=>Png("conflictZones","MarkerConflictZones",39),(3,true)=>Png("conflictZonesThin","MarkerConflictZonesThin",88),
        (4,false)=>Png("taxi","MarkerTaxi",49),(4,true)=>Png("taxiThin","MarkerTaxiThin",98),
        _=>null
    };

    private static GalaxyOriginalIcon Svg(string name,string asset,int sprite,int frame)=>new(name,"Assets/GalaxyIcons/"+asset+".svg",sprite,frame);
    private static GalaxyOriginalIcon Png(string name,string asset,int frame)=>new(name,"Assets/GalaxyIcons/"+asset+".png",41,frame);
}