|
@@ -11,6 +11,7 @@ namespace GFGGame
|
|
|
private UI_ChangeNameUI _ui;
|
|
|
private EffectUI _effectUI1;
|
|
|
private EffectUI _effectUI2;
|
|
|
+ private bool _isNewPlayer;
|
|
|
|
|
|
public override void Dispose()
|
|
|
{
|
|
@@ -45,9 +46,16 @@ namespace GFGGame
|
|
|
{
|
|
|
base.OnShown();
|
|
|
this._ui.m_inputName.text = "";
|
|
|
- _ui.m_txtNeed.text = string.Format("改名卡:{0}/{1}", ItemDataManager.GetItemNum(GlobalCfgArray.globalCfg.changeNameCostArr[0]), GlobalCfgArray.globalCfg.changeNameCostArr[1]);
|
|
|
- ItemCfg cfg = ItemCfgArray.Instance.GetCfg(GlobalCfgArray.globalCfg.changeNameCostArr[0]);
|
|
|
- _ui.m_loaIcon.url = ResPathUtil.GetCommonGameResPath(cfg.res);
|
|
|
+
|
|
|
+ _isNewPlayer = GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl) == 1;
|
|
|
+ _ui.m_txtNeed.visible = !_isNewPlayer;
|
|
|
+ _ui.m_loaIcon.visible = !_isNewPlayer;
|
|
|
+ if (!_isNewPlayer)
|
|
|
+ {
|
|
|
+ _ui.m_txtNeed.text = string.Format("改名卡:{0}/{1}", ItemDataManager.GetItemNum(GlobalCfgArray.globalCfg.changeNameCostArr[0]), GlobalCfgArray.globalCfg.changeNameCostArr[1]);
|
|
|
+ ItemCfg cfg = ItemCfgArray.Instance.GetCfg(GlobalCfgArray.globalCfg.changeNameCostArr[0]);
|
|
|
+ _ui.m_loaIcon.url = ResPathUtil.GetCommonGameResPath(cfg.res);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
@@ -86,15 +94,28 @@ namespace GFGGame
|
|
|
string costName = ItemUtil.GetItemName(GlobalCfgArray.globalCfg.changeNameCostArr[0]);
|
|
|
int count = GlobalCfgArray.globalCfg.changeNameCostArr[1];
|
|
|
|
|
|
- AlertUI.Show(string.Format("是否花费{0}个{1}改名1次?", count, costName))
|
|
|
- .SetLeftButton(true).SetRightButton(true, "确定", async (object data) =>
|
|
|
+ if (_isNewPlayer)
|
|
|
+ {
|
|
|
+ ChangeName(roleName);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ AlertUI.Show(string.Format("是否花费{0}个{1}改名1次?", count, costName))
|
|
|
+ .SetLeftButton(true).SetRightButton(true, "确定", (object data) =>
|
|
|
{
|
|
|
- bool result = await RoleInfoSProxy.ReqModifyRoleName(roleName);
|
|
|
- if (result)
|
|
|
- {
|
|
|
- this.Hide();
|
|
|
- }
|
|
|
+ ChangeName(roleName);
|
|
|
});
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private async void ChangeName(string roleName)
|
|
|
+ {
|
|
|
+ bool result = await RoleInfoSProxy.ReqModifyRoleName(roleName);
|
|
|
+ if (result)
|
|
|
+ {
|
|
|
+ this.Hide();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private async void RandomRoleName()
|