void IOwnerInfoElement.SetAddressLength(int length)
 {
     lastAddressLength = length;
     if (textOwner.text.Length != length)
     {
         textOwner.text = NFTPromptHUDController.FormatOwnerAddress(address, lastAddressLength);
     }
 }
Esempio n. 2
0
 public void SetUp()
 {
     controller = new NFTPromptHUDController();
     view       = (NFTPromptHUDView)controller.view;
 }
Esempio n. 3
0
        protected override IEnumerator SetUp()
        {
            yield return(base.SetUp());

            controller = new NFTPromptHUDController();
        }
 void IOwnerInfoElement.SetOwner(string ownerAddress)
 {
     address        = ownerAddress;
     textOwner.text = NFTPromptHUDController.FormatOwnerAddress(ownerAddress, lastAddressLength);
 }
Esempio n. 5
0
    void INFTPromptHUDView.SetNFTInfo(NFTInfoSingleAsset info, string comment)
    {
        Show();

        spinnerGeneral.SetActive(false);

        imageNftBackground.color = Color.white;
        backgroundColorSet       = info.backgroundColor != null;
        if (backgroundColorSet)
        {
            imageNftBackground.color = info.backgroundColor.Value;
        }

        textNftName.text = info.name;
        textNftName.gameObject.SetActive(true);

        bool hasMultipleOwners = info.owners.Length > 1;

        if (hasMultipleOwners)
        {
            textMultipleOwner.text = string.Format(MULTIPLE_OWNERS_FORMAT, info.owners.Length);
        }
        else
        {
            textOwner.text = info.owners.Length == 1
                ? NFTPromptHUDController.FormatOwnerAddress(info.owners[0].owner, ADDRESS_MAX_CHARS)
                : NFTPromptHUDController.FormatOwnerAddress("0x0000000000000000000000000000000000000000", ADDRESS_MAX_CHARS);
        }
        textOwner.gameObject.SetActive(!hasMultipleOwners);
        multipleOwnersContainer.gameObject.SetActive(hasMultipleOwners);

        if (!string.IsNullOrEmpty(info.lastSaleAmount))
        {
            textLastSalePrice.text = ShortDecimals(info.lastSaleAmount, 4);
            textLastSalePrice.gameObject.SetActive(true);
        }
        else
        {
            textLastSaleNeverSold.gameObject.SetActive(true);
        }

        if (!string.IsNullOrEmpty(info.currentPrice))
        {
            textPrice.text = ShortDecimals(info.currentPrice, 4);
            textPrice.gameObject.SetActive(true);

            if (info.currentPriceToken != null)
            {
                SetTokenSymbol(textPriceSymbol, info.currentPriceToken.Value.symbol);
            }
        }
        else
        {
            textPriceNotForSale.gameObject.SetActive(true);
        }

        if (info.lastSaleToken != null)
        {
            SetTokenSymbol(textLastSaleSymbol, info.lastSaleToken.Value.symbol);
        }

        if (!string.IsNullOrEmpty(info.description))
        {
            textDescription.text = info.description;
            containerDescription.SetActive(true);
        }

        if (!string.IsNullOrEmpty(comment))
        {
            textComment.text = comment;
            containerComment.SetActive(true);
        }

        textOpenMarketButton.text = "VIEW";
        if (info.marketInfo != null)
        {
            textOpenMarketButton.text = $"{textOpenMarketButton.text} ON {info.marketInfo.Value.name.ToUpper()}";
        }

        marketUrl = null;
        if (!string.IsNullOrEmpty(info.marketLink))
        {
            marketUrl = info.marketLink;
        }
        else if (!string.IsNullOrEmpty(info.assetLink))
        {
            marketUrl = info.assetLink;
        }

        buttonCancel.gameObject.SetActive(true);
        buttonOpenMarket.gameObject.SetActive(true);

        fetchNFTImageRoutine = StartCoroutine(FetchNFTImage(info));
    }
Esempio n. 6
0
    public virtual IHUD CreateHUD(HUDElementID hudElementId)
    {
        IHUD hudElement = null;

        switch (hudElementId)
        {
        case HUDElementID.NONE:
            break;

        case HUDElementID.MINIMAP:
            hudElement = new MinimapHUDController();
            break;

        case HUDElementID.PROFILE_HUD:
            hudElement = new ProfileHUDController();
            break;

        case HUDElementID.NOTIFICATION:
            hudElement = new NotificationHUDController();
            break;

        case HUDElementID.AVATAR_EDITOR:
            hudElement = new AvatarEditorHUDController();
            break;

        case HUDElementID.SETTINGS_PANEL:
            hudElement = new SettingsPanelHUDController();
            break;

        case HUDElementID.EXPRESSIONS:
            hudElement = new ExpressionsHUDController();
            break;

        case HUDElementID.PLAYER_INFO_CARD:
            hudElement = new PlayerInfoCardHUDController();
            break;

        case HUDElementID.AIRDROPPING:
            hudElement = new AirdroppingHUDController();
            break;

        case HUDElementID.TERMS_OF_SERVICE:
            hudElement = new TermsOfServiceHUDController();
            break;

        case HUDElementID.WORLD_CHAT_WINDOW:
            hudElement = new WorldChatWindowHUDController();
            break;

        case HUDElementID.FRIENDS:
            hudElement = new FriendsHUDController();
            break;

        case HUDElementID.PRIVATE_CHAT_WINDOW:
            hudElement = new PrivateChatWindowHUDController();
            break;

        case HUDElementID.TASKBAR:
            hudElement = new TaskbarHUDController();
            break;

        case HUDElementID.MESSAGE_OF_THE_DAY:
            hudElement = new WelcomeHUDController();
            break;

        case HUDElementID.OPEN_EXTERNAL_URL_PROMPT:
            hudElement = new ExternalUrlPromptHUDController();
            break;

        case HUDElementID.NFT_INFO_DIALOG:
            hudElement = new NFTPromptHUDController();
            break;

        case HUDElementID.TELEPORT_DIALOG:
            hudElement = new TeleportPromptHUDController();
            break;

        case HUDElementID.CONTROLS_HUD:
            hudElement = new ControlsHUDController();
            break;

        case HUDElementID.EXPLORE_HUD:
            hudElement = new ExploreHUDController();
            break;

        case HUDElementID.HELP_AND_SUPPORT_HUD:
            hudElement = new HelpAndSupportHUDController();
            break;

        case HUDElementID.USERS_AROUND_LIST_HUD:
            hudElement = new UsersAroundListHUDController();
            break;

        case HUDElementID.GRAPHIC_CARD_WARNING:
            hudElement = new GraphicCardWarningHUDController();
            break;

        case HUDElementID.BUILDER_IN_WORLD_MAIN:
            hudElement = new BuildModeHUDController();
            break;

        case HUDElementID.QUESTS_PANEL:
            hudElement = new QuestsPanelHUDController();
            break;

        case HUDElementID.QUESTS_TRACKER:
            hudElement = new QuestsTrackerHUDController();
            break;

        case HUDElementID.SIGNUP:
            hudElement = new SignupHUDController();
            break;

        case HUDElementID.BUILDER_PROJECTS_PANEL:
            hudElement = new BuilderProjectsPanelController();
            break;

        case HUDElementID.LOADING:
            hudElement = new LoadingHUDController();
            break;

        case HUDElementID.AVATAR_NAMES:
            hudElement = new AvatarNamesHUDController();
            break;
        }

        return(hudElement);
    }