Skip to content

Commit

Permalink
[CN UPDATE] Client:2.2.41 Data:24-04-09-18-51-30-130d51
Browse files Browse the repository at this point in the history
  • Loading branch information
MuelsyseBot_v1 committed Apr 11, 2024
1 parent 5f99a22 commit 6924708
Show file tree
Hide file tree
Showing 234 changed files with 478,405 additions and 43,955 deletions.
2 changes: 1 addition & 1 deletion zh_CN/gamedata/[uc]lua/GlobalConfig.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GlobalConfig =
{
CUR_FUNC_VER = "V048",
CUR_FUNC_VER = "V049",
}


Expand Down
6 changes: 3 additions & 3 deletions zh_CN/gamedata/[uc]lua/feature/FeatureModule.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ require "Feature/Activity/PrayOnly/PrayOnlyActDefines"

require "Feature/Activity/ActFlip/ActFlipMainDlg"

require "Feature/Activity/CheckinAccess/ActCheckinAccessMainDlg"

require "Feature/Activity/LuaActivityUtil"

require "Feature/Activity/Act3D5/Act3D5Dlg"
Expand Down Expand Up @@ -85,6 +87,4 @@ require "Feature/Activity/MainlineBp/MainlineBpMainDlg";

require "Feature/Activity/BlessOnly/BlessOnlyDefine"
require "Feature/Activity/BlessOnly/BlessOnlyUtil"
require "Feature/Activity/BlessOnly/BlessOnlyMainDlg"

require "Feature/SandboxV2/SandboxV2DiffDialog"
require "Feature/Activity/BlessOnly/BlessOnlyMainDlg"
33 changes: 33 additions & 0 deletions zh_CN/gamedata/[uc]lua/feature/activity/LuaActivityUtil.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ local HOME_WEIGHT_SWITCH_ONLY = 560;
local HOME_WEIGHT_CHECKIN_VS = 570;
local HOME_WEIGHT_UNIQUE_ONLY = 580;
local HOME_WEIGHT_BLESS_ONLY = 590;
local HOME_WEIGHT_ACTACCESS = 595;

local HOME_WEIGHT_MAIN_BUFF = 600;
local HOME_WEIGHT_MAINLINE_BP = 610;
Expand Down Expand Up @@ -219,6 +220,24 @@ function LuaActivityUtil:_FindValidBlessOnly(validActs, uncompleteActs)
end
end



function LuaActivityUtil:_FindValidCheckInAccess(validActs, uncompleteActs)
local actList = CS.Torappu.UI.ActivityUtil.FindValidActs(CS.Torappu.ActivityType.CHECKIN_ACCESS);
if actList == nil then
return;
end

for i = 0, actList.Count - 1 do
local actId = actList[i];
local validAct = CS.Torappu.SortableString(actId, HOME_WEIGHT_ACTACCESS);
validActs:Add(validAct);
if self:_CheckIfActAccessUncomplete(actId) then
uncompleteActs:Add(validAct);
end
end
end

function LuaActivityUtil:_FindValidMainlineBpAct(validActs, uncompleteActs)
local actList = CS.Torappu.UI.ActivityUtil.FindValidActs(CS.Torappu.ActivityType.MAINLINE_BP);
if actList == nil then
Expand Down Expand Up @@ -251,6 +270,7 @@ function LuaActivityUtil:FindValidHomeActs(validActs, uncompleteActs)
self:_FindValidUniqueOnly(validActs,uncompleteActs);
self:_FindValidBlessOnly(validActs,uncompleteActs);
self:_FindValidMainlineBpAct(validActs, uncompleteActs);
self:_FindValidCheckInAccess(validActs,uncompleteActs);
end


Expand Down Expand Up @@ -297,6 +317,9 @@ local DEFINE_CLS_FUNCS = {
BLESS_ONLY = function(clsName, config)
DlgMgr.DefineDialog(clsName, config.dlgPath, BlessOnlyMainDlg)
end,
CHECKIN_ACCESS = function(clsName, config)
DlgMgr.DefineDialog(clsName, config.dlgPath, ActCheckinAccessMainDlg)
end,
}


