mutators: remove comments
This commit is contained in:
parent
5e43a58c12
commit
f79a9cf0e5
2 changed files with 12 additions and 10 deletions
|
@ -61,7 +61,7 @@ local mutators_view = {
|
||||||
self:setup_hooks()
|
self:setup_hooks()
|
||||||
|
|
||||||
self.initialized = true
|
self.initialized = true
|
||||||
print("INIT")
|
--print("INIT")
|
||||||
end,
|
end,
|
||||||
|
|
||||||
deinitialize = function(self)
|
deinitialize = function(self)
|
||||||
|
@ -90,7 +90,7 @@ local mutators_view = {
|
||||||
self.map_view = nil
|
self.map_view = nil
|
||||||
|
|
||||||
self.initialized = false
|
self.initialized = false
|
||||||
print("DEINIT")
|
--print("DEINIT")
|
||||||
end,
|
end,
|
||||||
|
|
||||||
-- Sorts mutators by title
|
-- Sorts mutators by title
|
||||||
|
@ -222,7 +222,7 @@ local mutators_view = {
|
||||||
|
|
||||||
self.active = true
|
self.active = true
|
||||||
|
|
||||||
print("ACTIVE!")
|
--print("ACTIVE!")
|
||||||
end,
|
end,
|
||||||
|
|
||||||
deactivate = function(self)
|
deactivate = function(self)
|
||||||
|
@ -255,7 +255,7 @@ local mutators_view = {
|
||||||
|
|
||||||
self.active = false
|
self.active = false
|
||||||
|
|
||||||
print("DEACTIVE")
|
--print("DEACTIVE")
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_mutators_page_change = function(self, index_change)
|
on_mutators_page_change = function(self, index_change)
|
||||||
|
|
|
@ -34,6 +34,7 @@ manager.sort_mutators = function()
|
||||||
|
|
||||||
if mutators_sorted then return end
|
if mutators_sorted then return end
|
||||||
|
|
||||||
|
--[[
|
||||||
-- LOG --
|
-- LOG --
|
||||||
manager:dump(mutators_sequence, "seq", 5)
|
manager:dump(mutators_sequence, "seq", 5)
|
||||||
for i, v in ipairs(mutators) do
|
for i, v in ipairs(mutators) do
|
||||||
|
@ -41,6 +42,7 @@ manager.sort_mutators = function()
|
||||||
end
|
end
|
||||||
print("-----------")
|
print("-----------")
|
||||||
-- /LOG --
|
-- /LOG --
|
||||||
|
--]]
|
||||||
|
|
||||||
-- Preventing endless loops (worst case is n*(n+1)/2 I believe)
|
-- Preventing endless loops (worst case is n*(n+1)/2 I believe)
|
||||||
local maxIter = #mutators * (#mutators + 1)/2
|
local maxIter = #mutators * (#mutators + 1)/2
|
||||||
|
@ -80,12 +82,14 @@ manager.sort_mutators = function()
|
||||||
end
|
end
|
||||||
mutators_sorted = true
|
mutators_sorted = true
|
||||||
|
|
||||||
|
--[[
|
||||||
-- LOG --
|
-- LOG --
|
||||||
for k, v in ipairs(mutators) do
|
for k, v in ipairs(mutators) do
|
||||||
print(k, v:get_name())
|
print(k, v:get_name())
|
||||||
end
|
end
|
||||||
print("-----------")
|
print("-----------")
|
||||||
-- /LOG --
|
-- /LOG --
|
||||||
|
--]]
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Disables mutators that cannot be enabled right now
|
-- Disables mutators that cannot be enabled right now
|
||||||
|
@ -227,7 +231,7 @@ local function set_mutator_state(mutator, state)
|
||||||
if enable_these_after and #mutators > i then
|
if enable_these_after and #mutators > i then
|
||||||
for j = #mutators, i + 1, -1 do
|
for j = #mutators, i + 1, -1 do
|
||||||
if mutators[j]:is_enabled() and table.has_item(enable_these_after, mutators[j]:get_name()) then
|
if mutators[j]:is_enabled() and table.has_item(enable_these_after, mutators[j]:get_name()) then
|
||||||
print("Disabled ", mutators[j]:get_name())
|
--print("Disabled ", mutators[j]:get_name())
|
||||||
mutators[j]:disable()
|
mutators[j]:disable()
|
||||||
table.insert(disabled_mutators, 1, mutators[j])
|
table.insert(disabled_mutators, 1, mutators[j])
|
||||||
end
|
end
|
||||||
|
@ -237,11 +241,11 @@ local function set_mutator_state(mutator, state)
|
||||||
-- Enable/disable current mutator
|
-- Enable/disable current mutator
|
||||||
-- We're calling methods on the class object because we've overwritten them on the current one
|
-- We're calling methods on the class object because we've overwritten them on the current one
|
||||||
if state then
|
if state then
|
||||||
print("Enabled ", mutator:get_name(), "!")
|
--print("Enabled ", mutator:get_name(), "!")
|
||||||
VMFMod.enable(mutator)
|
VMFMod.enable(mutator)
|
||||||
on_enabled(mutator)
|
on_enabled(mutator)
|
||||||
else
|
else
|
||||||
print("Disabled ", mutator:get_name(), "!")
|
--print("Disabled ", mutator:get_name(), "!")
|
||||||
VMFMod.disable(mutator)
|
VMFMod.disable(mutator)
|
||||||
on_disabled(mutator)
|
on_disabled(mutator)
|
||||||
end
|
end
|
||||||
|
@ -250,12 +254,10 @@ local function set_mutator_state(mutator, state)
|
||||||
-- This will be recursive
|
-- This will be recursive
|
||||||
if #disabled_mutators > 0 then
|
if #disabled_mutators > 0 then
|
||||||
for j = #disabled_mutators, 1, -1 do
|
for j = #disabled_mutators, 1, -1 do
|
||||||
print("Enabled ", disabled_mutators[j]:get_name())
|
--print("Enabled ", disabled_mutators[j]:get_name())
|
||||||
disabled_mutators[j]:enable()
|
disabled_mutators[j]:enable()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
print("---------")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue