Sfoglia il codice sorgente

会员VIP界面修改ui

huangxiaoyue 1 anno fa
parent
commit
cad9c58201

+ 6 - 12
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Store/UI_ListVipItem.cs

@@ -14,12 +14,10 @@ namespace UI.Store
         public GTextField m_txtName2;
         public GTextField m_txtName3;
         public GTextField m_txtName4;
-        public GTextField m_txtGiftBag;
         public GList m_listGiftBag;
         public GButton m_btnGetGiftBag;
-        public GTextField m_txtWeekGiftBag;
-        public GList m_listWeekGiftBag;
-        public GButton m_btnGetWeekGiftBag;
+        public GTextField m_txtGiftBag;
+        public GButton m_btnWeek;
         public const string URL = "ui://p9mtgheoqik1tby";
         public const string PACKAGE_NAME = "Store";
         public const string RES_NAME = "ListVipItem";
@@ -74,12 +72,10 @@ namespace UI.Store
             m_txtName2 = (GTextField)comp.GetChild("txtName2");
             m_txtName3 = (GTextField)comp.GetChild("txtName3");
             m_txtName4 = (GTextField)comp.GetChild("txtName4");
-            m_txtGiftBag = (GTextField)comp.GetChild("txtGiftBag");
             m_listGiftBag = (GList)comp.GetChild("listGiftBag");
             m_btnGetGiftBag = (GButton)comp.GetChild("btnGetGiftBag");
-            m_txtWeekGiftBag = (GTextField)comp.GetChild("txtWeekGiftBag");
-            m_listWeekGiftBag = (GList)comp.GetChild("listWeekGiftBag");
-            m_btnGetWeekGiftBag = (GButton)comp.GetChild("btnGetWeekGiftBag");
+            m_txtGiftBag = (GTextField)comp.GetChild("txtGiftBag");
+            m_btnWeek = (GButton)comp.GetChild("btnWeek");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -90,12 +86,10 @@ namespace UI.Store
             m_txtName2 = null;
             m_txtName3 = null;
             m_txtName4 = null;
-            m_txtGiftBag = null;
             m_listGiftBag = null;
             m_btnGetGiftBag = null;
-            m_txtWeekGiftBag = null;
-            m_listWeekGiftBag = null;
-            m_btnGetWeekGiftBag = null;
+            m_txtGiftBag = null;
+            m_btnWeek = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 86 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Store/UI_WeekGiftUI.cs

@@ -0,0 +1,86 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.Store
+{
+    public partial class UI_WeekGiftUI
+    {
+        public GComponent target;
+        public Controller m_c1;
+        public GComponent m_bg;
+        public GTextField m_txtLock;
+        public GTextField m_txtWeekGiftBag;
+        public GList m_listWeekGiftBag;
+        public GButton m_btnGetWeekGiftBag;
+        public const string URL = "ui://p9mtgheoe98ntdw";
+        public const string PACKAGE_NAME = "Store";
+        public const string RES_NAME = "WeekGiftUI";
+        private static UI_WeekGiftUI _proxy;
+
+        public static UI_WeekGiftUI Create(GObject gObject = null)
+        {
+            var ui = new UI_WeekGiftUI();
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_WeekGiftUI Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_WeekGiftUI();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static void ProxyEnd()
+        {
+            if (_proxy != null)
+            {
+                _proxy.Dispose();
+            }
+        }
+
+        public static void ClearProxy()
+        {
+            ProxyEnd();
+            _proxy = null;
+        }
+
+        private void Init(GComponent comp)
+        {
+            m_c1 = comp.GetController("c1");
+            m_bg = (GComponent)comp.GetChild("bg");
+            m_txtLock = (GTextField)comp.GetChild("txtLock");
+            m_txtWeekGiftBag = (GTextField)comp.GetChild("txtWeekGiftBag");
+            m_listWeekGiftBag = (GList)comp.GetChild("listWeekGiftBag");
+            m_btnGetWeekGiftBag = (GButton)comp.GetChild("btnGetWeekGiftBag");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_c1 = null;
+            m_bg = null;
+            m_txtLock = null;
+            m_txtWeekGiftBag = null;
+            m_listWeekGiftBag = null;
+            m_btnGetWeekGiftBag = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Store/UI_WeekGiftUI.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4baca8b746d02b8439510b810f5cfe50
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 14 - 33
GameClient/Assets/Game/HotUpdate/Views/Store/StoreChargeAddUpView.cs

@@ -124,14 +124,6 @@ namespace GFGGame
             item.m_listGiftBag.data = lastVipCfg.bonusOnceArr;
             item.m_listGiftBag.numItems = lastVipCfg.bonusOnceArr.Length;
 
-            item.m_txtWeekGiftBag.SetVar("value", vipCfg.id.ToString()).FlushVars();
-            if (item.m_listWeekGiftBag.data == null)
-            {
-                item.m_listWeekGiftBag.itemRenderer = ListRewardItemRender;
-            }
-            item.m_listWeekGiftBag.data = vipCfg.bonusWeekArr;
-            item.m_listWeekGiftBag.numItems = vipCfg.bonusWeekArr.Length;
-
             if (item.m_holder.data == null)
             {
                 DressUpObjUI dressUpObjUI = new DressUpObjUI("SceneSuitFoster");
@@ -156,14 +148,14 @@ namespace GFGGame
             bool isGet = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.VipGetStatus), vipCfg.id);
             item.m_btnGetGiftBag.grayed = isGet || vipCfg.id > RoleDataManager.vipLv;
             RedDotController.Instance.SetComRedDot(item.m_btnGetGiftBag, !isGet && RoleDataManager.vipLv >= vipCfg.id);
-            if (item.m_btnGetWeekGiftBag.data == null)
+            if (item.m_btnWeek.data == null)
             {
-                item.m_btnGetWeekGiftBag.onClick.Add(OnBtnGetWeekGiftBagClick);
+                item.m_btnWeek.onClick.Add(OnBtnWeekClick);
             }
-            item.m_btnGetWeekGiftBag.data = vipCfg.id;
+            item.m_btnWeek.data = vipCfg.id;
             bool canGet = GameGlobal.myNumericComponent.GetAsInt(NumericType.VipWeekGetStatus) == 0 && RoleDataManager.vipLv == vipCfg.id;
-            item.m_btnGetWeekGiftBag.grayed = !canGet;
-            RedDotController.Instance.SetComRedDot(item.m_btnGetWeekGiftBag, canGet);
+            item.m_btnWeek.grayed = !canGet;
+            RedDotController.Instance.SetComRedDot(item.m_btnWeek, canGet);
             UI_ListVipItem.ProxyEnd();
         }
 
@@ -196,6 +188,14 @@ namespace GFGGame
             }
             ViewManager.Show<SuitShowView>(new object[] { _suitTypeId, suitId, new List<int>() { suitId }, false });
         }
