From 3c3002122ece4909ad9ca49fbf67715379c4f5ef Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 29 Jul 2022 18:36:58 +0300 Subject: Add settings option for Evidence double-click that can be turned off (single-click evidence view) and more (#749) * Add 'evidence_one_click_view' courtroom_design.ini function, which allows you to treat every click as if it's a double-click (meaning every click will bring evidence overlay) Fix name not being set to read only when evidence is initialized If evidence is double-clicked and overlay is visible, trigger "on_x_clicked" behavior Make sure evidence is selected when double-click is called Stop hovering from changing name text if overlay is visible Simplify on_evidence_x_clicked "modified" check by simply checking if "ui_evidence_ok" is visible * Fix pressing "cancel" when trying to switch between evidence still acting the same as "discard" * Remove unnecessary ic message input focus setters for evidence, make only the Present button set focus on ic message input * Fix second page ignoring the evidence_one_click_view setting because of a wrong ID being used for the double-click call * Make evidence_switch() have everything required to properly switch between private/global * Make evidence cursor start at the top when looking at evidence description * Change it from theme setting to settings option * Make evidence double click default option to "true" due to it being the default for years Co-authored-by: Salanto <62221668+Salanto@users.noreply.github.com> --- src/text_file_functions.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/text_file_functions.cpp') diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp index f1e1fbba..bfb72f72 100644 --- a/src/text_file_functions.cpp +++ b/src/text_file_functions.cpp @@ -1232,3 +1232,9 @@ bool AOApplication::get_player_count_optout() return configini->value("player_count_optout", "false").value() .startsWith("true"); } + +bool AOApplication::get_evidence_double_click() +{ + return configini->value("evidence_double_click", "true").value() + .startsWith("true"); +} -- cgit