Add on_settings to scripts without it
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user