Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Aceship committed Sep 9, 2024
1 parent e2f89e4 commit 0d1253d
Show file tree
Hide file tree
Showing 196 changed files with 673,158 additions and 172,115 deletions.
10 changes: 6 additions & 4 deletions json/gamedata/zh_CN/gamedata/[uc]lua/base/network/uisender.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ local rapidjson = require("rapidjson")
UISender = ModelMgr.DefineModel("UISender")

local ConcurrentType = CS.Torappu.UI.UISender.ConcurrentType
local CSLuaSender = CS.Torappu.Lua.LuaSender



Expand All @@ -23,12 +24,12 @@ local function _GenDefaultOptions()
end

function UISender:OnInit()
CS.Torappu.Lua.LuaSender.LuaOnlyBindCallback(self)
CSLuaSender.LuaOnlyBindCallback(self)
self.m_callbacks = {}
end

function UISender:OnDispose()
CS.Torappu.Lua.LuaSender.LuaOnlyBindCallback(nil)
CSLuaSender.LuaOnlyBindCallback(nil)
self.m_callbacks = nil
end

Expand All @@ -47,7 +48,7 @@ function UISender:SendGet(url, param, config)
useMask = config.useMask
end

local requestId = CS.Torappu.Lua.LuaSender.SendGet(url, param, useMask)
local requestId = CSLuaSender.SendGet(url, param, useMask)

local callback = {}
if config ~= nil then
Expand Down Expand Up @@ -75,6 +76,7 @@ end
function UISender:SendRequest(serviceCode, body, config)
local options = _GenDefaultOptions()

CSLuaSender.AchieveServiceMeta(serviceCode, body)
options.serviceCode = serviceCode
options.body = rapidjson.encode(body)
if config ~= nil then
Expand All @@ -90,7 +92,7 @@ function UISender:SendRequest(serviceCode, body, config)
options.overrideUrl = config.url
end

local requestId = CS.Torappu.Lua.LuaSender.SendRequest(options)
local requestId = CSLuaSender.SendRequest(options)

local callback = {}
if config ~= nil then
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@







local CollectionTaskListAdapter = Class("CollectionTaskListAdapter", UIRecycleAdapterBase);
local CollectionTimedTaskItem = require("Feature/Activity/Collection/CollectionTimedTaskItem");

function CollectionTaskListAdapter:ViewConstructor(objPool)
local missionItem = self:CreateWidgetByPrefab(CollectionTimedTaskItem, self._itemPrefab, self._container);
self:AddObj(missionItem, missionItem:RootGameObject());
return missionItem:RootGameObject();
end

function CollectionTaskListAdapter:OnRender(transform, index)
if #self.missionList <= 0 then
return;
end

local luaIndex = index + 1;
local missionData = self.missionList[luaIndex];
local item = self:GetWidget(transform.gameObject);
item:Refresh(missionData, self.actCfg);
end


function CollectionTaskListAdapter:GetTotalCount()
if self.missionList == nil then
return 0;
end
return #self.missionList;
end

return CollectionTaskListAdapter;
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@





local CollectionTaskListAdapter = require("Feature/Activity/Collection/CollectionTaskListAdapter")
CollectionTaskListDlg = DlgMgr.DefineDialog("CollectionTaskListDlg", "Activity/Collection/task_list_dlg");

function CollectionTaskListDlg:OnInit()
self.m_limitItems = {}
self.m_dailyItem = self:CreateWidgetByGO(CollectionDailyTaskItem, self._dailyItem);

self.m_listAdapter = self:CreateCustomComponent(CollectionTaskListAdapter, self._listAdapter, self);
self.m_listAdapter.missionList = {};
end

function CollectionTaskListDlg:OnClose()
Expand Down Expand Up @@ -44,43 +45,34 @@ function CollectionTaskListDlg:Refresh(activityId, close)
local missionData = CollectionActModel.me:FindMission(missionId);

if missionData then
local item = null;
if idx < #self.m_limitItems then
item = self.m_limitItems[idx+1];
else
item = self:CreateWidgetByPrefab(CollectionTimedTaskItem, self._limitItemPrefab);
table.insert(self.m_limitItems, item);
end

item:Refresh(missionData, actcfg);
table.insert(list, item);
table.insert(list, missionData);
end

end

local playerMissions = CS.Torappu.PlayerData.instance.data.mission.missions;
local suc, typeMissions = playerMissions:TryGetValue(CS.Torappu.MissionPlayerDataGroup.MissionTypeString.ACTIVITY);
if not suc then
return;
end

table.sort(list, function(a, b)
if a:Finished() == b:Finished() then
return a:SortId() < b:SortId();
end
return b:Finished();
end);

