Merge remote-tracking branch 'origin/dev_cyp' into dev_nonearth

# Conflicts:
#	Assets/Scripts/Scenes/MainController.cs
This commit is contained in:
lishuo committed 2022-01-06 18:03:12 +08:00
commit 14e9e8e23b
27 files changed
+4561 -2171

No files matched your search

@@ -74,5 +74,8 @@ namespace Assets.Scripts.Apis.Models
public DateTime UpdateTime { get; set; }
public string WebHost { get; set; }//创建比赛url
public bool CanCreateRace { get; set; }//是否可以创建比赛
//第三方userid
public string AppleUserId { get; set; }
public string FacebookUserId { get; set; }
}
}
+16 -4
View File
@@ -762,6 +762,7 @@ public class LoginController : BaseScene
wxLogin3.Find("NickName").GetComponent<Text>().text = wxInfoJson.Value<string>("nickname");
pageNums = 5;
//this.goSign();
PerfectInfo();
StartScrollPanel(2);
}
else
@@ -1120,6 +1121,7 @@ public class LoginController : BaseScene
if (wxLogin2.gameObject.activeSelf) wxLogin2.gameObject.SetActive(false);
//if (wxLogin3.gameObject.activeSelf) wxLogin3.gameObject.SetActive(false);
pageNums = 4;
signType = 0;
#if !(UNITY_ANDROID || UNITY_IOS)
if (wxLogin1.transform.localPosition.y == 0)
{
@@ -1254,6 +1256,18 @@ public class LoginController : BaseScene
{
return signType > 0;
}
void PerfectInfo()
{
var txt = transform.Find("Panel/LoginContainer/LoginScrollView/Viewport/Content/FormContainer-Sign/signText").GetComponent<Text>();
if (isThird())
{
txt.text = App.GetLocalString("PERFECT INFORMATION");
}
else
{
txt.text = App.GetLocalString("SIGN UP");
}
}
/// <summary>
///
/// </summary>
@@ -1272,6 +1286,7 @@ public class LoginController : BaseScene
#endif
signPage1.Find("signThird").gameObject.SetActive(true);
ShowPassword();
PerfectInfo();
this.StartScrollPanel(3);
this.StartScrollSign(0);
}
@@ -1280,10 +1295,6 @@ public class LoginController : BaseScene
if (type == 0)
{
pageNums = 4;
if (signType < 2)
{
signType = 0;
}
signContainer.Find("signText").GetComponent<Text>().text = App.GetLocalString("SIGN UP");
wxLogin2.gameObject.SetActive(false);
signPage1.Find("next").gameObject.SetActive(true);
@@ -1291,6 +1302,7 @@ public class LoginController : BaseScene
signPage1.Find("previousThird").gameObject.SetActive(false);
signPage1.Find("signThird").gameObject.SetActive(false);
ShowPassword();
PerfectInfo();
this.StartScrollPanel(2);
this.StartScrollSign(0);
}
+10 -28
View File
@@ -86,7 +86,7 @@ public class MainController : BaseScene
msgs = List<CanvasGroup> { msg, msg2, msg3 };
rightMessage = transform.Find("GameObject/MessageRight").GetComponent<CanvasGroup>();
#else
msgLocation = new Vector3(168, 37, 0);
msgLocation = new Vector3(168, 37-80, 0);
var go = transform.Find("GameObject");
go.GetComponent<RectTransform>().anchorMin = Vector2.zero;
go.GetComponent<RectTransform>().anchorMax = Vector2.one;
@@ -102,7 +102,7 @@ public class MainController : BaseScene
rightMessage.transform.localPosition = 1 * msgLocation;
rightMessage.alpha = 0;
msgs = new List<CanvasGroup> { rightMessage };
for (int i = 0; i < 5; i++)
for (int i = 0; i < 3; i++)
{
var tmpm = Instantiate<CanvasGroup>(rightMessage);
tmpm.transform.SetParent(rightMessage.transform.parent);
@@ -172,9 +172,9 @@ public class MainController : BaseScene
}
private void DoMessage6(LinkedMessageEvent e)
{
var selectIndex = msgIndex % 6;
var selectIndex = msgIndex % 4;
var m = msgs[selectIndex];
if (msgIndex >= 6) //
if (msgIndex >= 4) //
{
//msgIndex = 0;
Sequence se = DOTween.Sequence();
@@ -363,7 +363,7 @@ public class MainController : BaseScene
UIManager.UpdateJoinCompetition();//查询当前我参加的赛事
}
float maxt = 0f; //用于获取全服最值内容
float emptyt = 0;//用于无消息计时
float t = 1f;
float scanTicks = 0;
@@ -430,13 +430,13 @@ public class MainController : BaseScene
//距离50
if (item.EndDistance >= 50)
{
var message = lang == "zh" ? $"骑行里程突破<color=#e3d427>{"50KM"}</color>!" : $"riding distance reaches <color=#e3d427>{"50KM"}</color>!";
var message = lang == "zh" ? $"骑行里程达到<color=#e3d427>{"50KM"}</color>!" : $"riding distance reaches <color=#e3d427>{"50KM"}</color>!";
EventQueueSystem.QueueEventOnce(new LinkedMessageEvent(item.RouteId, message, item.HeadImage, item.Name, item.RouteName), $"{item.RouteId}{item.Name}50KM");
}
//距离100
if (item.EndDistance >= 100)
{
var message = lang == "zh" ? $"骑行里程突破<color=#e3d427>{"100KM"}</color>!" : $"riding distance reaches <color=#e3d427>{"100KM"}</color>!";
var message = lang == "zh" ? $"骑行里程达到<color=#e3d427>{"100KM"}</color>!" : $"riding distance reaches <color=#e3d427>{"100KM"}</color>!";
EventQueueSystem.QueueEventOnce(new LinkedMessageEvent(item.RouteId, message, item.HeadImage, item.Name, item.RouteName), $"{item.RouteId}{item.Name}100KM");
}
////速度35
@@ -448,36 +448,18 @@ public class MainController : BaseScene
//速度50
if (item.Speed >= 50)
{
var message = lang == "zh" ? $"骑行速度突破<color=#e3d427>{Math.Round(item.Speed,2)}KM/H</color>!" : $"riding speed reaches <color=#e3d427>{Math.Round(item.Speed, 2)}KM/H</color>!";
var message = lang == "zh" ? $"骑行速度达到<color=#e3d427>{Math.Round(item.Speed,2)}KM/H</color>!" : $"riding speed reaches <color=#e3d427>{Math.Round(item.Speed, 2)}KM/H</color>!";
EventQueueSystem.QueueEventOnce(new LinkedMessageEvent(item.RouteId, message, item.HeadImage, item.Name, item.RouteName), $"{item.RouteId}{item.Name}50KM/H");
}
//功体比
if (item.WeightKg >= 4)
{
var message = lang == "zh" ? $"骑行功体比突破<color=#e3d427>{Math.Round(item.WeightKg, 2)}w/kg</color>!" : $" riding PWR reaches <color=#e3d427>{Math.Round(item.WeightKg, 2)}w/kg</color>!";
var message = lang == "zh" ? $"骑行功体比达到<color=#e3d427>{Math.Round(item.WeightKg, 2)}w/kg</color>!" : $" riding PWR reaches <color=#e3d427>{Math.Round(item.WeightKg, 2)}w/kg</color>!";
EventQueueSystem.QueueEventOnce(new LinkedMessageEvent(item.RouteId, message, item.HeadImage, item.Name, item.RouteName), $"{item.RouteId}{item.Name}3WeightKg");
}
}
}
maxt -= Time.deltaTime;
if (maxt <= 0)
{
GetMaxRanking();
maxt += 60f;
}
}
private async void GetMaxRanking()
{
var res = await ConfigHelper.mapApi.GetMaxRanking();
if (res.result)
{
foreach (var item in res.data)
{
EventQueueSystem.QueueEvent(new LinkedMessageEvent(-1, item.Message, item.WxHeadImg, item.NickName,null));
}
}
}
+9 -9
View File
@@ -91,14 +91,6 @@ public class NewMainNav : MonoBehaviour
{
item.gameObject.SetActive(false);
}
else if (item.name == "Custom")
{
item.gameObject.SetActive(custom != null && types.Contains(item.name));
}
else if (item.name == "Custom2")
{
item.gameObject.SetActive(custom2 != null && types.Contains(item.name));
}
else
{
item.gameObject.SetActive(types.Contains(item.name));
@@ -108,7 +100,15 @@ public class NewMainNav : MonoBehaviour
{
item.gameObject.SetActive(item.name == "PF"|| item.name == shrinkName);
}
//自定义按钮出来
if (item.name == "Custom")
{
item.gameObject.SetActive(custom != null && types.Contains(item.name));
}
else if (item.name == "Custom2")
{
item.gameObject.SetActive(custom2 != null && types.Contains(item.name));
}
}
}
@@ -246,10 +246,10 @@ public class HomeController : PFUIPanel
{
Utils.DisplayHead(todayData.Find("Avatar").GetComponent<RawImage>(), App.CurrentUser.WxHeadImg);
todayData.Find("Datas/Distance/Value").GetComponent<Text>().text = $"{summary.ContinuesDay}"+ (summary.ContinuesDay > 1 ? App.GetLocalString("DAYS") : App.GetLocalString("DAY"));
todayData.Find("Datas/Climb/Value").GetComponent<Text>().text = $"{summary.ContinuesKm.ToString("#0")}KM";//$"{double.Parse(summary.TotalClimb, CultureInfo.InvariantCulture).ToString("0")}M";
todayData.Find("Datas/Carlories/Value").GetComponent<Text>().text = $"{summary.ContinuesKcal.ToString("#0")}KCAL";
todayData.Find("Datas/Climb/Value").GetComponent<Text>().text = $"{summary.ContinuesKm.ToString("#0.0")}";//$"{double.Parse(summary.TotalClimb, CultureInfo.InvariantCulture).ToString("0")}M";
todayData.Find("Datas/Carlories/Value").GetComponent<Text>().text = $"{summary.ContinuesKcal.ToString("#0")}";
//todayData.Find("Datas/Distance/Rank").GetComponent<Text>().text = summary.CurrentTotalDistance == 0 ? "——" : $"+{summary.CurrentTotalDistance.ToString("#0")}";
todayData.Find("Datas/Climb/Rank").GetComponent<Text>().text = summary.CurrentTotalDistance == 0 ? "——" : $"+{summary.CurrentTotalDistance.ToString("#0")}";
todayData.Find("Datas/Climb/Rank").GetComponent<Text>().text = summary.CurrentTotalDistance == 0 ? "——" : $"+{summary.CurrentTotalDistance.ToString("#0.0")}";
todayData.Find("Datas/Carlories/Rank").GetComponent<Text>().text = summary.CurrentTotalKcal == 0 ? "——" : $"+{summary.CurrentTotalKcal.ToString("#0")}";
}
@@ -282,12 +282,38 @@ public class HomeController : PFUIPanel
// Utils.showToast(gameObject, res.errMsg);
//}
}
float maxt = 0f; //用于获取全服最值内容
// Update is called once per frame
void Update()
{
maxt -= Time.deltaTime;
if (maxt <= 0)
{
GetMaxRanking();
maxt += 60f;
}
}
private async void GetMaxRanking()
{
var res = await ConfigHelper.mapApi.GetMaxRanking();
if (res.result)
{
var list = res.data;
if (list.Count >= 3)
{
Transform p = transform.Find("MaxRankingData/Power"),
d = transform.Find("MaxRankingData/Distance"),
c = transform.Find("MaxRankingData/Climb");
Utils.DisplayHead(p.Find("Avatar").GetComponent<RawImage>(), list[1].WxHeadImg);
Utils.DisplayHead(d.Find("Avatar").GetComponent<RawImage>(), list[0].WxHeadImg);
Utils.DisplayHead(c.Find("Avatar").GetComponent<RawImage>(), list[2].WxHeadImg);
p.Find("NickName").GetComponent<Text>().text = list[1].NickName;
d.Find("NickName").GetComponent<Text>().text = list[0].NickName;
c.Find("NickName").GetComponent<Text>().text = list[2].NickName;
}
}
}
public override void Show()
{
base.Show();
@@ -34,18 +34,22 @@ public class MapListExtraController : PFUIPanel
#else
tmpCollectItem = Resources.Load<Transform>("UI/Prefab/NewRoute/RouteItem");
#endif
UIManager.AddEvent(typeSelector.Find("Route").gameObject, EventTriggerType.PointerClick, b =>
UIManager.AddEvent(typeSelector.Find("Container/Route").gameObject, EventTriggerType.PointerClick, b =>
{
typeSelector.Find("Route").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
typeSelector.Find("Collection").GetComponent<Text>().color = Utils.HexToColorHtml("#5c5c6e");
typeSelector.Find("Container/Route").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
typeSelector.Find("Container1/Collection").GetComponent<Text>().color = Utils.HexToColorHtml("#5c5c6e");
typeSelector.Find("Container/Line").gameObject.SetActive(true);
typeSelector.Find("Container1/Line").gameObject.SetActive(false);
p1.DOLocalMoveX(p1originx, 0.5f);
p2.DOLocalMoveX(p2originx, 0.5f);
transform.Find("Tmp/MainNav-mobile").GetComponent<NewMainNav>().ShowButton("Custom");
});
UIManager.AddEvent(typeSelector.Find("Collection").gameObject, EventTriggerType.PointerClick, b =>
UIManager.AddEvent(typeSelector.Find("Container1/Collection").gameObject, EventTriggerType.PointerClick, b =>
{
typeSelector.Find("Route").GetComponent<Text>().color = Utils.HexToColorHtml("#5c5c6e");
typeSelector.Find("Collection").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
typeSelector.Find("Container/Route").GetComponent<Text>().color = Utils.HexToColorHtml("#5c5c6e");
typeSelector.Find("Container1/Collection").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
typeSelector.Find("Container/Line").gameObject.SetActive(false);
typeSelector.Find("Container1/Line").gameObject.SetActive(true);
p1.DOLocalMoveX(p1originx - 764f, 0.5f);
p2.DOLocalMoveX(p2originx - 764f, 0.5f);
transform.Find("Tmp/MainNav-mobile").GetComponent<NewMainNav>().HideButton("Custom");
@@ -82,8 +86,10 @@ public class MapListExtraController : PFUIPanel
}
p1.localPosition = new Vector3(p1originx, p1.localPosition.y, p1.localPosition.z);
p2.localPosition = new Vector3(p2originx, p2.localPosition.y, p2.localPosition.z);
typeSelector.Find("Route").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
typeSelector.Find("Collection").GetComponent<Text>().color = Utils.HexToColorHtml("#5c5c6e");
typeSelector.Find("Container/Route").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
typeSelector.Find("Container1/Collection").GetComponent<Text>().color = Utils.HexToColorHtml("#5c5c6e");
typeSelector.Find("Container/Line").gameObject.SetActive(true);
typeSelector.Find("Container1/Line").gameObject.SetActive(false);
transform.Find("Tmp/MainNav-mobile").GetComponent<NewMainNav>().ShowButton("Custom");
}
private async void GetList()
@@ -147,7 +147,7 @@ public class NewRouteDetailController : PFUIPanel
.text = string.Empty;
transform.Find("Container/Left/Infos/SlopeContainer/Text").GetComponent<Text>()
.text = string.Empty;
transform.Find("Container/Left/Desc").GetComponent<Text>()
transform.Find("Container/Left/DescScroll/Viewport/Content/Desc").GetComponent<Text>()
.text = string.Empty;
if (area.CoverImage != null)
{
@@ -253,8 +253,9 @@ public class NewRouteDetailController : PFUIPanel
.text = $"{res.data.TotalClimb.ToString("#0")}M";
transform.Find("Container/Left/Infos/SlopeContainer/Text").GetComponent<Text>()
.text = $"{res.data.AverageGrade.ToString("#0.00")}%";
transform.Find("Container/Left/Desc").GetComponent<Text>()
transform.Find("Container/Left/DescScroll/Viewport/Content/Desc").GetComponent<Text>()
.text = res.data.Description;
LayoutRebuilder.ForceRebuildLayoutImmediate(transform.Find("Container/Left/DescScroll").GetComponent<ScrollRect>().content);
transform.Find("Container/Left/Fav").GetComponent<Image>().sprite = FavDict[res.data.IsFav];
LayoutRebuilder.ForceRebuildLayoutImmediate(transform.Find("Container/Left/RideContainer").GetComponent<RectTransform>());
}
@@ -112,9 +112,9 @@ public class UserInfoController : PFUIPanel
#if UNITY_IOS || UNITY_ANDROID
infoPanel.Find("Container/Ftp").Find("Value").GetComponent<Text>().text = user.FTP.ToString();
infoPanel.Find("Container/MHR").Find("Value").GetComponent<Text>().text = user.MaxHeartRate.ToString();
infoPanel.Find("Container/Weight").Find("Value").GetComponent<Text>().text = $"{user.Weight}KG";
infoPanel.Find("Container/BW").Find("Value").GetComponent<Text>().text = $"{user.BicycleWeight}KG";
infoPanel.Find("Container/WD").Find("Value").GetComponent<Text>().text = $"{user.WheelDiameter}MM";
infoPanel.Find("Container/Weight").Find("Value").GetComponent<Text>().text = $"{user.Weight}";
infoPanel.Find("Container/BW").Find("Value").GetComponent<Text>().text = $"{user.BicycleWeight}";
infoPanel.Find("Container/WD").Find("Value").GetComponent<Text>().text = $"{user.WheelDiameter}";
infoPanel.Find("Container/Ftp").Find("Time").GetComponent<Text>().text = user.LastUpdateFtpTime.ToLocalString("dd-MM-yyyy");
infoPanel.Find("Container/Weight").Find("Time").GetComponent<Text>().text = user.LastUpdateWeightTime.ToLocalString("dd-MM-yyyy");
infoPanel.Find("Container/BW").Find("Time").GetComponent<Text>().text = user.LastUpdateBicycleWeightTime.ToLocalString("dd-MM-yyyy");
@@ -255,6 +255,9 @@ public class RaceListScript : RaceScript
mc.gameObject.SetActive(true);
mc.GetComponent<CanvasGroup>().alpha = 0;
mc.GetComponent<CanvasGroup>().DOFade(1, 0.3f);
}),custom2:new NewMainNav.CustomButton(Resources.Load<Sprite>("Images/Race/back up"),()=>
{
UIManager.ShowPrePanel();
}));
newNav = nav;
#else