<commit_before>local ReplicatedStorage = game:GetService("ReplicatedStorage")

local NevermoreEngine   = require(ReplicatedStorage:WaitForChild("NevermoreEngine"))
local LoadCustomLibrary = NevermoreEngine.LoadLibrary

local MakeMaid          = LoadCustomLibrary("Maid").MakeMaid

-- @author Quenty
--- An extra of a BindableAction that links a LabeledKeyIcon and a BindableAction

local BindedIcon = {}
BindedIcon.__index = BindedIcon
BindedIcon.ClassName = "BindedIcon"

function BindedIcon.new(Icon)
	-- @param Icon, A LabeledKeyIcon (or KeyIcon), that will be pushed upon the IconBar
	-- Note: Must call :SetBindableAction(BindableAction) to get this to work.

	local self = {}
	setmetatable(self, BindedIcon)

	-- PRIVATE
	self.Maid  = MakeMaid()
	self.Icon  = Icon or error("No icon sent, need icon")

	return self
end

function BindedIcon:SetBindableAction(BindableAction)
	assert(BindableAction, "Need to send BindableAction")
	assert(not self.BindableAction, "Already have BindableAction")

	self.BindableAction = BindableAction

	self.BindableAction:BindFunction("_UpdateIcon", function(ActionName, InputState, InputObject)
		if InputState.Name == "Begin" then
			self.Icon:SetFillTransparency(0.5)
		elseif InputState.Name == "End" then
			self.Icon:SetFillTransparency(1)
		end
	end)
end

function BindedIcon:Destroy()
	-- Disconnects events
	setmetatable(self, nil)

	self.BindableAction:UnbindFunction("_UpdateIcon")
	self.Maid:DoCleaning()

	self.Icon:Destroy()
end






local BindedBarIcon = {}
BindedBarIcon.__index = BindedBarIcon
BindedBarIcon.ClassName = "BindedBarIcon"
setmetatable(BindedBarIcon, BindedIcon)

function BindedBarIcon.new(Icon)
	local self = BindedIcon.new(Icon)<commit_msg>Force error on redestruction<commit_after>local ReplicatedStorage = game:GetService("ReplicatedStorage")

local NevermoreEngine   = require(ReplicatedStorage:WaitForChild("NevermoreEngine"))
local LoadCustomLibrary = NevermoreEngine.LoadLibrary

local MakeMaid          = LoadCustomLibrary("Maid").MakeMaid

-- @author Quenty
--- An extra of a BindableAction that links a LabeledKeyIcon and a BindableAction

local BindedIcon = {}
BindedIcon.__index = BindedIcon
BindedIcon.ClassName = "BindedIcon"

function BindedIcon.new(Icon)
	-- @param Icon, A LabeledKeyIcon (or KeyIcon), that will be pushed upon the IconBar
	-- Note: Must call :SetBindableAction(BindableAction) to get this to work.

	local self = {}
	setmetatable(self, BindedIcon)

	-- PRIVATE
	self.Maid  = MakeMaid()
	self.Icon  = Icon or error("No icon sent, need icon")

	return self
end

function BindedIcon:SetBindableAction(BindableAction)
	assert(BindableAction, "Need to send BindableAction")
	assert(not self.BindableAction, "Already have BindableAction")

	self.BindableAction = BindableAction

	self.BindableAction:BindFunction("_UpdateIcon", function(ActionName, InputState, InputObject)
		if InputState.Name == "Begin" then
			self.Icon:SetFillTransparency(0.5)
		elseif InputState.Name == "End" then
			self.Icon:SetFillTransparency(1)
		end
	end)
end

function BindedIcon:Destroy()
	-- Disconnects events
	setmetatable(self, nil)

	self.BindableAction:UnbindFunction("_UpdateIcon")
	self.Maid:DoCleaning()
	self.Maid = nil

	self.Icon:Destroy()
	self.Icon = nil
end






local BindedBarIcon = {}
BindedBarIcon.__index = BindedBarIcon
BindedBarIcon.ClassName = "BindedBarIcon"
setmetatable(BindedBarIcon, BindedIcon)

function BindedBarIcon.new(Icon)
	local self = BindedIcon.new(Icon)
{'fraction_non_alphanumeric': 0.09501871580765908, 'fraction_numerical': 0.0017276130146847107, 'mean_word_length': 5.655172413793103, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2617058', 'n_tokens_mistral': 1165, 'n_tokens_neox': 1125, 'n_words': 262}