refactoring
This commit is contained in:
+2
-2
@@ -75,8 +75,8 @@ function set_unit_start_price(amount)
|
||||
end
|
||||
|
||||
function get_unit_buyout_price()
|
||||
local money_text = p/unit_buyout_price:GetText()
|
||||
return p/aux.money.from_string(money_text) or 0
|
||||
local money_text = unit_buyout_price:GetText()
|
||||
return aux.money.from_string(money_text) or 0
|
||||
end
|
||||
|
||||
function set_unit_buyout_price(amount)
|
||||
|
||||
@@ -224,7 +224,6 @@ function create_frames()
|
||||
editbox.change = function() refresh = true end
|
||||
editbox.enter = function() this:ClearFocus() end
|
||||
editbox.focus_loss = function()
|
||||
p = this.SetText
|
||||
this:SetText(money.to_string(get_unit_start_price(), true, nil, 3, nil, true))
|
||||
end
|
||||
do
|
||||
@@ -261,7 +260,6 @@ function create_frames()
|
||||
editbox.change = function() refresh = true end
|
||||
editbox.enter = function() this:ClearFocus() end
|
||||
editbox.focus_loss = function()
|
||||
p(this.SetText)
|
||||
this:SetText(money.to_string(get_unit_buyout_price(), true, nil, 3, nil, true))
|
||||
end
|
||||
do
|
||||
@@ -277,8 +275,6 @@ function create_frames()
|
||||
buyout_price_percentage = label
|
||||
end
|
||||
unit_buyout_price = editbox
|
||||
local o = editbox.SetText
|
||||
function editbox:SetText(v) p(v) o(self, v) end
|
||||
end
|
||||
do
|
||||
local btn = gui.button(frame.parameters, 14)
|
||||
|
||||
Reference in New Issue
Block a user