Expand Down Expand Up @@ -369,6 +392,8 @@ function LuaActivityUtil:CheckIfActivityUncomplete(type, actId)
return self:_CheckIfBlessOnlyUncomplete(actId);
elseif type == CS.Torappu.ActivityType.MAINLINE_BP then
return self:_CheckIfMainlineBpUncomplete(actId);
elseif type == CS.Torappu.ActivityType.CHECKIN_ACCESS then
return self:_CheckIfActAccessUncomplete(actId);
else
return false;
end
Expand Down Expand Up @@ -512,6 +537,14 @@ function LuaActivityUtil:_CheckIfBlessOnlyUncomplete(actId)
return BlessOnlyUtil.CheckBlessActIsUncomplete(actId);
end

function LuaActivityUtil:_CheckIfActAccessUncomplete(actId)
local suc, playerData = CS.Torappu.PlayerData.instance.data.activity.checkinAccessList:TryGetValue(actId);
if (suc) then
return playerData.currentStatus == 1
end
return false
end



function LuaActivityUtil:_CheckIfMainlineBpUncomplete(actId)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
local luaUtils = CS.Torappu.Lua.Util;
ActCheckinAccessMainDlg = Class("ActCheckinAccessMainDlg", DlgBase)
ActCheckinAccessMainDlg.ServiceCode = "/activity/actCheckinAccess/getCheckInReward"












function ActCheckinAccessMainDlg:OnInit()

local actId = self.m_parent:GetData("actId")
self.m_actId = actId
self.m_times = 0
self:_InitFromGameData(actId)
self:AddButtonClickListener(self._btnCheckin, self.EventOnCheckin)
end

function ActCheckinAccessMainDlg:EventOnCheckin()

UISender.me:SendRequest(ActCheckinAccessMainDlg.ServiceCode,
{
activityId = self.m_actId;
},
{
onProceed = Event.Create(self, self._OnHandleWork);
});
end

function ActCheckinAccessMainDlg:_OnHandleWork(resp)

local handler = CS.Torappu.UI.LuaUIMisc.ShowGainedItems(resp.items, CS.Torappu.UI.UIGainItemFloatPanel.Style.DEFAULT, function()
self:_RefreshPlayerDataState()
end);
self:_AddDisposableObj(handler);
end

function ActCheckinAccessMainDlg:_RefreshPlayerDataState()

local suc, playerData = CS.Torappu.PlayerData.instance.data.activity.checkinAccessList:TryGetValue(self.m_actId);
if (suc) then
local canReach = playerData.currentStatus == 1
CS.Torappu.Lua.Util.SetActiveIfNecessary(self._ableToGetPart, canReach)
CS.Torappu.Lua.Util.SetActiveIfNecessary(self._alreadyCheckInPart, not canReach and playerData.rewardsCount <self.m_times)
CS.Torappu.Lua.Util.SetActiveIfNecessary(self._allFinishPart, not canReach and playerData.rewardsCount >= self.m_times)
self._alreadyTimesText.text = CS.Torappu.Lua.Util.Format(StringRes.ACT_ACCESS_TIMES, playerData.rewardsCount);
if canReach then
self._itemCanvasGroup.alpha = 1
else
self._itemCanvasGroup.alpha = 0.3
end
end
end

function ActCheckinAccessMainDlg:_InitFromGameData(actId)
self.m_actId = actId
self:AddButtonClickListener(self._btnClose, self._OnClickCloseBtn);
self:AddButtonClickListener(self._btnClose2, self._OnClickCloseBtn);
local dynActs = CS.Torappu.ActivityDB.data.dynActs;
if actId == nil or dynActs == nil then
return
end
local suc, jObject = dynActs:TryGetValue(actId)
if not suc then
luaUtils.LogError("Activity not found in dynActs : "..actId)
return
end
local data = luaUtils.ConvertJObjectToLuaTable(jObject)
self.m_times = data.dayCount
self._apSupplyTime.text = "";
if data.apSupplyOutOfDateDict then
for apid, endtime in pairs(data.apSupplyOutOfDateDict) do
local apItemData = CS.Torappu.UI.UIItemViewModel();
apItemData:LoadGameData(apid, CS.Torappu.ItemType.NONE);
local dateTime = CS.Torappu.DateTimeUtil.TimeStampToDateTime(endtime);
local timedesc = CS.Torappu.Lua.Util.Format(CS.Torappu.StringRes.DATE_FORMAT_YYYY_MM_DD_HH_MM,dateTime.Year, dateTime.Month, dateTime.Day,dateTime.Hour,dateTime.Minute);
local str = CS.Torappu.StringRes.ACT4D0_AP_REMAIN;
self._apSupplyTime.text = CS.Torappu.Lua.Util.Format(str, apItemData.name, timedesc);
break;
end
end

local suc, basicData = CS.Torappu.ActivityDB.data.basicInfo:TryGetValue(self.m_actId)
if not suc then
return;
end
local endTime = CS.Torappu.DateTimeUtil.TimeStampToDateTime(basicData.endTime)
self._textTime.text = CS.Torappu.Lua.Util.Format(
StringRes.ACT_ACCESS_TIME,
endTime.Year,
endTime.Month,
endTime.Day,
endTime.Hour,
endTime.Minute
);
local prefab = CS.Torappu.UI.UIAssetLoader.instance.itemCardPrefab;
local str = ""
for idx = 1, #data.rewardItemPerDay do
local itemCard = CS.UnityEngine.GameObject.Instantiate(prefab, self._itemHolder);
local viewModel = CS.Torappu.UI.UIItemViewModel();
local prefab = CS.Torappu.UI.UIAssetLoader.instance.itemCardPrefab;
local item = data.rewardItemPerDay[idx]

viewModel:LoadGameData(item.id, item.type);
viewModel.itemCount = item.count;
itemCard:Render(idx, viewModel);
itemCard.showItemNum = true;
itemCard.isCardClickable = true;
if (idx > 1) then
str = str .. CS.Torappu.StringRes.SP_CHAR_NAME_SEPARATOR
end
str = str .. viewModel.name .. "*" .. tostring(viewModel.itemCount)
self:AsignDelegate(itemCard, "onItemClick", function(this, index)
CS.Torappu.UI.UIItemDescFloatController.ShowItemDesc(itemCard.gameObject, viewModel);
end);
local scaler = itemCard:GetComponent("Torappu.UI.UIScaler");
if scaler then
scaler.scale = 0.6;
end
end
self._dailyText.text = CS.Torappu.Lua.Util.Format(StringRes.ACT_ACCESS_REWARD_ITEM_TWO_ITEM,str)
self:_RefreshPlayerDataState()
end

function ActCheckinAccessMainDlg:_OnClickCloseBtn()
self:Close();
end
4 changes: 1 addition & 3 deletions zh_CN/gamedata/[uc]lua/hotfixes/DefinedFix.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ local list =
{

"HotFixes/TestStubHotfixer",
"HotFixes/SandboxV2PreprocessRuneInputHotfixer",
"HotFixes/FriendPageHotfixer",
"HotFixes/R6Hotfix"
"HotFixes/HomeThemeTrackPointHotfixer"
};

return list;
40 changes: 40 additions & 0 deletions zh_CN/gamedata/[uc]lua/hotfixes/HomeThemeTrackPointHotfixer.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
local HomeDisplayController = CS.Torappu.UI.Home.HomeDisplayController
local HomePage = CS.Torappu.UI.Home.HomePage
local HomeMainState = CS.Torappu.UI.Home.HomeMainState
local HomeThemeTrackPointHotfixer = Class("HomeThemeTrackPointHotfixer", HotfixBase)

local function _FixLoadHomeTheme(self, themeId)
self:LoadHomeTheme(themeId)

local homePage = self:GetPage()
local stateEngine = homePage.stateEngine
if stateEngine == nil then
return
end

local homeMainState = stateEngine.defaultState
if homeMainState == nil or homeMainState:GetType() ~= typeof(HomeMainState) then
return
end

local homeMainStateBean = homeMainState._stateBean
if homeMainStateBean == nil then
return
end
homeMainStateBean:OnPlayerDataChanged()
end

function HomeThemeTrackPointHotfixer:OnInit()
xlua.private_accessible(HomeDisplayController)
xlua.private_accessible(HomePage)
xlua.private_accessible(HomeMainState)

self:Fix_ex(HomeDisplayController, "LoadHomeTheme", function(self, themeId)
local ok, ret = xpcall(_FixLoadHomeTheme, debug.traceback, self, themeId)
if not ok then
LogError("[HomeThemeTrackPointHotfixer] _FixLoadHomeTheme" .. ret)
end
end)
end

return HomeThemeTrackPointHotfixer
Loading

0 comments on commit 6924708

Please sign in to comment.