mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 20:41:41 +09:00
I Was wrong
This commit is contained in:
@@ -45,7 +45,7 @@ function add_frame.popup(style,default_display,default_tooltip,restriction,on_cl
|
|||||||
if not style then error('Popup style requires a name') end
|
if not style then error('Popup style requires a name') end
|
||||||
if not event or type(event) ~= 'function' then error('Popup style requires a draw function') end
|
if not event or type(event) ~= 'function' then error('Popup style requires a draw function') end
|
||||||
local restriction = restriction or 0
|
local restriction = restriction or 0
|
||||||
table.insert(frames.popup,{name=style,display=default_display,on_click=on_click,event=event})
|
table.insert(frames.popup,{style=style,display=default_display,on_click=on_click,event=event})
|
||||||
if on_click and type(on_click) == 'function' then
|
if on_click and type(on_click) == 'function' then
|
||||||
ExpGui.toolbar.add_button(style,default_display,default_tooltip,restriction,draw_frame.popup_button)
|
ExpGui.toolbar.add_button(style,default_display,default_tooltip,restriction,draw_frame.popup_button)
|
||||||
end
|
end
|
||||||
@@ -55,8 +55,8 @@ function draw_frame.popup_button(player,element)
|
|||||||
local frame_data = nil
|
local frame_data = nil
|
||||||
for _,frame in pairs(frames.popup) do if element.name == frame.style then frame_data = frame break end end
|
for _,frame in pairs(frames.popup) do if element.name == frame.style then frame_data = frame break end end
|
||||||
local popups = mod_gui.get_frame_flow(player).popups
|
local popups = mod_gui.get_frame_flow(player).popups
|
||||||
if popups[frame_data.name..'_on_click'] then popups[frame_data.name..'_on_click'].destroy() return end
|
if popups[frame_data.style..'_on_click'] then popups[frame_data.style..'_on_click'].destroy() return end
|
||||||
local frame = get_next_popup(popups,frame_data.name)
|
local frame = get_next_popup(popups,frame_data.style)
|
||||||
frame_data.on_click(player,frame)
|
frame_data.on_click(player,frame)
|
||||||
end
|
end
|
||||||
--used to draw a popup style can be called at any time; can not be called from a button directly
|
--used to draw a popup style can be called at any time; can not be called from a button directly
|
||||||
|
|||||||
Reference in New Issue
Block a user