From 3eee5957f6df4918b7e84835880462a38dabe225 Mon Sep 17 00:00:00 2001 From: chenxi Date: Fri, 2 Jun 2023 15:48:12 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/account/account_manager.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lua/app/module/account/account_manager.lua b/lua/app/module/account/account_manager.lua index 36e44dc5..4eba2a09 100644 --- a/lua/app/module/account/account_manager.lua +++ b/lua/app/module/account/account_manager.lua @@ -57,7 +57,7 @@ function AccountManager:bindAccount() end function AccountManager:onBindAccount(result) - if result.err_code == GConst.ERROR_STR.SUCCESS then + if result.status == 0 then local accountInfo = LocalData:getAccountInfo() local loginType = SDKManager.BF_LOGIN_TYPE.GOOGLE if Platform:isIosPlatform() then @@ -74,6 +74,12 @@ function AccountManager:onBindAccount(result) GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.BIND_ACCOUNT_SUCCESS)) EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.BIND_ACCOUNT_SUCCESS) else -- 一些失败的提示 + local params = { + content = I18N:getGlobalText(I18N.GlobalConst.ALREADY_BINDED_DESC), + boxType = GConst.MESSAGE_BOX_TYPE.MB_OK, + okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK), + } + GFunc.showMessageBox(params) local loginType = SDKManager.BF_LOGIN_TYPE.GOOGLE if Platform:isIosPlatform() then loginType = SDKManager.BF_LOGIN_TYPE.APPLE @@ -103,7 +109,7 @@ function AccountManager:changeAccount() end function AccountManager:onChangeAccount(result) - if result.err_code == GConst.ERROR_STR.SUCCESS then -- 目标账号存在,切换到目标账号 + if result.status == 0 then local accountInfo = LocalData:getAccountInfo() local loginType = SDKManager.BF_LOGIN_TYPE.GOOGLE if Platform:isIosPlatform() then From ec5d5fbc827b94be4aa7e9185bd35a5dfcb868e2 Mon Sep 17 00:00:00 2001 From: chenxi Date: Fri, 2 Jun 2023 17:07:09 +0800 Subject: [PATCH 2/8] gm --- lua/app/module/gm/gm_const.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/app/module/gm/gm_const.lua b/lua/app/module/gm/gm_const.lua index 7460ba4b..d891f70d 100644 --- a/lua/app/module/gm/gm_const.lua +++ b/lua/app/module/gm/gm_const.lua @@ -98,6 +98,12 @@ args:不掉落的元素类型 Example: set_seal_element 1 2 3]], type = "set_seal_element" }, + { + title = "账号解绑", + desc = [[账号解绑 type:unbind +Example: unbind google]], + type = "unbind" + }, } return GMConst \ No newline at end of file From c73734a068f85b336b4c138a64740dcb1b781bce Mon Sep 17 00:00:00 2001 From: chenxi Date: Fri, 2 Jun 2023 17:20:31 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../localization_global_const.lua | 11 ++ lua/app/config/skill.lua | 157 +++++++++++++----- lua/app/config/strings/cn/global.lua | 11 ++ lua/app/module/account/account_manager.lua | 18 +- 4 files changed, 153 insertions(+), 44 deletions(-) diff --git a/lua/app/config/localization/localization_global_const.lua b/lua/app/config/localization/localization_global_const.lua index 659feef3..1874a5d0 100644 --- a/lua/app/config/localization/localization_global_const.lua +++ b/lua/app/config/localization/localization_global_const.lua @@ -194,6 +194,17 @@ local LocalizationGlobalConst = NO_ADS = "NO_ADS", BESURE_DELETE_TIPS_DESC = "BESURE_DELETE_TIPS_DESC", BESURE_DELETE_ACCOUNT_DESC = "BESURE_DELETE_ACCOUNT_DESC", + DELETE_ACCOUNT_FAILED = "DELETE_ACCOUNT_FAILED", + CHANGE_ACCOUNT_TIPS_DESC = "CHANGE_ACCOUNT_TIPS_DESC", + BIND_ACCOUNT_SUCCESS = "BIND_ACCOUNT_SUCCESS", + MAINTAIN = "MAINTAIN", + DISCONNECT_RELOGIN = "DISCONNECT_RELOGIN", + FORBIDDEN = "FORBIDDEN", + OTHER_LOGIN = "OTHER_LOGIN", + ACCOUNT_EXCHANGE_DESC = "ACCOUNT_EXCHANGE_DESC", + ALREADY_BINDED_DESC = "ALREADY_BINDED_DESC", + BIND_ACCOUNT_FAILED = "BIND_ACCOUNT_FAILED", + CHANGE_ACCOUNT_FAILED = "CHANGE_ACCOUNT_FAILED", } return LocalizationGlobalConst \ No newline at end of file diff --git a/lua/app/config/skill.lua b/lua/app/config/skill.lua index 27c144a2..7b90e5dc 100644 --- a/lua/app/config/skill.lua +++ b/lua/app/config/skill.lua @@ -207,7 +207,12 @@ local skill = { ["shake_type"]=5, ["sound_hit"]=1200120, ["name_act"]="skill01", - ["fx_self"]=300022 + ["fx_self"]=300022, + ["bullet_time"]={ + 1167, + 3000, + 300 + } }, [1200121]={ ["position"]=1, @@ -409,7 +414,12 @@ local skill = { ["shake_type"]=5, ["sound_hit"]=1200120, ["name_act"]="skill01", - ["fx_self"]=300059 + ["fx_self"]=300059, + ["bullet_time"]={ + 1900, + 3000, + 400 + } }, [1300121]={ ["position"]=1, @@ -495,7 +505,12 @@ local skill = { ["shake_type"]=5, ["sound_hit"]=1200120, ["name_act"]="skill01", - ["fx_self"]=300059 + ["fx_self"]=300059, + ["bullet_time"]={ + 1900, + 3000, + 400 + } }, [1300124]={ ["position"]=1, @@ -703,7 +718,12 @@ local skill = { ["shake_type"]=5, ["sound_hit"]=1200114, ["name_act"]="skill01", - ["fx_self"]=300039 + ["fx_self"]=300039, + ["bullet_time"]={ + 1500, + 3000, + 400 + } }, [1300221]={ ["position"]=1, @@ -806,7 +826,12 @@ local skill = { ["shake_type"]=5, ["sound_hit"]=1200114, ["name_act"]="skill01", - ["fx_self"]=300039 + ["fx_self"]=300039, + ["bullet_time"]={ + 1500, + 3000, + 400 + } }, [1400110]={ ["position"]=1, @@ -929,7 +954,12 @@ local skill = { ["shake_type"]=5, ["sound_hit"]=1200120, ["name_act"]="skill01", - ["fx_self"]=300049 + ["fx_self"]=300049, + ["bullet_time"]={ + 400, + 3000, + 400 + } }, [1400121]={ ["position"]=1, @@ -1131,7 +1161,7 @@ local skill = { ["name_act"]="skill01", ["fx_self"]=300009, ["bullet_time"]={ - 1100, + 933, 3000, 400 } @@ -1218,7 +1248,7 @@ local skill = { ["name_act"]="skill01", ["fx_self"]=300009, ["bullet_time"]={ - 1100, + 933, 3000, 400 } @@ -1352,7 +1382,7 @@ local skill = { ["name_act"]="skill01", ["fx_self"]=300044, ["bullet_time"]={ - 1100, + 1400, 3000, 400 } @@ -1420,7 +1450,7 @@ local skill = { ["name_act"]="skill01", ["fx_self"]=300044, ["bullet_time"]={ - 1100, + 1400, 3000, 400 } @@ -1649,7 +1679,7 @@ local skill = { ["name_act"]="skill01", ["fx_self"]=300054, ["bullet_time"]={ - 1100, + 800, 3000, 400 } @@ -2100,7 +2130,7 @@ local skill = { ["name_act"]="skill01", ["fx_self"]=300004, ["bullet_time"]={ - 1566, + 966, 5000, 400 } @@ -2506,7 +2536,7 @@ local skill = { ["name_act"]="skill01", ["fx_self"]=300074, ["bullet_time"]={ - 1100, + 1500, 3000, 400 } @@ -2604,7 +2634,7 @@ local skill = { ["name_act"]="skill01", ["fx_self"]=300074, ["bullet_time"]={ - 1100, + 1500, 3000, 400 } @@ -2689,7 +2719,7 @@ local skill = { ["name_act"]="skill01", ["fx_self"]=300074, ["bullet_time"]={ - 1100, + 1500, 3000, 400 } @@ -2825,7 +2855,7 @@ local skill = { ["name_act"]="skill01", ["fx_self"]=300092, ["bullet_time"]={ - 1100, + 1600, 3000, 400 } @@ -2947,7 +2977,7 @@ local skill = { ["name_act"]="skill01", ["fx_self"]=300092, ["bullet_time"]={ - 1100, + 1600, 3000, 400 } @@ -3061,7 +3091,12 @@ local skill = { ["shake_type"]=6, ["sound_hit"]=4200120, ["name_act"]="skill01", - ["fx_target"]=300014 + ["fx_target"]=300014, + ["bullet_time"]={ + 1066, + 3000, + 400 + } }, [4200121]={ ["position"]=4, @@ -3248,7 +3283,12 @@ local skill = { ["shake_type"]=6, ["sound_hit"]=4200120, ["name_act"]="skill01", - ["fx_self"]=300084 + ["fx_self"]=300084, + ["bullet_time"]={ + 200, + 3000, + 400 + } }, [4300121]={ ["position"]=4, @@ -3366,7 +3406,12 @@ local skill = { ["shake_type"]=6, ["sound_hit"]=4200120, ["name_act"]="skill01", - ["fx_self"]=300084 + ["fx_self"]=300084, + ["bullet_time"]={ + 200, + 3000, + 400 + } }, [4300210]={ ["position"]=4, @@ -3497,7 +3542,12 @@ local skill = { ["shake_type"]=6, ["sound_hit"]=4200120, ["name_act"]="skill01", - ["fx_self"]=300079 + ["fx_self"]=300079, + ["bullet_time"]={ + 1833, + 3000, + 400 + } }, [4300221]={ ["position"]=4, @@ -3706,7 +3756,7 @@ local skill = { ["name_act"]="skill01", ["fx_target"]=300034, ["bullet_time"]={ - 733, + 633, 3000, 400 } @@ -4068,7 +4118,12 @@ local skill = { ["shake_type"]=6, ["sound_hit"]=4200120, ["name_act"]="skill01", - ["fx_self"]=300064 + ["fx_self"]=300064, + ["bullet_time"]={ + 2066, + 3000, + 400 + } }, [5300121]={ ["position"]=5, @@ -4267,7 +4322,12 @@ local skill = { ["shake_type"]=6, ["sound_hit"]=4200120, ["name_act"]="skill01", - ["fx_self"]=300069 + ["fx_self"]=300069, + ["bullet_time"]={ + 1133, + 3000, + 400 + } }, [5300221]={ ["position"]=5, @@ -4409,7 +4469,12 @@ local skill = { ["shake_type"]=6, ["sound_hit"]=4200120, ["name_act"]="skill01", - ["fx_self"]=300069 + ["fx_self"]=300069, + ["bullet_time"]={ + 1133, + 3000, + 400 + } }, [5400110]={ ["position"]=5, @@ -4531,7 +4596,12 @@ local skill = { ["shake_type"]=6, ["sound_hit"]=4200120, ["name_act"]="skill01", - ["fx_self"]=300089 + ["fx_self"]=300089, + ["bullet_time"]={ + 1800, + 3000, + 400 + } }, [5400121]={ ["skill_type"]=11, @@ -4593,7 +4663,12 @@ local skill = { ["shake_type"]=6, ["sound_hit"]=4200120, ["name_act"]="skill01", - ["fx_self"]=300089 + ["fx_self"]=300089, + ["bullet_time"]={ + 1800, + 3000, + 400 + } }, [5400124]={ ["effect_type"]=2, @@ -4879,9 +4954,9 @@ local skill = { ["name_act"]="skill01", ["fx_self"]=200045, ["bullet_time"]={ - 333, + 500, 3000, - 666 + 400 } }, [10017]={ @@ -4911,9 +4986,9 @@ local skill = { ["name_act"]="skill01", ["fx_self"]=200037, ["bullet_time"]={ - 333, + 1500, 3000, - 666 + 400 } }, [10018]={ @@ -4948,9 +5023,9 @@ local skill = { ["name_act"]="skill01", ["fx_self"]=200117, ["bullet_time"]={ - 333, + 400, 3000, - 666 + 400 } }, [10019]={ @@ -4980,9 +5055,9 @@ local skill = { ["name_act"]="skill01", ["fx_self"]=200002, ["bullet_time"]={ - 333, + 666, 3000, - 666 + 400 } }, [10020]={ @@ -5012,9 +5087,9 @@ local skill = { ["name_act"]="skill01", ["fx_self"]=200005, ["bullet_time"]={ - 333, + 666, 3000, - 666 + 400 } }, [10021]={ @@ -5044,9 +5119,9 @@ local skill = { ["name_act"]="skill01", ["fx_self"]=400044, ["bullet_time"]={ - 333, + 200, 3000, - 666 + 400 } }, [10022]={ @@ -5371,7 +5446,7 @@ local skill = { ["trigger"]=1, ["effect"]={ { - ["type"]="shield_rebound_200", + ["type"]="shield", ["num"]=1000, ["ratio"]=10000, ["round"]=2 @@ -5578,8 +5653,6 @@ local skill = { ["sound_hit"]=1200120, ["name_act"]="skill01", ["fx_self"]=200028, - ["fx_target"]=2, - ["fx_target_delay"]=900, ["bullet_time"]={ 1100, 3000, diff --git a/lua/app/config/strings/cn/global.lua b/lua/app/config/strings/cn/global.lua index 80d90981..8f49136a 100644 --- a/lua/app/config/strings/cn/global.lua +++ b/lua/app/config/strings/cn/global.lua @@ -194,6 +194,17 @@ local localization_global = ["NO_ADS"] = "新广告还没有准备好", ["BESURE_DELETE_TIPS_DESC"] = "是否要删除账号,删除后将清除所有信息和内容,账号重新登陆后将是初始1级新手状态。如果确定请输入“{0}”", ["BESURE_DELETE_ACCOUNT_DESC"] = "确认删除", + ["DELETE_ACCOUNT_FAILED"] = "账号删除失败,请重试", + ["CHANGE_ACCOUNT_TIPS_DESC"] = "当前账号未绑定, 切换后可能会导致数据丢失, 是否确认要切换?", + ["BIND_ACCOUNT_SUCCESS"] = "账号绑定成功", + ["MAINTAIN"] = "服务器维护", + ["DISCONNECT_RELOGIN"] = "网络连接已断开, 请重新登录", + ["FORBIDDEN"] = "封号/禁止登录", + ["OTHER_LOGIN"] = "账号在其他设备登录", + ["ACCOUNT_EXCHANGE_DESC"] = "账号是没有信息的新号,无法切换。", + ["ALREADY_BINDED_DESC"] = "绑定失败,该账号已有其他绑定信息", + ["BIND_ACCOUNT_FAILED"] = "账号绑定失败,请重试", + ["CHANGE_ACCOUNT_FAILED"] = "账号切换失败,请重试", } return localization_global \ No newline at end of file diff --git a/lua/app/module/account/account_manager.lua b/lua/app/module/account/account_manager.lua index 4eba2a09..a31e2fa5 100644 --- a/lua/app/module/account/account_manager.lua +++ b/lua/app/module/account/account_manager.lua @@ -73,12 +73,16 @@ function AccountManager:onBindAccount(result) BIReport:postAccountBindFinish(loginType, true) GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.BIND_ACCOUNT_SUCCESS)) EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.BIND_ACCOUNT_SUCCESS) - else -- 一些失败的提示 + else local params = { - content = I18N:getGlobalText(I18N.GlobalConst.ALREADY_BINDED_DESC), boxType = GConst.MESSAGE_BOX_TYPE.MB_OK, okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK), } + if result.status == 13 then -- 重复绑定 + params.content = I18N:getGlobalText(I18N.GlobalConst.ALREADY_BINDED_DESC) + else + params.content = I18N:getGlobalText(I18N.GlobalConst.BIND_ACCOUNT_FAILED) + end GFunc.showMessageBox(params) local loginType = SDKManager.BF_LOGIN_TYPE.GOOGLE if Platform:isIosPlatform() then @@ -124,6 +128,16 @@ function AccountManager:onChangeAccount(result) BIReport:postAccountChangeFinish(loginType, true) ModuleManager.LoginManager:goToLoginScene() else + local params = { + boxType = GConst.MESSAGE_BOX_TYPE.MB_OK, + okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK), + } + if result.status == 14 then + params.content = I18N:getGlobalText(I18N.GlobalConst.ACCOUNT_EXCHANGE_DESC) + else + params.content = I18N:getGlobalText(I18N.GlobalConst.CHANGE_ACCOUNT_FAILED) + end + GFunc.showMessageBox(params) local loginType = SDKManager.BF_LOGIN_TYPE.GOOGLE if Platform:isIosPlatform() then loginType = SDKManager.BF_LOGIN_TYPE.APPLE From 2f2a993c124a43b92a1c1f15a3314b4ddee0764d Mon Sep 17 00:00:00 2001 From: chenxi Date: Fri, 2 Jun 2023 18:20:15 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E6=89=93=E5=AE=8C=E7=AC=AC=E4=BA=8C?= =?UTF-8?q?=E7=AB=A0=E5=90=8E=E4=B8=83=E5=A4=A9=E4=B9=90=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=BC=80=E5=90=AF=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/common/data_manager.lua | 41 ++++++++++++++++++- lua/app/module/chapter/chapter_manager.lua | 2 + lua/app/module/player/player_manager.lua | 1 + .../activity/seven_day/seven_day_data.lua | 16 +++++++- 4 files changed, 58 insertions(+), 2 deletions(-) diff --git a/lua/app/common/data_manager.lua b/lua/app/common/data_manager.lua index 1a43a6c9..0cb72b65 100644 --- a/lua/app/common/data_manager.lua +++ b/lua/app/common/data_manager.lua @@ -101,6 +101,7 @@ function DataManager:clear() -- 任务数据最后清理 self.TaskData:clear() ModuleManager.TaskManager:clear() + self:clearTryOpenFunc() end function DataManager:initWithServerData(data) @@ -255,6 +256,44 @@ function DataManager:scheduleGlobal() end, 1) end +function DataManager:tryOpenModules() + if not self.tryOpenCallbacks then + return + end + for k, v in pairs(self.tryOpenCallbacks) do + v() + end +end + +function DataManager:registerTryOpenFunc(bindId, func) + if not bindId or not func then + return + end + if not self.tryOpenCallbacks then + self.tryOpenCallbacks = {} + end + self.tryOpenCallbacks[bindId] = func +end + +function DataManager:unregisterTryOpenFunc(bindId) + if not bindId then + return + end + if not self.tryOpenCallbacks then + return + end + self.tryOpenCallbacks[bindId] = nil +end + +function DataManager:clearTryOpenFunc() + if not self.tryOpenCallbacks then + return + end + for k, v in pairs(self.tryOpenCallbacks) do + self.tryOpenCallbacks[k] = nil + end +end + function DataManager:getSignInfo() local nowTime = Time:getServerTime() local lastSignTime = self.signInfo.latest_at // 1000 @@ -264,7 +303,7 @@ function DataManager:getSignInfo() canSign = false end return self.signInfo.count or 0, canSign, self.hasSigned -end +end function DataManager:setSignCount(count) self.hasSigned = true diff --git a/lua/app/module/chapter/chapter_manager.lua b/lua/app/module/chapter/chapter_manager.lua index ecdbbae9..b17813c5 100644 --- a/lua/app/module/chapter/chapter_manager.lua +++ b/lua/app/module/chapter/chapter_manager.lua @@ -119,6 +119,8 @@ function ChapterManager:endFightFinish(result) if maxChapter == 1 then DataManager.ShopData:markPopUpGiftForBeginnerGift() end + -- 新章节通关,尝试解锁新功能 + DataManager:tryOpenModules() -- 章节通关 标记可弹出章节礼包 DataManager.ShopData:markPopUpGiftForActChapterStore(maxChapter) ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_PASS_CHAPTER) diff --git a/lua/app/module/player/player_manager.lua b/lua/app/module/player/player_manager.lua index 43195b26..e1303cfd 100644 --- a/lua/app/module/player/player_manager.lua +++ b/lua/app/module/player/player_manager.lua @@ -20,6 +20,7 @@ function PlayerManager:onLevelUpFinish(result) if diffLv > 0 then self:showPlayerUpUI(currLv, result.rewards) ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_PLAYER_LV_REACH, diffLv) + DataManager:tryOpenModules() end end end diff --git a/lua/app/userdata/activity/seven_day/seven_day_data.lua b/lua/app/userdata/activity/seven_day/seven_day_data.lua index f4f3da05..f57657e5 100644 --- a/lua/app/userdata/activity/seven_day/seven_day_data.lua +++ b/lua/app/userdata/activity/seven_day/seven_day_data.lua @@ -13,6 +13,7 @@ function SevenDayData:clear() self.tasks = {} self.stepRewards = {} DataManager:unregisterCrossDayFunc("SevenDayData") + DataManager:unregisterTryOpenFunc("SevenDayData") end function SevenDayData:init(data) @@ -35,6 +36,19 @@ function SevenDayData:init(data) self:calCollectStepCount() self:initTaskListener() + if self.openTs <= 0 then + DataManager:registerTryOpenFunc("SevenDayData", function() + if self.openTs <= 0 then + if ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.SEVEN_DAY, true) then + self.openTs = Time:getBeginningOfServerToday() + self.endTime = self.openTs + self:getDurationTime() + self.actDay = 1 + DataManager:unregisterTryOpenFunc("SevenDayData") + end + end + end) + end + DataManager:registerCrossDayFunc("SevenDayData", function() self.actDay = self.actDay + 1 self:setDirty() @@ -361,7 +375,7 @@ end function SevenDayData:initTaskListener() local nowTime = Time:getServerTime() -- 活动结束就不用监听了 - if self.endTime < nowTime then + if self.endTime > 0 and self.endTime < nowTime then ModuleManager.TaskManager:unRegisterAllModuleTask("SevenDayData") return false end From b6936a2c4a7d59d55ba889ebb93b1a22dcba590c Mon Sep 17 00:00:00 2001 From: Fang Date: Fri, 2 Jun 2023 15:37:44 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E8=A7=A3=E9=94=81?= =?UTF-8?q?=E9=A3=9E=E8=A1=8C=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/bf/unity/base_object.lua | 5 + lua/app/module/maincity/maincity_manager.lua | 57 +++++++++ .../ui/main_city/cell/side_bar_base_cell.lua | 19 +++ .../cell/side_bar_beginner_gift_cell.lua | 4 + .../cell/side_bar_first_recharge_cell.lua | 4 + .../main_city/cell/side_bar_gold_pig_cell.lua | 4 + .../cell/side_bar_growth_fund_cell.lua | 4 + .../ui/main_city/cell/side_bar_idle_cell.lua | 4 + .../cell/side_bar_seven_days_cell.lua | 4 + lua/app/ui/main_city/component/main_comp.lua | 37 ++++-- lua/app/ui/main_city/main_city_ui.lua | 61 ++++++++- lua/app/ui/main_city/module_unlock_ui.lua | 118 +++++++++++++----- lua/app/userdata/activity/activity_data.lua | 1 - 13 files changed, 278 insertions(+), 44 deletions(-) diff --git a/lua/app/bf/unity/base_object.lua b/lua/app/bf/unity/base_object.lua index a1d055bd..6af513ca 100644 --- a/lua/app/bf/unity/base_object.lua +++ b/lua/app/bf/unity/base_object.lua @@ -259,6 +259,11 @@ function BaseObject:addPosition(x, y, z) transform.position = Vector3 end +function BaseObject:getPosition() + local transform = self:getTransform() + return transform.position +end + function BaseObject:getLocalPosition() local transform = self:getTransform() return transform.localPosition diff --git a/lua/app/module/maincity/maincity_manager.lua b/lua/app/module/maincity/maincity_manager.lua index 8276f98f..f4ab3c67 100644 --- a/lua/app/module/maincity/maincity_manager.lua +++ b/lua/app/module/maincity/maincity_manager.lua @@ -26,7 +26,13 @@ function MaincityManager:firstEnterMainCity() end function MaincityManager:changeMainCityLeftSideBarOpenOrClose() + local mainUI = UIManager:getUIByIndex(UIManager.UI_PATH.MAINCITY_UI) + if not mainUI then + return nil + end + self.isLeftSideBarClose = not self.isLeftSideBarClose + mainUI:refreshLeftBtns() end function MaincityManager:getIsMainCityLeftSideBarClose() @@ -34,11 +40,62 @@ function MaincityManager:getIsMainCityLeftSideBarClose() end function MaincityManager:changeMainCityRightSideBarOpenOrClose() + local mainUI = UIManager:getUIByIndex(UIManager.UI_PATH.MAINCITY_UI) + if not mainUI then + return nil + end + self.isRightSideBarClose = not self.isRightSideBarClose + mainUI:refreshRightBtns() end function MaincityManager:getIsMainCityRightSideBarClose() return self.isRightSideBarClose end +-- 获取主界面各个模块的入口坐标 +function MaincityManager:getModuleEntrancePos(moduleKey) + local mainUI = UIManager:getUIByIndex(UIManager.UI_PATH.MAINCITY_UI) + if not mainUI then + return nil + end + + if moduleKey == ModuleManager.MODULE_KEY.TASK then + return mainUI:getTaskIconPos() + elseif moduleKey == ModuleManager.MODULE_KEY.MALL_DAILY then + return mainUI:getMallIconPos() + elseif moduleKey == ModuleManager.MODULE_KEY.DAILY_CHALLENGE then + return mainUI:getDailyChallengeIconPos() + elseif moduleKey == ModuleManager.MODULE_KEY.FUND or + moduleKey == ModuleManager.MODULE_KEY.IDLE_DROP or + moduleKey == ModuleManager.MODULE_KEY.SEVEN_DAY then + return mainUI:getSideBarActIconPos(moduleKey) + end +end + +-- 模块在侧边栏,-1:左,0:不在侧边栏,1:右 +function MaincityManager:getModuleInSideBarWhere(moduleKey) + local mainUI = UIManager:getUIByIndex(UIManager.UI_PATH.MAINCITY_UI) + if not mainUI then + return nil + end + + if self.mainCityUI:isInSideBarLeft(moduleKey) then + return -1 + elseif self.mainCityUI:isInSideBarRight(moduleKey) then + return 1 + else + return 0 + end +end + +function MaincityManager:isActivSideBarModule(moduleKey) + local mainUI = UIManager:getUIByIndex(UIManager.UI_PATH.MAINCITY_UI) + if not mainUI then + return nil + end + + return self.mainCityUI:isActivSideBarModule(moduleKey) +end + return MaincityManager \ No newline at end of file diff --git a/lua/app/ui/main_city/cell/side_bar_base_cell.lua b/lua/app/ui/main_city/cell/side_bar_base_cell.lua index 6a5ea157..2d254b78 100644 --- a/lua/app/ui/main_city/cell/side_bar_base_cell.lua +++ b/lua/app/ui/main_city/cell/side_bar_base_cell.lua @@ -5,6 +5,12 @@ local DEFAULT_RED_POINT_POS_Y = 30 local DEFAULT_RED_POINT_SCALE = 0.6 -- 需要继承重写的部分 *********************************************************** + +-- 模块key值,对应ModuleManager.MODULE_KEY +function SideBarBaseCellComp:getModuleKey() + return nil +end + function SideBarBaseCellComp:getIsOpen() return false end @@ -142,6 +148,19 @@ function SideBarBaseCellComp:setVisible(visible) end end +function SideBarBaseCellComp:getIsVisible() + return self.visible +end + +function SideBarBaseCellComp:getEntrancePos() + if self:getIconRes() then + return self.icon:getPosition() + elseif self:getSpineName() then + return self.spine:getPosition() + end + return nil +end + function SideBarBaseCellComp:getCellPath() return self.cellPath end diff --git a/lua/app/ui/main_city/cell/side_bar_beginner_gift_cell.lua b/lua/app/ui/main_city/cell/side_bar_beginner_gift_cell.lua index 5fcfbc4f..6738e77a 100644 --- a/lua/app/ui/main_city/cell/side_bar_beginner_gift_cell.lua +++ b/lua/app/ui/main_city/cell/side_bar_beginner_gift_cell.lua @@ -1,6 +1,10 @@ local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell" local SideBarBeginnerGiftCell = class("SideBarBeginnerGiftCell", SideBarBaseCellComp) +function SideBarBeginnerGiftCell:getModuleKey() + return ModuleManager.MODULE_KEY.BEGINNER_GIFT +end + function SideBarBeginnerGiftCell:getIsOpen() return DataManager.ShopData:getBeginnerGiftShowSideBar() end diff --git a/lua/app/ui/main_city/cell/side_bar_first_recharge_cell.lua b/lua/app/ui/main_city/cell/side_bar_first_recharge_cell.lua index ec4da44b..b952199a 100644 --- a/lua/app/ui/main_city/cell/side_bar_first_recharge_cell.lua +++ b/lua/app/ui/main_city/cell/side_bar_first_recharge_cell.lua @@ -1,6 +1,10 @@ local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell" local SideBarFirstRechargeCell = class("SideBarFirstRechargeCell", SideBarBaseCellComp) +function SideBarFirstRechargeCell:getModuleKey() + return ModuleManager.MODULE_KEY.FIRST_RECHARGE +end + function SideBarFirstRechargeCell:getIsOpen() return DataManager.ShopData:getShowFirstRechargeSideBar() end diff --git a/lua/app/ui/main_city/cell/side_bar_gold_pig_cell.lua b/lua/app/ui/main_city/cell/side_bar_gold_pig_cell.lua index eadb6a0a..1d8e9446 100644 --- a/lua/app/ui/main_city/cell/side_bar_gold_pig_cell.lua +++ b/lua/app/ui/main_city/cell/side_bar_gold_pig_cell.lua @@ -1,6 +1,10 @@ local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell" local SideBarGoldPigCell = class("SideBarGoldPigCell", SideBarBaseCellComp) +function SideBarGoldPigCell:getModuleKey() + return ModuleManager.MODULE_KEY.GOLD_PIG +end + function SideBarGoldPigCell:getIsOpen() return DataManager.GoldPigData:getIsOpen() end diff --git a/lua/app/ui/main_city/cell/side_bar_growth_fund_cell.lua b/lua/app/ui/main_city/cell/side_bar_growth_fund_cell.lua index 6bf5f779..9e8d4ad6 100644 --- a/lua/app/ui/main_city/cell/side_bar_growth_fund_cell.lua +++ b/lua/app/ui/main_city/cell/side_bar_growth_fund_cell.lua @@ -1,6 +1,10 @@ local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell" local SideBarGrowthFundCell = class("SideBarGrowthFundCell", SideBarBaseCellComp) +function SideBarGrowthFundCell:getModuleKey() + return ModuleManager.MODULE_KEY.FUND +end + function SideBarGrowthFundCell:getIsOpen() return DataManager.GrowthFundData:getIsOpen() end diff --git a/lua/app/ui/main_city/cell/side_bar_idle_cell.lua b/lua/app/ui/main_city/cell/side_bar_idle_cell.lua index c3c2e277..6b659715 100644 --- a/lua/app/ui/main_city/cell/side_bar_idle_cell.lua +++ b/lua/app/ui/main_city/cell/side_bar_idle_cell.lua @@ -1,6 +1,10 @@ local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell" local SideBarIdleCell = class("SideBarIdleCell", SideBarBaseCellComp) +function SideBarIdleCell:getModuleKey() + return ModuleManager.MODULE_KEY.IDLE_DROP +end + function SideBarIdleCell:getIsOpen() return DataManager.IdleData:getIsOpen() end diff --git a/lua/app/ui/main_city/cell/side_bar_seven_days_cell.lua b/lua/app/ui/main_city/cell/side_bar_seven_days_cell.lua index ab2ef947..fb1dbc22 100644 --- a/lua/app/ui/main_city/cell/side_bar_seven_days_cell.lua +++ b/lua/app/ui/main_city/cell/side_bar_seven_days_cell.lua @@ -1,6 +1,10 @@ local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell" local SideBarSevenDaysCell = class("SideBarSevenDaysCell", SideBarBaseCellComp) +function SideBarSevenDaysCell:getModuleKey() + return ModuleManager.MODULE_KEY.SEVEN_DAY +end + function SideBarSevenDaysCell:getIsOpen() return DataManager.SevenDayData:getIsOpen() end diff --git a/lua/app/ui/main_city/component/main_comp.lua b/lua/app/ui/main_city/component/main_comp.lua index 59d1bed1..9ce7880c 100644 --- a/lua/app/ui/main_city/component/main_comp.lua +++ b/lua/app/ui/main_city/component/main_comp.lua @@ -71,8 +71,10 @@ function MainComp:refreshFightBtn() end function MainComp:refreshLeftBtn() - local leftBtn = self.uiMap["main_comp.left_btn"] - leftBtn:setActive(false) + if self.leftBtn == nil then + self.leftBtn = self.uiMap["main_comp.left_btn"] + end + self.leftBtn:setActive(false) local leftIdx = self:getCurLeftModuleIdx() if leftIdx == nil then @@ -83,23 +85,25 @@ function MainComp:refreshLeftBtn() return end - leftBtn:setActive(true) + self.leftBtn:setActive(true) local iconAtlas, iconName = moduleCell:getEntranceIcon() self.uiMap["main_comp.left_btn.desc"]:setText(moduleCell:getEntranceName()) self.uiMap["main_comp.left_btn.icon"]:setSprite(iconAtlas, iconName) - leftBtn:addClickListener(function() + self.leftBtn:addClickListener(function() self:refreshModule(leftIdx) end) if moduleCell:getShowEntranceRedPoint() then - leftBtn:addRedPoint(65, 35, 0.6) + self.leftBtn:addRedPoint(65, 35, 0.6) else - leftBtn:removeRedPoint() + self.leftBtn:removeRedPoint() end end function MainComp:refreshRightBtn() - local rightBtn = self.uiMap["main_comp.right_btn"] - rightBtn:setActive(false) + if self.rightBtn == nil then + self.rightBtn = self.uiMap["main_comp.right_btn"] + end + self.rightBtn:setActive(false) local rightIdx = self:getCurRightModuleIdx() if rightIdx == nil then @@ -110,17 +114,17 @@ function MainComp:refreshRightBtn() return end - rightBtn:setActive(true) + self.rightBtn:setActive(true) local iconAtlas, iconName = moduleCell:getEntranceIcon() self.uiMap["main_comp.right_btn.desc"]:setText(moduleCell:getEntranceName()) self.uiMap["main_comp.right_btn.icon"]:setSprite(iconAtlas, iconName) - rightBtn:addClickListener(function() + self.rightBtn:addClickListener(function() self:refreshModule(rightIdx) end) if moduleCell:getShowEntranceRedPoint() then - rightBtn:addRedPoint(-65, 35, 0.6) + self.rightBtn:addRedPoint(-65, 35, 0.6) else - rightBtn:removeRedPoint() + self.rightBtn:removeRedPoint() end end @@ -188,4 +192,13 @@ function MainComp:refreshStageFormaion() end end +function MainComp:getDailyChallengeIconPos() + if self:getCurLeftModuleIdx() == GConst.MainCityConst.MAIN_MODULE.DAILY_CHALLENGE then + return self.leftBtn:getPosition() + end + if self:getCurRightModuleIdx() == GConst.MainCityConst.MAIN_MODULE.DAILY_CHALLENGE then + return self.rightBtn:getPosition() + end +end + return MainComp \ No newline at end of file diff --git a/lua/app/ui/main_city/main_city_ui.lua b/lua/app/ui/main_city/main_city_ui.lua index fa188a81..1f3a3615 100644 --- a/lua/app/ui/main_city/main_city_ui.lua +++ b/lua/app/ui/main_city/main_city_ui.lua @@ -403,7 +403,6 @@ end function MainCityUI:openOrCloseLeftSideBar() ModuleManager.MaincityManager:changeMainCityLeftSideBarOpenOrClose() - self:refreshLeftBtns() if self.isShowLeftSideBarArrowRedPoint ~= nil then local isShowLeftSideBarArrowRedPoint = self.isShowLeftSideBarArrowRedPoint self.isShowLeftSideBarArrowRedPoint = nil @@ -470,7 +469,6 @@ end function MainCityUI:openOrCloseRightSideBar() ModuleManager.MaincityManager:changeMainCityRightSideBarOpenOrClose() - self:refreshRightBtns() if self.isShowRightSideBarArrowRedPoint ~= nil then local isShowRightSideBarArrowRedPoint = self.isShowRightSideBarArrowRedPoint self.isShowRightSideBarArrowRedPoint = nil @@ -969,4 +967,63 @@ function MainCityUI:checkGift() end end +function MainCityUI:getTaskIconPos() + return self.taskBtn:getPosition() +end + +function MainCityUI:getMallIconPos() + return self.bottomBtnSpines[GConst.MainCityConst.BOTTOM_PAGE.SHOP]:getPosition() +end + +function MainCityUI:getDailyChallengeIconPos() + return self.subComps[GConst.MainCityConst.BOTTOM_PAGE.MAIN]:getDailyChallengeIconPos() +end + +function MainCityUI:getSideBarActIconPos(moduleKey) + for name, cell in pairs(self.leftBarList) do + if moduleKey == cell:getModuleKey() then + return cell:getBaseObject():getPosition() + end + end + for name, cell in pairs(self.rightBarList) do + if moduleKey == cell:getModuleKey() then + return cell:getBaseObject():getPosition() + end + end + return nil +end + +function MainCityUI:isInSideBarLeft(moduleKey) + for name, cell in pairs(self.leftBarList) do + if moduleKey == cell:getModuleKey() then + return true + end + end + return false +end + +function MainCityUI:isInSideBarRight(moduleKey) + for name, cell in pairs(self.rightBarList) do + if moduleKey == cell:getModuleKey() then + return true + end + end + return false +end + +function MainCityUI:isActivSideBarModule(moduleKey) + for name, cell in pairs(self.leftBarList) do + if moduleKey == cell:getModuleKey() then + return cell:getIsActive() and cell:getIsVisible() + end + end + for name, cell in pairs(self.rightBarList) do + if moduleKey == cell:getModuleKey() then + return cell:getIsActive() and cell:getIsVisible() + end + end + return nil +end + + return MainCityUI \ No newline at end of file diff --git a/lua/app/ui/main_city/module_unlock_ui.lua b/lua/app/ui/main_city/module_unlock_ui.lua index 5fc5ed30..4be18147 100644 --- a/lua/app/ui/main_city/module_unlock_ui.lua +++ b/lua/app/ui/main_city/module_unlock_ui.lua @@ -29,54 +29,114 @@ end function ModuleUnlockUI:onLoadRootComplete() self.uiMap = self.root:genAllChildren() - self.uiMap["module_unlock_ui.bg"]:addClickListener(function() - self:showNextModuleUnlockAnimation() + + self.bg = self.uiMap["module_unlock_ui.bg"] + self.bg:addClickListener(function() + if not self.canClick then + return + end + self:showModuleUnlockVanishAnim() end) - - self.moduleNameTx = self.uiMap["module_unlock_ui.name_tx"] + self.moduleNameTx = self.uiMap["module_unlock_ui.bg.name_tx"] self.moduleIcon = self.uiMap["module_unlock_ui.icon"] - self.uiMap["module_unlock_ui.continue"]:setText(I18N:getGlobalText(I18N.GlobalConst.CLICK_TO_CONTINUE)) - self.uiMap["module_unlock_ui.title_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.FUNC_UNLOCK)) + self.titleTx = self.uiMap["module_unlock_ui.bg.spine_title.title_tx"] + self.spineTitle = self.uiMap["module_unlock_ui.bg.spine_title"] + self.spineCircle = self.uiMap["module_unlock_ui.icon.spine_circle"] + self.spineStar = self.uiMap["module_unlock_ui.spine_star"] + self.uiMap["module_unlock_ui.bg.continue"]:setText(I18N:getGlobalText(I18N.GlobalConst.CLICK_TO_CONTINUE)) + self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.FUNC_UNLOCK)) - self:showModuleUnlockAnimation() + self.initIconPos = self.uiMap["module_unlock_ui.init_pos"]:getPosition() + self.canvasGroupBg = self.bg:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP) + self.canvasGroupTitleTx = self.titleTx:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP) + self.canvasGroupIcon = self.moduleIcon:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP) + + self:checkShowNext() end -function ModuleUnlockUI:showNextModuleUnlockAnimation() - if self:showModuleUnlockAnimation() then - self:playUnlockAnimation() - end -end - -function ModuleUnlockUI:showModuleUnlockAnimation() +-- 检查是否展示 +function ModuleUnlockUI:checkShowNext() if #self.unlockList <= 0 then self:closeUI() - return false + return end - local moduleKey = table.remove(self.unlockList, 1) - local info = ConfigManager:getConfig("func_open")[moduleKey] - local i18nInfo = I18N:getConfig("func_open")[moduleKey] + self.moduleKey = table.remove(self.unlockList, 1) + local info = ConfigManager:getConfig("func_open")[self.moduleKey] + local i18nInfo = I18N:getConfig("func_open")[self.moduleKey] if info == nil or i18nInfo == nil then self:closeUI() - return false + return end self.moduleNameTx:setText(i18nInfo.name) if info.icon then self.moduleIcon:setSprite(GConst.ATLAS_PATH.MODULE, info.icon) end - return true + + -- 侧边栏功能,检查处理侧边栏打开 + if not ModuleManager.MaincityManager:isActivSideBarModule(self.moduleKey) then + if ModuleManager.MaincityManager:getModuleInSideBarWhere(self.moduleKey) == -1 then + ModuleManager.MaincityManager:changeMainCityLeftSideBarOpenOrClose() + elseif ModuleManager.MaincityManager:getModuleInSideBarWhere(self.moduleKey) == 1 then + ModuleManager.MaincityManager:changeMainCityRightSideBarOpenOrClose() + end + end + self:showModuleUnlockAppearAnim() end -function ModuleUnlockUI:playUnlockAnimation() - if self.unlockAnimationSeq == nil then - self.unlockAnimationSeq = self.root:createBindTweenSequence() - local scaleTween1 = self.root:getTransform():DOScale(1.05, 0.15) - self.unlockAnimationSeq:Append(scaleTween1) +-- 出现 +function ModuleUnlockUI:showModuleUnlockAppearAnim() + self.canClick = false + self.canvasGroupBg.alpha = 0 + self.canvasGroupTitleTx.alpha = 0 + self.canvasGroupIcon.alpha = 0 + self.titleTx:setLocalScale(0,0,0) + self.moduleIcon:setLocalScale(1,1,1) + self.moduleIcon:setPosition(self.initIconPos.x, self.initIconPos.y, self.initIconPos.z) - local scaleTween2 = self.root:getTransform():DOScale(1, 0.2) - self.unlockAnimationSeq:Append(scaleTween2) - self.unlockAnimationSeq:SetAutoKill(false) + self.spineTitle:playAnim("idle", false, true, true) + self:performWithDelayGlobal(function() + self.spineCircle:playAnim("idle", false, true, true) + end, 0.17) + if self.animAppear == nil then + self.animAppear = self.root:createBindTweenSequence() + self.animAppear:Insert(0, self.canvasGroupBg:DOFade(1, 0.14)) + self.animAppear:Insert(0.13, self.canvasGroupIcon:DOFade(1, 0.07)) + self.animAppear:Insert(0.13, self.moduleIcon:getTransform():DOScale(1.2, 0.07)) + self.animAppear:Insert(0.17, self.canvasGroupTitleTx:DOFade(1, 0.1)) + self.animAppear:Insert(0.17, self.titleTx:getTransform():DOScale(1.2, 0.1)) + self.animAppear:Insert(0.2, self.moduleIcon:getTransform():DOScale(1, 0.13)) + self.animAppear:SetAutoKill(false) + self.animAppear:OnComplete(function() + self.canClick = true + end) else - self.unlockAnimationSeq:Restart() + self.animAppear:Restart() + end +end + +-- 消失 +function ModuleUnlockUI:showModuleUnlockVanishAnim() + self.canClick = false + self.animVanish = self.root:createBindTweenSequence() + self.animVanish:Insert(0, self.canvasGroupBg:DOFade(0, 0.1)) + self.animVanish:Insert(0, self.titleTx:getTransform():DOScale(1, 0.16)) + self.animVanish:Insert(0, self.moduleIcon:getTransform():DOScale(0.46, 0.1)) + self.animVanish:Insert(0.33, self.canvasGroupIcon:DOFade(0, 0.07)) + local targetPos = ModuleManager.MaincityManager:getModuleEntrancePos(self.moduleKey) + if targetPos then + self.spineStar:setPosition(targetPos.x, targetPos.y, targetPos.z) + self.animVanish:Insert(0.17, self.moduleIcon:getTransform():DOMove(CS.UnityEngine.Vector3(targetPos.x, targetPos.y, targetPos.z), 0.16)) + self.animVanish:OnComplete(function() + self.animVanish = nil + self.spineStar:playAnimComplete("idle", false, true, function() + self:checkShowNext() + end) + end) + else + self.animVanish:OnComplete(function() + self.animVanish = nil + self:checkShowNext() + end) end end diff --git a/lua/app/userdata/activity/activity_data.lua b/lua/app/userdata/activity/activity_data.lua index 11f31d14..12aeaef6 100644 --- a/lua/app/userdata/activity/activity_data.lua +++ b/lua/app/userdata/activity/activity_data.lua @@ -1,7 +1,6 @@ local ActivityData = class("ActivityData", BaseData) function ActivityData:init(data) - end return ActivityData \ No newline at end of file From 3e0beb45003560a2fbda952e91d6a42916499a7a Mon Sep 17 00:00:00 2001 From: CloudJ Date: Fri, 2 Jun 2023 18:40:51 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E6=A0=8F=E7=A4=BC?= =?UTF-8?q?=E5=8C=85=E6=9B=BF=E6=8D=A2spine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/ui/main_city/cell/side_bar_base_cell.lua | 13 ++++++++++++- .../main_city/cell/side_bar_beginner_gift_cell.lua | 4 ++-- .../main_city/cell/side_bar_grow_up_gift_1_cell.lua | 4 ++-- .../main_city/cell/side_bar_grow_up_gift_2_cell.lua | 4 ++-- .../ui/main_city/cell/side_bar_growth_fund_cell.lua | 4 ++++ 5 files changed, 22 insertions(+), 7 deletions(-) diff --git a/lua/app/ui/main_city/cell/side_bar_base_cell.lua b/lua/app/ui/main_city/cell/side_bar_base_cell.lua index 6a5ea157..beb02c92 100644 --- a/lua/app/ui/main_city/cell/side_bar_base_cell.lua +++ b/lua/app/ui/main_city/cell/side_bar_base_cell.lua @@ -19,6 +19,16 @@ function SideBarBaseCellComp:getSpineName() return nil end +-- 图标动画资源默认名称 +function SideBarBaseCellComp:getSpineAnimationName() + return "idle" +end + +-- 图标动画默认位置 +function SideBarBaseCellComp:getSpinePositionY() + return 0 +end + -- 特效资源路径,为空时不显示 function SideBarBaseCellComp:getVfxRes() return nil @@ -67,10 +77,11 @@ function SideBarBaseCellComp:refreshSpine() self.spine:getSkeletonGraphic().enabled = false return end + self.spine:setAnchoredPositionY(self:getSpinePositionY()) if not self.isInitSpine then self.isInitSpine = true self.spine:loadAssetAsync(self:getSpineName(), function() - self.spine:playAnim("idle", true, true, true) + self.spine:playAnim(self:getSpineAnimationName(), true, true, true) if self.isActive then self.spine:setActive(true) else diff --git a/lua/app/ui/main_city/cell/side_bar_beginner_gift_cell.lua b/lua/app/ui/main_city/cell/side_bar_beginner_gift_cell.lua index 5fcfbc4f..da0c6592 100644 --- a/lua/app/ui/main_city/cell/side_bar_beginner_gift_cell.lua +++ b/lua/app/ui/main_city/cell/side_bar_beginner_gift_cell.lua @@ -5,8 +5,8 @@ function SideBarBeginnerGiftCell:getIsOpen() return DataManager.ShopData:getBeginnerGiftShowSideBar() end -function SideBarBeginnerGiftCell:getIconRes() - return "main_btn_gift_1" +function SideBarBeginnerGiftCell:getSpineName() + return "main_btn_gift_new" end function SideBarBeginnerGiftCell:onClick() diff --git a/lua/app/ui/main_city/cell/side_bar_grow_up_gift_1_cell.lua b/lua/app/ui/main_city/cell/side_bar_grow_up_gift_1_cell.lua index c8888638..743285f4 100644 --- a/lua/app/ui/main_city/cell/side_bar_grow_up_gift_1_cell.lua +++ b/lua/app/ui/main_city/cell/side_bar_grow_up_gift_1_cell.lua @@ -5,8 +5,8 @@ function SideBarGrowUpGift1Cell:getIsOpen() return #DataManager.ShopData:getValidGrowUpGifts() >= 1 end -function SideBarGrowUpGift1Cell:getIconRes() - return "main_btn_gift_2" +function SideBarGrowUpGift1Cell:getSpineName() + return "ui_main_btn_gift_grow" end function SideBarGrowUpGift1Cell:onClick() diff --git a/lua/app/ui/main_city/cell/side_bar_grow_up_gift_2_cell.lua b/lua/app/ui/main_city/cell/side_bar_grow_up_gift_2_cell.lua index 2d8fe520..0c7781ec 100644 --- a/lua/app/ui/main_city/cell/side_bar_grow_up_gift_2_cell.lua +++ b/lua/app/ui/main_city/cell/side_bar_grow_up_gift_2_cell.lua @@ -5,8 +5,8 @@ function SideBarGrowUpGift2Cell:getIsOpen() return #DataManager.ShopData:getValidGrowUpGifts() >= 2 end -function SideBarGrowUpGift2Cell:getIconRes() - return "main_btn_gift_2" +function SideBarGrowUpGift2Cell:getSpineName() + return "ui_main_btn_gift_grow" end function SideBarGrowUpGift2Cell:onClick() diff --git a/lua/app/ui/main_city/cell/side_bar_growth_fund_cell.lua b/lua/app/ui/main_city/cell/side_bar_growth_fund_cell.lua index 6bf5f779..6881758c 100644 --- a/lua/app/ui/main_city/cell/side_bar_growth_fund_cell.lua +++ b/lua/app/ui/main_city/cell/side_bar_growth_fund_cell.lua @@ -9,6 +9,10 @@ function SideBarGrowthFundCell:getSpineName() return "ui_main_btn_growup" end +function SideBarGrowthFundCell:getSpinePositionY() + return -50 -- 临时资源 +end + function SideBarGrowthFundCell:onClick() ModuleManager.FundManager:showLevelFundUI() end From 5ee2be883785aef6224e89768d41d995312c3a28 Mon Sep 17 00:00:00 2001 From: Fang Date: Fri, 2 Jun 2023 18:41:00 +0800 Subject: [PATCH 7/8] fix --- lua/app/module/maincity/maincity_manager.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/app/module/maincity/maincity_manager.lua b/lua/app/module/maincity/maincity_manager.lua index f4ab3c67..1873819a 100644 --- a/lua/app/module/maincity/maincity_manager.lua +++ b/lua/app/module/maincity/maincity_manager.lua @@ -80,9 +80,9 @@ function MaincityManager:getModuleInSideBarWhere(moduleKey) return nil end - if self.mainCityUI:isInSideBarLeft(moduleKey) then + if mainUI:isInSideBarLeft(moduleKey) then return -1 - elseif self.mainCityUI:isInSideBarRight(moduleKey) then + elseif mainUI:isInSideBarRight(moduleKey) then return 1 else return 0 @@ -95,7 +95,7 @@ function MaincityManager:isActivSideBarModule(moduleKey) return nil end - return self.mainCityUI:isActivSideBarModule(moduleKey) + return mainUI:isActivSideBarModule(moduleKey) end return MaincityManager \ No newline at end of file From ab68ef30a94128ae1968b2da51b1f99bc49eaef0 Mon Sep 17 00:00:00 2001 From: chenxi Date: Fri, 2 Jun 2023 19:00:26 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E5=8F=98=E9=87=8F=E5=90=8D=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/account/account_manager.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/app/module/account/account_manager.lua b/lua/app/module/account/account_manager.lua index a31e2fa5..3da5800f 100644 --- a/lua/app/module/account/account_manager.lua +++ b/lua/app/module/account/account_manager.lua @@ -64,7 +64,7 @@ function AccountManager:onBindAccount(result) loginType = SDKManager.BF_LOGIN_TYPE.APPLE accountInfo.apple_id = result.reqData.id else - accountInfo.googld_id = result.reqData.id + accountInfo.google_id = result.reqData.id end LocalData:setLastLoginInfo(loginType, result.reqData.id, result.reqData.token) LocalData:setAccountInfo(accountInfo) @@ -120,7 +120,7 @@ function AccountManager:onChangeAccount(result) loginType = SDKManager.BF_LOGIN_TYPE.APPLE accountInfo.apple_id = result.reqData.id else - accountInfo.googld_id = result.reqData.id + accountInfo.google_id = result.reqData.id end LocalData:setLastLoginInfo(loginType, result.reqData.id, result.reqData.token) LocalData:setAccountInfo(accountInfo)