Exemplo n.º 1
0
    private void OnTattooLearned(FaustComm.NetResponse msg)
    {
        if (msg.Succeeded)
        {
            TattooRecipeResponse myMsg = msg as TattooRecipeResponse;

            UpdateInforResponseData updateData = myMsg.updateData;

            PlayerInfo.Instance.playerMasteredTattoos.Add(myMsg.tattooID);

            updateData.Broadcast();

            DisplayRecipeInfo();

            _focusItem.SetData(_focusItem.ttData, this);

            SetFocus(_focusItem);

            UIMessageBoxManager.Instance.ShowMessageBox(string.Format(Localization.instance.Get("IDS_MESSAGE_TATTOO_STUDYTATTOO"),
                                                                      _focusItem.ttData.GetDisplayName()), null, MB_TYPE.MB_OK, null);
        }
        else
        {
            UIMessageBoxManager.Instance.ShowMessageBox(Utils.GetErrorIDS(msg.errorCode), null, MB_TYPE.MB_OK, null);
        }
    }
Exemplo n.º 2
0
    private void OnEquipTattoo(FaustComm.NetResponse msg)
    {
        if (msg.Succeeded)
        {
            TattooEquipResponse myMsg = msg as TattooEquipResponse;

            //if current slot is not empty, move the item into inventory
            if (PlayerInfo.Instance.playerTattoos.tattooDict.ContainsKey(SelectedPart))
            {
                ItemInventory oldItem = PlayerInfo.Instance.playerTattoos.tattooDict[SelectedPart];

                PlayerInfo.Instance.PlayerInventory.AddItemInventory(oldItem);
            }

            UpdateInforResponseData updateData = myMsg.updateData;

            updateData.Broadcast();

            //remove the item from inventory. It may not be there, but call removeItem in any case.
            PlayerInfo.Instance.PlayerInventory.RemoveItem(_focusItem.inventoryItem);

            UIMessageBoxManager.Instance.ShowMessageBox(Localization.instance.Get("IDS_TATTOO_ALREADYEQUIPPED"), null, MB_TYPE.MB_OK, null);

            _uiTattoo.RefreshMainPanel();
            this.Initialize(_selectedPart, _uiTattoo);
        }
        else
        {
            UIMessageBoxManager.Instance.ShowMessageBox(Utils.GetErrorIDS(msg.errorCode), null, MB_TYPE.MB_OK, null);
        }
    }
Exemplo n.º 3
0
    public void OnSendBattleSummary(FaustComm.NetResponse msg)
    {
        if (msg.Succeeded)
        {
            ConnectionManager.Instance.SendACK(SendBattleSummary, true);

            UpdateInforResponseData updateData = (msg as BattleEndResponse).updateData;

            if (updateData != null)
            {
                PlayerInfo.Instance.ApplyPlayerPropChanges(updateData.playerPropsList.ToArray());

                PlayerInfo.Instance.PlayerInventory.ApplyItemCountChanges(updateData.itemCountOps);
            }

            updateData.Broadcast();

            StartBattleSummary();
        }
        else
        {
            //show error only
            UIMessageBoxManager.Instance.ShowErrorMessageBox(msg.errorCode, null);

            Debug.LogError("Error passing server check.");
        }
    }
Exemplo n.º 4
0
    private void OnReplaceTattoo(FaustComm.NetResponse msg)
    {
        if (msg.Succeeded)
        {
            TattooEquipResponse myMsg = msg as TattooEquipResponse;

            UpdateInforResponseData updateData = myMsg.updateData;

            updateData.Broadcast();

            UIMessageBoxManager.Instance.ShowMessageBox(Localization.instance.Get("IDS_TATTOO_ALREADYEQUIPPED"), null, MB_TYPE.MB_OK, null);

            _uiTattooMain.RefreshMainPanel();
        }
        else
        {
            UIMessageBoxManager.Instance.ShowMessageBox(Utils.GetErrorIDS(msg.errorCode), null, MB_TYPE.MB_OK, null);
        }
    }
Exemplo n.º 5
0
    private void OnMakeTattoo(FaustComm.NetResponse msg)
    {
        if (msg.Succeeded)
        {
            TattooRecipeResponse myMsg = msg as TattooRecipeResponse;

            UpdateInforResponseData updateData = myMsg.updateData;

            updateData.Broadcast();

            DisplayRecipeInfo();

            UIMessageBoxManager.Instance.ShowMessageBox(Localization.instance.Get("IDS_MESSAGE_TATTOO_FUSIONSUCCESSFUL"), null, MB_TYPE.MB_OK, null);
        }
        else
        {
            //remember this, to fail this battle
            UIMessageBoxManager.Instance.ShowMessageBox(Utils.GetErrorIDS(msg.errorCode), null, MB_TYPE.MB_OK, null);
        }
    }
Exemplo n.º 6
0
    private void OnDisenchant(FaustComm.NetResponse msg)
    {
        if (msg.Succeeded)
        {
            TattooRecipeResponse myMsg = msg as TattooRecipeResponse;

            UpdateInforResponseData updateData = myMsg.updateData;

            updateData.Broadcast();

            this.OnDisable();

            this.OnEnable();

            UIMessageBoxManager.Instance.ShowMessageBox(Localization.instance.Get("IDS_BUTTON_TATTOO_DISENCHANTITEMLIST"), null, MB_TYPE.MB_OK_WITH_ITEMS, null, updateData.itemUpdateList);
        }
        else
        {
            UIMessageBoxManager.Instance.ShowErrorMessageBox(msg.errorCode, "Tattoo");
        }
    }
Exemplo n.º 7
0
    private void OnRemoveTattoo(FaustComm.NetResponse msg)
    {
        if (msg.Succeeded)
        {
            TattooEquipResponse myMsg = msg as TattooEquipResponse;

            UpdateInforResponseData updateData = myMsg.updateData;

            updateData.Broadcast();

            //manually add to inventory
            PlayerInfo.Instance.PlayerInventory.AddItemInventory(_slot.item);

            UIMessageBoxManager.Instance.ShowMessageBox(Localization.instance.Get("IDS_BUTTON_TATTOO_REMOVE"), null, MB_TYPE.MB_OK, OnMsgboxCallback);
        }
        else
        {
            //remember this, to fail this battle
            UIMessageBoxManager.Instance.ShowMessageBox(Utils.GetErrorIDS(msg.errorCode), null, MB_TYPE.MB_OK, null);
        }
    }