fix:1、更换项目,使用winter来创建

This commit is contained in:
2026-04-22 11:13:16 +08:00
parent 173cfb2dc9
commit 83ff9f71ad
7375 changed files with 209752 additions and 157557 deletions
+72 -60
View File
@@ -1,23 +1,24 @@
using System;
using FairyGUI;
using FGUI.P01_Common;
using FGUI.P04_Menu;
using FGUI.ZM_Setting_07;
using SGModule.ApplePay;
using SGModule.Common.Extensions;
using SGModule.Net;
// using FGUI.G006_menu;
using UnityEngine;
namespace FlowerPower
namespace LoveLegend
{
public class MenuUI : BaseUI
{
private MenuUICtrl ctrl;
private MenuModel model;
private FGUI.P04_Menu.com_setting ui;
private FGUI.ZM_Setting_07.com_setting ui;
private int selectIndex = -1;
private int total_item;
private bool is_exit_game = false;
public MenuUI(MenuUICtrl ctrl) : base(ctrl)
{
@@ -27,7 +28,7 @@ namespace FlowerPower
protected override void SetUIInfo(UIInfo uiInfo)
{
uiInfo.packageName = "P04_Menu";
uiInfo.packageName = "ZM_Setting_07";
uiInfo.assetName = "com_setting";
uiInfo.layerType = UILayerType.Popup;
uiInfo.isNeedOpenAnim = false;
@@ -44,31 +45,33 @@ namespace FlowerPower
protected override void OnClose()
{
//
CommonHelper.FadeOut(ui);
}
protected override void OnBind()
{
ui = baseUI as FGUI.P04_Menu.com_setting;
ui = baseUI as FGUI.ZM_Setting_07.com_setting;
}
protected override void OnOpenBefore(object args)
{
if (args != null)
{
is_exit_game = (bool)args;
var type = (int)args;
ui.btn_back_home.visible = type == 2; //type 1是大厅 2是游戏
}
if (Screen.safeArea.y != 0)
if (Screen.safeArea.y != 0)
{
ui.com_gold.y += Screen.safeArea.y;
}
//
ui.gift_switch.selectedIndex = GameHelper.IsGiftSwitch() ? 1 : 0;
total_item = 8;
selectIndex = PreferencesMgr.Instance.PlayerAvatarId;
selectIndex = DataMgr.PlayerAvatarId.Value;
InitView();
@@ -77,6 +80,12 @@ namespace FlowerPower
protected override void OnOpen(object args)
{
CommonHelper.FadeIn(ui);
// if (args != null)
// {
// ui.menu.selectedIndex = (bool)args ? com_setting.Menu_settings : com_setting.Menu_person;
// }
}
protected override void OnHide()
@@ -105,16 +114,13 @@ namespace FlowerPower
private void InitView()
{
ui.com_gold.GetChild("text_gold").text = $"{PreferencesMgr.Instance.Currency101:N0}";
ui.com_gold.GetChild("text_gold").text = $"{DataMgr.Coin.Value:N0}";
var namStr = GameHelper.GetUserName();
if (is_exit_game)
{
ui.btn_quit.visible = true;
}
ui.btn_back.SetClick(OnCloseView);
ui.btn_music.SetClick(OnClickSetMusic);
@@ -123,45 +129,55 @@ namespace FlowerPower
ui.btn_privacy.menus.selectedIndex = btn_menu.Menus_privacy;
ui.btn_terms.menus.selectedIndex = btn_menu.Menus_terms;
ui.btn_official.menus.selectedIndex = btn_menu.Menus_official;
ui.btn_record.menus.selectedIndex = btn_menu.Menus_record;
ui.btn_privacy.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open); });
ui.btn_terms.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open, true); });
ui.btn_official.SetClick(() => { OpenBrowser.OpenURL("https://www.flowerlazypower.fun/"); });
ui.btn_contact_us.SetClick(() => { GameHelper.OpenEmail(); });
ui.btn_quit.SetClick(() =>
// ui.btn_credits.menus.selectedIndex = btn_menu.Menus_credits;
ui.btn_privacy.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open, 0); });
ui.btn_terms.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open, 1); });
ui.btn_official.SetClick(() => { OpenBrowser.OpenURL("https://www.frozenarena.top/"); });
ui.btn_us.SetClick(() => { GameHelper.OpenEmail(); });
// ui.btn_credits.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open, 2); });
ui.btn_restore.SetClick(() =>
{
if (is_exit_game)
ApplePayManager.Instance.AppleRestore((success, message) =>
{
GameDispatcher.Instance.Dispatch(GameMsg.ExitGame);
}
OnCloseView();
if (success)
{
Debug.Log("[barry] restore success: " + success);
GameHelper.ShowTips("Restore_pur", true);
SaveData.GetSaveObject().have_slot = success;
DataMgr.VipLevel.Value = 3;
DataMgr.VipExpirationTime.Value = ServerClock.GetCurrentServerTime() + 7 * 24 * 60 * 60;
}
else
{
GameHelper.ShowTips("recoverable_tips", true);
}
});
});
ui.btn_language.SetClick(() => {
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LanguageViewUI_Open);
});
SetUID();
SetVersion();
RefreshMusicUI();
if (GameHelper.IsGiftSwitch()) {
ui.btn_restore.visible = false;
}
ui.btn_restore.SetClick(() =>
ui.btn_back_home.SetClick(() =>
{
PurchasingManager.Instance.IosRestore((success,message)=>{
Debug.Log("[barry] restore success message: " + message);
if (success)
GameDispatcher.Instance.Dispatch(GameMsg.ExitGame);
if (!GameHelper.GetVipPrivilege(Subscription.RemoveInterstitialAd.As<int>()) && GameHelper.IsGiftSwitch())
{
int random_ = UnityEngine.Random.Range(1, 100);
Debug.Log($"[back hall] SaveData.GetSaveObject().is_get_removead=========={SaveData.GetSaveObject().is_get_removead} ");
if (!SaveData.GetSaveObject().is_get_removead && random_ < GameHelper.GetCommonModel().HomeInterstitialAd)
{
Debug.Log("[barry] restore success: " + success);
GameHelper.ShowTips("Restore Purchases Success!");
// SaveData.GetSaveobject().is_get_packreward = success;
SaveData.GetSaveobject().have_slot = success;
//GameHelper.ShowInterstitial("BackHall");
uiCtrlDispatcher.Dispatch(UICtrlMsg.AdcomingUI_Open);
}
else
{
// Debug.Log("[barry] restore failed: " + success);
GameHelper.ShowTips("There are no recoverable transactions");
}
});
}
CtrlCloseUI();
});
}
@@ -173,11 +189,7 @@ namespace FlowerPower
private void SetUID()
{
// if (GameHelper.IsGiftSwitch()) {
ui.text_uid.SetVar("UID", GameHelper.GetLoginModel().uid.ToString()).FlushVars();
// } else {
// ui.text_uid.visible = false;
// }
ui.text_uid.SetVar("UID", GameHelper.GetLoginModel().Uid.ToString()).FlushVars();
}
public override void OnSwitchLanguage()
@@ -193,10 +205,10 @@ namespace FlowerPower
{
// CloseMenu();
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.MenuUI_Close, true);
TimerHelper.mEasy.AddTimer(0.5f, () =>
{
CtrlCloseUI();
});
TimerHelper.mEasy.AddTimer(0.5f, () =>
{
CtrlCloseUI();
});
}
@@ -215,9 +227,9 @@ namespace FlowerPower
private void RefreshMusicUI()
{
ui.btn_music.on_off.selectedIndex =
model.IsOpenMusic ? btn_on_off.On_off_on : btn_on_off.On_off_off;
model.IsOpenMusic ? 1 : 0;
ui.btn_sound.on_off.selectedIndex =
model.IsOpenEffect ? btn_on_off.On_off_on : btn_on_off.On_off_off;
model.IsOpenEffect ? 1 : 0;
}
}
}
}