Shop

Add-Ons for MFPS.
User avatar
Lovatto
Admin
Admin
Posts: 1541
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

Sat May 09, 2020 4:36 pm

MFPS already have that, if you check in GameData -> Virtual Coins -> Coins Score Value = How much score / XP = 1 coin,
by default is 100, which means that if the player gets 1000 of score at the end of the match, he will get 10 coins.
User avatar
KKHackLabs
Member
Member
Posts: 39
Joined: Thu May 07, 2020 3:34 pm

Sun May 10, 2020 1:36 pm

Nice, I hadn't completed a match during testing and they did not apply.

Another question/bug - When a character is available in the Player Select screen, but has not been purchased, the player button is blacked out, but you can still select the character bypassing the purchase lock.

In the screen, you can see the third character has a price and is blacked out, but you can still click and select the character for use.

Image

Is there a function I need to set or is this possibly a bug?
User avatar
Lovatto
Admin
Admin
Posts: 1541
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

Sun May 10, 2020 7:36 pm

This is a bug, I have fixed, please replace the code of bl_PSOperatorUI.cs with this:

Code: Select all

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

namespace MFPS.PlayerSelector
{
    public class bl_PSOperatorUI : MonoBehaviour
    {

        public Image PreviewImage;
        public GameObject BlockedUI;
        public GameObject SelectedUI;

        private bl_PlayerSelectorLobby Manager;
        private bl_PlayerSelectorInfo cacheInfo;
        public bool isBlocked = false;
        public void SetUp(bl_PlayerSelectorInfo info, bl_PlayerSelectorLobby manager)
        {
            Manager = manager;
            cacheInfo = info;
            PreviewImage.sprite = info.Preview;
            SelectedUI.SetActive(info.isEquipedOne());
#if SHOP && ULSP
            if (info.Price > 0 && bl_DataBase.Instance != null)
            {
                int pID = bl_PlayerSelectorData.Instance.GetPlayerID(info.Name);
                bool unlock = bl_DataBase.Instance.LocalUser.ShopData.isItemPurchase(ShopItemType.PlayerSkin, pID);
                isBlocked = !unlock;
                BlockedUI.SetActive(!unlock);
            }
            else { BlockedUI.SetActive(false); }
#else
            BlockedUI.SetActive(false);
#endif
        }

        public void OnOver()
        {
            Manager.OnShowUpOp(cacheInfo);
        }

        public void OnExit()
        {
            Manager.ShowUpSelectedOne(cacheInfo.team);
        }

        public void SelectThis()
        {
            if (isBlocked) return;
            Manager.SelectOperator(cacheInfo);
            bl_PSOperatorUI[] all = transform.parent.GetComponentsInChildren<bl_PSOperatorUI>();
            foreach(bl_PSOperatorUI ui in all)
            {
                ui.SelectedUI.SetActive(false);
            }
            SelectedUI.SetActive(true);
        }
    }
}
User avatar
KKHackLabs
Member
Member
Posts: 39
Joined: Thu May 07, 2020 3:34 pm

Wed May 13, 2020 6:09 pm

How do you edit the Weapon Names for the integration of the Shop and the Weapon Pack #1?
User avatar
Lovatto
Admin
Admin
Posts: 1541
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

Thu May 14, 2020 4:03 pm

KKHackLabs wrote:
Wed May 13, 2020 6:09 pm
How do you edit the Weapon Names for the integration of the Shop and the Weapon Pack #1?
By editing the weapon info in GameData.

MFPS Resources folder -> GameData -> All Weapons -> [Find your weapon] -> Change the Name.
User avatar
KKHackLabs
Member
Member
Posts: 39
Joined: Thu May 07, 2020 3:34 pm

Tue May 19, 2020 1:51 pm

Are there any available details or docs about paypal integration?

I found where the options are to integrate and the drop down option within Unity, but there are no further details. And, the assetstore link to resource is no longer availble.

Thanks
User avatar
InCodeWeTrust
Contributor
Contributor
Posts: 18
Joined: Wed Mar 27, 2019 10:05 am

Tue Aug 25, 2020 7:27 pm

Found a bug with how the buy coins options works from the main menu.

From the main menu scene, if you click on -> TopMenu -> Profile -> Buy Coins.

It throws this Error:

Code: Select all

NullReferenceException: Object reference not set to an instance of an object
bl_Lobby.ShowBuyCoins () (at Assets/MFPS/Scripts/Network/Lobby/bl_Lobby.cs:596)
From what I can tell the Shop panel is deactivated somewhere in the code during start up.
If the Shop Panel is enabled in the editor before pressing the button it will show the buy coins as normal.

I can't seem to find where its disabling the contents as this is where the issue is.
It should turn of the Shop panel content, not the entire shop game object.

Logging in does not change the error.
User avatar
Lovatto
Admin
Admin
Posts: 1541
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

Wed Aug 26, 2020 7:24 pm

in MFPS 1.7.5, try the following:

in bl_Lobby.cs replace the function ShowBuyCoins() -> with this:

Code: Select all

    public void ShowBuyCoins()
    {
#if SHOP
        bl_LobbyUI.Instance.ChangeWindow("shop");
        bl_ShopManager.Instance.BuyCoinsWindow.SetActive(true);
#else
        Debug.Log("Require shop addon.");
#endif
    }
Post Reply