Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 65 additions & 47 deletions data/ui/options_dialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -313,24 +313,7 @@
<item row="18" column="1">
<widget class="QComboBox" name="language_combobox"/>
</item>
<item row="20" column="0">
<widget class="QLabel" name="shake_lbl">
<property name="toolTip">
<string>Allows screenshaking. Disable this if you have concerns or issues with photosensitivity and/or seizures.</string>
</property>
<property name="text">
<string>Allow Screenshake:</string>
</property>
</widget>
</item>
<item row="20" column="1">
<widget class="QCheckBox" name="shake_cb">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="21" column="0">
<item row="24" column="0">
<widget class="QLabel" name="effects_lbl">
<property name="toolTip">
<string>Allows screen effects. Disable this if you have concerns or issues with photosensitivity and/or seizures.</string>
Expand All @@ -340,14 +323,14 @@
</property>
</widget>
</item>
<item row="21" column="1">
<item row="24" column="1">
<widget class="QCheckBox" name="effects_cb">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="22" column="0">
<item row="25" column="0">
<widget class="QLabel" name="framenetwork_lbl">
<property name="toolTip">
<string>Send screen-shaking, flashes and sounds as defined in the char.ini over the network. Only works for servers that support this functionality.</string>
Expand All @@ -357,14 +340,14 @@
</property>
</widget>
</item>
<item row="22" column="1">
<item row="25" column="1">
<widget class="QCheckBox" name="framenetwork_cb">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="23" column="0">
<item row="26" column="0">
<widget class="QLabel" name="colorlog_lbl">
<property name="toolTip">
<string>Use the markup colors in the server IC chatlog.</string>
Expand All @@ -374,14 +357,14 @@
</property>
</widget>
</item>
<item row="23" column="1">
<item row="26" column="1">
<widget class="QCheckBox" name="colorlog_cb">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="24" column="0">
<item row="27" column="0">
<widget class="QLabel" name="stickysounds_lbl">
<property name="toolTip">
<string>Turn this on to prevent the sound dropdown from clearing the sound after playing it.</string>
Expand All @@ -391,14 +374,14 @@
</property>
</widget>
</item>
<item row="24" column="1">
<item row="27" column="1">
<widget class="QCheckBox" name="stickysounds_cb">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="25" column="0">
<item row="28" column="0">
<widget class="QLabel" name="stickyeffects_lbl">
<property name="toolTip">
<string>Turn this on to prevent the effects dropdown from clearing the effect after playing it.</string>
Expand All @@ -408,14 +391,14 @@
</property>
</widget>
</item>
<item row="25" column="1">
<item row="28" column="1">
<widget class="QCheckBox" name="stickyeffects_cb">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="26" column="0">
<item row="29" column="0">
<widget class="QLabel" name="stickypres_lbl">
<property name="toolTip">
<string>Turn this on to prevent preanimation checkbox from clearing after playing the emote.</string>
Expand All @@ -425,14 +408,14 @@
</property>
</widget>
</item>
<item row="26" column="1">
<item row="29" column="1">
<widget class="QCheckBox" name="stickypres_cb">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="27" column="0">
<item row="30" column="0">
<widget class="QLabel" name="customchat_lbl">
<property name="toolTip">
<string>Turn this on to allow characters to define their own custom chat box designs.</string>
Expand All @@ -442,14 +425,14 @@
</property>
</widget>
</item>
<item row="27" column="1">
<item row="30" column="1">
<widget class="QCheckBox" name="customchat_cb">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="28" column="0">
<item row="31" column="0">
<widget class="QLabel" name="sticker_lbl">
<property name="toolTip">
<string>Turn this on to allow characters to define their own stickers (unique images that show up over the chatbox - like avatars or shownames).</string>
Expand All @@ -459,14 +442,14 @@
</property>
</widget>
</item>
<item row="28" column="1">
<item row="31" column="1">
<widget class="QCheckBox" name="sticker_cb">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="29" column="0">
<item row="32" column="0">
<widget class="QLabel" name="continuous_lbl">
<property name="toolTip">
<string>Whether or not to resume playing animations from where they left off. Turning off might reduce lag.</string>
Expand All @@ -476,14 +459,14 @@
</property>
</widget>
</item>
<item row="29" column="1">
<item row="32" column="1">
<widget class="QCheckBox" name="continuous_cb">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="30" column="0">
<item row="33" column="0">
<widget class="QLabel" name="category_stop_lbl">
<property name="toolTip">
<string>Stop music when double-clicking a category. If this is disabled, use the right-click context menu to stop music.</string>
Expand All @@ -493,14 +476,14 @@
</property>
</widget>
</item>
<item row="30" column="1">
<item row="33" column="1">
<widget class="QCheckBox" name="category_stop_cb">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="31" column="0">
<item row="34" column="0">
<widget class="QLabel" name="sfx_on_idle_lbl">
<property name="toolTip">
<string>If the SFX dropdown has an SFX selected, send the custom SFX alongside the message even if Preanim is OFF.</string>
Expand All @@ -510,14 +493,14 @@
</property>
</widget>
</item>
<item row="31" column="1">
<item row="34" column="1">
<widget class="QCheckBox" name="sfx_on_idle_cb">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="32" column="0">
<item row="35" column="0">
<widget class="QLabel" name="evidence_double_click_lbl">
<property name="toolTip">
<string>If ticked, Evidence needs a double-click to view rather than a single click.</string>
Expand All @@ -527,14 +510,14 @@
</property>
</widget>
</item>
<item row="32" column="1">
<item row="35" column="1">
<widget class="QCheckBox" name="evidence_double_click_cb">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="33" column="0">
<item row="36" column="0">
<widget class="QLabel" name="slides_lbl">
<property name="toolTip">
<string>If ticked, slide animations will play when requested.</string>
Expand All @@ -544,7 +527,7 @@
</property>
</widget>
</item>
<item row="33" column="1">
<item row="36" column="1">
<widget class="QCheckBox" name="slides_cb">
<property name="text">
<string/>
Expand Down Expand Up @@ -583,7 +566,7 @@
</item>
</widget>
</item>
<item row="34" column="0">
<item row="37" column="0">
<widget class="QLabel" name="restoreposition_lbl">
<property name="toolTip">
<string>If ticked, some windows restore their last known position where they were closed.</string>
Expand All @@ -593,14 +576,14 @@
</property>
</widget>
</item>
<item row="34" column="1">
<item row="37" column="1">
<widget class="QCheckBox" name="restoreposition_cb">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="35" column="0">
<item row="38" column="0">
<widget class="QLabel" name="playerlist_format_lbl">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;Set the format for the player list to use.&lt;br&gt;&lt;br&gt;Valid fields are:&lt;br&gt;{id} - Client ID&lt;br&gt;{displayname} - Character display name&lt;br&gt;{character} - Character folder name&lt;br&gt;{username} - Out-of-character name&lt;br&gt;(Note: Some servers may hide out-of-character names.)&lt;/body&gt;&lt;/html&gt;</string>
Expand All @@ -610,9 +593,44 @@
</property>
</widget>
</item>
<item row="35" column="1">
<item row="38" column="1">
<widget class="QLineEdit" name="playerlist_format_edit"/>
</item>
<item row="20" column="0">
<widget class="QLabel" name="dumb_pos_lbl">
<property name="toolTip">
<string>Enables a simpler form of background position detection. If you're unsure, leave this off.</string>
</property>
<property name="text">
<string>Simple Position Detection
(EXPERIMENTAL)</string>
</property>
</widget>
</item>
<item row="20" column="1">
<widget class="QCheckBox" name="dumb_pos_cb">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="23" column="0">
<widget class="QLabel" name="shake_lbl">
<property name="toolTip">
<string>Allows screenshaking. Disable this if you have concerns or issues with photosensitivity and/or seizures.</string>
</property>
<property name="text">
<string>Allow Screenshake:</string>
</property>
</widget>
</item>
<item row="23" column="1">
<widget class="QCheckBox" name="shake_cb">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
Expand Down
62 changes: 47 additions & 15 deletions src/courtroom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1395,31 +1395,63 @@ void Courtroom::set_background(QString p_background, bool display)

