示例#1
0
            public static bool Prefix(WholeMapViewer __instance, ref MapIconData iconData, ref MapIconInfo icon)
            {
                if (!enabled)
                {
                    return(true);
                }
                if (iconData.CurIcon is PresetIcon && (iconData.CurIcon as PresetIcon).IsIcon(MapIcon.TRANSFERPOINT))
                {
                    iconData.iconObject.GetComponent <Image>().raycastTarget = false;
                    UnityEngine.Object.Destroy(iconData.iconObject.GetComponent <MapIconInteractTransfer>());
                    UnityEngine.Object.Destroy(iconData.iconObject.GetComponent <Selectable>());
                }
                iconData.SetCurIcon(icon, __instance.GetHashCode());

                PresetIcon presetIcon = icon as PresetIcon;

                if (icon is PresetIcon && presetIcon.IsIcon(MapIcon.TRANSFERPOINT))
                {
                    (iconData.iconObject as MapIconPoolSprite).SetRaycastTarget(true);
                    if (iconData.iconObject.gameObject.GetComponent <MapIconInteractTransfer>() == null)
                    {
                        iconData.iconObject.gameObject.AddComponent <MapIconInteractTransfer>();
                        iconData.iconObject.gameObject.AddComponent <Selectable>();
                    }
                    iconData.iconObject.gameObject.GetComponent <MapIconInteractTransfer>().SetImap(iconData.imap);
                    int tranId = Singleton <TransferTransIdDataBase> .Self.GetTranId((iconData.imap as SceneItemTransfer_IMap).SItem.ID);

                    string name = (tranId <= 0) ? string.Empty : TextMgr.GetStr(tranId, -1);
                    Dbgl($"name: {name} pos: {iconData.imap.GetPos()}");
                }
                return(false);
            }
示例#2
0
            public static bool Prefix(WholeMapViewer __instance, MapIconData iconData, MapIconInfo icon, float ___curLayerMin, float ___curLayerMax)
            {
                if (!enabled)
                {
                    return(true);
                }
                PresetIcon presetIcon = icon as PresetIcon;

                if (icon.HasInfo(MapType.Transport) && presetIcon != null && presetIcon.IsIcon(MapIcon.TRANSFERPOINT))
                {
                    GameObject parent = (GameObject)typeof(MapViewer).GetMethod("GetIconLayerParent", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(__instance, new object[] { icon.GetIconLayer() });
                    typeof(MapViewer).GetMethod("ShowIcon", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(__instance, new object[] { iconData, parent, icon });
                    typeof(WholeMapViewer).GetMethod("SetIconRectTrans", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(__instance, new object[] { iconData, icon });
                    return(false);
                }
                return(true);
            }
示例#3
0
            public static void Postfix(List <MapIconData> ___listIconPrefabs)
            {
                if (!enabled)
                {
                    return;
                }
                MessageManager.Instance.Unsubscribe("UIOtherMapTransfer", new Action <object[]>(JoyStickConfirm));

                for (int i = 0; i < ___listIconPrefabs.Count; i++)
                {
                    MapIconData iconData = ___listIconPrefabs[i];
                    if (iconData.CurIcon is PresetIcon && (iconData.CurIcon as PresetIcon).IsIcon(MapIcon.TRANSFERPOINT))
                    {
                        UnityEngine.Object.Destroy(iconData.iconObject.GetComponent <MapIconInteractTransfer>());
                        UnityEngine.Object.Destroy(iconData.iconObject.GetComponent <Selectable>());
                    }
                }
            }
示例#4
0
    public static void LoadDate()
    {
        s_tblIconInfo   = new List <MapIconData>();
        s_tblCustomInfo = new List <MapIconData>();
        SqliteDataReader reader = LocalDatabase.Instance.ReadFullTable("Icon");

        while (reader.Read())
        {
            MapIconData fIcon = new MapIconData();
            fIcon.mId       = Convert.ToInt32(reader.GetString(0));
            fIcon.mIconName = reader.GetString(1);
            fIcon.mMaskType = (MapMaskType)Convert.ToInt32(reader.GetString(2));
            if (fIcon.mMaskType == MapMaskType.Custom)
            {
                s_tblCustomInfo.Add(fIcon);
            }
            s_tblIconInfo.Add(fIcon);
        }
    }