|
@@ -4,87 +4,6 @@ using System.Collections.Generic;
|
|
|
using UnityEngine;
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
-public class FashionShowData
|
|
|
-{
|
|
|
- public int PraisedAmount;
|
|
|
- public bool Praised;
|
|
|
- public string RefererId;
|
|
|
- public string ShowName;
|
|
|
- public string ShowContent;
|
|
|
- public string CuteRate;
|
|
|
- public string GloryRate;
|
|
|
- public string GraceRate;
|
|
|
- public string SimpleRate;
|
|
|
- public string VividRate;
|
|
|
-
|
|
|
- public List<int> CloseIDs = new List<int>();
|
|
|
-
|
|
|
- public int GetHeadId()
|
|
|
- {
|
|
|
- return CloseIDs[0];
|
|
|
- }
|
|
|
-
|
|
|
- public int GetSkirtId()
|
|
|
- {
|
|
|
- return CloseIDs[1];
|
|
|
- }
|
|
|
-
|
|
|
- public int GetShoeId()
|
|
|
- {
|
|
|
- return CloseIDs[2];
|
|
|
- }
|
|
|
-
|
|
|
- public int GetHeadwearId()
|
|
|
- {
|
|
|
- return CloseIDs[3];
|
|
|
- }
|
|
|
-
|
|
|
- public int GetTopId()
|
|
|
- {
|
|
|
- return CloseIDs[4];
|
|
|
- }
|
|
|
-
|
|
|
- public int GetEyeId()
|
|
|
- {
|
|
|
- return CloseIDs[5];
|
|
|
- }
|
|
|
-
|
|
|
- public int GetMouseId()
|
|
|
- {
|
|
|
- return CloseIDs[6];
|
|
|
- }
|
|
|
-
|
|
|
- public int GetWingId()
|
|
|
- {
|
|
|
- return CloseIDs[7];
|
|
|
- }
|
|
|
-
|
|
|
- public int GetCuteRate()
|
|
|
- {
|
|
|
- return int.Parse(CuteRate);
|
|
|
- }
|
|
|
-
|
|
|
- public int GetGloryRate()
|
|
|
- {
|
|
|
- return int.Parse(GloryRate);
|
|
|
- }
|
|
|
-
|
|
|
- public int GetGraceRate()
|
|
|
- {
|
|
|
- return int.Parse(GraceRate);
|
|
|
- }
|
|
|
-
|
|
|
- public int GetSimpleRate()
|
|
|
- {
|
|
|
- return int.Parse(SimpleRate);
|
|
|
- }
|
|
|
-
|
|
|
- public int GetVividRate()
|
|
|
- {
|
|
|
- return int.Parse(VividRate);
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
public class FashionShowEditPage : Regist
|
|
|
{
|
|
|
#region Config
|
|
@@ -166,7 +85,7 @@ public class FashionShowEditPage : Regist
|
|
|
private static KV<int, double> TotalCoin;
|
|
|
private static KV<int, double> TotalDiamond;
|
|
|
private static TweenRenderer PlayerTween;
|
|
|
- private static FashionShowData FashionShowData;
|
|
|
+ private static GetFashionShowData FashionShowData;
|
|
|
private static List<int> CloseIDs = new List<int>();
|
|
|
//private static List<string> CloseNames = new List<string>();
|
|
|
private static List<FashionShowCloseItem> CloseItems = new List<FashionShowCloseItem>();
|
|
@@ -297,11 +216,11 @@ public class FashionShowEditPage : Regist
|
|
|
}
|
|
|
|
|
|
|
|
|
- public static void ShowEditPanel(FashionShowData data)
|
|
|
+ public static void ShowEditPanel(GetFashionShowData data)
|
|
|
{
|
|
|
BelongSelf = true;
|
|
|
FashionShowData = data;
|
|
|
- CloseIDs = data.CloseIDs;
|
|
|
+ CloseIDs = data.GetCloseIds();
|
|
|
//CloseNames = Player.DressIDToDressName(data.CloseIDs); ;
|
|
|
|
|
|
TransitPanel();
|
|
@@ -309,11 +228,11 @@ public class FashionShowEditPage : Regist
|
|
|
EnterEditMode();
|
|
|
}
|
|
|
|
|
|
- public static void ShowRatePanel(bool belongSelf, FashionShowData data)
|
|
|
+ public static void ShowRatePanel(bool belongSelf, GetFashionShowData data)
|
|
|
{
|
|
|
BelongSelf = belongSelf;
|
|
|
FashionShowData = data;
|
|
|
- CloseIDs = data.CloseIDs;
|
|
|
+ CloseIDs = data.GetCloseIds();
|
|
|
//CloseNames = Player.DressIDToDressName(data.CloseIDs); ;
|
|
|
|
|
|
Panel.TweenForVec();
|
|
@@ -334,20 +253,20 @@ public class FashionShowEditPage : Regist
|
|
|
}
|
|
|
DelayCall.Call(1, () => { DisplayPlayer.ResetDepth(); DisplayPlayer.DisplayInUI(37.5f); });
|
|
|
|
|
|
- float cuteRate = float.Parse(FashionShowData.CuteRate);
|
|
|
- float gloryRate = float.Parse(FashionShowData.GloryRate);
|
|
|
- float graceRate = float.Parse(FashionShowData.GraceRate);
|
|
|
- float simpleRate = float.Parse(FashionShowData.SimpleRate);
|
|
|
- float vividRate = float.Parse(FashionShowData.VividRate);
|
|
|
+ float cuteRate = FashionShowData.GetCuteRate();
|
|
|
+ float gloryRate = FashionShowData.GetGloryRate();
|
|
|
+ float graceRate = FashionShowData.GetGraceRate();
|
|
|
+ float simpleRate = FashionShowData.GetSimpleRate();
|
|
|
+ float vividRate = FashionShowData.GetVividRate();
|
|
|
CuteSlider.value = cuteRate == 0 ? 1 : cuteRate;
|
|
|
GlorySlider.value = cuteRate == 0 ? 1 : gloryRate;
|
|
|
GraceSlider.value = cuteRate == 0 ? 1 : graceRate;
|
|
|
SimpleSlider.value = cuteRate == 0 ? 1 : simpleRate;
|
|
|
VividSlider.value = cuteRate == 0 ? 1 : vividRate;
|
|
|
ShowRateValue();
|
|
|
- FashionTitleInputField.text = FashionShowData.ShowName;
|
|
|
- FashionContentInputField.text = FashionShowData.ShowContent;
|
|
|
- RecommendTitle.text = Language.GetStr(LanguageLabel.UI__Pg_RecommendTitle).Replace(TransferLabel.Value, FashionShowData.RefererId);
|
|
|
+ FashionTitleInputField.text = FashionShowData.title;
|
|
|
+ FashionContentInputField.text = FashionShowData.content;
|
|
|
+ RecommendTitle.text = Language.GetStr(LanguageLabel.UI__Pg_RecommendTitle).Replace(TransferLabel.Value, FashionShowData.playerNickName);
|
|
|
|
|
|
HideRateButton();
|
|
|
DisableRatePanel();
|
|
@@ -375,11 +294,11 @@ public class FashionShowEditPage : Regist
|
|
|
GraceSlider.value = 3;
|
|
|
SimpleSlider.value = 3;
|
|
|
VividSlider.value = 3;
|
|
|
- CuteValue.text = FashionShowData.CuteRate == "0" ? "--" : FashionShowData.CuteRate;
|
|
|
- GloryValue.text = FashionShowData.GloryRate == "0" ? "--" : FashionShowData.GloryRate;
|
|
|
- GraceValue.text = FashionShowData.GraceRate == "0" ? "--" : FashionShowData.GraceRate;
|
|
|
- SimpleValue.text = FashionShowData.SimpleRate == "0" ? "--" : FashionShowData.SimpleRate;
|
|
|
- VividValue.text = FashionShowData.VividRate == "0" ? "--" : FashionShowData.VividRate;
|
|
|
+ CuteValue.text = FashionShowData.cuteScore == 0 ? "--" : FashionShowData.GetCuteRate().ToString("0.0");
|
|
|
+ GloryValue.text = FashionShowData.gloryScore == 0 ? "--" : FashionShowData.GetGloryRate().ToString("0.0");
|
|
|
+ GraceValue.text = FashionShowData.graceScore == 0 ? "--" : FashionShowData.GetGraceRate().ToString("0.0");
|
|
|
+ SimpleValue.text = FashionShowData.simpleScore == 0 ? "--" : FashionShowData.GetSimpleRate().ToString("0.0");
|
|
|
+ VividValue.text = FashionShowData.vividScore == 0 ? "--" : FashionShowData.GetVividRate().ToString("0.0");
|
|
|
}
|
|
|
|
|
|
private static void TransitPanel()
|
|
@@ -571,18 +490,17 @@ public class FashionShowEditPage : Regist
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if (FashionShowData.ShowName == FashionTitleInputField.text && FashionShowData.ShowContent == FashionContentInputField.text)
|
|
|
+ if (FashionShowData.playerNickName == FashionTitleInputField.text && FashionShowData.content == FashionContentInputField.text)
|
|
|
{
|
|
|
Bubble.Show(null, Language.GetStr(LanguageLabel.UI__Pg_RepeatData));
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
SaveButton.interactable = false;
|
|
|
- FashionShowData data = new FashionShowData();
|
|
|
- data.ShowName = FashionTitleInputField.text;
|
|
|
- data.ShowContent = FashionContentInputField.text;
|
|
|
- data.RefererId = NickNameManager.NickName;
|
|
|
- HttpManager.SaveFashionShowData(data, OnSaveSucceedCallback, OnSaveFailedCallback);
|
|
|
+ FashionShowData data = new FashionShowData(FashionShowData);
|
|
|
+ data.title = FashionTitleInputField.text;
|
|
|
+ data.content = FashionContentInputField.text;
|
|
|
+ AddShowHttp.Add(data, OnSaveSucceedCallback, OnSaveFailedCallback);
|
|
|
}
|
|
|
|
|
|
private static void OnSaveFailedCallback()
|
|
@@ -591,10 +509,10 @@ public class FashionShowEditPage : Regist
|
|
|
Bubble.Show(null, Language.GetStr(LanguageLabel.UI__Pg_SaveFailed));
|
|
|
}
|
|
|
|
|
|
- private static void OnSaveSucceedCallback(FashionShowData fashionShowData)
|
|
|
+ private static void OnSaveSucceedCallback(/*FashionShowData fashionShowData*/)
|
|
|
{
|
|
|
- FashionShowData.ShowName = fashionShowData.ShowName;
|
|
|
- FashionShowData.ShowContent = fashionShowData.ShowName;
|
|
|
+ //FashionShowData.ShowName = fashionShowData.ShowName;
|
|
|
+ //FashionShowData.ShowContent = fashionShowData.ShowName;
|
|
|
SaveButton.interactable = true;
|
|
|
Bubble.Show(null, Language.GetStr(LanguageLabel.UI__Pg_SaveSucceed));
|
|
|
}
|
|
@@ -602,8 +520,8 @@ public class FashionShowEditPage : Regist
|
|
|
private static void OnResetButtonClick()
|
|
|
{
|
|
|
AudioManager.PlayClip(ResourceLabel.BtnClip);
|
|
|
- FashionTitleInputField.text = FashionShowData.ShowName;
|
|
|
- FashionContentInputField.text = FashionShowData.ShowContent;
|
|
|
+ FashionTitleInputField.text = FashionShowData.title;
|
|
|
+ FashionContentInputField.text = FashionShowData.content;
|
|
|
}
|
|
|
|
|
|
private static void OnDeleteButtonClick()
|
|
@@ -617,7 +535,9 @@ public class FashionShowEditPage : Regist
|
|
|
() =>
|
|
|
{
|
|
|
HidePanel();
|
|
|
- HttpManager.DeleteFashionShowData();
|
|
|
+ long playerId = HttpManager.GetPlayerId();
|
|
|
+ DeleteShowHttp.Delete(playerId, FashionShowData.showId, null, null);
|
|
|
+ //HttpManager.DeleteFashionShowData();
|
|
|
}
|
|
|
);
|
|
|
}
|
|
@@ -876,16 +796,17 @@ public class FashionShowEditPage : Regist
|
|
|
{
|
|
|
AudioManager.PlayClip(ResourceLabel.BtnClip);
|
|
|
|
|
|
- FashionShowData data = new FashionShowData();
|
|
|
- data.CuteRate = "0";
|
|
|
- data.GloryRate = "0";
|
|
|
- data.GraceRate = "0";
|
|
|
- data.SimpleRate = "0";
|
|
|
- data.VividRate = "0";
|
|
|
- data.ShowName = "";
|
|
|
- data.ShowContent = "";
|
|
|
- data.RefererId = NickNameManager.NickName;
|
|
|
- data.CloseIDs = PlayerManager.Player.GetCurrentChangableDressIDs();
|
|
|
+ GetFashionShowData data = new GetFashionShowData();
|
|
|
+ data.cuteScore = 0;
|
|
|
+ data.gloryScore = 0;
|
|
|
+ data.graceScore = 0;
|
|
|
+ data.simpleScore = 0;
|
|
|
+ data.vividScore = 0;
|
|
|
+ data.title = "";
|
|
|
+ data.content = "";
|
|
|
+ data.playerId = HttpManager.GetPlayerId();
|
|
|
+ List<int> closeIds = PlayerManager.Player.GetCurrentChangableDressIDs();
|
|
|
+ data.SetCloseIds(closeIds);
|
|
|
ShowEditPanel(data);
|
|
|
}
|
|
|
}
|