local co = coroutine.create(function()
for _, item in ipairs(list) do
item:CreateRewardIcon(actcfg);
item:RootGameObject().transform:SetParent(self._limitContainer, false);
coroutine.yield();
local comp = function(a, b)
local a_finish = self:_CheckMissionFinished(typeMissions, a.id);
local b_finish = self:_CheckMissionFinished(typeMissions, b.id);

if a_finish == b_finish then
return a.sortId < b.sortId;
end
end);
self:Frame(#list, self._RunCoroutine, co);
return b_finish;
end;

table.sort(list, comp);
self.m_listAdapter.missionList = list;
self.m_listAdapter.actCfg = actcfg;
self.m_listAdapter:NotifyDataSourceChanged();

self:_SynTime();
end

function CollectionTaskListDlg:_RunCoroutine(co)
coroutine.resume(co);
end

function CollectionTaskListDlg:_SynTime()

local time = CS.Torappu.DateTimeUtil.currentTime:AddHours(-1 * CS.Torappu.SharedConsts.GAME_DAY_DIVISION_HOUR);
Expand All @@ -91,3 +83,11 @@ function CollectionTaskListDlg:_SynTime()
local timeRemain = endTime - CS.Torappu.DateTimeUtil.currentTime;
self._limitTaskTimeLabel.text = CS.Torappu.Lua.Util.Format(CS.Torappu.StringRes.SHOP_REMAIN_COUNT, CS.Torappu.FormatUtil.FormatTimeDelta(timeRemain));
end




function CollectionTaskListDlg:_CheckMissionFinished(playerMissionDict, missionId)
local suc, state = playerMissionDict:TryGetValue(missionId);
return suc and state.state == CS.Torappu.MissionHoldingState.FINISHED;
end
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ local ColorRes = CS.Torappu.ColorRes;



CollectionTimedTaskItem = Class("CollectionTimedTaskItem", UIWidget);
local CollectionTimedTaskItem = Class("CollectionTimedTaskItem", UIWidget);



Expand Down Expand Up @@ -123,4 +123,6 @@ end

function CollectionTimedTaskItem:SortId()
return self.m_sortId;
end
end

return CollectionTimedTaskItem;
2 changes: 1 addition & 1 deletion json/gamedata/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 = "V053",
CUR_FUNC_VER = "V054",
}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
local CameraControllerHotfixer = Class("CameraControllerHotfixer", HotfixBase)

local function ReplaceCameraHotfix(self, newCamera)
if newCamera == nil or self._camera == nil then
return
end

newCamera.transform.localPosition = self._camera.transform.localPosition
newCamera.transform.localRotation = self._camera.transform.localRotation
self:ReplaceCamera(newCamera)
end

function CameraControllerHotfixer:OnInit()
xlua.private_accessible(CS.Torappu.Battle.CameraController)

self:Fix_ex(CS.Torappu.Battle.CameraController, "ReplaceCamera", function(self, newCamera)
local ok, errorInfo = xpcall(ReplaceCameraHotfix, debug.traceback, self, newCamera)
if not ok then
LogError("[CameraControllerHotfixer] fix" .. errorInfo)
end
end)
end

function CameraControllerHotfixer:OnDispose()
end

return CameraControllerHotfixer
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
local SandboxBattleDataControllerHotfixer = Class("SandboxBattleDataControllerHotfixer", HotfixBase)

local function RecordUsingConstructItemFix(self, character)
local gameMode = self.m_gameMode
if character ~= nil and character.data ~= nil and gameMode ~= nil and gameMode.configData ~= nil and not gameMode.isInBuildType then
local itemId = CS.Torappu.Battle.Sandbox.SandboxBattleUtil.GetTrapItemId(character, gameMode.configData)
local output = self.m_output
if itemId ~= nil and output ~= nil then
local constructItems = output.constructItems
if constructItems ~= nil then
local itemCnt = constructItems:get_Item(itemId)
if itemCnt ~= nil then
local sourceCard = CS.Torappu.Battle.BattleController.instance:GetDeck(CS.Torappu.PlayerSide.DEFAULT):FindCard(character.data.uniqueId)
if sourceCard ~= nil and sourceCard.remainingCnt == itemCnt then
return
end
end
end
end
end

self:RecordUsingConstructItem(character)
end

function SandboxBattleDataControllerHotfixer:OnInit()
xlua.private_accessible(CS.Torappu.Battle.Sandbox.SandboxBattleDataController)
xlua.private_accessible(CS.Torappu.Battle.GameMode.GameModeFactory.SandboxGameMode)
xlua.private_accessible(CS.Torappu.SandboxV2Data)
xlua.private_accessible(CS.Torappu.Battle.Character)

self:Fix_ex(CS.Torappu.Battle.Sandbox.SandboxBattleDataController, "RecordUsingConstructItem", function(self, character)
local ok, errorInfo = xpcall(RecordUsingConstructItemFix, debug.traceback, self, character)
if not ok then
LogError("[SandboxBattleDataControllerHotfixer] fix" .. errorInfo)
end
end)
end

function SandboxBattleDataControllerHotfixer:OnDispose()
end

return SandboxBattleDataControllerHotfixer
Loading

0 comments on commit 0d1253d

Please sign in to comment.