更新
This commit is contained in:
parent
b41e4d8b93
commit
47c238cfcd
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"robloxLsp.diagnostics.workspaceDelay": 30000
|
||||
}
|
@ -54,6 +54,9 @@ function UIWindow:AutoInjectVariables()
|
||||
if firstChar == "_" then
|
||||
if sixChar == "__list" then
|
||||
local prefab = Utils:FindInDescendantsUI(self.UIRoot, varName)
|
||||
if not prefab then
|
||||
warn("没找到预制体", self.UIRoot, varName)
|
||||
end
|
||||
target = UIList:Init(prefab)
|
||||
target.TopUI = self
|
||||
elseif sevenChar == "__money" then
|
||||
|
@ -97,6 +97,7 @@ local function OnPlayerAdded(Player: Player)
|
||||
Proxies.AbilityProxy:InitPlayer(Player)
|
||||
Proxies.GemProxy:InitPlayer(Player)
|
||||
Proxies.BookProxy:InitPlayer(Player)
|
||||
Proxies.RuneProxy:InitPlayer(Player)
|
||||
Proxies.PlayerFightProxy:InitPlayer(Player)
|
||||
end
|
||||
|
||||
|
@ -245,6 +245,26 @@ function EquipmentProxy:AddEquipment(Player: Player, EquipmentId: number)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
------------------------------------------------------------
|
||||
-- 随机生成技能槽位数量
|
||||
local AbilityProxy = require(ServerStorage.Proxy.AbilityProxy)
|
||||
|
||||
local maxAbilityNumber = PlayerInfoProxy:GetPlayerInfo(Player)["AttributesUpgrade"]["11"] or 0
|
||||
local abilityNumber = rng:NextInteger(0, maxAbilityNumber)
|
||||
ResultData.maxAbilityNumber = abilityNumber
|
||||
|
||||
-- 随机生成宝石数量
|
||||
local GemProxy = require(ServerStorage.Proxy.GemProxy)
|
||||
local maxGemNumber = PlayerInfoProxy:GetPlayerInfo(Player).gemNumber or 0
|
||||
local gemNumber = rng:NextInteger(0, maxGemNumber)
|
||||
ResultData.maxGemNumber = gemNumber
|
||||
|
||||
-- 随机生成符文数量
|
||||
local RuneProxy = require(ServerStorage.Proxy.RuneProxy)
|
||||
local maxRuneNumber = PlayerInfoProxy:GetPlayerInfo(Player).runeNumber or 0
|
||||
local runeNumber = rng:NextInteger(0, maxRuneNumber)
|
||||
ResultData.maxRuneNumber = runeNumber
|
||||
------------------------------------------------------------
|
||||
|
||||
ArchiveProxy.pData[Player.UserId][STORE_NAME][UniqueId] = ResultData
|
||||
@ -253,12 +273,6 @@ function EquipmentProxy:AddEquipment(Player: Player, EquipmentId: number)
|
||||
------------------------------------------------------------
|
||||
-- 下面逻辑会找Instance实例,所以放在之后执行逻辑
|
||||
|
||||
-- 随机生成技能槽位数量
|
||||
local AbilityProxy = require(ServerStorage.Proxy.AbilityProxy)
|
||||
|
||||
local maxAbilityNumber = PlayerInfoProxy:GetPlayerInfo(Player)["AttributesUpgrade"]["11"] or 0
|
||||
local abilityNumber = rng:NextInteger(0, maxAbilityNumber)
|
||||
ResultData.maxAbilityNumber = abilityNumber
|
||||
if abilityNumber > 0 then
|
||||
local spawnAbilitiesId = {}
|
||||
for i = 1, abilityNumber do
|
||||
@ -279,11 +293,6 @@ function EquipmentProxy:AddEquipment(Player: Player, EquipmentId: number)
|
||||
end
|
||||
end
|
||||
|
||||
-- 随机生成宝石数量
|
||||
local GemProxy = require(ServerStorage.Proxy.GemProxy)
|
||||
local maxGemNumber = PlayerInfoProxy:GetPlayerInfo(Player).gemNumber or 0
|
||||
local gemNumber = rng:NextInteger(0, maxGemNumber)
|
||||
ResultData.maxGemNumber = gemNumber
|
||||
if gemNumber > 0 then
|
||||
local spawnGemsId = {}
|
||||
for i = 1, gemNumber do
|
||||
@ -294,11 +303,6 @@ function EquipmentProxy:AddEquipment(Player: Player, EquipmentId: number)
|
||||
end
|
||||
end
|
||||
|
||||
-- 随机生成符文数量
|
||||
local RuneProxy = require(ServerStorage.Proxy.RuneProxy)
|
||||
local maxRuneNumber = PlayerInfoProxy:GetPlayerInfo(Player).runeNumber or 0
|
||||
local runeNumber = rng:NextInteger(0, maxRuneNumber)
|
||||
ResultData.maxRuneNumber = runeNumber
|
||||
if runeNumber > 0 then
|
||||
local spawnRunesId = {}
|
||||
for i = 1, runeNumber do
|
||||
|
@ -87,6 +87,7 @@ function MainWindow:Init(UIManager: table, Data: table?)
|
||||
["_btnMainAttributeUpgrade"] = 0,
|
||||
["_btnStartChallenge"] = 0,
|
||||
["_btnBlessing"] = 0,
|
||||
["_btnRune"] = 0,
|
||||
|
||||
-- 锻造条
|
||||
["_goForgeBar"] = 0,
|
||||
@ -154,12 +155,16 @@ function MainWindow:OnOpenWindow()
|
||||
local blessingCon = self.Variables["_btnBlessing"].Activated:Connect(function()
|
||||
self.UIManager:OpenWindow("BlessingWindow")
|
||||
end)
|
||||
local runeCon = self.Variables["_btnRune"].Activated:Connect(function()
|
||||
self.UIManager:OpenWindow("RuneWindow")
|
||||
end)
|
||||
|
||||
table.insert(self.Connections, createCon)
|
||||
table.insert(self.Connections, chaCon)
|
||||
table.insert(self.Connections, attributeUpgradeCon)
|
||||
table.insert(self.Connections, startChallengeCon)
|
||||
table.insert(self.Connections, blessingCon)
|
||||
table.insert(self.Connections, runeCon)
|
||||
|
||||
local challengeLevelEndCon = challengeLevelEndSignal:Connect(function(result: boolean)
|
||||
self.Variables["_btnStartChallenge"].Visible = true
|
||||
|
@ -8,8 +8,6 @@ local Localization = require(ReplicatedStorage.Tools.Localization)
|
||||
local JsonRune = require(ReplicatedStorage.Json.Rune)
|
||||
local JsonItemProp = require(ReplicatedStorage.Json.ItemProp)
|
||||
|
||||
local FolderRune = ReplicatedStorage:WaitForChild("Prefabs"):WaitForChild("Runes")
|
||||
|
||||
function PackageShow:Init(data: table)
|
||||
local self = {}
|
||||
self.Data = data
|
||||
|
@ -8,8 +8,6 @@ local Localization = require(ReplicatedStorage.Tools.Localization)
|
||||
local JsonRune = require(ReplicatedStorage.Json.Rune)
|
||||
local JsonItemProp = require(ReplicatedStorage.Json.ItemProp)
|
||||
|
||||
local FolderRune = ReplicatedStorage:WaitForChild("Prefabs"):WaitForChild("Runes")
|
||||
|
||||
function WearingShow:Init(data: table)
|
||||
local self = {}
|
||||
self.Data = data
|
||||
|
@ -26,16 +26,15 @@ local LocalPlayer = game.Players.LocalPlayer
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
local ChaWindow = {}
|
||||
ChaWindow.__index = ChaWindow
|
||||
setmetatable(ChaWindow, {__index = UIWindow})
|
||||
local RuneWindow = {}
|
||||
RuneWindow.__index = RuneWindow
|
||||
setmetatable(RuneWindow, {__index = UIWindow})
|
||||
|
||||
function ChaWindow:Init(UIManager: table, Data: table?)
|
||||
function RuneWindow:Init(UIManager: table, Data: table?)
|
||||
local self = UIWindow:Init(UIManager, Data)
|
||||
setmetatable(self, ChaWindow)
|
||||
setmetatable(self, RuneWindow)
|
||||
self.Variables = {
|
||||
["_goRunePanel"] = 0,
|
||||
["_goEquipmentDetail"] = 0,
|
||||
["__listRunePackage"] = 0,
|
||||
["__listRuneWearing"] = 0,
|
||||
["_tmpCombatValue"] = 0,
|
||||
@ -57,7 +56,7 @@ function ChaWindow:Init(UIManager: table, Data: table?)
|
||||
return self
|
||||
end
|
||||
|
||||
function ChaWindow:ShowDetailData(uniqueId: number)
|
||||
function RuneWindow:ShowDetailData(uniqueId: number)
|
||||
if uniqueId then
|
||||
self.NowSelectRuneId = uniqueId
|
||||
local runeData = Utils:GetIdDataFromJson(JsonRune, uniqueId)
|
||||
@ -74,7 +73,7 @@ function ChaWindow:ShowDetailData(uniqueId: number)
|
||||
end
|
||||
end
|
||||
|
||||
function ChaWindow:WearRefresh(data: table)
|
||||
function RuneWindow:WearRefresh(data: table)
|
||||
local newSlot = data.instance:GetAttribute("wearing")
|
||||
self.Variables["__listRuneWearing"]:RemoveData("slot"..newSlot)
|
||||
self.Variables["__listRunePackage"]:RemoveData(tostring(data.id))
|
||||
@ -87,7 +86,7 @@ function ChaWindow:WearRefresh(data: table)
|
||||
if data.id == self.NowSelectRuneId then self:ShowDetailData() end
|
||||
end
|
||||
|
||||
function ChaWindow:UnwearRefresh(data: table)
|
||||
function RuneWindow:UnwearRefresh(data: table)
|
||||
local oldSlot = data.wearing
|
||||
self.Variables["__listRuneWearing"]:RemoveData("slot"..oldSlot)
|
||||
data.wearing = 0
|
||||
@ -98,13 +97,13 @@ function ChaWindow:UnwearRefresh(data: table)
|
||||
self.Variables["__listRuneWearing"]:AddData("slot"..oldSlot, self.Data.Wearing["slot"..oldSlot])
|
||||
end
|
||||
|
||||
function ChaWindow:InlayRune()
|
||||
function RuneWindow:InlayRune()
|
||||
if self.NowSelectRuneId and self.ShowEquipmentId then
|
||||
RE_RuneInlay:FireClient(self.NowSelectRuneId, self.ShowEquipmentId)
|
||||
end
|
||||
end
|
||||
|
||||
function ChaWindow:AddInstanceData(configInstance: Instance, Data: table?)
|
||||
function RuneWindow:AddInstanceData(configInstance: Instance, Data: table?)
|
||||
local data = self.Data
|
||||
if Data then data = Data end
|
||||
local attributes = configInstance:GetAttributes()
|
||||
@ -124,7 +123,7 @@ function ChaWindow:AddInstanceData(configInstance: Instance, Data: table?)
|
||||
return data[parentName][secondName], parentName
|
||||
end
|
||||
|
||||
function ChaWindow:RemoveInstanceData(configInstance: Instance, Data: table?)
|
||||
function RuneWindow:RemoveInstanceData(configInstance: Instance, Data: table?)
|
||||
for key, data in pairs(self.Data.WearingRune) do
|
||||
if data.instance == configInstance then
|
||||
return tostring(key), "WearingRune"
|
||||
@ -138,8 +137,20 @@ function ChaWindow:RemoveInstanceData(configInstance: Instance, Data: table?)
|
||||
return nil
|
||||
end
|
||||
|
||||
function ChaWindow:OnOpenWindow()
|
||||
function RuneWindow:OnOpenWindow()
|
||||
UIWindow.OnOpenWindow(self)
|
||||
self.Variables["__listRunePackage"]:AddComponent(PackageShow)
|
||||
self.Variables["__listRuneWearing"]:AddComponent(WearingShow)
|
||||
|
||||
local bgCloseCon = self.Variables["_btnBgClose"].Activated:Connect(function()
|
||||
self.UIManager:CloseWindow(script.Name)
|
||||
end)
|
||||
local closeCon = self.Variables["_btnClose"].Activated:Connect(function()
|
||||
self.UIManager:CloseWindow(script.Name)
|
||||
end)
|
||||
|
||||
table.insert(self.Connections, bgCloseCon)
|
||||
table.insert(self.Connections, closeCon)
|
||||
|
||||
-- 自己进行数据处理
|
||||
local DataFolder = Utils:WaitPlayerDataFolder(LocalPlayer):FindFirstChild("Rune")
|
||||
@ -218,29 +229,20 @@ function ChaWindow:OnOpenWindow()
|
||||
end
|
||||
end)
|
||||
|
||||
local bgCloseCon = self.Variables["_btnBgClose"].Activated:Connect(function()
|
||||
self.UIManager:CloseWindow(script.Name)
|
||||
end)
|
||||
local closeCon = self.Variables["_btnClose"].Activated:Connect(function()
|
||||
self.UIManager:CloseWindow(script.Name)
|
||||
end)
|
||||
|
||||
table.insert(self.Connections, addCon)
|
||||
table.insert(self.Connections, removeCon)
|
||||
table.insert(self.Connections, bgCloseCon)
|
||||
table.insert(self.Connections, closeCon)
|
||||
|
||||
self.Variables["__listRunePackage"]:AddComponent(PackageShow)
|
||||
self.Variables["__listRuneWearing"]:AddComponent(WearingShow)
|
||||
print(self.Variables["__listRunePackage"], self.Variables["__listRuneWearing"])
|
||||
self.Variables["__listRunePackage"]:SetData(self.Data.PackageRune)
|
||||
self.Variables["__listRuneWearing"]:SetData(self.Data.WearingRune)
|
||||
self.Variables["__listRuneWearing"]:SetLayoutOrder("wearingSlot")
|
||||
end
|
||||
|
||||
function ChaWindow:OnCloseWindow()
|
||||
function RuneWindow:OnCloseWindow()
|
||||
UIWindow.OnCloseWindow(self)
|
||||
end
|
||||
|
||||
|
||||
|
||||
return ChaWindow
|
||||
return RuneWindow
|
Loading…
x
Reference in New Issue
Block a user