+
+        private void OnBtnWeekClick(EventContext context)
+        {
+            GObject obj = context.sender as GObject;
+            int vipLv = (int)obj.data;
+            ViewManager.Show<WeekGiftView>(vipLv);
+        }
+            
         private void OnBtnGetGiftBagClick(EventContext context)
         {
             GObject obj = context.sender as GObject;
@@ -213,26 +213,7 @@ namespace GFGGame
             }
             ShopSProxy.ReqGetVipGiftBag(vipLv).Coroutine();
         }
-        private void OnBtnGetWeekGiftBagClick(EventContext context)
-        {
-            GObject obj = context.sender as GObject;
-            int vipLv = (int)obj.data;
-            if (GameGlobal.myNumericComponent.GetAsInt(NumericType.VipWeekGetStatus) == 1)
-            {
-                PromptController.Instance.ShowFloatTextPrompt("会员每周礼包已领取");
-                return;
-            }
-            if (RoleDataManager.vipLv < vipLv)
-            {
-                PromptController.Instance.ShowFloatTextPrompt("会员等级不足");
-                return;
-            }
-            AlertUI.Show("提升VIP等级能领取更高级的礼包,是否继续领取当前等级的VIP礼包?", "(该礼包每周只能领取1次)")
-             .SetLeftButton(true, "否").SetRightButton(true, "是", async (object data) =>
-             {
-                 ShopSProxy.ReqGetVipWeekGiftBag(vipLv).Coroutine();
-             });
-        }
+
         private void OnBtnLeftClick()
         {
 

+ 82 - 0
GameClient/Assets/Game/HotUpdate/Views/Store/WeekGiftView.cs

@@ -0,0 +1,82 @@
+using System.Threading.Tasks;
+using ET;
+using FairyGUI;
+using UI.Store;
+
+namespace GFGGame
+{
+    public class WeekGiftView : BaseWindow
+    {
+        private UI_WeekGiftUI _ui;
+        private int _vipLv;
+
+        public override void Dispose()
+        {
+            if (_ui != null)
+            {
+                _ui.Dispose();
+            }
+            _ui = null;
+            base.Dispose();
+        }
+        protected override void OnHide()
+        {
+            base.OnHide();
+
+        }
+        protected override void OnInit()
+        {
+            base.OnInit();
+            packageName = UI_WeekGiftUI.PACKAGE_NAME;
+            _ui = UI_WeekGiftUI.Create();
+            this.viewCom = _ui.target;
+            this.viewCom.Center();
+            this.modal = true;
+            _ui.m_listWeekGiftBag.itemRenderer = ListRewardItemRender;
+            _ui.m_btnGetWeekGiftBag.onClick.Add(OnBtnGetWeekGiftBagClick);
+        }
+
+        protected override void OnShown()
+        {
+            base.OnShown();
+            _vipLv = (int)this.viewData;
+            VipCfg vipCfg = VipCfgArray.Instance.dataArray[_vipLv + 1];
+            _ui.m_txtWeekGiftBag.SetVar("value", vipCfg.id.ToString()).FlushVars();
+            _ui.m_listWeekGiftBag.data = vipCfg.bonusWeekArr;
+            _ui.m_listWeekGiftBag.numItems = vipCfg.bonusWeekArr.Length;
+        }
+
+        private void ListRewardItemRender(int index, GObject obj)
+        {
+            int[][] rewards = (int[][])obj.parent.data;
+
+            if (obj.data == null)
+            {
+                obj.data = new ItemView(obj as GComponent);
+            }
+            ItemData itemData = ItemUtil.createItemData(rewards[index]);
+            (obj.data as ItemView).SetData(itemData);
+            (obj.data as ItemView).ChangeTxtCountStyle();
+        }
+
+        private void OnBtnGetWeekGiftBagClick(EventContext context)
+        {
+            if (GameGlobal.myNumericComponent.GetAsInt(NumericType.VipWeekGetStatus) == 1)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("会员每周礼包已领取");
+                return;
+            }
+            if (RoleDataManager.vipLv < _vipLv)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("会员等级不足");
+                return;
+            }
+            AlertUI.Show("提升VIP等级能领取更高级的礼包,是否继续领取当前等级的VIP礼包?", "(该礼包每周只能领取1次)")
+             .SetLeftButton(true, "否").SetRightButton(true, "是", async (object data) =>
+             {
+                 bool result = await ShopSProxy.ReqGetVipWeekGiftBag(_vipLv);
+                 if (result){ }
+             });
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Views/Store/WeekGiftView.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1e8bec429231c934f94623ac1b657a2e
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
GameClient/Assets/ResIn/UI/Store/Store_atlas0.png


BIN
GameClient/Assets/ResIn/UI/Store/Store_atlas0_1.png


BIN
GameClient/Assets/ResIn/UI/Store/Store_atlas0_2.png


BIN
GameClient/Assets/ResIn/UI/Store/Store_atlas0_3.png


BIN
GameClient/Assets/ResIn/UI/Store/Store_atlas0_4.png


+ 0 - 96
GameClient/Assets/ResIn/UI/Store/Store_atlas0_4.png.meta

@@ -1,96 +0,0 @@
-fileFormatVersion: 2
-guid: 8ad3bfb21b6a4f74b9df645db2bf76bd
-TextureImporter:
-  internalIDToNameTable: []
-  externalObjects: {}
-  serializedVersion: 11
-  mipmaps:
-    mipMapMode: 0
-    enableMipMap: 0
-    sRGBTexture: 1
-    linearTexture: 0
-    fadeOut: 0
-    borderMipMap: 0
-    mipMapsPreserveCoverage: 0
-    alphaTestReferenceValue: 0.5
-    mipMapFadeDistanceStart: 1
-    mipMapFadeDistanceEnd: 3
-  bumpmap:
-    convertToNormalMap: 0
-    externalNormalMap: 0
-    heightScale: 0.25
-    normalMapFilter: 0
-  isReadable: 0
-  streamingMipmaps: 0
-  streamingMipmapsPriority: 0
-  vTOnly: 0
-  grayScaleToAlpha: 0
-  generateCubemap: 6
-  cubemapConvolution: 0
-  seamlessCubemap: 0
-  textureFormat: 1
-  maxTextureSize: 2048
-  textureSettings:
-    serializedVersion: 2
-    filterMode: 1
-    aniso: 1
-    mipBias: 0
-    wrapU: 1
-    wrapV: 1
-    wrapW: 1
-  nPOTScale: 0
-  lightmap: 0
-  compressionQuality: 50
-  spriteMode: 1
-  spriteExtrude: 1
-  spriteMeshType: 1
-  alignment: 0
-  spritePivot: {x: 0.5, y: 0.5}
-  spritePixelsToUnits: 100
-  spriteBorder: {x: 0, y: 0, z: 0, w: 0}
-  spriteGenerateFallbackPhysicsShape: 1
-  alphaUsage: 1
-  alphaIsTransparency: 1
-  spriteTessellationDetail: -1
-  textureType: 8
-  textureShape: 1
-  singleChannelComponent: 0
-  flipbookRows: 1
-  flipbookColumns: 1
-  maxTextureSizeSet: 0
-  compressionQualitySet: 0
-  textureFormatSet: 0
-  ignorePngGamma: 0
-  applyGammaDecoding: 0
-  platformSettings:
-  - serializedVersion: 3
-    buildTarget: DefaultTexturePlatform
-    maxTextureSize: 2048
-    resizeAlgorithm: 0
-    textureFormat: -1
-    textureCompression: 1
-    compressionQuality: 50
-    crunchedCompression: 0
-    allowsAlphaSplitting: 0
-    overridden: 0
-    androidETC2FallbackOverride: 0
-    forceMaximumCompressionQuality_BC6H_BC7: 0
-  spriteSheet:
-    serializedVersion: 2
-    sprites: []
-    outline: []
-    physicsShape: []
-    bones: []
-    spriteID: 5e97eb03825dee720800000000000000
-    internalID: 0
-    vertices: []
-    indices: 
-    edges: []
-    weights: []
-    secondaryTextures: []
-  spritePackingTag: 
-  pSDRemoveMatte: 0
-  pSDShowRemoveMatteOption: 0
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

BIN
GameClient/Assets/ResIn/UI/Store/Store_atlas0_5.png


+ 0 - 96
GameClient/Assets/ResIn/UI/Store/Store_atlas0_5.png.meta

@@ -1,96 +0,0 @@
-fileFormatVersion: 2
-guid: 1a220ab3991363647afc3bac21725423
-TextureImporter:
-  internalIDToNameTable: []
-  externalObjects: {}
-  serializedVersion: 11
-  mipmaps:
-    mipMapMode: 0
-    enableMipMap: 0
-    sRGBTexture: 1
-    linearTexture: 0
-    fadeOut: 0
-    borderMipMap: 0
-    mipMapsPreserveCoverage: 0
-    alphaTestReferenceValue: 0.5
-    mipMapFadeDistanceStart: 1
-    mipMapFadeDistanceEnd: 3
-  bumpmap:
-    convertToNormalMap: 0
-    externalNormalMap: 0
-    heightScale: 0.25
-    normalMapFilter: 0
-  isReadable: 0
-  streamingMipmaps: 0
-  streamingMipmapsPriority: 0
-  vTOnly: 0
-  grayScaleToAlpha: 0
-  generateCubemap: 6
-  cubemapConvolution: 0
-  seamlessCubemap: 0
-  textureFormat: 1
-  maxTextureSize: 2048
-  textureSettings:
-    serializedVersion: 2
-    filterMode: 1
-    aniso: 1
-    mipBias: 0
-    wrapU: 1
-    wrapV: 1
-    wrapW: 1
-  nPOTScale: 0
-  lightmap: 0
-  compressionQuality: 50
-  spriteMode: 1
-  spriteExtrude: 1
-  spriteMeshType: 1
-  alignment: 0
-  spritePivot: {x: 0.5, y: 0.5}
-  spritePixelsToUnits: 100
-  spriteBorder: {x: 0, y: 0, z: 0, w: 0}
-  spriteGenerateFallbackPhysicsShape: 1
-  alphaUsage: 1
-  alphaIsTransparency: 1
-  spriteTessellationDetail: -1
-  textureType: 8
-  textureShape: 1
-  singleChannelComponent: 0
-  flipbookRows: 1
-  flipbookColumns: 1
-  maxTextureSizeSet: 0
-  compressionQualitySet: 0
-  textureFormatSet: 0
-  ignorePngGamma: 0
-  applyGammaDecoding: 0
-  platformSettings:
-  - serializedVersion: 3
-    buildTarget: DefaultTexturePlatform
-    maxTextureSize: 2048
-    resizeAlgorithm: 0
-    textureFormat: -1
-    textureCompression: 1
-    compressionQuality: 50
-    crunchedCompression: 0
-    allowsAlphaSplitting: 0
-    overridden: 0
-    androidETC2FallbackOverride: 0
-    forceMaximumCompressionQuality_BC6H_BC7: 0
-  spriteSheet:
-    serializedVersion: 2
-    sprites: []
-    outline: []
-    physicsShape: []
-    bones: []
-    spriteID: 5e97eb03825dee720800000000000000
-    internalID: 0
-    vertices: []
-    indices: 
-    edges: []
-    weights: []
-    secondaryTextures: []
-  spritePackingTag: 
-  pSDRemoveMatte: 0
-  pSDShowRemoveMatteOption: 0
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

BIN
GameClient/Assets/ResIn/UI/Store/Store_atlas_hhx91q.png


BIN
GameClient/Assets/ResIn/UI/Store/Store_fui.bytes