mirror of
https://github.com/Refactorio/RedMew.git
synced 2024-12-14 10:13:13 +02:00
tasklist bug fix
This commit is contained in:
parent
89f767b8b7
commit
10def6fe66
38
tasklist.lua
38
tasklist.lua
@ -406,6 +406,24 @@ local function draw_main_frame(left, player)
|
||||
frame.add {type = 'button', name = main_button_name, caption = 'Close'}
|
||||
end
|
||||
|
||||
local function close_edit_announcments_frame(frame)
|
||||
local editing_players = announcements.editing_players
|
||||
editing_players[frame.player_index] = nil
|
||||
Gui.destroy(frame)
|
||||
|
||||
if not next(editing_players) then
|
||||
return
|
||||
end
|
||||
|
||||
local editing_players_message = get_editing_players_message(editing_players)
|
||||
|
||||
for _, data in pairs(editing_players) do
|
||||
local editing_players_label = data.editing_players_label
|
||||
editing_players_label.caption = editing_players_message
|
||||
editing_players_label.tooltip = editing_players_message
|
||||
end
|
||||
end
|
||||
|
||||
local function toggle(event)
|
||||
local player = event.player
|
||||
local left = player.gui.left
|
||||
@ -414,7 +432,7 @@ local function toggle(event)
|
||||
Gui.destroy(frame)
|
||||
frame = left[edit_announcements_frame_name]
|
||||
if frame and frame.valid then
|
||||
Gui.destroy(frame)
|
||||
close_edit_announcments_frame(frame)
|
||||
end
|
||||
frame = left[create_task_frame_name]
|
||||
if frame and frame.valid then
|
||||
@ -449,24 +467,6 @@ local function update_edit_announcements_textbox(text, player)
|
||||
end
|
||||
end
|
||||
|
||||
local function close_edit_announcments_frame(frame)
|
||||
local editing_players = announcements.editing_players
|
||||
editing_players[frame.player_index] = nil
|
||||
Gui.destroy(frame)
|
||||
|
||||
if not next(editing_players) then
|
||||
return
|
||||
end
|
||||
|
||||
local editing_players_message = get_editing_players_message(editing_players)
|
||||
|
||||
for _, data in pairs(editing_players) do
|
||||
local editing_players_label = data.editing_players_label
|
||||
editing_players_label.caption = editing_players_message
|
||||
editing_players_label.tooltip = editing_players_message
|
||||
end
|
||||
end
|
||||
|
||||
local function update_announcements(player)
|
||||
local text = announcements.edit_text
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user