Add on_settings to scripts without it

This commit is contained in:
Evgeny
2024-05-16 15:27:31 +04:00
parent 7d6b925802
commit 9ab0ab3934
8 changed files with 34 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ The type of script is determined by the line (meta tag) at the beginning of the
* Added `prefs:show_dialog` method * Added `prefs:show_dialog` method
* Added support for SVG icons to the Rich UI API * Added support for SVG icons to the Rich UI API
* To show settings dialog you must declare `on_settings` function
### 5.2.3 ### 5.2.3

View File

@@ -47,6 +47,10 @@ function on_click()
settings:show_dialog() settings:show_dialog()
end end
function on_settings()
settings:show_dialog()
end
-- utils -- utils
function get_milestone_idx(passed) function get_milestone_idx(passed)

View File

@@ -93,6 +93,10 @@ function on_network_result_cmd(result)
end end
end end
function on_settings()
settings:show_dialog()
end
-- utils -- utils
function init_url_from_settings() function init_url_from_settings()

View File

@@ -14,9 +14,14 @@ function on_resume()
end end
function on_click() function on_click()
aio:show_args_dialog() settings:show_dialog()
end end
function on_network_result(result) function on_network_result(result)
ui:show_text(result) ui:show_text(result)
end end
function on_settings()
settings:show_dialog()
end

View File

@@ -31,3 +31,8 @@ function init_progressbar()
percent = math.floor((current_time - start_period) / ((end_period - start_period) / 100)) percent = math.floor((current_time - start_period) / ((end_period - start_period) / 100))
ui:show_progress_bar(name_period..": "..percent.."%", current_time - start_period, end_period - start_period, "#7069f0ae") ui:show_progress_bar(name_period..": "..percent.."%", current_time - start_period, end_period - start_period, "#7069f0ae")
end end
function on_settings()
settings:show_dialog()
end

View File

@@ -65,5 +65,9 @@ function on_network_result(result, code)
end end
ui:show_buttons(names, colours) ui:show_buttons(names, colours)
end end
function on_settings()
settings:show_dialog()
end

View File

@@ -91,3 +91,8 @@ function table_to_tables(tab, num)
return out_tab return out_tab
end end
function on_settings()
settings:show_dialog()
end

View File

@@ -92,6 +92,10 @@ function create_tab(result)
return tab return tab
end end
function on_settings()
settings:show_dialog()
end
-- utils -- -- utils --
function get_formatted_change_text(change) function get_formatted_change_text(change)