// Populate the dropdown list with all pos that exist on this bg
QStringList pos_list = {};
for (const QPair<QString, QString> &pos_pair : std::as_const(legacy_positions))
// Alternative simple list of files with minimal processing
if (Options::getInstance().simplePositionDetection())
{
if (file_exists(ao_app->get_image_suffix(ao_app->get_background_path(pos_pair.first))) || // if we have 2.8-style positions, e.g. def.png, wit.webp, hld.apng
file_exists(ao_app->get_image_suffix(ao_app->get_background_path(pos_pair.second)))) // if we have pre-2.8-style positions, e.g. defenseempty.png
QDir directory(ao_app->get_real_path(VPath("background/" + get_current_background())));
for (const QString &file : directory.entryList(QDir::Files))
{
pos_list.append(pos_pair.first); // the dropdown always uses the new style
if ((file.endsWith(".png") || file.endsWith(".jpg") || file.endsWith(".apng") || file.endsWith(".webp") || file.endsWith(".gif")) && !file.split(".")[0].endsWith("_overlay"))
{
QFileInfo fi(file);
pos_list.append(fi.completeBaseName());
}
// Fix old-style positions
pos_list.removeAll("defensedesk");
pos_list.removeAll("prosecutordesk");
pos_list.removeAll("judgedesk");
pos_list.removeAll("prohelperdesk");
pos_list.removeAll("helperdesk");
pos_list.removeAll("jurydesk");
pos_list.removeAll("seancedesk");
pos_list.replaceInStrings("defenseempty", "def");
pos_list.replaceInStrings("prohelperstand", "hlp");
pos_list.replaceInStrings("helperstand", "hld");
pos_list.replaceInStrings("prosecutorempty", "pro");
pos_list.replaceInStrings("witnessempty", "wit");
pos_list.replaceInStrings("judgestand", "jud");
pos_list.replaceInStrings("jurystand", "jur");
pos_list.replaceInStrings("seancestand", "sea");
}
}
if (file_exists(ao_app->get_image_suffix(ao_app->get_background_path("court"))))
else
{
const QStringList overrides = {"def", "wit", "pro"};
for (const QString &override_pos : overrides)
for (const QString &key : default_pos.keys())
{
if (file_exists(ao_app->get_image_suffix(ao_app->get_background_path(default_pos[key]))) || // if we have 2.8-style positions, e.g. def.png, wit.webp, hld.apng
file_exists(ao_app->get_image_suffix(ao_app->get_background_path(key))))
{ // if we have pre-2.8-style positions, e.g. defenseempty.png
pos_list.append(default_pos[key]);
}
}
if (file_exists(ao_app->get_image_suffix(ao_app->get_background_path("court"))))
{
if (!ao_app->read_design_ini("court:" + override_pos + "/origin", ao_app->get_background_path("design.ini")).isEmpty())
const QStringList overrides = {"def", "wit", "pro"};
for (const QString &override_pos : overrides)
{
pos_list.append(override_pos);
if (!ao_app->read_design_ini("court:" + override_pos + "/origin", ao_app->get_background_path("design.ini")).isEmpty())
{
pos_list.append(override_pos);
}
}
}
}
for (const QString &pos : ao_app->read_design_ini("positions", ao_app->get_background_path("design.ini")).split(","))
{
QString real_pos = pos.split(":")[0];
if ((file_exists(ao_app->get_image_suffix(ao_app->get_background_path(real_pos)))))
for (const QString &pos : ao_app->read_design_ini("positions", ao_app->get_background_path("design.ini")).split(","))
{
pos_list.append(pos);
QString real_pos = pos.split(":")[0];
if ((file_exists(ao_app->get_image_suffix(ao_app->get_background_path(real_pos)))))
{
pos_list.append(pos);
}
}
}

Expand Down
Loading
Loading