CoolFace
Datasetpublic

jiuyhfdj/wdsm_cocos_lua_debug_shell

# WDSM Cocos-Lua Debug Shell 这是从 D:\UU\23707_wdsm_wdsm_3k_20260319_28719_m0.apk 逆向整理出的 Cocos2d-x Lua Win32 调试壳工程,用于继续恢复、修改和预览游戏 UI / 建筑功能。 给 Max 接手先读 D:\UU\wdsm_cocos_lua_debug_shell\MAX_START_HERE.md D:\UU\wdsm_cocos_lua_debug_shell\MAX_RUNBOOK.md D:\UU\wdsm_cocos_lua_debug_shell\MAX_TASK_STATE.md D:\UU\wdsm_cocos_lua_debug_shell\MAX_PROJECT_INDEX.md D:\UU\wdsm_cocos_lua_debug_shell\work\mission-state.md 快速启动… See the full description on the dataset page: https://huggingface.co/datasets/jiuyhfdj/wdsm_cocos_lua_debug_shell.

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes28downloads
CCBReaderLoad.lua125 linesDownload Raw Back to cocosbuilder
1if nil == cc.CCBReader then2    return3end4 5ccb = ccb or {}6 7function CCBReaderLoad(strFilePath,proxy,owner)8    if nil == proxy then9        return nil10    end11 12    local ccbReader = proxy:createCCBReader()13    local node      = ccbReader:load(strFilePath)14    local rootName  = "" 15    --owner set in readCCBFromFile is proxy16    if nil ~= owner then17        --Callbacks18        local ownerCallbackNames = ccbReader:getOwnerCallbackNames() 19        local ownerCallbackNodes = ccbReader:getOwnerCallbackNodes()20        local ownerCallbackControlEvents = ccbReader:getOwnerCallbackControlEvents()21        local i = 122        for i = 1,table.getn(ownerCallbackNames) do23            local callbackName =  ownerCallbackNames[i]24            local callbackNode =  tolua.cast(ownerCallbackNodes[i],"cc.Node")25 26            if "function" == type(owner[callbackName]) then27                proxy:setCallback(callbackNode, owner[callbackName], ownerCallbackControlEvents[i])28            else29                print("Warning: Cannot find owner's lua function:" .. ":" .. callbackName .. " for ownerVar selector")30            end31 32        end33 34        --Variables35        local ownerOutletNames = ccbReader:getOwnerOutletNames() 36        local ownerOutletNodes = ccbReader:getOwnerOutletNodes()37 38        for i = 1, table.getn(ownerOutletNames) do39            local outletName = ownerOutletNames[i]40            local outletNode = tolua.cast(ownerOutletNodes[i],"cc.Node")41            owner[outletName] = outletNode42        end43    end44 45    local nodesWithAnimationManagers = ccbReader:getNodesWithAnimationManagers()46    local animationManagersForNodes  = ccbReader:getAnimationManagersForNodes()47 48    for i = 1 , table.getn(nodesWithAnimationManagers) do49        local innerNode = tolua.cast(nodesWithAnimationManagers[i], "cc.Node")50        local animationManager = tolua.cast(animationManagersForNodes[i], "cc.CCBAnimationManager")51        local documentControllerName = animationManager:getDocumentControllerName()52        if "" == documentControllerName then53            54        end55        if nil ~=  ccb[documentControllerName] then56            ccb[documentControllerName]["mAnimationManager"] = animationManager57        end58        59        --Callbacks60        local documentCallbackNames = animationManager:getDocumentCallbackNames()61        local documentCallbackNodes = animationManager:getDocumentCallbackNodes()62        local documentCallbackControlEvents = animationManager:getDocumentCallbackControlEvents()63 64        for i = 1,table.getn(documentCallbackNames) do65            local callbackName = documentCallbackNames[i]66            local callbackNode = tolua.cast(documentCallbackNodes[i],"cc.Node")67            if "" ~= documentControllerName and nil ~= ccb[documentControllerName] then68                if "function" == type(ccb[documentControllerName][callbackName]) then69                    proxy:setCallback(callbackNode, ccb[documentControllerName][callbackName], documentCallbackControlEvents[i])70                else71                    print("Warning: Cannot found lua function [" .. documentControllerName .. ":" .. callbackName .. "] for docRoot selector")72                end73            end74        end75 76        --Variables77        local documentOutletNames = animationManager:getDocumentOutletNames()78        local documentOutletNodes = animationManager:getDocumentOutletNodes()79 80        for i = 1, table.getn(documentOutletNames) do81            local outletName = documentOutletNames[i]82            local outletNode = tolua.cast(documentOutletNodes[i],"cc.Node")83            84            if nil ~= ccb[documentControllerName] then85                ccb[documentControllerName][outletName] = tolua.cast(outletNode, proxy:getNodeTypeName(outletNode))86            end 87        end88        --[[89        if (typeof(controller.onDidLoadFromCCB) == "function")90            controller.onDidLoadFromCCB();91        ]]--92        --Setup timeline callbacks93        local keyframeCallbacks = animationManager:getKeyframeCallbacks()94 95        for i = 1 , table.getn(keyframeCallbacks) do96            local callbackCombine = keyframeCallbacks[i]97            local beignIndex,endIndex = string.find(callbackCombine,":")98            local callbackType    = tonumber(string.sub(callbackCombine,1,beignIndex - 1))99            local callbackName    = string.sub(callbackCombine,endIndex + 1, -1)100            --Document callback101 102            if 1 == callbackType and nil ~= ccb[documentControllerName] then103                local callfunc = cc.CallFunc:create(ccb[documentControllerName][callbackName])104                animationManager:setCallFuncForLuaCallbackNamed(callfunc, callbackCombine);105            elseif 2 == callbackType and nil ~= owner then --Owner callback106                local callfunc = cc.CallFunc:create(owner[callbackName])--need check107                animationManager:setCallFuncForLuaCallbackNamed(callfunc, callbackCombine)108            end109        end110        --start animation111        local autoPlaySeqId = animationManager:getAutoPlaySequenceId()112        if -1 ~= autoPlaySeqId then113            animationManager:runAnimationsForSequenceIdTweenDuration(autoPlaySeqId, 0)114        end115    end116 117    return node118end119 120 121local function CCBuilderReaderLoad(strFilePath,proxy,owner)122    print("\n********** \n".."CCBuilderReaderLoad(strFilePath,proxy,owner)".." was deprecated please use ".. "CCBReaderLoad(strFilePath,proxy,owner)" .. " instead.\n**********")123    return CCBReaderLoad(strFilePath,proxy,owner)124end125rawset(_G,"CCBuilderReaderLoad",CCBuilderReaderLoad)
jiuyhfdj/wdsm_cocos_lua_debug_shell · CoolFace