2025-07-19 03:03:02 +08:00
|
|
|
--> Services
|
|
|
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
|
|
|
|
|
|
|
--> Dependencies
|
|
|
|
local UIWindow = require(ReplicatedStorage.Base.UIWindow)
|
|
|
|
local UIEnums = require(ReplicatedStorage.Base.UIEnums)
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
local MainWindow = {}
|
|
|
|
MainWindow.__index = MainWindow
|
|
|
|
setmetatable(MainWindow, {__index = UIWindow})
|
|
|
|
|
|
|
|
function MainWindow:Init(UIManager: table, Data: table?)
|
|
|
|
local self = UIWindow:Init(UIManager, Data)
|
|
|
|
setmetatable(self, MainWindow)
|
|
|
|
self.Variables = {
|
|
|
|
["_btnMainCreate"] = 0,
|
2025-07-22 01:56:56 +08:00
|
|
|
["_btnMainCha"] = 0,
|
2025-07-23 01:04:27 +08:00
|
|
|
["_btnMainAttributeUpgrade"] = 0,
|
2025-07-19 03:03:02 +08:00
|
|
|
}
|
|
|
|
self.UIRootName = "ui_w_main"
|
|
|
|
self.UIParentName = UIEnums.UIParent.UIRoot
|
|
|
|
|
|
|
|
return self
|
|
|
|
end
|
|
|
|
|
|
|
|
function MainWindow:OnOpenWindow()
|
|
|
|
UIWindow.OnOpenWindow(self)
|
|
|
|
|
|
|
|
local createCon = self.Variables["_btnMainCreate"].Activated:Connect(function()
|
|
|
|
self.UIManager:OpenWindow("CreateWindow")
|
|
|
|
end)
|
2025-07-22 01:56:56 +08:00
|
|
|
local chaCon = self.Variables["_btnMainCha"].Activated:Connect(function()
|
|
|
|
self.UIManager:OpenWindow("ChaWindow")
|
|
|
|
end)
|
2025-07-23 01:04:27 +08:00
|
|
|
local attributeUpgradeCon = self.Variables["_btnMainAttributeUpgrade"].Activated:Connect(function()
|
|
|
|
self.UIManager:OpenWindow("AttributeLvupWindow")
|
|
|
|
end)
|
2025-07-22 01:56:56 +08:00
|
|
|
|
2025-07-19 03:03:02 +08:00
|
|
|
table.insert(self.Connections, createCon)
|
2025-07-22 01:56:56 +08:00
|
|
|
table.insert(self.Connections, chaCon)
|
2025-07-23 01:04:27 +08:00
|
|
|
table.insert(self.Connections, attributeUpgradeCon)
|
2025-07-19 03:03:02 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return MainWindow
|