Fix a bug with sound effect from misc/ folder not being read

Make an "effects_icon_size" entry in courtroom_design.ini for scaling the buttons in the effects list
This commit is contained in:
Crystalwarrior 2019-09-18 14:28:26 +03:00
parent 2d329cdbd2
commit f8d3d5d8fd
2 changed files with 6 additions and 3 deletions

View File

@ -619,8 +619,11 @@ void Courtroom::set_widgets()
set_size_and_pos(ui_effects_dropdown, "effects_dropdown");
ui_effects_dropdown->setInsertPolicy(QComboBox::InsertAtBottom);
ui_effects_dropdown->setToolTip(tr("Choose an effect to play on your next spoken message."));
ui_effects_dropdown->setIconSize(QSize(16, 16)); //Todo: don't do hardcoding hell - make it part of courtroom_design.ini
//Todo: actual list of effects
//Todo: recode this entire fucking system with these dumbass goddamn ini's why is everything so specifically coded for all these purposes
//is ABSTRACT CODING not a thing now huh what the FUCK why do I gotta do this pleASE FOR THE LOVE OF GOD SPARE ME FROM THIS FRESH HELL
//btw i still love coding.
QPoint p_point = ao_app->get_button_spacing("effects_icon_size", filename);
ui_effects_dropdown->setIconSize(QSize(p_point.x(), p_point.y()));
set_size_and_pos(ui_defense_bar, "defense_bar");
ui_defense_bar->set_image("defensebar" + QString::number(defense_bar_state));

View File

@ -884,7 +884,7 @@ QString AOApplication::get_effect(QString effect, QString p_char)
QString AOApplication::get_effect_sound(QString fx_name, QString p_char)
{
QString p_effect = read_char_ini(p_char, "effects", "Options");
QString p_path = get_base_path() + "misc/effects/" + p_effect + "/effects.ini";
QString p_path = get_base_path() + "misc/" + p_effect + "/effects.ini";
QString design_ini_path = get_theme_path("effects/effects.ini");
QString default_path = get_default_theme_path("effects/effects.ini");