Save_Pet_MenuBack 작업 중...
This commit is contained in:
parent
d5253fcdfa
commit
e1725afaf1
|
|
@ -2021,6 +2021,25 @@ handlers.Save_Skill_Awaken = function(args)
|
|||
return Get_Return(1);
|
||||
}
|
||||
|
||||
handlers.Save_Pet_MenuBack = function(args)
|
||||
{
|
||||
var readonlydata = Get_UserReadOnlyData();
|
||||
var error = Get_Error(readonlydata, args.Token);
|
||||
if (error < 0) return Get_Return(error);
|
||||
|
||||
var urod = Get_JsonUserData(readonlydata);
|
||||
|
||||
if (urod.Pet[args.PetID])
|
||||
{
|
||||
urod.Equip.Equip["Pet"] = args.PetID;
|
||||
Add_MissionCount(Get_MissionTable(), urod, "PET_MOUNT_LIMIT", 0, 1);
|
||||
}
|
||||
|
||||
Set_JsonUserData(urod);
|
||||
return Get_Return(0, {
|
||||
equipPetID: urod.Equip.Equip["Pet"]
|
||||
});
|
||||
}
|
||||
handlers.Save_Pet_Gacha = function(args)
|
||||
{
|
||||
var readonlydata = Get_UserReadOnlyData();
|
||||
|
|
|
|||
|
|
@ -3164,6 +3164,10 @@ public class SC_EquipmentMenuBackResult
|
|||
public List<SD_Slot_Read> Slot;
|
||||
public List<SC_Items> AllEnchantAmount;
|
||||
}
|
||||
public class SC_PetMenuBackResult
|
||||
{
|
||||
public int equipPetID;
|
||||
}
|
||||
public class SC_PetGachaResult
|
||||
{
|
||||
public int gem;
|
||||
|
|
|
|||
|
|
@ -1888,6 +1888,36 @@ public class ServerInfo : MyCoroutine
|
|||
});
|
||||
}
|
||||
|
||||
public void Save_Pet_MenuBack(int petid, Action<SC_PetMenuBackResult> _act)
|
||||
{
|
||||
NetWait.Ins.Set(true);
|
||||
PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest
|
||||
{
|
||||
FunctionName = MethodBase.GetCurrentMethod().Name,
|
||||
GeneratePlayStreamEvent = true,
|
||||
FunctionParameter = new
|
||||
{
|
||||
Token = m_LoginInfo.EntityToken.EntityToken,
|
||||
PetID = petid,
|
||||
}
|
||||
},
|
||||
result =>
|
||||
{
|
||||
if (result.Error == null)
|
||||
{
|
||||
NetWait.Ins.Set(false);
|
||||
var str_result = result.FunctionResult.ToString();
|
||||
var error = MyErrorCheck(str_result);
|
||||
_act?.Invoke(JsonConvert.DeserializeObject<SC_PetMenuBackResult>(str_result));
|
||||
}
|
||||
else
|
||||
Set_Coroutine(() => { Save_Pet_MenuBack(petid, _act); }, 2f);
|
||||
},
|
||||
fail =>
|
||||
{
|
||||
Set_Coroutine(() => { Save_Pet_MenuBack(petid, _act); }, 2f);
|
||||
});
|
||||
}
|
||||
public void Save_Pet_Gacha(bool isad, int amount, Action<SC_PetGachaResult> _act)
|
||||
{
|
||||
NetWait.Ins.Set(true);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
public class PetUI : BotMenuBase
|
||||
{
|
||||
public PetUI_Left m_PetUI_Left;
|
||||
|
|
@ -5,11 +7,36 @@ public class PetUI : BotMenuBase
|
|||
public PetSkillDetailUI m_PetSkillDetailUI;
|
||||
public PetInfoDetailUI m_PetInfoDetailUI;
|
||||
|
||||
Dictionary<eItem, int> dic_EnterID = new Dictionary<eItem, int> { { eItem.Pet, 0 } };
|
||||
|
||||
public override void Set()
|
||||
{
|
||||
base.Set();
|
||||
m_PetUI_Right.Set(); // left 포함
|
||||
|
||||
Set_Money(table_GlobalValue.Ins.Get_Int("n_CashItemID"), table_GlobalValue.Ins.Get_Int("n_PetReinforceMaterialID"));
|
||||
Set_EnterID(eItem.Pet, ServerInfo.Ins.m_ServerData.Get_EqiupmentEquip(eItem.Pet));
|
||||
}
|
||||
|
||||
public void Set_EnterID(eItem item, int id) { dic_EnterID[item] = id; }
|
||||
public int Get_EnterID(eItem item) { return dic_EnterID[item]; }
|
||||
|
||||
public override void OnClick_Back()
|
||||
{
|
||||
var sdata = ServerInfo.Ins.m_ServerData;
|
||||
bool changePet = Get_EnterID(eItem.Pet) > 0 && Get_EnterID(eItem.Pet) != sdata.Get_EqiupmentEquip(eItem.Pet);
|
||||
|
||||
if (changePet)
|
||||
{
|
||||
ServerInfo.Ins.Save_Pet_MenuBack(Get_EnterID(eItem.Pet), result =>
|
||||
{
|
||||
sdata.Equip.Set_Equip(eItem.Pet, result.equipPetID);
|
||||
PCInfo.Ins.Make_Pet(false, sdata, MyValue.MyPC);
|
||||
sdata.Add_MissionCount(ePurpose.PET_MOUNT_LIMIT);
|
||||
base.OnClick_Back();
|
||||
});
|
||||
}
|
||||
else
|
||||
base.OnClick_Back();
|
||||
}
|
||||
}
|
||||
|
|
@ -95,14 +95,13 @@ public class PetUI_Right : uScrollViewMgr
|
|||
{
|
||||
if (CanEquip())
|
||||
{
|
||||
ServerInfo.Ins.Save_Pet_Equip(Get_SelectPetData().n_PetID, () =>
|
||||
{
|
||||
//ServerInfo.Ins.Save_Pet_Equip(Get_SelectPetData().n_PetID, () =>
|
||||
//{
|
||||
var sdata = ServerInfo.Ins.m_ServerData;
|
||||
sdata.Equip.Set_Equip(eItem.Pet, Get_SelectPetData().n_PetID);
|
||||
PCInfo.Ins.Make_Pet(false, sdata, MyValue.MyPC);
|
||||
Set();
|
||||
sdata.Add_MissionCount(ePurpose.PET_MOUNT_LIMIT);
|
||||
});
|
||||
//sdata.Add_MissionCount(ePurpose.PET_MOUNT_LIMIT);
|
||||
//});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue