zxl
/
CTT
forked from Cal/CTT
1
0
Fork 0
CTT/Unity/Assets/HotfixView/UI/TransPointUI/RightTransPointUI/RightTransPointUI.cs

261 lines
9.8 KiB
C#

using Cal.DataTable;
using ET;
using FairyGUI;
using System;
using System.Collections.Generic;
namespace ET
{
public class RightTransPointUIAwakeSyatem : AwakeSystem<RightTransPointUI>
{
public override void Awake(RightTransPointUI self)
{
self.Awake();
}
}
public class RightTransPointUIDestroySyatem : DestroySystem<RightTransPointUI>
{
public override void Destroy(RightTransPointUI self)
{
self.Destroy();
}
}
public class RightTransPointUI : Entity
{
public FUI_RightTransPointUI ui;
private Scene zoneScene;
private bool isHardMainStory;
public void Awake()
{
zoneScene = this.ZoneScene();
ui = GetParent<FUI_RightTransPointUI>();
AwakeAsync().Coroutine();
}
private async ETVoid AwakeAsync()
{
isHardMainStory = false;
FUIWindowComponent window = ui.GetComponent<FUIWindowComponent>();
this.ui.m_mainStory.selectedIndex = 0;
this.ui.m_btn0MainStory.self.onClick.Set(() =>
{
isHardMainStory = false;
});
this.ui.m_btn1MainStory.self.onClick.Set(() =>
{
isHardMainStory = true;
});
//!主线
ui.m_mainstoryList.onClickItem.Set1(async context =>
{
if (!context.inputEvent.isDoubleClick)
{
return;
}
int mainStoryIndex = ui.m_mainstoryList.GetChildIndex(context.data as GButton);
int m_SelectMainLevel = mainStoryIndex + Cal.DataTable.Sys_SceneId.Scene_MainStory1;
if (isHardMainStory)
m_SelectMainLevel = mainStoryIndex + Sys_SceneId.Scene_MainStory17;
M2C_RequestEnterMap m2C_RequestEnterMap = (M2C_RequestEnterMap)await zoneScene.GetComponent<SessionComponent>().Session.Call(new C2M_RequestEnterMap() { MapId = m_SelectMainLevel * 100 + 1 });
if (!m2C_RequestEnterMap.Message.IsNullOrEmpty())
{
TipHelper.OpenUI(m2C_RequestEnterMap.Message);
return;
}
window.Hide();
});
//!活动
ui.m_activeList.onClickItem.Set1(async context =>
{
if (!context.inputEvent.isDoubleClick)
{
return;
}
int activeIndex = ui.m_activeList.GetChildIndex(context.data as GButton);
if (activeIndex == 1)
{
//初级试炼之地
M2C_RequestEnterMap ret = (M2C_RequestEnterMap)await zoneScene.GetComponent<SessionComponent>().Session.Call(new C2M_RequestEnterMap()
{
MapId = Cal.DataTable.Sys_SceneId.Scene_Challenge * 100 + 1
});
if (!ret.Message.IsNullOrEmpty())
{
TipHelper.OpenUI(ret.Message);
return;
}
window.Hide();
}
else
if (activeIndex == 2)
{
//初级试炼之地
M2C_RequestEnterMap ret = (M2C_RequestEnterMap)await zoneScene.GetComponent<SessionComponent>().Session.Call(new C2M_RequestEnterMap()
{
MapId = Cal.DataTable.Sys_SceneId.Scene_Challenge_Middle * 100 + 1
});
if (!ret.Message.IsNullOrEmpty())
{
TipHelper.OpenUI(ret.Message);
return;
}
window.Hide();
}
else
if (activeIndex == 3)
{
//初级试炼之地
M2C_RequestEnterMap ret = (M2C_RequestEnterMap)await zoneScene.GetComponent<SessionComponent>().Session.Call(new C2M_RequestEnterMap()
{
MapId = Cal.DataTable.Sys_SceneId.Scene_Challenge_Hard * 100 + 1
});
if (!ret.Message.IsNullOrEmpty())
{
TipHelper.OpenUI(ret.Message);
return;
}
window.Hide();
}
else
if (activeIndex == 4)
{
//boss之家
M2C_RequestEnterMap ret = (M2C_RequestEnterMap)await zoneScene.GetComponent<SessionComponent>().Session.Call(new C2M_RequestEnterMap()
{
MapId = Cal.DataTable.Sys_SceneId.Scene_PersonalBoss * 100 + 1
});
if (!ret.Message.IsNullOrEmpty())
{
TipHelper.OpenUI(ret.Message);
return;
}
window.Hide();
}
else
if (activeIndex == 5)
{
//青铜斗士场
M2C_RequestEnterMap ret = (M2C_RequestEnterMap)await zoneScene.GetComponent<SessionComponent>().Session.Call(new C2M_RequestEnterMap()
{
MapId = Cal.DataTable.Sys_SceneId.Scene_PersonalPvp1 * 100 + 1
});
if (!ret.Message.IsNullOrEmpty())
{
TipHelper.OpenUI(ret.Message);
return;
}
window.Hide();
}
else
if (activeIndex == 6)
{
//白银斗士场
M2C_RequestEnterMap ret = (M2C_RequestEnterMap)await zoneScene.GetComponent<SessionComponent>().Session.Call(new C2M_RequestEnterMap()
{
MapId = Cal.DataTable.Sys_SceneId.Scene_PersonalPvp2 * 100 + 1
});
if (!ret.Message.IsNullOrEmpty())
{
TipHelper.OpenUI(ret.Message);
return;
}
window.Hide();
}
else
if (activeIndex == 7)
{
//黄金斗士场
M2C_RequestEnterMap ret = (M2C_RequestEnterMap)await zoneScene.GetComponent<SessionComponent>().Session.Call(new C2M_RequestEnterMap()
{
MapId = Cal.DataTable.Sys_SceneId.Scene_PersonalPvp3 * 100 + 1
});
if (!ret.Message.IsNullOrEmpty())
{
TipHelper.OpenUI(ret.Message);
return;
}
window.Hide();
}
else
if (activeIndex == 8)
{
//初级手工
M2C_RequestEnterMap ret = (M2C_RequestEnterMap)await zoneScene.GetComponent<SessionComponent>().Session.Call(new C2M_RequestEnterMap()
{
MapId = Cal.DataTable.Sys_SceneId.Scene_ManulEquip1 * 100 + 1
});
if (!ret.Message.IsNullOrEmpty())
{
TipHelper.OpenUI(ret.Message);
return;
}
window.Hide();
}
else
if (activeIndex == 9)
{
//中级手工
M2C_RequestEnterMap ret = (M2C_RequestEnterMap)await zoneScene.GetComponent<SessionComponent>().Session.Call(new C2M_RequestEnterMap()
{
MapId = Cal.DataTable.Sys_SceneId.Scene_ManulEquip2 * 100 + 1
});
if (!ret.Message.IsNullOrEmpty())
{
TipHelper.OpenUI(ret.Message);
return;
}
window.Hide();
}
else
if (activeIndex == 10)
{
//高级手工
M2C_RequestEnterMap ret = (M2C_RequestEnterMap)await zoneScene.GetComponent<SessionComponent>().Session.Call(new C2M_RequestEnterMap()
{
MapId = Cal.DataTable.Sys_SceneId.Scene_ManulEquip3 * 100 + 1
});
if (!ret.Message.IsNullOrEmpty())
{
TipHelper.OpenUI(ret.Message);
return;
}
window.Hide();
}
else
{
TipHelper.OpenUI("暂未开放!");
}
});
//!Boss
ui.m_bossList.onClickItem.Set1(async context =>
{
if (!context.inputEvent.isDoubleClick)
{
return;
}
int bossIndex = ui.m_bossList.GetChildIndex(context.data as GButton) + 1;
M2C_RequestEnterMap ret = (M2C_RequestEnterMap)await zoneScene.GetComponent<SessionComponent>().Session.Call(new C2M_RequestEnterMap()
{
MapId = Cal.DataTable.Sys_SceneId.Scene_Boss * 100 + bossIndex
});
if (!ret.Message.IsNullOrEmpty())
{
TipHelper.OpenUI(ret.Message);
return;
}
window.Hide();
});
await ETTask.CompletedTask;
}
public void Destroy()
{
}
}
}