move Iris into UI and remove Health.luau

This commit is contained in:
2024-08-04 11:43:36 -04:00
parent 619e0d01f5
commit a1a455fb78
4 changed files with 2 additions and 62 deletions

2
.gitmodules vendored
View File

@@ -1,3 +1,3 @@
[submodule "Iris"]
path = src/client/Iris
path = src/client/UI/Iris
url = https://github.com/Michael-48/Iris

File diff suppressed because one or more lines are too long

View File

@@ -1,60 +0,0 @@
--!optimize 2
--!native
--!strict
type ClassConstructor = typeof(setmetatable({} :: Constructor_Return_Props, {} :: Impl_Constructor))
type Impl_Constructor = {
__index: Impl_Constructor,
constructor: Constructor_Fun,
--Class functions
Enable: (self: ClassConstructor) -> (),
Disable: (self: ClassConstructor) -> (),
DisplayHealth: (self: ClassConstructor, Amount: number) -> (),
} & Impl_Static_Props
type Impl_Static_Props = {
Enabled: boolean
}
type Constructor_Fun = (PlayerGui: PlayerGui) -> ClassConstructor
type Constructor_Return_Props = {
HealthGui: ScreenGui,
Amount: TextLabel
}
local HealthModule = {} :: Impl_Constructor
HealthModule.__index = HealthModule
HealthModule.Enabled = false
function HealthModule.constructor(PlayerGui: PlayerGui)
local HealthGui = PlayerGui:WaitForChild("Health") :: ScreenGui
local Amount = HealthGui:WaitForChild("Amount") :: TextLabel
return setmetatable({
HealthGui = HealthGui,
Amount = Amount
}, HealthModule)
end
function HealthModule:Enable()
HealthModule.Enabled = true
end
function HealthModule:Disable()
HealthModule.Enabled = false
end
function HealthModule:DisplayHealth(Amount: number)
self.Amount.Text = tostring(Amount)
if Amount <= 40 then
self.Amount.TextColor3 = Color3.fromRGB(255,238,0)
elseif Amount <= 20 then
self.Amount.TextColor3 = Color3.fromRGB(255,0,38)
else
self.Amount.TextColor3 = Color3.new(1,1,1)
end
end
return HealthModule