From 3c0cedbe922c9fcacd0d171423f83e375f66e178 Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Fri, 18 Jan 2019 19:08:56 -0800 Subject: Add screenshake, frame-specific effects, looping SFX, and clientside music looping Committed by patch since Goof is currently banned on GitHub for no good reason. --- Attorney_Online.pro | 2 +- base/themes/default/courtroom_design.ini | 3 + base/themes/default/screenshake.png | Bin 0 -> 3507 bytes base/themes/default/screenshake_pressed.png | Bin 0 -> 3324 bytes include/aoapplication.h | 29 ++- include/aocharmovie.h | 30 ++- include/aomusicplayer.h | 18 +- include/aooptionsdialog.h | 4 + include/aosfxplayer.h | 10 +- include/courtroom.h | 23 ++- include/datatypes.h | 7 +- src/aocharmovie.cpp | 240 +++++++++++++----------- src/aomusicplayer.cpp | 44 ++++- src/aooptionsdialog.cpp | 25 +++ src/aosfxplayer.cpp | 31 +++- src/courtroom.cpp | 271 ++++++++++++++++++++++++++-- src/packet_distribution.cpp | 3 + src/text_file_functions.cpp | 48 +++++ 18 files changed, 643 insertions(+), 145 deletions(-) create mode 100644 base/themes/default/screenshake.png create mode 100644 base/themes/default/screenshake_pressed.png diff --git a/Attorney_Online.pro b/Attorney_Online.pro index 39366c0..73d3534 100644 --- a/Attorney_Online.pro +++ b/Attorney_Online.pro @@ -11,7 +11,7 @@ OBJECTS_DIR = $$PWD/build MOC_DIR = $$PWD/build SOURCES += $$files($$PWD/src/*.cpp) -HEADERS += $$files($$PWD/include/*.h) +HEADERS += $$files($$PWD/include/*.h) $$PWD/include/aomusicplayer.h $$PWD/include/aosfxplayer.h LIBS += -L$$PWD/lib -lbass -ldiscord-rpc CONFIG += c++11 diff --git a/base/themes/default/courtroom_design.ini b/base/themes/default/courtroom_design.ini index 960d6e4..fe8fadf 100644 --- a/base/themes/default/courtroom_design.ini +++ b/base/themes/default/courtroom_design.ini @@ -132,6 +132,9 @@ call_mod = 104, 637, 64, 23 ; Mute button mute_button = 150, 515, 42, 42 +; Screenshake +screenshake = 51, 515, 42, 42 + ; Where the Mute list pops up when you click Mute mute_list = 280, 469, 210, 198 diff --git a/base/themes/default/screenshake.png b/base/themes/default/screenshake.png new file mode 100644 index 0000000..5b71e3b Binary files /dev/null and b/base/themes/default/screenshake.png differ diff --git a/base/themes/default/screenshake_pressed.png b/base/themes/default/screenshake_pressed.png new file mode 100644 index 0000000..43e01c8 Binary files /dev/null and b/base/themes/default/screenshake_pressed.png differ diff --git a/include/aoapplication.h b/include/aoapplication.h index 44aef7a..cff0afb 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -74,6 +74,7 @@ public: bool arup_enabled = false; bool casing_alerts_enabled = false; bool modcall_reason_enabled = false; + bool looping_sfx_support_enabled = false; ///////////////loading info/////////////////// @@ -94,9 +95,9 @@ public: //////////////////versioning/////////////// - constexpr int get_release() const { return RELEASE; } - constexpr int get_major_version() const { return MAJOR_VERSION; } - constexpr int get_minor_version() const { return MINOR_VERSION; } + int get_release() const { return RELEASE; } + int get_major_version() const { return MAJOR_VERSION; } + int get_minor_version() const { return MINOR_VERSION; } QString get_version_string(); /////////////////////////////////////////// @@ -146,6 +147,12 @@ public: //Returns true if blank blips is enabled in config.ini and false otherwise bool get_blank_blip(); + //Returns true if looping sound effects are enabled in the config.ini + bool get_looping_sfx(); + + //Returns true if kill music on object is enabled in the config.ini + bool get_objectmusic(); + //Returns the value of default_music in config.ini int get_default_music(); @@ -257,6 +264,18 @@ public: //Returns the sfx of p_char's p_emote QString get_sfx_name(QString p_char, int p_emote); + //Returns if an emote loops it's SFX + QString get_sfx_looping(QString p_char, int p_emote); + + //Returns if an emote has a frame specific SFX for it + QString get_frame_sfx_name(QString p_char, QString p_emote, int n_frame); + + //Returns if an emote has a frame specific SFX for it + QString get_realization_frame(QString p_char, QString p_emote, int n_frame); + + //Returns if an emote has a frame specific SFX for it + QString get_screenshake_frame(QString p_char, QString p_emote, int n_frame); + //Not in use int get_sfx_delay(QString p_char, int p_emote); @@ -299,8 +318,8 @@ public: private: const int RELEASE = 2; - const int MAJOR_VERSION = 6; - const int MINOR_VERSION = 1; + const int MAJOR_VERSION = 7; + const int MINOR_VERSION = 0; QString current_theme = "default"; diff --git a/include/aocharmovie.h b/include/aocharmovie.h index 7ef7da3..94e242b 100644 --- a/include/aocharmovie.h +++ b/include/aocharmovie.h @@ -6,9 +6,12 @@ #include #include #include +#include +#include "include/aosfxplayer.h" +#include "include/courtroom.h" -class AOApplication; +class AOApplication; class AOCharMovie : public QLabel { Q_OBJECT @@ -22,25 +25,41 @@ public: void play_idle(QString p_char, QString p_emote); void set_flipped(bool p_flipped) {m_flipped = p_flipped;} - + void LoadImageWithStupidMethodForFlipSupport(QImage image); void stop(); void move(int ax, int ay); - void combo_resize(int w, int h); - + void play_frame_sfx(); + + void sfx_two_network_boogaloo(); + void screenshake_two_network_boogaloo(); + void realization_two_network_boogaloo(); + + AOSfxPlayer *frame_specific_sfx_player; + Courtroom *mycourtroom; + QString frame_sfx_hellstring = ""; + QString frame_screenshake_hellstring = ""; + QString frame_realization_hellstring = ""; + bool use_networked_framehell = false; private: AOApplication *ao_app; QMovie *m_movie; QVector movie_frames; QTimer *preanim_timer; + QTimer *ticker; + QString last_path; + QString current_emote; + QString current_char; const int time_mod = 62; // These are the X and Y values before they are fixed based on the sprite's width. int x = 0; int y = 0; + int default_w; + int default_h; bool m_flipped = false; @@ -50,8 +69,7 @@ signals: void done(); private slots: - void frame_change(int n_frame); void timer_done(); + void movie_ticker(); }; - #endif // AOCHARMOVIE_H diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h index 560a7f9..54f3b5f 100644 --- a/include/aomusicplayer.h +++ b/include/aomusicplayer.h @@ -7,22 +7,32 @@ #include #include #include +#include +#include -class AOMusicPlayer +class AOMusicPlayer : public QObject { + Q_OBJECT public: AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); - ~AOMusicPlayer(); - + virtual ~AOMusicPlayer(); void play(QString p_song); void set_volume(int p_value); + void kill_loop(); + QString get_path(); + private: QWidget *m_parent; AOApplication *ao_app; - + QTimer *music_loop_timer; int m_volume = 0; + QString f_path; + HSTREAM m_stream; + +private slots: + void restart_loop(); }; #endif // AOMUSICPLAYER_H diff --git a/include/aooptionsdialog.h b/include/aooptionsdialog.h index a65e3f5..03b1e71 100644 --- a/include/aooptionsdialog.h +++ b/include/aooptionsdialog.h @@ -80,6 +80,10 @@ private: QLabel *ui_bliprate_lbl; QCheckBox *ui_blank_blips_cb; QLabel *ui_blank_blips_lbl; + QLabel *ui_loopsfx_lbl; + QCheckBox *ui_loopsfx_cb; + QLabel *ui_objectmusic_lbl; + QCheckBox *ui_objectmusic_cb; QDialogButtonBox *ui_settings_buttons; QWidget *ui_casing_tab; diff --git a/include/aosfxplayer.h b/include/aosfxplayer.h index 30cbe9d..5c6f108 100644 --- a/include/aosfxplayer.h +++ b/include/aosfxplayer.h @@ -7,22 +7,28 @@ #include #include #include +#include -class AOSfxPlayer +class AOSfxPlayer : public QObject { + Q_OBJECT public: AOSfxPlayer(QWidget *parent, AOApplication *p_ao_app); void play(QString p_sfx, QString p_char = "", QString shout = ""); void stop(); void set_volume(int p_volume); - + void setLooping(bool is_looping); private: QWidget *m_parent; AOApplication *ao_app; + QTimer *sfx_loop_timer; int m_volume = 0; + bool looping_sfx = false; HSTREAM m_stream; +private slots: + void restart_loop(); }; #endif // AOSFXPLAYER_H diff --git a/include/courtroom.h b/include/courtroom.h index ec9f9ef..3f93e4c 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -25,6 +25,7 @@ #include "datatypes.h" #include "debug_functions.h" #include "chatlogpiece.h" +#include "aocharmovie.h" #include #include @@ -48,11 +49,15 @@ #include #include #include +#include +#include +#include +#include #include class AOApplication; - +class AOCharMovie; class Courtroom : public QMainWindow { Q_OBJECT @@ -63,7 +68,6 @@ public: void append_evidence(evi_type p_evi){evidence_list.append(p_evi);} void append_music(QString f_music){music_list.append(f_music);} void append_area(QString f_area){area_list.append(f_area);} - void fix_last_area() { if (area_list.size() > 0) @@ -210,6 +214,8 @@ public: void announce_case(QString title, bool def, bool pro, bool jud, bool jur, bool steno); void check_connection_received(); + void doScreenShake(); + void doRealization(); ~Courtroom(); @@ -227,7 +233,10 @@ private: bool first_message_sent = false; int maximumMessages = 0; - + QPropertyAnimation *screenshake_animation; + QPropertyAnimation *chatbox_screenshake_animation; + QParallelAnimationGroup *screenshake_group; + QImageReader *frame_emote_checker; // This is for inline message-colouring. enum INLINE_COLOURS { @@ -318,7 +327,7 @@ private: //every time point in char.inis times this equals the final time const int time_mod = 40; - static const int chatmessage_size = 23; + static const int chatmessage_size = 28; QString m_chatmessage[chatmessage_size]; bool chatmessage_is_empty = false; @@ -352,6 +361,7 @@ private: int objection_state = 0; int realization_state = 0; + int screenshake_state = 0; int text_color = 0; bool is_presenting_evidence = false; @@ -390,6 +400,9 @@ private: AOMusicPlayer *music_player; AOSfxPlayer *sfx_player; + AOSfxPlayer *misc_sfx_player; + AOSfxPlayer *frame_emote_sfx_player; + AOSfxPlayer *pair_frame_emote_sfx_player; AOSfxPlayer *objection_player; AOBlipPlayer *blip_player; @@ -478,6 +491,7 @@ private: AOButton *ui_custom_objection; AOButton *ui_realization; + AOButton *ui_screenshake; AOButton *ui_mute; AOButton *ui_defense_plus; @@ -605,6 +619,7 @@ private slots: void on_custom_objection_clicked(); void on_realization_clicked(); + void on_screenshake_clicked(); void on_mute_clicked(); void on_pair_clicked(); diff --git a/include/datatypes.h b/include/datatypes.h index aaa5de5..1b76f72 100644 --- a/include/datatypes.h +++ b/include/datatypes.h @@ -100,7 +100,12 @@ enum CHAT_MESSAGE SELF_OFFSET, OTHER_OFFSET, OTHER_FLIP, - NONINTERRUPTING_PRE + NONINTERRUPTING_PRE, + LOOPING_SFX, + SCREENSHAKE, + FRAME_SCREENSHAKE, + FRAME_REALIZATION, + FRAME_SFX }; enum COLOR diff --git a/src/aocharmovie.cpp b/src/aocharmovie.cpp index 5748723..a5beefb 100644 --- a/src/aocharmovie.cpp +++ b/src/aocharmovie.cpp @@ -7,25 +7,26 @@ AOCharMovie::AOCharMovie(QWidget *p_parent, AOApplication *p_ao_app) : QLabel(p_parent) { ao_app = p_ao_app; - m_movie = new QMovie(this); - preanim_timer = new QTimer(this); + ticker = new QTimer(this); preanim_timer->setSingleShot(true); - - connect(m_movie, SIGNAL(frameChanged(int)), this, SLOT(frame_change(int))); + ticker->setSingleShot(true); + connect(ticker, SIGNAL(timeout()), this, SLOT(movie_ticker())); connect(preanim_timer, SIGNAL(timeout()), this, SLOT(timer_done())); + this->setUpdatesEnabled(true); } void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix) { QString original_path = ao_app->get_character_path(p_char, emote_prefix + p_emote + ".gif"); - QString alt_path = ao_app->get_character_path(p_char, p_emote + ".png"); + QString alt_path = ao_app->get_character_path(p_char, emote_prefix + p_emote + ".png"); QString apng_path = ao_app->get_character_path(p_char, emote_prefix + p_emote + ".apng"); QString placeholder_path = ao_app->get_theme_path("placeholder.gif"); QString placeholder_default_path = ao_app->get_default_theme_path("placeholder.gif"); QString gif_path; - + current_emote = emote_prefix + p_emote; + current_char = p_char; if (file_exists(apng_path)) gif_path = apng_path; else if (file_exists(original_path)) @@ -36,27 +37,139 @@ void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix) gif_path = placeholder_path; else gif_path = placeholder_default_path; - + delete m_movie; + m_movie = new QMovie(this); m_movie->stop(); + this->clear(); m_movie->setFileName(gif_path); + m_movie->jumpToFrame(0); + this->LoadImageWithStupidMethodForFlipSupport(m_movie->currentImage()); + qDebug() << "playing file path: " << gif_path; + this->show(); + this->play_frame_sfx(); + ticker->start(m_movie->nextFrameDelay()); +} - QImageReader *reader = new QImageReader(gif_path); - - movie_frames.clear(); - QImage f_image = reader->read(); - while (!f_image.isNull()) +void AOCharMovie::play_frame_sfx() +{ + int current_frame = m_movie->currentFrameNumber(); + QString sfx_to_play = ao_app->get_frame_sfx_name(current_char, current_emote, current_frame); + QString screenshake_to_play = ao_app->get_screenshake_frame(current_char, current_emote, current_frame); + QString realization_to_play = ao_app->get_realization_frame(current_char, current_emote, current_frame); + if(sfx_to_play != "" && !use_networked_framehell) { - if (m_flipped) - movie_frames.append(f_image.mirrored(true, false)); - else - movie_frames.append(f_image); - f_image = reader->read(); + frame_specific_sfx_player->play(ao_app->get_sfx_suffix(sfx_to_play)); } + else if(use_networked_framehell) + { + this->sfx_two_network_boogaloo(); + } + if(screenshake_to_play != "" && !use_networked_framehell) + { + mycourtroom->doScreenShake(); + } + else if(use_networked_framehell) + { + this->screenshake_two_network_boogaloo(); + } + if(realization_to_play != "" && !use_networked_framehell) + { + mycourtroom->doRealization(); + } + else if(use_networked_framehell) + { + this->realization_two_network_boogaloo(); + } +} - delete reader; +void AOCharMovie::realization_two_network_boogaloo() +{ + int current_frame = m_movie->currentFrameNumber(); + QStringList fucking_garbage = this->frame_realization_hellstring.split("^"); + for (int i = 0; i < fucking_garbage.length(); i++) { + QString fucking_christ = fucking_garbage.at(i); + QStringList extra_garbage = fucking_christ.split("|"); + if(extra_garbage.at(0) != current_emote){ + continue; + } + for (int ii = 1; ii < extra_garbage.length(); ii++) { + QString levels_of_garbage = extra_garbage.at(ii); + QStringList that_shouldnt_be_possible = levels_of_garbage.split("="); + if(that_shouldnt_be_possible.at(0).toInt() == current_frame && that_shouldnt_be_possible.at(1) != "") { + mycourtroom->doRealization(); + } + } + } +} - this->show(); - m_movie->start(); +void AOCharMovie::screenshake_two_network_boogaloo() +{ + int current_frame = m_movie->currentFrameNumber(); + QStringList fucking_garbage = this->frame_screenshake_hellstring.split("^"); + for (int i = 0; i < fucking_garbage.length(); i++) { + QString fucking_christ = fucking_garbage.at(i); + QStringList extra_garbage = fucking_christ.split("|"); + if(extra_garbage.at(0) != current_emote){ + continue; + } + for (int ii = 1; ii < extra_garbage.length(); ii++) { + QString levels_of_garbage = extra_garbage.at(ii); + QStringList that_shouldnt_be_possible = levels_of_garbage.split("="); + if(that_shouldnt_be_possible.at(0).toInt() == current_frame && that_shouldnt_be_possible.at(1) != "") { + mycourtroom->doScreenShake(); + } + } + } +} + +void AOCharMovie::sfx_two_network_boogaloo() +{ + int current_frame = m_movie->currentFrameNumber(); + QStringList fucking_garbage = this->frame_sfx_hellstring.split("^"); + for (int i = 0; i < fucking_garbage.length(); i++) { + QString fucking_christ = fucking_garbage.at(i); + QStringList extra_garbage = fucking_christ.split("|"); + if(extra_garbage.at(0) != current_emote){ + continue; + } + for (int ii = 1; ii < extra_garbage.length(); ii++) { + QString levels_of_garbage = extra_garbage.at(ii); + QStringList that_shouldnt_be_possible = levels_of_garbage.split("="); + if(that_shouldnt_be_possible.at(0).toInt() == current_frame && that_shouldnt_be_possible.at(1) != "") { + frame_specific_sfx_player->play(ao_app->get_sfx_suffix(that_shouldnt_be_possible.at(1))); + } + } + } +} + + +void AOCharMovie::movie_ticker() +{ + m_movie->jumpToNextFrame(); + this->LoadImageWithStupidMethodForFlipSupport(m_movie->currentImage()); // imagine if QT had sane stuff like "mirror on QMovie" or "resize the image on QT" or "interface with the current QMovie image" or anything else + // ps: fuck private functions/variables as a concept, freedom 2 do dangerous things 5ever + this->play_frame_sfx(); + ticker->start(m_movie->nextFrameDelay()); +} + +void AOCharMovie::LoadImageWithStupidMethodForFlipSupport(QImage image) +{ + QPixmap f_pixmap; + if(m_flipped) // imagine if QT wasn't handicapped harder than people who think MLP is good + f_pixmap = QPixmap::fromImage(image.mirrored(true, false)); + else + f_pixmap = QPixmap::fromImage(image); + auto aspect_ratio = Qt::KeepAspectRatio; + + if (f_pixmap.size().width() > f_pixmap.size().height()) + aspect_ratio = Qt::KeepAspectRatioByExpanding; + + if (f_pixmap.size().width() > this->size().width() || f_pixmap.size().height() > this->size().height()) + this->setPixmap(f_pixmap.scaled(this->width(), this->height(), aspect_ratio, Qt::SmoothTransformation)); + else + this->setPixmap(f_pixmap.scaled(this->width(), this->height(), aspect_ratio, Qt::FastTransformation)); + + QLabel::move(x + (this->width() - this->pixmap()->width())/2, y); } void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration) @@ -64,79 +177,29 @@ void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration) QString gif_path = ao_app->get_character_path(p_char, p_emote); m_movie->stop(); - this->clear(); m_movie->setFileName(gif_path); m_movie->jumpToFrame(0); - - int full_duration = duration * time_mod; int real_duration = 0; - - play_once = false; - for (int n_frame = 0 ; n_frame < m_movie->frameCount() ; ++n_frame) { + qDebug() << "frame " << n_frame << " delay of " << m_movie->nextFrameDelay(); real_duration += m_movie->nextFrameDelay(); m_movie->jumpToFrame(n_frame + 1); } - -#ifdef DEBUG_GIF - qDebug() << "full_duration: " << full_duration; - qDebug() << "real_duration: " << real_duration; -#endif - - double percentage_modifier = 100.0; - - if (real_duration != 0 && duration != 0) - { - double modifier = full_duration / static_cast(real_duration); - percentage_modifier = 100 / modifier; - - if (percentage_modifier > 100.0) - percentage_modifier = 100.0; - } - -#ifdef DEBUG_GIF - qDebug() << "% mod: " << percentage_modifier; -#endif - - if (full_duration == 0 || full_duration >= real_duration) - { - play_once = true; - } - else - { - play_once = false; - preanim_timer->start(full_duration); - } - - - m_movie->setSpeed(static_cast(percentage_modifier)); + play_once = true; + preanim_timer->start(real_duration); play(p_char, p_emote, ""); } void AOCharMovie::play_talking(QString p_char, QString p_emote) { - QString gif_path = ao_app->get_character_path(p_char, "(b)" + p_emote); - - m_movie->stop(); - this->clear(); - m_movie->setFileName(gif_path); - play_once = false; - m_movie->setSpeed(100); play(p_char, p_emote, "(b)"); } void AOCharMovie::play_idle(QString p_char, QString p_emote) { - QString gif_path = ao_app->get_character_path(p_char, "(a)" + p_emote); - - m_movie->stop(); - this->clear(); - m_movie->setFileName(gif_path); - play_once = false; - m_movie->setSpeed(100); play(p_char, p_emote, "(a)"); } @@ -145,6 +208,7 @@ void AOCharMovie::stop() //for all intents and purposes, stopping is the same as hiding. at no point do we want a frozen gif to display m_movie->stop(); preanim_timer->stop(); + frame_specific_sfx_player->stop(); this->hide(); } @@ -152,9 +216,8 @@ void AOCharMovie::combo_resize(int w, int h) { QSize f_size(w, h); this->resize(f_size); - m_movie->setScaledSize(f_size); + m_movie->setScaledSize(this->size()); } - void AOCharMovie::move(int ax, int ay) { x = ax; @@ -162,34 +225,7 @@ void AOCharMovie::move(int ax, int ay) QLabel::move(x, y); } -void AOCharMovie::frame_change(int n_frame) -{ - - if (movie_frames.size() > n_frame) - { - QPixmap f_pixmap = QPixmap::fromImage(movie_frames.at(n_frame)); - auto aspect_ratio = Qt::KeepAspectRatio; - - if (f_pixmap.size().width() > f_pixmap.size().height()) - aspect_ratio = Qt::KeepAspectRatioByExpanding; - - if (f_pixmap.size().width() > this->size().width() || f_pixmap.size().height() > this->size().height()) - this->setPixmap(f_pixmap.scaled(this->width(), this->height(), aspect_ratio, Qt::SmoothTransformation)); - else - this->setPixmap(f_pixmap.scaled(this->width(), this->height(), aspect_ratio, Qt::FastTransformation)); - - QLabel::move(x + (this->width() - this->pixmap()->width())/2, y); - } - - if (m_movie->frameCount() - 1 == n_frame && play_once) - { - preanim_timer->start(m_movie->nextFrameDelay()); - m_movie->stop(); - } -} - void AOCharMovie::timer_done() { - done(); } diff --git a/src/aomusicplayer.cpp b/src/aomusicplayer.cpp index 997d82d..a52603c 100644 --- a/src/aomusicplayer.cpp +++ b/src/aomusicplayer.cpp @@ -1,21 +1,25 @@ #include "aomusicplayer.h" -AOMusicPlayer::AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app) + +AOMusicPlayer::AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app): QObject() { m_parent = parent; ao_app = p_ao_app; + music_loop_timer = new QTimer(this); + music_loop_timer->setSingleShot(true); + connect(music_loop_timer, SIGNAL(timeout()), this, SLOT(restart_loop())); } AOMusicPlayer::~AOMusicPlayer() { - BASS_ChannelStop(m_stream); + kill_loop(); } void AOMusicPlayer::play(QString p_song) { BASS_ChannelStop(m_stream); - QString f_path = ao_app->get_music_path(p_song); + f_path = ao_app->get_music_path(p_song); m_stream = BASS_StreamCreateFile(FALSE, f_path.utf16(), 0, 0, BASS_STREAM_AUTOFREE | BASS_UNICODE | BASS_ASYNCFILE); @@ -24,6 +28,15 @@ void AOMusicPlayer::play(QString p_song) if (ao_app->get_audio_output_device() != "default") BASS_ChannelSetDevice(m_stream, BASS_GetDevice()); BASS_ChannelPlay(m_stream, false); + music_loop_timer->stop(); + QWORD len=BASS_ChannelGetLength(m_stream, BASS_POS_BYTE); // the length in bytes + double time=BASS_ChannelBytes2Seconds(m_stream, len); // the length in seconds + if(time > 0) + { + qDebug() << "Will loop in " << time << " seconds."; + music_loop_timer->start(time*1000); + } + } void AOMusicPlayer::set_volume(int p_value) @@ -32,3 +45,28 @@ void AOMusicPlayer::set_volume(int p_value) float volume = m_volume / 100.0f; BASS_ChannelSetAttribute(m_stream, BASS_ATTRIB_VOL, volume); } + +QString AOMusicPlayer::get_path() +{ + return f_path; +} + +void AOMusicPlayer::restart_loop() +{ + qDebug() << "Restarting Music"; + /* + m_stream = BASS_StreamCreateFile(FALSE, f_path.utf16(), 0, 0, BASS_STREAM_AUTOFREE | BASS_UNICODE | BASS_ASYNCFILE); + if (ao_app->get_audio_output_device() != "default") + BASS_ChannelSetDevice(m_stream, BASS_GetDevice());*/ + QWORD len=BASS_ChannelGetLength(m_stream, BASS_POS_BYTE); // the length in bytes + double time=BASS_ChannelBytes2Seconds(m_stream, len); // the length in seconds + music_loop_timer->start(time*1000); + BASS_ChannelPlay(m_stream, true); +} + +void AOMusicPlayer::kill_loop() +{ + music_loop_timer->stop(); + BASS_ChannelStop(m_stream); +} + diff --git a/src/aooptionsdialog.cpp b/src/aooptionsdialog.cpp index cd69c76..4d0e479 100644 --- a/src/aooptionsdialog.cpp +++ b/src/aooptionsdialog.cpp @@ -312,6 +312,29 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) : QDi ui_audio_layout->setWidget(7, QFormLayout::FieldRole, ui_blank_blips_cb); + ui_loopsfx_lbl = new QLabel(ui_audio_widget); + ui_loopsfx_lbl->setText(tr("Enable Looping SFX:")); + ui_loopsfx_lbl->setToolTip(tr("If true, the game will allow looping sound effects to play on preanimations.")); + + ui_audio_layout->setWidget(8, QFormLayout::LabelRole, ui_loopsfx_lbl); + + ui_loopsfx_cb = new QCheckBox(ui_audio_widget); + ui_loopsfx_cb->setChecked(p_ao_app->get_looping_sfx()); + + ui_audio_layout->setWidget(8, QFormLayout::FieldRole, ui_loopsfx_cb); + + + ui_objectmusic_lbl = new QLabel(ui_audio_widget); + ui_objectmusic_lbl->setText(tr("Kill Music On Objection:")); + ui_objectmusic_lbl->setToolTip(tr("If true, the game will stop music when someone objects, like in the actual games.")); + + ui_audio_layout->setWidget(9, QFormLayout::LabelRole, ui_objectmusic_lbl); + + ui_objectmusic_cb = new QCheckBox(ui_audio_widget); + ui_objectmusic_cb->setChecked(p_ao_app->get_objectmusic()); + + ui_audio_layout->setWidget(9, QFormLayout::FieldRole, ui_objectmusic_cb); + // The casing tab! ui_casing_tab = new QWidget(); ui_settings_tabs->addTab(ui_casing_tab, tr("Casing")); @@ -483,6 +506,8 @@ void AOOptionsDialog::save_pressed() configini->setValue("default_blip", ui_blips_volume_spinbox->value()); configini->setValue("blip_rate", ui_bliprate_spinbox->value()); configini->setValue("blank_blip", ui_blank_blips_cb->isChecked()); + configini->setValue("looping_sfx", ui_loopsfx_cb->isChecked()); + configini->setValue("kill_music_on_object", ui_objectmusic_cb->isChecked()); configini->setValue("casing_enabled", ui_casing_enabled_cb->isChecked()); configini->setValue("casing_defence_enabled", ui_casing_def_cb->isChecked()); diff --git a/src/aosfxplayer.cpp b/src/aosfxplayer.cpp index 7fe7987..e219c03 100644 --- a/src/aosfxplayer.cpp +++ b/src/aosfxplayer.cpp @@ -1,10 +1,13 @@ #include "aosfxplayer.h" #include "file_functions.h" -AOSfxPlayer::AOSfxPlayer(QWidget *parent, AOApplication *p_ao_app) +AOSfxPlayer::AOSfxPlayer(QWidget *parent, AOApplication *p_ao_app): QObject() { m_parent = parent; ao_app = p_ao_app; + sfx_loop_timer = new QTimer(this); + sfx_loop_timer->setSingleShot(true); + connect(sfx_loop_timer, SIGNAL(timeout()), this, SLOT(restart_loop())); } void AOSfxPlayer::play(QString p_sfx, QString p_char, QString shout) @@ -28,7 +31,7 @@ void AOSfxPlayer::play(QString p_sfx, QString p_char, QString shout) f_path = misc_path; else f_path = sound_path; - + BASS_ChannelStop(m_stream); m_stream = BASS_StreamCreateFile(FALSE, f_path.utf16(), 0, 0, BASS_STREAM_AUTOFREE | BASS_UNICODE | BASS_ASYNCFILE); set_volume(m_volume); @@ -36,11 +39,35 @@ void AOSfxPlayer::play(QString p_sfx, QString p_char, QString shout) if (ao_app->get_audio_output_device() != "default") BASS_ChannelSetDevice(m_stream, BASS_GetDevice()); BASS_ChannelPlay(m_stream, false); + sfx_loop_timer->stop(); + QWORD len=BASS_ChannelGetLength(m_stream, BASS_POS_BYTE); // the length in bytes + double time=BASS_ChannelBytes2Seconds(m_stream, len); // the length in seconds + if(time > 0 && looping_sfx && ao_app->get_looping_sfx()) + { + sfx_loop_timer->start(time*1000); + } +} + +void AOSfxPlayer::setLooping(bool is_looping) +{ + this->looping_sfx = is_looping; } void AOSfxPlayer::stop() { BASS_ChannelStop(m_stream); + sfx_loop_timer->stop(); +} + +void AOSfxPlayer::restart_loop() +{ + if(ao_app->get_looping_sfx() && looping_sfx) + { + QWORD len=BASS_ChannelGetLength(m_stream, BASS_POS_BYTE); // the length in bytes + double time=BASS_ChannelBytes2Seconds(m_stream, len); // the length in seconds + sfx_loop_timer->start(time*1000); + BASS_ChannelPlay(m_stream, true); + } } void AOSfxPlayer::set_volume(int p_value) diff --git a/src/courtroom.cpp b/src/courtroom.cpp index be7629b..ab387da 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -56,7 +56,13 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() sfx_player = new AOSfxPlayer(this, ao_app); sfx_player->set_volume(0); objection_player = new AOSfxPlayer(this, ao_app); - sfx_player->set_volume(0); + objection_player->set_volume(0); + misc_sfx_player = new AOSfxPlayer(this, ao_app); + misc_sfx_player->set_volume(0); + frame_emote_sfx_player = new AOSfxPlayer(this, ao_app); + frame_emote_sfx_player->set_volume(0); + pair_frame_emote_sfx_player = new AOSfxPlayer(this, ao_app); // todo: recode pair // todo: recode fucking everything + pair_frame_emote_sfx_player->set_volume(0); blip_player = new AOBlipPlayer(this, ao_app); blip_player->set_volume(0); @@ -70,7 +76,11 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() ui_vp_speedlines = new AOMovie(ui_viewport, ao_app); ui_vp_speedlines->set_play_once(false); ui_vp_player_char = new AOCharMovie(ui_viewport, ao_app); + ui_vp_player_char->frame_specific_sfx_player = frame_emote_sfx_player; + ui_vp_player_char->mycourtroom = this; ui_vp_sideplayer_char = new AOCharMovie(ui_viewport, ao_app); + ui_vp_sideplayer_char->frame_specific_sfx_player = pair_frame_emote_sfx_player; + ui_vp_sideplayer_char->mycourtroom = this; ui_vp_sideplayer_char->hide(); ui_vp_desk = new AOScene(ui_viewport, ao_app); ui_vp_legacy_desk = new AOScene(ui_viewport, ao_app); @@ -200,6 +210,7 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() ui_custom_objection = new AOButton(this, ao_app); ui_realization = new AOButton(this, ao_app); + ui_screenshake = new AOButton(this, ao_app); ui_mute = new AOButton(this, ao_app); ui_defense_plus = new AOButton(this, ao_app); @@ -284,7 +295,7 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() connect(ui_custom_objection, SIGNAL(clicked()), this, SLOT(on_custom_objection_clicked())); connect(ui_realization, SIGNAL(clicked()), this, SLOT(on_realization_clicked())); - + connect(ui_screenshake, SIGNAL(clicked()), this, SLOT(on_screenshake_clicked())); connect(ui_mute, SIGNAL(clicked()), this, SLOT(on_mute_clicked())); connect(ui_defense_minus, SIGNAL(clicked()), this, SLOT(on_defense_minus_clicked())); @@ -622,6 +633,9 @@ void Courtroom::set_widgets() set_size_and_pos(ui_realization, "realization"); ui_realization->set_image("realization.png"); + set_size_and_pos(ui_screenshake, "screenshake"); + ui_screenshake->set_image("screenshake.png"); + set_size_and_pos(ui_mute, "mute_button"); ui_mute->set_image("mute.png"); @@ -909,6 +923,9 @@ void Courtroom::enter_courtroom(int p_cid) music_player->set_volume(ui_music_slider->value()); sfx_player->set_volume(ui_sfx_slider->value()); objection_player->set_volume(ui_sfx_slider->value()); + misc_sfx_player->set_volume(ui_sfx_slider->value()); + frame_emote_sfx_player->set_volume(ui_sfx_slider->value()); + pair_frame_emote_sfx_player->set_volume(ui_sfx_slider->value()); blip_player->set_volume(ui_blip_slider->value()); testimony_in_progress = false; @@ -1227,7 +1244,126 @@ void Courtroom::on_chat_return_pressed() packet_contents.append("0"); } } + // If the server we're on supports Looping SFX and Screenshake, use it if the emote uses it. + if (ao_app->looping_sfx_support_enabled) + { + packet_contents.append(ao_app->get_sfx_looping(current_char, current_emote)); + qDebug() << "Are we looping this? " << ao_app->get_sfx_looping(current_char, current_emote); + packet_contents.append(QString::number(screenshake_state)); + qDebug() << "Are we screen shaking this one? " << screenshake_state; + + QString frame_screenshake = ""; + QString frame_realization = ""; + QString frame_sfx = ""; + + QString preemote_sfx = ""; + QString preemote_shake = ""; + QString preemote_flash = ""; + + QString talkemote_sfx = ""; + QString talkemote_shake = ""; + QString talkemote_flash = ""; + + QString idleemote_sfx = ""; + QString idleemote_shake = ""; + QString idleemote_flash = ""; + + QString preemote = ao_app->get_image_suffix(ao_app->get_character_path(current_char, ao_app->get_pre_emote(current_char, current_emote))); + QString talkemote_to_check = ao_app->get_image_suffix(ao_app->get_character_path(current_char, "(b)" + ao_app->get_emote(current_char, current_emote))); + QString idleemote_to_check = ao_app->get_image_suffix(ao_app->get_character_path(current_char, "(a)" + ao_app->get_emote(current_char, current_emote))); + frame_emote_checker = new QImageReader(preemote); + preemote_sfx += ao_app->get_pre_emote(current_char, current_emote); + preemote_shake += ao_app->get_pre_emote(current_char, current_emote); + preemote_flash += ao_app->get_pre_emote(current_char, current_emote); + for (int i = 0; i < frame_emote_checker->imageCount(); i++) { + QString sfx_to_play = ao_app->get_frame_sfx_name(current_char, ao_app->get_pre_emote(current_char, current_emote), i); + QString screenshake_to_play = ao_app->get_screenshake_frame(current_char, ao_app->get_pre_emote(current_char, current_emote), i); + QString realization_to_play = ao_app->get_realization_frame(current_char, ao_app->get_pre_emote(current_char, current_emote), i); + if(sfx_to_play != "") + { + preemote_sfx += "|" + QString::number(i) + "=" + sfx_to_play; + } + if(screenshake_to_play != "") + { + preemote_shake += "|" + QString::number(i) + "=" + screenshake_to_play; + } + if(realization_to_play != "") + { + preemote_flash += "|" + QString::number(i) + "=" + realization_to_play; + } + } + preemote_sfx += "^"; + preemote_shake += "^"; + preemote_flash += "^"; + delete frame_emote_checker; + talkemote_sfx += "(b)" + ao_app->get_emote(current_char, current_emote); + talkemote_shake += "(b)" + ao_app->get_emote(current_char, current_emote); + talkemote_flash += "(b)" + ao_app->get_emote(current_char, current_emote); + frame_emote_checker = new QImageReader(talkemote_to_check); + for (int i = 0; i < frame_emote_checker->imageCount(); i++) { + QString sfx_to_play = ao_app->get_frame_sfx_name(current_char, "(b)" + ao_app->get_emote(current_char, current_emote), i); + QString screenshake_to_play = ao_app->get_screenshake_frame(current_char, "(b)" + ao_app->get_emote(current_char, current_emote), i); + QString realization_to_play = ao_app->get_realization_frame(current_char, "(b)" + ao_app->get_emote(current_char, current_emote), i); + if(sfx_to_play != "") + { + talkemote_sfx += "|" + QString::number(i) + "=" + sfx_to_play; + } + if(screenshake_to_play != "") + { + talkemote_shake += "|" + QString::number(i) + "=" + screenshake_to_play; + } + if(realization_to_play != "") + { + talkemote_flash += "|" + QString::number(i) + "=" + realization_to_play; + } + } + talkemote_sfx += "^"; + talkemote_shake += "^"; + talkemote_flash += "^"; + delete frame_emote_checker; + idleemote_sfx += "(a)" + ao_app->get_emote(current_char, current_emote); + idleemote_shake += "(a)" + ao_app->get_emote(current_char, current_emote); + idleemote_flash += "(a)" + ao_app->get_emote(current_char, current_emote); + frame_emote_checker = new QImageReader(idleemote_to_check); + for (int i = 0; i < frame_emote_checker->imageCount(); i++) { + QString sfx_to_play = ao_app->get_frame_sfx_name(current_char, "(a)" + ao_app->get_emote(current_char, current_emote), i); + QString screenshake_to_play = ao_app->get_screenshake_frame(current_char, "(a)" + ao_app->get_emote(current_char, current_emote), i); + QString realization_to_play = ao_app->get_realization_frame(current_char, "(a)" + ao_app->get_emote(current_char, current_emote), i); + if(sfx_to_play != "") + { + idleemote_sfx += "|" + QString::number(i) + "=" + sfx_to_play; + } + if(screenshake_to_play != "") + { + idleemote_shake += "|" + QString::number(i) + "=" + screenshake_to_play; + } + if(realization_to_play != "") + { + idleemote_flash += "|" + QString::number(i) + "=" + realization_to_play; + } + } + delete frame_emote_checker; + + frame_screenshake += preemote_shake; + frame_screenshake += talkemote_shake; + frame_screenshake += idleemote_shake; + + frame_realization += preemote_flash; + frame_realization += talkemote_flash; + frame_realization += idleemote_flash; + + frame_sfx += preemote_sfx; + frame_sfx += talkemote_sfx; + frame_sfx += idleemote_sfx; + qDebug() << "Final strings:"; + qDebug() << frame_screenshake; + qDebug() << frame_realization; + qDebug() << frame_sfx; + packet_contents.append(frame_screenshake); + packet_contents.append(frame_realization); + packet_contents.append(frame_sfx); + } ao_app->send_server_packet(new AOPacket("MS", packet_contents)); } @@ -1296,6 +1432,7 @@ void Courtroom::handle_chatmessage(QStringList *p_contents) ui_ic_chat_message->clear(); objection_state = 0; realization_state = 0; + screenshake_state = 0; is_presenting_evidence = false; ui_pre->setChecked(false); ui_hold_it->set_image("holdit.png"); @@ -1303,6 +1440,7 @@ void Courtroom::handle_chatmessage(QStringList *p_contents) ui_take_that->set_image("takethat.png"); ui_custom_objection->set_image("custom.png"); ui_realization->set_image("realization.png"); + ui_screenshake->set_image("screenshake.png"); ui_evidence_present->set_image("present_disabled.png"); } @@ -1334,6 +1472,8 @@ void Courtroom::handle_chatmessage(QStringList *p_contents) case 2: ui_vp_objection->play("objection", f_char, f_custom_theme); objection_player->play("objection.wav", f_char, f_custom_theme); + if(ao_app->get_objectmusic()) + music_player->kill_loop(); break; case 3: ui_vp_objection->play("takethat", f_char, f_custom_theme); @@ -1366,7 +1506,10 @@ void Courtroom::handle_chatmessage_2() { ui_vp_speedlines->stop(); ui_vp_player_char->stop(); - + ui_vp_player_char->frame_sfx_hellstring = m_chatmessage[FRAME_SFX]; + ui_vp_player_char->frame_realization_hellstring = m_chatmessage[FRAME_REALIZATION]; + ui_vp_player_char->frame_screenshake_hellstring = m_chatmessage[FRAME_SCREENSHAKE]; + ui_vp_player_char->use_networked_framehell = true; if (m_chatmessage[SHOWNAME].isEmpty() || !ui_showname_enable->isChecked()) { QString real_name = char_list.at(m_chatmessage[CHAR_ID].toInt()).name; @@ -1548,6 +1691,7 @@ void Courtroom::handle_chatmessage_2() ui_vp_sideplayer_char->set_flipped(true); else ui_vp_sideplayer_char->set_flipped(false); + ui_vp_sideplayer_char->use_networked_framehell = false; ui_vp_sideplayer_char->play_idle(m_chatmessage[OTHER_NAME], m_chatmessage[OTHER_EMOTE]); } else @@ -1555,13 +1699,17 @@ void Courtroom::handle_chatmessage_2() // If the server understands other characters, but there // really is no second character, hide 'em, and center the first. ui_vp_sideplayer_char->hide(); + ui_vp_sideplayer_char->stop(); ui_vp_sideplayer_char->move(0,0); ui_vp_player_char->move(0,0); } } } - + if (m_chatmessage[SCREENSHAKE] == "1") + { + this->doScreenShake(); + } switch (emote_mod) { case 1: case 2: case 6: @@ -1578,6 +1726,53 @@ void Courtroom::handle_chatmessage_2() } } +void Courtroom::doScreenShake() +{ + screenshake_group = new QParallelAnimationGroup; + screenshake_animation = new QPropertyAnimation(ui_viewport, "pos", this); + chatbox_screenshake_animation = new QPropertyAnimation(ui_vp_chatbox, "pos", this); + int screen_x = ui_viewport->x(); + int screen_y = ui_viewport->y(); + QPoint pos_default = QPoint(screen_x, screen_y); + QPoint pos1 = QPoint(screen_x + 3, screen_y + -5); + QPoint pos2 = QPoint(screen_x + 3, screen_y + -5); + QPoint pos3 = QPoint(screen_x + -3, screen_y + 5); + QPoint pos4 = QPoint(screen_x + 3, screen_y + -5); + QPoint pos5 = QPoint(screen_x + -3,screen_y + -5); + + int chatbox_x = ui_vp_chatbox->x(); + int chatbox_y = ui_vp_chatbox->y(); + QPoint chatbox_pos_default = QPoint(chatbox_x, chatbox_y); + QPoint chatbox_pos1 = QPoint(chatbox_x + 3, chatbox_y + -5); + QPoint chatbox_pos2 = QPoint(chatbox_x + 3, chatbox_y + -5); + QPoint chatbox_pos3 = QPoint(chatbox_x + -3, chatbox_y + 5); + QPoint chatbox_pos4 = QPoint(chatbox_x + 3, chatbox_y + -5); + QPoint chatbox_pos5 = QPoint(chatbox_x + -3,chatbox_y + -5); + + screenshake_animation->setDuration(200); + screenshake_animation->setKeyValueAt(0, pos_default); + screenshake_animation->setKeyValueAt(0.1, pos1); + screenshake_animation->setKeyValueAt(0.3, pos2); + screenshake_animation->setKeyValueAt(0.5, pos3); + screenshake_animation->setKeyValueAt(0.7, pos4); + screenshake_animation->setKeyValueAt(0.9, pos5); + screenshake_animation->setEndValue(pos_default); + screenshake_animation->setEasingCurve(QEasingCurve::Linear); + chatbox_screenshake_animation->setDuration(200); + chatbox_screenshake_animation->setKeyValueAt(0, chatbox_pos_default); + chatbox_screenshake_animation->setKeyValueAt(0.1, chatbox_pos3); + chatbox_screenshake_animation->setKeyValueAt(0.3, chatbox_pos5); + chatbox_screenshake_animation->setKeyValueAt(0.5, chatbox_pos2); + chatbox_screenshake_animation->setKeyValueAt(0.7, chatbox_pos1); + chatbox_screenshake_animation->setKeyValueAt(0.9, chatbox_pos4); + chatbox_screenshake_animation->setEndValue(chatbox_pos_default); + chatbox_screenshake_animation->setEasingCurve(QEasingCurve::Linear); + + screenshake_group->addAnimation(screenshake_animation); + screenshake_group->addAnimation(chatbox_screenshake_animation); + screenshake_group->start(QAbstractAnimation::DeletionPolicy::DeleteWhenStopped); +} + void Courtroom::handle_chatmessage_3() { start_chat_ticking(); @@ -1709,6 +1904,17 @@ QString Courtroom::filter_ic_text(QString p_text) p_text.remove(trick_check_pos,1); } + else if (f_character == "$" and !ic_next_is_not_special) + { + p_text.remove(trick_check_pos,1); + } + + else if (f_character == "@" and !ic_next_is_not_special) + { + p_text.remove(trick_check_pos,1); + } + + // Orange inline colourisation. else if (f_character == "|" and !ic_next_is_not_special) { @@ -1919,14 +2125,14 @@ void Courtroom::play_preanim(bool noninterrupting) int ao2_duration = ao_app->get_ao2_preanim_duration(f_char, f_preanim); int text_delay = ao_app->get_text_delay(f_char, f_preanim) * time_mod; int sfx_delay = m_chatmessage[SFX_DELAY].toInt() * 60; - + bool looping_sfx = m_chatmessage[LOOPING_SFX] == "1"; int preanim_duration; if (ao2_duration < 0) preanim_duration = ao_app->get_preanim_duration(f_char, f_preanim); else preanim_duration = ao2_duration; - + sfx_player->setLooping(looping_sfx); sfx_delay_timer->start(sfx_delay); QString anim_to_find = ao_app->get_image_suffix(ao_app->get_character_path(f_char, f_preanim)); if (!file_exists(anim_to_find) || @@ -1942,7 +2148,6 @@ void Courtroom::play_preanim(bool noninterrupting) } ui_vp_player_char->play_pre(f_char, f_preanim, preanim_duration); - if (noninterrupting) anim_state = 4; else @@ -1966,6 +2171,13 @@ void Courtroom::realization_done() ui_vp_realization->hide(); } +void Courtroom::doRealization() +{ + realization_timer->start(60); + ui_vp_realization->show(); + +} + void Courtroom::start_chat_ticking() { //we need to ensure that the text isn't already ticking because this function can be called by two logic paths @@ -1974,11 +2186,9 @@ void Courtroom::start_chat_ticking() if (m_chatmessage[REALIZATION] == "1") { - realization_timer->start(60); - ui_vp_realization->show(); - sfx_player->play(ao_app->get_custom_realization(m_chatmessage[CHAR_NAME])); + this->doRealization(); + misc_sfx_player->play(ao_app->get_custom_realization(m_chatmessage[CHAR_NAME])); } - ui_vp_message->clear(); set_text_color(); rainbow_counter = 0; @@ -2076,6 +2286,18 @@ void Courtroom::chat_tick() formatting_char = true; } + else if (f_character == "@" and !next_character_is_not_special) + { + this->doScreenShake(); + formatting_char = true; + } + + else if (f_character == "$" and !next_character_is_not_special) + { + this->doRealization(); + formatting_char = true; + } + // Orange inline colourisation. else if (f_character == "|" and !next_character_is_not_special) { @@ -2541,7 +2763,7 @@ void Courtroom::handle_wtce(QString p_wtce, int variant) //witness testimony if (p_wtce == "testimony1") { - sfx_player->play(ao_app->get_sfx("witness_testimony")); + misc_sfx_player->play(ao_app->get_sfx("witness_testimony")); ui_vp_wtce->play("witnesstestimony"); testimony_in_progress = true; show_testimony(); @@ -2549,7 +2771,7 @@ void Courtroom::handle_wtce(QString p_wtce, int variant) //cross examination else if (p_wtce == "testimony2") { - sfx_player->play(ao_app->get_sfx("cross_examination")); + misc_sfx_player->play(ao_app->get_sfx("cross_examination")); ui_vp_wtce->play("crossexamination"); testimony_in_progress = false; } @@ -2557,12 +2779,12 @@ void Courtroom::handle_wtce(QString p_wtce, int variant) { if (variant == 0) { - sfx_player->play(ao_app->get_sfx("not_guilty")); + misc_sfx_player->play(ao_app->get_sfx("not_guilty")); ui_vp_wtce->play("notguilty"); testimony_in_progress = false; } else if (variant == 1) { - sfx_player->play(ao_app->get_sfx("guilty")); + misc_sfx_player->play(ao_app->get_sfx("guilty")); ui_vp_wtce->play("guilty"); testimony_in_progress = false; } @@ -3140,6 +3362,22 @@ void Courtroom::on_realization_clicked() ui_ic_chat_message->setFocus(); } +void Courtroom::on_screenshake_clicked() +{ + if (screenshake_state == 0) + { + screenshake_state = 1; + ui_screenshake->set_image("screenshake_pressed.png"); + } + else + { + screenshake_state = 0; + ui_screenshake->set_image("screenshake.png"); + } + + ui_ic_chat_message->setFocus(); +} + void Courtroom::on_mute_clicked() { if (ui_mute_list->isHidden()) @@ -3223,6 +3461,9 @@ void Courtroom::on_sfx_slider_moved(int p_value) { sfx_player->set_volume(p_value); objection_player->set_volume(p_value); + misc_sfx_player->set_volume(p_value); + frame_emote_sfx_player->set_volume(p_value); + pair_frame_emote_sfx_player->set_volume(p_value); ui_ic_chat_message->setFocus(); } diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp index 68d2fb9..f8adb12 100644 --- a/src/packet_distribution.cpp +++ b/src/packet_distribution.cpp @@ -151,6 +151,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet) arup_enabled = false; casing_alerts_enabled = false; modcall_reason_enabled = false; + looping_sfx_support_enabled = false; //workaround for tsuserver4 if (f_contents.at(0) == "NOENCRYPT") @@ -209,6 +210,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet) casing_alerts_enabled = true; if (f_packet.contains("modcall_reason",Qt::CaseInsensitive)) modcall_reason_enabled = true; + if (f_packet.contains("looping_sfx",Qt::CaseInsensitive)) + looping_sfx_support_enabled = true; w_lobby->enable_connect_button(); } diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp index 1e920d7..e8cfeba 100644 --- a/src/text_file_functions.cpp +++ b/src/text_file_functions.cpp @@ -555,6 +555,42 @@ QString AOApplication::get_sfx_name(QString p_char, int p_emote) else return f_result; } +QString AOApplication::get_sfx_looping(QString p_char, int p_emote) +{ + QString f_result = read_char_ini(p_char, QString::number(p_emote + 1), "SoundL"); + + if (f_result == "") + return "0"; + else return f_result; +} + +QString AOApplication::get_frame_sfx_name(QString p_char, QString p_emote, int n_frame) +{ + QString f_result = read_char_ini(p_char, QString::number(n_frame), p_emote.append("_FrameSFX")); + if (f_result == "") + return ""; + else return f_result; +} + +QString AOApplication::get_screenshake_frame(QString p_char, QString p_emote, int n_frame) +{ + QString f_result = read_char_ini(p_char, QString::number(n_frame), p_emote.append("_FrameScreenshake")); + if (f_result == "") + return ""; + else return f_result; +} + + +QString AOApplication::get_realization_frame(QString p_char, QString p_emote, int n_frame) +{ + QString f_result = read_char_ini(p_char, QString::number(n_frame), p_emote.append("_FrameRealization")); + if (f_result == "") + return ""; + else return f_result; +} + + + int AOApplication::get_sfx_delay(QString p_char, int p_emote) { QString f_result = read_char_ini(p_char, QString::number(p_emote + 1), "SoundT"); @@ -588,6 +624,18 @@ bool AOApplication::get_blank_blip() return result.startsWith("true"); } +bool AOApplication::get_looping_sfx() +{ + QString result = configini->value("looping_sfx", "true").value(); + return result.startsWith("true"); +} + +bool AOApplication::get_objectmusic() +{ + QString result = configini->value("kill_music_on_object", "true").value(); + return result.startsWith("true"); +} + bool AOApplication::is_discord_enabled() { QString result = configini->value("discord", "true").value(); -- cgit From 248444307ff7cbe87ec4fe4024073cddb999dabc Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Fri, 18 Jan 2019 22:05:21 -0800 Subject: Fix bug with simultaneous shakes --- include/aoapplication.h | 2 +- include/courtroom.h | 2 +- src/courtroom.cpp | 26 ++++++++++++++++++++++---- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/include/aoapplication.h b/include/aoapplication.h index cff0afb..2ae1655 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -319,7 +319,7 @@ public: private: const int RELEASE = 2; const int MAJOR_VERSION = 7; - const int MINOR_VERSION = 0; + const int MINOR_VERSION = 1; QString current_theme = "default"; diff --git a/include/courtroom.h b/include/courtroom.h index 3f93e4c..7d2a551 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -124,7 +124,7 @@ public: //reads theme inis and sets size and pos based on the identifier void set_size_and_pos(QWidget *p_widget, QString p_identifier); - + QPoint get_theme_pos(QString p_identifier); //sets status as taken on character with cid n_char and places proper shading on charselect void set_taken(int n_char, bool p_taken); diff --git a/src/courtroom.cpp b/src/courtroom.cpp index ab387da..ce4ccf1 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -776,6 +776,24 @@ void Courtroom::set_size_and_pos(QWidget *p_widget, QString p_identifier) } } +QPoint Courtroom::get_theme_pos(QString p_identifier) +{ + QString filename = "courtroom_design.ini"; + + pos_size_type design_ini_result = ao_app->get_element_dimensions(p_identifier, filename); + + if (design_ini_result.width < 0 || design_ini_result.height < 0) + { + qDebug() << "W: could not find \"" << p_identifier << "\" in " << filename; + return QPoint(0,0); + } + else + { + return QPoint(design_ini_result.x, design_ini_result.y); + } +} + + void Courtroom::set_taken(int n_char, bool p_taken) { if (n_char >= char_list.size()) @@ -1731,8 +1749,8 @@ void Courtroom::doScreenShake() screenshake_group = new QParallelAnimationGroup; screenshake_animation = new QPropertyAnimation(ui_viewport, "pos", this); chatbox_screenshake_animation = new QPropertyAnimation(ui_vp_chatbox, "pos", this); - int screen_x = ui_viewport->x(); - int screen_y = ui_viewport->y(); + int screen_x = get_theme_pos("viewport").x(); + int screen_y = get_theme_pos("viewport").y(); QPoint pos_default = QPoint(screen_x, screen_y); QPoint pos1 = QPoint(screen_x + 3, screen_y + -5); QPoint pos2 = QPoint(screen_x + 3, screen_y + -5); @@ -1740,8 +1758,8 @@ void Courtroom::doScreenShake() QPoint pos4 = QPoint(screen_x + 3, screen_y + -5); QPoint pos5 = QPoint(screen_x + -3,screen_y + -5); - int chatbox_x = ui_vp_chatbox->x(); - int chatbox_y = ui_vp_chatbox->y(); + int chatbox_x = get_theme_pos("ao2_chatbox").x(); + int chatbox_y = get_theme_pos("ao2_chatbox").y(); QPoint chatbox_pos_default = QPoint(chatbox_x, chatbox_y); QPoint chatbox_pos1 = QPoint(chatbox_x + 3, chatbox_y + -5); QPoint chatbox_pos2 = QPoint(chatbox_x + 3, chatbox_y + -5); -- cgit From c44832a707f655191e4337e3b3fc567ff02636eb Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Sat, 19 Jan 2019 14:39:42 -0800 Subject: guard -> disable modcalls, bugfixes for guard button, etc. --- base/sounds/general/adminhelp.ogg | Bin 0 -> 17220 bytes base/themes/default/courtroom_design.ini | 2 +- base/themes/default/courtroom_sounds.ini | 2 +- src/courtroom.cpp | 15 ++++++++------- 4 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 base/sounds/general/adminhelp.ogg diff --git a/base/sounds/general/adminhelp.ogg b/base/sounds/general/adminhelp.ogg new file mode 100644 index 0000000..704c0fd Binary files /dev/null and b/base/sounds/general/adminhelp.ogg differ diff --git a/base/themes/default/courtroom_design.ini b/base/themes/default/courtroom_design.ini index fe8fadf..f2dd2d7 100644 --- a/base/themes/default/courtroom_design.ini +++ b/base/themes/default/courtroom_design.ini @@ -107,7 +107,7 @@ pre = 5, 490, 80, 21 flip = 104, 490, 51, 21 ; Guard button -guard = 200, 560, 61, 21 +guard = 200, 580, 81, 21 pre_no_interrupt = 200, 490, 80, 21 diff --git a/base/themes/default/courtroom_sounds.ini b/base/themes/default/courtroom_sounds.ini index b24e2ce..050576e 100644 --- a/base/themes/default/courtroom_sounds.ini +++ b/base/themes/default/courtroom_sounds.ini @@ -3,6 +3,6 @@ witness_testimony = sfx-testimony2.wav cross_examination = sfx-testimony.wav evidence_present = sfx-evidenceshoop.wav word_call = sfx-gaspen-yeah!.wav -mod_call = sfx-gallery.wav +mod_call = adminhelp.ogg not_guilty = sfx-notguilty.wav guilty = sfx-guilty.wav \ No newline at end of file diff --git a/src/courtroom.cpp b/src/courtroom.cpp index ce4ccf1..da1b090 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -193,7 +193,7 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() ui_flip->setText("Flip"); ui_flip->hide(); ui_guard = new QCheckBox(this); - ui_guard->setText("Guard"); + ui_guard->setText("Disable Modcalls"); ui_guard->hide(); ui_casing = new QCheckBox(this); ui_casing->setChecked(ao_app->get_casing_enabled()); @@ -1085,6 +1085,12 @@ void Courtroom::append_server_chatmessage(QString p_name, QString p_message, QSt colour = ao_app->get_color("ooc_default_color", "courtroom_design.ini").name(); if (p_colour == "1") colour = ao_app->get_color("ooc_server_color", "courtroom_design.ini").name(); + qDebug() << p_message; + if(p_message == "Logged in as a moderator.") + { + ui_guard->show(); + append_server_chatmessage("CLIENT", "You were granted the Disable Modcalls button.", "1"); + } ui_server_chatlog->append_chatmessage(p_name, p_message, colour); } @@ -2855,7 +2861,7 @@ void Courtroom::toggle_judge_buttons(bool is_on) void Courtroom::mod_called(QString p_ip) { ui_server_chatlog->append(p_ip); - if (ui_guard->isChecked()) + if (!ui_guard->isChecked()) { modcall_player->play(ao_app->get_sfx("mod_call")); ao_app->alert(this); @@ -2897,11 +2903,6 @@ void Courtroom::on_ooc_return_pressed() toggle_judge_buttons(false); } } - else if (ooc_message.startsWith("/login")) - { - ui_guard->show(); - append_server_chatmessage("CLIENT", "You were granted the Guard button.", "1"); - } else if (ooc_message.startsWith("/rainbow") && ao_app->yellow_text_enabled && !rainbow_appended) { //ui_text_color->addItem("Rainbow"); -- cgit From 10436992148e2342e6bd563d1acfb684f225aa30 Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Sat, 19 Jan 2019 21:01:19 -0800 Subject: Suffix-independent Music, Mod Music List, looping bugfixes, easter eggs, etc. --- base/sounds/music/failed_login.opus | Bin 0 -> 396160 bytes include/aomusicplayer.h | 1 + include/courtroom.h | 10 +++------ src/aomusicplayer.cpp | 14 ++++++++----- src/courtroom.cpp | 23 +++++++++++++++++++-- src/packet_distribution.cpp | 40 +++++++++++++++--------------------- src/path_functions.cpp | 23 ++++++++++++++++++--- 7 files changed, 71 insertions(+), 40 deletions(-) create mode 100644 base/sounds/music/failed_login.opus diff --git a/base/sounds/music/failed_login.opus b/base/sounds/music/failed_login.opus new file mode 100644 index 0000000..33532ee Binary files /dev/null and b/base/sounds/music/failed_login.opus differ diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h index 54f3b5f..24ea0c5 100644 --- a/include/aomusicplayer.h +++ b/include/aomusicplayer.h @@ -21,6 +21,7 @@ public: void kill_loop(); QString get_path(); + bool enable_looping = true; private: QWidget *m_parent; diff --git a/include/courtroom.h b/include/courtroom.h index 7d2a551..c76e4a1 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -68,14 +68,10 @@ public: void append_evidence(evi_type p_evi){evidence_list.append(p_evi);} void append_music(QString f_music){music_list.append(f_music);} void append_area(QString f_area){area_list.append(f_area);} - void fix_last_area() + void handle_failed_login(); + void reset_music_list() { - if (area_list.size() > 0) - { - QString malplaced = area_list.last(); - area_list.removeLast(); - append_music(malplaced); - } + music_list.clear(); } void arup_append(int players, QString status, QString cm, QString locked) diff --git a/src/aomusicplayer.cpp b/src/aomusicplayer.cpp index a52603c..2a35f0b 100644 --- a/src/aomusicplayer.cpp +++ b/src/aomusicplayer.cpp @@ -29,14 +29,18 @@ void AOMusicPlayer::play(QString p_song) BASS_ChannelSetDevice(m_stream, BASS_GetDevice()); BASS_ChannelPlay(m_stream, false); music_loop_timer->stop(); - QWORD len=BASS_ChannelGetLength(m_stream, BASS_POS_BYTE); // the length in bytes - double time=BASS_ChannelBytes2Seconds(m_stream, len); // the length in seconds - if(time > 0) + if(enable_looping) { - qDebug() << "Will loop in " << time << " seconds."; - music_loop_timer->start(time*1000); + QWORD len=BASS_ChannelGetLength(m_stream, BASS_POS_BYTE); // the length in bytes + double time=BASS_ChannelBytes2Seconds(m_stream, len); // the length in seconds + if(time > 0) + { + qDebug() << "Will loop in " << time << " seconds."; + music_loop_timer->start(time*1000); + } } + } void AOMusicPlayer::set_volume(int p_value) diff --git a/src/courtroom.cpp b/src/courtroom.cpp index da1b090..a097444 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -2761,9 +2761,22 @@ void Courtroom::handle_song(QStringList *p_contents) if (p_contents->length() > 2) { - str_show = p_contents->at(2); + if(p_contents->at(2) != "") + { + str_show = p_contents->at(2); + } + } + if (p_contents->length() > 3) + { + if(p_contents->at(3) != "-1") + { + music_player->enable_looping = false; + } + else + { + music_player->enable_looping = true; + } } - if (!mute_map.value(n_char)) { chatlogpiece* temp = new chatlogpiece(str_char, str_show, f_song, true); @@ -2780,6 +2793,12 @@ void Courtroom::handle_song(QStringList *p_contents) } } +void Courtroom::handle_failed_login() +{ + music_player->enable_looping = false; + music_player->play("failed_login"); +} + void Courtroom::handle_wtce(QString p_wtce, int variant) { QString sfx_file = "courtroom_sounds.ini"; diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp index f8adb12..9ea2839 100644 --- a/src/packet_distribution.cpp +++ b/src/packet_distribution.cpp @@ -106,13 +106,6 @@ void AOApplication::ms_packet_received(AOPacket *p_packet) destruct_courtroom(); destruct_lobby(); } - else if (header == "DOOM") - { - call_notice("You have been exiled from AO." - "Have a nice day."); - destruct_courtroom(); - destruct_lobby(); - } end: @@ -398,16 +391,9 @@ void AOApplication::server_packet_received(AOPacket *p_packet) } else { - if (f_music.endsWith(".wav") || - f_music.endsWith(".mp3") || - f_music.endsWith(".mp4") || - f_music.endsWith(".ogg") || - f_music.endsWith(".opus")) + if (f_contents.at(n_element) == "===MUSIC START===.mp3") { musics_time = true; - areas--; - w_courtroom->fix_last_area(); - w_courtroom->append_music(f_music); } else { @@ -493,16 +479,9 @@ void AOApplication::server_packet_received(AOPacket *p_packet) } else { - if (f_contents.at(n_element).endsWith(".wav") || - f_contents.at(n_element).endsWith(".mp3") || - f_contents.at(n_element).endsWith(".mp4") || - f_contents.at(n_element).endsWith(".ogg") || - f_contents.at(n_element).endsWith(".opus")) + if (f_contents.at(n_element) == "===MUSIC START===.mp3") { musics_time = true; - w_courtroom->fix_last_area(); - w_courtroom->append_music(f_contents.at(n_element)); - areas--; } else { @@ -538,6 +517,16 @@ void AOApplication::server_packet_received(AOPacket *p_packet) destruct_lobby(); } + else if (header == "REFMUSIC") + { + if (courtroom_constructed) + w_courtroom->reset_music_list(); + for (int n_element = 0 ; n_element < f_contents.size() ; ++n_element) + { + w_courtroom->append_music(f_contents.at(n_element)); + } + w_courtroom->list_music(); + } else if (header == "BN") { if (f_contents.size() < 1) @@ -618,6 +607,11 @@ void AOApplication::server_packet_received(AOPacket *p_packet) } } } + else if (header == "FAILEDLOGIN") + { + if (courtroom_constructed) + w_courtroom->handle_failed_login(); + } else if (header == "IL") { if (courtroom_constructed && f_contents.size() > 0) diff --git a/src/path_functions.cpp b/src/path_functions.cpp index c51cfde..92ff765 100644 --- a/src/path_functions.cpp +++ b/src/path_functions.cpp @@ -94,11 +94,28 @@ QString AOApplication::get_sounds_path(QString p_file) QString AOApplication::get_music_path(QString p_song) { - QString path = get_base_path() + "sounds/music/" + p_song; + QString mp3_check = get_base_path() + "sounds/music/" + p_song + ".mp3"; + QString opus_check = get_base_path() + "sounds/music/" + p_song + ".opus"; + if (file_exists(opus_check)) + { + #ifndef CASE_SENSITIVE_FILESYSTEM + return get_base_path() + "sounds/music/" + p_song + ".opus"; + #else + return get_case_sensitive_path(get_base_path() + "sounds/music/" + p_song + ".opus"); + #endif + } + else if (file_exists(mp3_check)) + { + #ifndef CASE_SENSITIVE_FILESYSTEM + return get_base_path() + "sounds/music/" + p_song + ".mp3"; + #else + return get_case_sensitive_path(get_base_path() + "sounds/music/" + p_song + ".mp3"); + #endif + } #ifndef CASE_SENSITIVE_FILESYSTEM - return path; + return get_base_path() + "sounds/music/" + p_song + ".wav"; #else - return get_case_sensitive_path(path); + return get_case_sensitive_path(get_base_path() + "sounds/music/" + p_song + ".wav"); #endif } -- cgit From debd386a7176327d481470621a7a3a65cd715f2e Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Sun, 20 Jan 2019 21:06:21 -0800 Subject: Bugfixes and blip speeds --- include/courtroom.h | 2 +- src/aocharmovie.cpp | 31 +++++++++++++++++++++---------- src/text_file_functions.cpp | 6 +++--- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/include/courtroom.h b/include/courtroom.h index c76e4a1..b746c6a 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -251,7 +251,7 @@ private: bool message_is_centered = false; int current_display_speed = 3; - int message_display_speed[7] = {30, 40, 50, 60, 75, 100, 120}; + int message_display_speed[7] = {10, 20, 30, 40, 50, 60, 75}; // This is for checking if the character should start talking again // when an inline blue text ends. diff --git a/src/aocharmovie.cpp b/src/aocharmovie.cpp index a5beefb..cbf9b79 100644 --- a/src/aocharmovie.cpp +++ b/src/aocharmovie.cpp @@ -13,7 +13,6 @@ AOCharMovie::AOCharMovie(QWidget *p_parent, AOApplication *p_ao_app) : QLabel(p_ preanim_timer->setSingleShot(true); ticker->setSingleShot(true); connect(ticker, SIGNAL(timeout()), this, SLOT(movie_ticker())); - connect(preanim_timer, SIGNAL(timeout()), this, SLOT(timer_done())); this->setUpdatesEnabled(true); } @@ -37,6 +36,7 @@ void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix) gif_path = placeholder_path; else gif_path = placeholder_default_path; + last_path = gif_path; delete m_movie; m_movie = new QMovie(this); m_movie->stop(); @@ -145,10 +145,29 @@ void AOCharMovie::sfx_two_network_boogaloo() void AOCharMovie::movie_ticker() { - m_movie->jumpToNextFrame(); + if(m_movie->currentFrameNumber() == m_movie->frameCount() - 1) + { + delete m_movie; + m_movie = new QMovie(this); + m_movie->stop(); + this->clear(); + m_movie->setFileName(last_path); + m_movie->jumpToFrame(0); + if(play_once) + { + timer_done(); + } + } + else + { + m_movie->jumpToNextFrame(); + } this->LoadImageWithStupidMethodForFlipSupport(m_movie->currentImage()); // imagine if QT had sane stuff like "mirror on QMovie" or "resize the image on QT" or "interface with the current QMovie image" or anything else // ps: fuck private functions/variables as a concept, freedom 2 do dangerous things 5ever this->play_frame_sfx(); + qDebug() << "Current frame number: " << m_movie->currentFrameNumber(); + qDebug() << "Frames Left: " << m_movie->frameCount() - 1; + qDebug() << "Frame Delay: " << m_movie->nextFrameDelay(); ticker->start(m_movie->nextFrameDelay()); } @@ -180,14 +199,7 @@ void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration) m_movie->setFileName(gif_path); m_movie->jumpToFrame(0); int real_duration = 0; - for (int n_frame = 0 ; n_frame < m_movie->frameCount() ; ++n_frame) - { - qDebug() << "frame " << n_frame << " delay of " << m_movie->nextFrameDelay(); - real_duration += m_movie->nextFrameDelay(); - m_movie->jumpToFrame(n_frame + 1); - } play_once = true; - preanim_timer->start(real_duration); play(p_char, p_emote, ""); } @@ -207,7 +219,6 @@ void AOCharMovie::stop() { //for all intents and purposes, stopping is the same as hiding. at no point do we want a frozen gif to display m_movie->stop(); - preanim_timer->stop(); frame_specific_sfx_player->stop(); this->hide(); } diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp index e8cfeba..6bc66d0 100644 --- a/src/text_file_functions.cpp +++ b/src/text_file_functions.cpp @@ -8,10 +8,10 @@ QString AOApplication::read_theme() int AOApplication::read_blip_rate() { - int result = configini->value("blip_rate", 1).toInt(); + int result = configini->value("blip_rate", 2).toInt(); - if (result < 1) - return 1; + if (result < 2) + return 2; return result; } -- cgit From a7a614482e379ad13f8e0ca1e7f3e31c33bb1c21 Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Mon, 21 Jan 2019 15:45:51 -0800 Subject: final commit --- include/aoapplication.h | 4 ++++ include/aocharmovie.h | 1 + include/aooptionsdialog.h | 2 ++ src/aocharmovie.cpp | 15 +++++++++++---- src/aooptionsdialog.cpp | 12 ++++++++++++ src/courtroom.cpp | 4 ++++ src/text_file_functions.cpp | 13 ++++++++++--- 7 files changed, 44 insertions(+), 7 deletions(-) diff --git a/include/aoapplication.h b/include/aoapplication.h index 2ae1655..7a5e633 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -166,6 +166,10 @@ public: // from the config.ini. bool is_discord_enabled(); + // Returns the value of whether shaking and flashing should be enabled. + // from the config.ini. + bool is_shakeandflash_enabled(); + // Returns the value of the maximum amount of lines the IC chatlog // may contain, from config.ini. int get_max_log_size(); diff --git a/include/aocharmovie.h b/include/aocharmovie.h index 94e242b..6c127a6 100644 --- a/include/aocharmovie.h +++ b/include/aocharmovie.h @@ -64,6 +64,7 @@ private: bool m_flipped = false; bool play_once = true; + bool apng = false; signals: void done(); diff --git a/include/aooptionsdialog.h b/include/aooptionsdialog.h index 03b1e71..175b804 100644 --- a/include/aooptionsdialog.h +++ b/include/aooptionsdialog.h @@ -55,6 +55,8 @@ private: QLineEdit *ui_ms_textbox; QLabel *ui_discord_lbl; QCheckBox *ui_discord_cb; + QLabel *ui_epilepsy_lbl; + QCheckBox *ui_epilepsy_cb; QWidget *ui_callwords_tab; QWidget *ui_callwords_widget; diff --git a/src/aocharmovie.cpp b/src/aocharmovie.cpp index cbf9b79..3d65055 100644 --- a/src/aocharmovie.cpp +++ b/src/aocharmovie.cpp @@ -18,6 +18,7 @@ AOCharMovie::AOCharMovie(QWidget *p_parent, AOApplication *p_ao_app) : QLabel(p_ void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix) { + apng = false; QString original_path = ao_app->get_character_path(p_char, emote_prefix + p_emote + ".gif"); QString alt_path = ao_app->get_character_path(p_char, emote_prefix + p_emote + ".png"); QString apng_path = ao_app->get_character_path(p_char, emote_prefix + p_emote + ".apng"); @@ -27,7 +28,10 @@ void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix) current_emote = emote_prefix + p_emote; current_char = p_char; if (file_exists(apng_path)) + { gif_path = apng_path; + apng = true; + } else if (file_exists(original_path)) gif_path = original_path; else if (file_exists(alt_path)) @@ -145,6 +149,9 @@ void AOCharMovie::sfx_two_network_boogaloo() void AOCharMovie::movie_ticker() { + if(apng){ + ticker->start(m_movie->nextFrameDelay()); + } if(m_movie->currentFrameNumber() == m_movie->frameCount() - 1) { delete m_movie; @@ -165,10 +172,10 @@ void AOCharMovie::movie_ticker() this->LoadImageWithStupidMethodForFlipSupport(m_movie->currentImage()); // imagine if QT had sane stuff like "mirror on QMovie" or "resize the image on QT" or "interface with the current QMovie image" or anything else // ps: fuck private functions/variables as a concept, freedom 2 do dangerous things 5ever this->play_frame_sfx(); - qDebug() << "Current frame number: " << m_movie->currentFrameNumber(); - qDebug() << "Frames Left: " << m_movie->frameCount() - 1; - qDebug() << "Frame Delay: " << m_movie->nextFrameDelay(); - ticker->start(m_movie->nextFrameDelay()); + if(!apng){ + ticker->start(m_movie->nextFrameDelay()); + } + } void AOCharMovie::LoadImageWithStupidMethodForFlipSupport(QImage image) diff --git a/src/aooptionsdialog.cpp b/src/aooptionsdialog.cpp index 4d0e479..247a231 100644 --- a/src/aooptionsdialog.cpp +++ b/src/aooptionsdialog.cpp @@ -167,6 +167,17 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) : QDi ui_gameplay_form->setWidget(9, QFormLayout::FieldRole, ui_discord_cb); + ui_epilepsy_lbl = new QLabel(ui_form_layout_widget); + ui_epilepsy_lbl->setText(tr("Allow Shake/Flash:")); + ui_epilepsy_lbl->setToolTip(tr("Allows screenshaking and flashing. Disable this if you have concerns or issues with photosensitivity and/or seizures.")); + + ui_gameplay_form->setWidget(10, QFormLayout::LabelRole, ui_epilepsy_lbl); + + ui_epilepsy_cb = new QCheckBox(ui_form_layout_widget); + ui_epilepsy_cb->setChecked(ao_app->is_shakeandflash_enabled()); + + ui_gameplay_form->setWidget(10, QFormLayout::FieldRole, ui_epilepsy_cb); + // Here we start the callwords tab. ui_callwords_tab = new QWidget(); ui_settings_tabs->addTab(ui_callwords_tab, tr("Callwords")); @@ -486,6 +497,7 @@ void AOOptionsDialog::save_pressed() configini->setValue("show_custom_shownames", ui_showname_cb->isChecked()); configini->setValue("master", ui_ms_textbox->text()); configini->setValue("discord", ui_discord_cb->isChecked()); + configini->setValue("shakeandflash", ui_epilepsy_cb->isChecked()); QFile* callwordsini = new QFile(ao_app->get_base_path() + "callwords.ini"); diff --git a/src/courtroom.cpp b/src/courtroom.cpp index a097444..537558f 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -1752,6 +1752,8 @@ void Courtroom::handle_chatmessage_2() void Courtroom::doScreenShake() { + if(!ao_app->is_shakeandflash_enabled()) + return; screenshake_group = new QParallelAnimationGroup; screenshake_animation = new QPropertyAnimation(ui_viewport, "pos", this); chatbox_screenshake_animation = new QPropertyAnimation(ui_vp_chatbox, "pos", this); @@ -2197,6 +2199,8 @@ void Courtroom::realization_done() void Courtroom::doRealization() { + if(!ao_app->is_shakeandflash_enabled()) + return; realization_timer->start(60); ui_vp_realization->show(); diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp index 6bc66d0..68d0a04 100644 --- a/src/text_file_functions.cpp +++ b/src/text_file_functions.cpp @@ -10,8 +10,8 @@ int AOApplication::read_blip_rate() { int result = configini->value("blip_rate", 2).toInt(); - if (result < 2) - return 2; + if (result < 1) + return 1; return result; } @@ -632,7 +632,7 @@ bool AOApplication::get_looping_sfx() bool AOApplication::get_objectmusic() { - QString result = configini->value("kill_music_on_object", "true").value(); + QString result = configini->value("kill_music_on_object", "false").value(); return result.startsWith("true"); } @@ -642,6 +642,13 @@ bool AOApplication::is_discord_enabled() return result.startsWith("true"); } +bool AOApplication::is_shakeandflash_enabled() +{ + QString result = configini->value("shakeandflash", "true").value(); + return result.startsWith("true"); +} + + bool AOApplication::get_casing_enabled() { QString result = configini->value("casing_enabled", "false").value(); -- cgit From 13bc82094f76011eef371ece3b3894d7cc20eaf9 Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Wed, 23 Jan 2019 00:14:47 -0800 Subject: >>>>multi-threading the frame sfx/screenshake/flashes --- include/aoapplication.h | 5 ++ include/courtroom.h | 24 +++++-- src/courtroom.cpp | 178 ++++++++++++++++++++++++++++++++---------------- 3 files changed, 143 insertions(+), 64 deletions(-) diff --git a/include/aoapplication.h b/include/aoapplication.h index 7a5e633..22c6c23 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -23,6 +23,11 @@ #include #include +#include +#include +#include +#include + class NetworkManager; class Lobby; class Courtroom; diff --git a/include/courtroom.h b/include/courtroom.h index b746c6a..1c739b8 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -40,7 +40,7 @@ #include #include #include - +#include #include #include #include @@ -53,7 +53,11 @@ #include #include #include - +#include +#include +#include +#include +#include #include class AOApplication; @@ -69,6 +73,16 @@ public: void append_music(QString f_music){music_list.append(f_music);} void append_area(QString f_area){area_list.append(f_area);} void handle_failed_login(); + QString threading_sfx = ""; + QString threading_shake = ""; + QString threading_flash = ""; + QString threading_prefix = ""; + //cid and this may differ in cases of ini-editing + QString current_char = ""; + int current_emote = 0; + AOApplication *ao_app; + void mt_pre_framegetter(int frameNumber); + void mt_framegetter(int frameNumber); void reset_music_list() { music_list.clear(); @@ -216,7 +230,6 @@ public: ~Courtroom(); private: - AOApplication *ao_app; int m_courtroom_width = 714; int m_courtroom_height = 668; @@ -232,7 +245,7 @@ private: QPropertyAnimation *screenshake_animation; QPropertyAnimation *chatbox_screenshake_animation; QParallelAnimationGroup *screenshake_group; - QImageReader *frame_emote_checker; + QMovie *frame_emote_checker; // This is for inline message-colouring. enum INLINE_COLOURS { @@ -352,8 +365,6 @@ private: //character id, which index of the char_list the player is int m_cid = -1; - //cid and this may differ in cases of ini-editing - QString current_char = ""; int objection_state = 0; int realization_state = 0; @@ -373,7 +384,6 @@ private: const int button_height = 60; int current_emote_page = 0; - int current_emote = 0; int emote_columns = 5; int emote_rows = 2; int max_emotes_on_page = 10; diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 537558f..19caa8d 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -1095,6 +1095,66 @@ void Courtroom::append_server_chatmessage(QString p_name, QString p_message, QSt ui_server_chatlog->append_chatmessage(p_name, p_message, colour); } +class AOFrameThreadingBullshitPre : public QRunnable +{ +public: + Courtroom *mycourt_fuck; + int my_frameNumber; + AOFrameThreadingBullshitPre(Courtroom *my_courtroom, int frameNumber){ + mycourt_fuck = my_courtroom; + my_frameNumber = frameNumber; + } + void run() + { + qDebug() << my_frameNumber << " FRAME NUMBER" << " from" << QThread::currentThread(); + QString sfx_to_play = mycourt_fuck->ao_app->get_frame_sfx_name(mycourt_fuck->current_char, mycourt_fuck->ao_app->get_pre_emote(mycourt_fuck->current_char, mycourt_fuck->current_emote), my_frameNumber); + QString screenshake_to_play = mycourt_fuck->ao_app->get_screenshake_frame(mycourt_fuck->current_char, mycourt_fuck->ao_app->get_pre_emote(mycourt_fuck->current_char, mycourt_fuck->current_emote), my_frameNumber); + QString realization_to_play = mycourt_fuck->ao_app->get_realization_frame(mycourt_fuck->current_char, mycourt_fuck->ao_app->get_pre_emote(mycourt_fuck->current_char, mycourt_fuck->current_emote), my_frameNumber); + if(sfx_to_play != "") + { + mycourt_fuck->threading_sfx += "|" + QString::number(my_frameNumber) + "=" + sfx_to_play; + } + if(screenshake_to_play != "") + { + mycourt_fuck->threading_shake += "|" + QString::number(my_frameNumber) + "=" + screenshake_to_play; + } + if(realization_to_play != "") + { + mycourt_fuck->threading_flash += "|" + QString::number(my_frameNumber) + "=" + realization_to_play; + } + } +}; + + +class AOFrameThreadingBullshit : public QRunnable +{ +public: + Courtroom *mycourt_fuck; + int my_frameNumber; + AOFrameThreadingBullshit(Courtroom *my_courtroom, int frameNumber){ + mycourt_fuck = my_courtroom; + my_frameNumber = frameNumber; + } + void run() + { + QString sfx_to_play = mycourt_fuck->ao_app->get_frame_sfx_name(mycourt_fuck->current_char, mycourt_fuck->threading_prefix + mycourt_fuck->ao_app->get_emote(mycourt_fuck->current_char, mycourt_fuck->current_emote), my_frameNumber); + QString screenshake_to_play = mycourt_fuck->ao_app->get_screenshake_frame(mycourt_fuck->current_char, mycourt_fuck->threading_prefix + mycourt_fuck->ao_app->get_emote(mycourt_fuck->current_char, mycourt_fuck->current_emote), my_frameNumber); + QString realization_to_play = mycourt_fuck->ao_app->get_realization_frame(mycourt_fuck->current_char, mycourt_fuck->threading_prefix + mycourt_fuck->ao_app->get_emote(mycourt_fuck->current_char, mycourt_fuck->current_emote), my_frameNumber); + if(sfx_to_play != "") + { + mycourt_fuck->threading_sfx += "|" + QString::number(my_frameNumber) + "=" + sfx_to_play; + } + if(screenshake_to_play != "") + { + mycourt_fuck->threading_shake += "|" + QString::number(my_frameNumber) + "=" + screenshake_to_play; + } + if(realization_to_play != "") + { + mycourt_fuck->threading_flash += "|" + QString::number(my_frameNumber) + "=" + realization_to_play; + } + } +}; + void Courtroom::on_chat_return_pressed() { if (ui_ic_chat_message->text() == "" || is_muted) @@ -1275,7 +1335,7 @@ void Courtroom::on_chat_return_pressed() qDebug() << "Are we looping this? " << ao_app->get_sfx_looping(current_char, current_emote); packet_contents.append(QString::number(screenshake_state)); qDebug() << "Are we screen shaking this one? " << screenshake_state; - + qDebug() << "MAX THREAD COUNT " << QThreadPool::globalInstance()->maxThreadCount(); QString frame_screenshake = ""; QString frame_realization = ""; QString frame_sfx = ""; @@ -1295,77 +1355,86 @@ void Courtroom::on_chat_return_pressed() QString preemote = ao_app->get_image_suffix(ao_app->get_character_path(current_char, ao_app->get_pre_emote(current_char, current_emote))); QString talkemote_to_check = ao_app->get_image_suffix(ao_app->get_character_path(current_char, "(b)" + ao_app->get_emote(current_char, current_emote))); QString idleemote_to_check = ao_app->get_image_suffix(ao_app->get_character_path(current_char, "(a)" + ao_app->get_emote(current_char, current_emote))); - frame_emote_checker = new QImageReader(preemote); + + frame_emote_checker = new QMovie(this); + frame_emote_checker->setFileName(preemote); + frame_emote_checker->jumpToFrame(0); + qDebug() << "Premote fuck: " << frame_emote_checker->frameCount(); + preemote_sfx += ao_app->get_pre_emote(current_char, current_emote); preemote_shake += ao_app->get_pre_emote(current_char, current_emote); preemote_flash += ao_app->get_pre_emote(current_char, current_emote); - for (int i = 0; i < frame_emote_checker->imageCount(); i++) { - QString sfx_to_play = ao_app->get_frame_sfx_name(current_char, ao_app->get_pre_emote(current_char, current_emote), i); - QString screenshake_to_play = ao_app->get_screenshake_frame(current_char, ao_app->get_pre_emote(current_char, current_emote), i); - QString realization_to_play = ao_app->get_realization_frame(current_char, ao_app->get_pre_emote(current_char, current_emote), i); - if(sfx_to_play != "") - { - preemote_sfx += "|" + QString::number(i) + "=" + sfx_to_play; - } - if(screenshake_to_play != "") - { - preemote_shake += "|" + QString::number(i) + "=" + screenshake_to_play; - } - if(realization_to_play != "") - { - preemote_flash += "|" + QString::number(i) + "=" + realization_to_play; - } + + threading_sfx = preemote_sfx; + threading_shake = preemote_shake; + threading_flash = preemote_flash; + + for(int i=0; i < frame_emote_checker->frameCount(); i++){ + AOFrameThreadingBullshitPre *testfuck = new AOFrameThreadingBullshitPre(this, i); + QThreadPool::globalInstance()->start(testfuck); } + QThreadPool::globalInstance()->waitForDone(); + preemote_sfx = threading_sfx; + preemote_shake = threading_shake; + preemote_flash = threading_flash; preemote_sfx += "^"; preemote_shake += "^"; preemote_flash += "^"; delete frame_emote_checker; + + + talkemote_sfx += "(b)" + ao_app->get_emote(current_char, current_emote); talkemote_shake += "(b)" + ao_app->get_emote(current_char, current_emote); talkemote_flash += "(b)" + ao_app->get_emote(current_char, current_emote); - frame_emote_checker = new QImageReader(talkemote_to_check); - for (int i = 0; i < frame_emote_checker->imageCount(); i++) { - QString sfx_to_play = ao_app->get_frame_sfx_name(current_char, "(b)" + ao_app->get_emote(current_char, current_emote), i); - QString screenshake_to_play = ao_app->get_screenshake_frame(current_char, "(b)" + ao_app->get_emote(current_char, current_emote), i); - QString realization_to_play = ao_app->get_realization_frame(current_char, "(b)" + ao_app->get_emote(current_char, current_emote), i); - if(sfx_to_play != "") - { - talkemote_sfx += "|" + QString::number(i) + "=" + sfx_to_play; - } - if(screenshake_to_play != "") - { - talkemote_shake += "|" + QString::number(i) + "=" + screenshake_to_play; - } - if(realization_to_play != "") - { - talkemote_flash += "|" + QString::number(i) + "=" + realization_to_play; - } + + frame_emote_checker = new QMovie(this); + frame_emote_checker->setFileName(talkemote_to_check); + frame_emote_checker->jumpToFrame(0); + qDebug() << "TALK fuck: " << frame_emote_checker->frameCount(); + + threading_sfx = talkemote_sfx; + threading_shake = talkemote_shake; + threading_flash = talkemote_flash; + threading_prefix = QString("(b)"); + + for(int i=0; i < frame_emote_checker->frameCount(); i++){ + AOFrameThreadingBullshit *testfuck = new AOFrameThreadingBullshit(this, i); + QThreadPool::globalInstance()->start(testfuck); } + QThreadPool::globalInstance()->waitForDone(); + + talkemote_sfx = threading_sfx; + talkemote_shake = threading_shake; + talkemote_flash = threading_flash; talkemote_sfx += "^"; talkemote_shake += "^"; talkemote_flash += "^"; delete frame_emote_checker; + + + idleemote_sfx += "(a)" + ao_app->get_emote(current_char, current_emote); idleemote_shake += "(a)" + ao_app->get_emote(current_char, current_emote); idleemote_flash += "(a)" + ao_app->get_emote(current_char, current_emote); - frame_emote_checker = new QImageReader(idleemote_to_check); - for (int i = 0; i < frame_emote_checker->imageCount(); i++) { - QString sfx_to_play = ao_app->get_frame_sfx_name(current_char, "(a)" + ao_app->get_emote(current_char, current_emote), i); - QString screenshake_to_play = ao_app->get_screenshake_frame(current_char, "(a)" + ao_app->get_emote(current_char, current_emote), i); - QString realization_to_play = ao_app->get_realization_frame(current_char, "(a)" + ao_app->get_emote(current_char, current_emote), i); - if(sfx_to_play != "") - { - idleemote_sfx += "|" + QString::number(i) + "=" + sfx_to_play; - } - if(screenshake_to_play != "") - { - idleemote_shake += "|" + QString::number(i) + "=" + screenshake_to_play; - } - if(realization_to_play != "") - { - idleemote_flash += "|" + QString::number(i) + "=" + realization_to_play; - } + + frame_emote_checker = new QMovie(this); + frame_emote_checker->setFileName(idleemote_to_check); + frame_emote_checker->jumpToFrame(0); + qDebug() << "idle fuck: " << frame_emote_checker->frameCount(); + + threading_sfx = idleemote_sfx; + threading_shake = idleemote_shake; + threading_flash = idleemote_flash; + threading_prefix = QString("(a)"); + for(int i=0; i < frame_emote_checker->frameCount(); i++){ + AOFrameThreadingBullshit *testfuck = new AOFrameThreadingBullshit(this, i); + QThreadPool::globalInstance()->start(testfuck); } + QThreadPool::globalInstance()->waitForDone(); + idleemote_sfx = threading_sfx; + idleemote_shake = threading_shake; + idleemote_flash = threading_flash; delete frame_emote_checker; frame_screenshake += preemote_shake; @@ -1379,10 +1448,6 @@ void Courtroom::on_chat_return_pressed() frame_sfx += preemote_sfx; frame_sfx += talkemote_sfx; frame_sfx += idleemote_sfx; - qDebug() << "Final strings:"; - qDebug() << frame_screenshake; - qDebug() << frame_realization; - qDebug() << frame_sfx; packet_contents.append(frame_screenshake); packet_contents.append(frame_realization); @@ -1390,7 +1455,6 @@ void Courtroom::on_chat_return_pressed() } ao_app->send_server_packet(new AOPacket("MS", packet_contents)); } - void Courtroom::handle_chatmessage(QStringList *p_contents) { // Instead of checking for whether a message has at least chatmessage_size -- cgit From 906c9016bb4660eb0445a3345a55ede959c3cb96 Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Wed, 23 Jan 2019 00:58:30 -0800 Subject: Multithreaded character generation TODO: fix loading screen --- include/courtroom.h | 22 ++++++++++------------ include/lobby.h | 3 ++- src/charselect.cpp | 48 ++++++++++++++++++++++++++++-------------------- src/lobby.cpp | 4 ++++ 4 files changed, 44 insertions(+), 33 deletions(-) diff --git a/include/courtroom.h b/include/courtroom.h index 1c739b8..f612412 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -58,6 +58,7 @@ #include #include #include +#include #include class AOApplication; @@ -81,6 +82,15 @@ public: QString current_char = ""; int current_emote = 0; AOApplication *ao_app; + //abstract widget to hold char buttons + QWidget *ui_char_buttons; + QVector char_list; + QVector evidence_list; + QVector music_list; + QVector area_list; + QSignalMapper *char_button_mapper; + QVector ui_char_button_list; + QVector ui_char_button_list_filtered; void mt_pre_framegetter(int frameNumber); void mt_framegetter(int frameNumber); void reset_music_list() @@ -280,18 +290,11 @@ private: // The offset this user has given if they want to appear alongside someone. int offset_with_pair = 0; - QVector char_list; - QVector evidence_list; - QVector music_list; - QVector area_list; - QVector arup_players; QVector arup_statuses; QVector arup_cms; QVector arup_locks; - QSignalMapper *char_button_mapper; - QVector ic_chatlog_history; // These map music row items and area row items to their actual IDs. @@ -534,11 +537,6 @@ private: AOImage *ui_char_select_background; - //abstract widget to hold char buttons - QWidget *ui_char_buttons; - - QVector ui_char_button_list; - QVector ui_char_button_list_filtered; AOImage *ui_selector; AOButton *ui_back_to_lobby; diff --git a/include/lobby.h b/include/lobby.h index 19276a7..3a34fb8 100644 --- a/include/lobby.h +++ b/include/lobby.h @@ -76,7 +76,8 @@ private: AOButton *ui_cancel; void set_size_and_pos(QWidget *p_widget, QString p_identifier); - +public slots: + void fucking_threading_goddamn_it(QString fuckshitassgoddamnfuck); private slots: void on_public_servers_clicked(); void on_favorites_clicked(); diff --git a/src/charselect.cpp b/src/charselect.cpp index 8e1b912..e6d9c9f 100644 --- a/src/charselect.cpp +++ b/src/charselect.cpp @@ -5,6 +5,30 @@ #include "debug_functions.h" #include "hardware_functions.h" +class AOCharSelectGenerationThreading : public QRunnable +{ +public: + Courtroom *mycourt_fuck; + int char_num; + AOCharButton *char_button; + AOCharSelectGenerationThreading(Courtroom *my_courtroom, int character_number, AOCharButton *charbut){ + mycourt_fuck = my_courtroom; + char_num = character_number; + char_button = charbut; + } + void run() + { + AOCharButton* character = char_button; + character->reset(); + character->hide(); + character->set_image(mycourt_fuck->char_list.at(char_num).name); + mycourt_fuck->ui_char_button_list.append(character); + + mycourt_fuck->connect(character, SIGNAL(clicked()), mycourt_fuck->char_button_mapper, SLOT(map())); + mycourt_fuck->char_button_mapper->setMapping(character, mycourt_fuck->ui_char_button_list.size() - 1); + } +}; + void Courtroom::construct_char_select() { ui_char_select_background = new AOImage(this, ao_app); @@ -197,27 +221,11 @@ void Courtroom::character_loading_finished() // Later on, we'll be revealing buttons as we need them. for (int n = 0; n < char_list.size(); n++) { - AOCharButton* character = new AOCharButton(ui_char_buttons, ao_app, 0, 0, char_list.at(n).taken); - character->reset(); - character->hide(); - character->set_image(char_list.at(n).name); - ui_char_button_list.append(character); - - connect(character, SIGNAL(clicked()), char_button_mapper, SLOT(map())); - char_button_mapper->setMapping(character, ui_char_button_list.size() - 1); - - // This part here serves as a way of showing to the player that the game is still running, it is - // just loading the pictures of the characters. - if (ao_app->lobby_constructed) - { - ao_app->generated_chars++; - int total_loading_size = ao_app->char_list_size * 2 + ao_app->evidence_list_size + ao_app->music_list_size; - int loading_value = int(((ao_app->loaded_chars + ao_app->generated_chars + ao_app->loaded_music + ao_app->loaded_evidence) / static_cast(total_loading_size)) * 100); - ao_app->w_lobby->set_loading_value(loading_value); - ao_app->w_lobby->set_loading_text("Generating chars:\n" + QString::number(ao_app->generated_chars) + "/" + QString::number(ao_app->char_list_size)); - } + AOCharButton* character = new AOCharButton(ui_char_buttons, ao_app, 0, 0, char_list.at(n).taken); + AOCharSelectGenerationThreading *char_generate = new AOCharSelectGenerationThreading(this, n, character); + QThreadPool::globalInstance()->start(char_generate); } - + QThreadPool::globalInstance()->waitForDone(); filter_character_list(); } diff --git a/src/lobby.cpp b/src/lobby.cpp index 4a96e56..6f8db06 100644 --- a/src/lobby.cpp +++ b/src/lobby.cpp @@ -172,6 +172,10 @@ void Lobby::set_size_and_pos(QWidget *p_widget, QString p_identifier) } } +void Lobby::fucking_threading_goddamn_it(QString text){ + this->set_loading_text(text); +} + void Lobby::set_loading_text(QString p_text) { ui_loading_text->clear(); -- cgit From f75032840450263bfe27d3b5a68ea1458a0ce8a5 Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Wed, 23 Jan 2019 01:07:20 -0800 Subject: Multithreaded filtering of the character list --- include/courtroom.h | 7 +++---- src/charselect.cpp | 52 ++++++++++++++++++++++++++++++++-------------------- 2 files changed, 35 insertions(+), 24 deletions(-) diff --git a/include/courtroom.h b/include/courtroom.h index f612412..be37869 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -91,6 +91,9 @@ public: QSignalMapper *char_button_mapper; QVector ui_char_button_list; QVector ui_char_button_list_filtered; + QLineEdit *ui_char_search; + QCheckBox *ui_char_passworded; + QCheckBox *ui_char_taken; void mt_pre_framegetter(int frameNumber); void mt_framegetter(int frameNumber); void reset_music_list() @@ -548,10 +551,6 @@ private: AOButton *ui_spectator; - QLineEdit *ui_char_search; - QCheckBox *ui_char_passworded; - QCheckBox *ui_char_taken; - void construct_char_select(); void set_char_select(); void set_char_select_page(); diff --git a/src/charselect.cpp b/src/charselect.cpp index e6d9c9f..c5a10bd 100644 --- a/src/charselect.cpp +++ b/src/charselect.cpp @@ -29,6 +29,35 @@ public: } }; +class AOCharSelectFilterThreading : public QRunnable +{ +public: + Courtroom *mycourt_fuck; + int char_num; + AOCharSelectFilterThreading(Courtroom *my_courtroom, int character_number){ + mycourt_fuck = my_courtroom; + char_num = character_number; + } + void run() + { + AOCharButton* current_char = mycourt_fuck->ui_char_button_list.at(char_num); + + if (!mycourt_fuck->ui_char_taken->isChecked() && mycourt_fuck->char_list.at(char_num).taken) + return; + + if (!mycourt_fuck->char_list.at(char_num).name.contains(mycourt_fuck->ui_char_search->text(), Qt::CaseInsensitive)) + return; + + // We only really need to update the fact that a character is taken + // for the buttons that actually appear. + // You'd also update the passwordedness and etc. here later. + current_char->reset(); + current_char->set_taken(mycourt_fuck->char_list.at(char_num).taken); + + mycourt_fuck->ui_char_button_list_filtered.append(current_char); + } +}; + void Courtroom::construct_char_select() { ui_char_select_background = new AOImage(this, ao_app); @@ -234,27 +263,10 @@ void Courtroom::filter_character_list() ui_char_button_list_filtered.clear(); for (int i = 0; i < char_list.size(); i++) { - AOCharButton* current_char = ui_char_button_list.at(i); - - // It seems passwording characters is unimplemented yet? - // Until then, this will stay here, I suppose. - //if (ui_char_passworded->isChecked() && character_is_passworded??) - // continue; - - if (!ui_char_taken->isChecked() && char_list.at(i).taken) - continue; - - if (!char_list.at(i).name.contains(ui_char_search->text(), Qt::CaseInsensitive)) - continue; - - // We only really need to update the fact that a character is taken - // for the buttons that actually appear. - // You'd also update the passwordedness and etc. here later. - current_char->reset(); - current_char->set_taken(char_list.at(i).taken); - - ui_char_button_list_filtered.append(current_char); + AOCharSelectFilterThreading *char_filter = new AOCharSelectFilterThreading(this, i); + QThreadPool::globalInstance()->start(char_filter); } + QThreadPool::globalInstance()->waitForDone(); current_char_page = 0; set_char_select_page(); -- cgit From edbd67c2dcd25c2e3da6765661d2b04beffdacbf Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Wed, 23 Jan 2019 01:40:57 -0800 Subject: multi-threaded music --- src/packet_distribution.cpp | 89 ++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 50 deletions(-) diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp index 9ea2839..1820547 100644 --- a/src/packet_distribution.cpp +++ b/src/packet_distribution.cpp @@ -7,6 +7,31 @@ #include "hardware_functions.h" #include "debug_functions.h" +class AOPacketLoadMusicThreading : public QRunnable +{ +public: + AOApplication *myapp; + QString filename; + bool ismusic; + AOPacketLoadMusicThreading(AOApplication *my_app, QString file_name, bool is_music){ + myapp = my_app; + filename = file_name; + ismusic = is_music; + } + void run() + { + qDebug() << "Processing " << filename << " on thread " << QThread::currentThread(); + if(ismusic) + { + myapp->w_courtroom->append_music(filename); + } + else + { + myapp->w_courtroom->append_area(filename); + } + } +}; + void AOApplication::ms_packet_received(AOPacket *p_packet) { p_packet->net_decode(); @@ -280,51 +305,6 @@ void AOApplication::server_packet_received(AOPacket *p_packet) if (is_discord_enabled()) discord->state_server(server_name.toStdString(), hash.result().toBase64().toStdString()); } - else if (header == "CI") - { - if (!courtroom_constructed) - goto end; - - for (int n_element = 0 ; n_element < f_contents.size() ; n_element += 2) - { - if (f_contents.at(n_element).toInt() != loaded_chars) - break; - - //this means we are on the last element and checking n + 1 element will be game over so - if (n_element == f_contents.size() - 1) - break; - - QStringList sub_elements = f_contents.at(n_element + 1).split("&"); - if (sub_elements.size() < 2) - break; - - char_type f_char; - f_char.name = sub_elements.at(0); - f_char.description = sub_elements.at(1); - f_char.evidence_string = sub_elements.at(3); - //temporary. the CharsCheck packet sets this properly - f_char.taken = false; - - ++loaded_chars; - - w_lobby->set_loading_text("Loading chars:\n" + QString::number(loaded_chars) + "/" + QString::number(char_list_size)); - - w_courtroom->append_char(f_char); - - int total_loading_size = char_list_size * 2 + evidence_list_size + music_list_size; - int loading_value = int(((loaded_chars + generated_chars + loaded_music + loaded_evidence) / static_cast(total_loading_size)) * 100); - w_lobby->set_loading_value(loading_value); - } - - if (improved_loading_enabled) - send_server_packet(new AOPacket("RE#%")); - else - { - QString next_packet_number = QString::number(((loaded_chars - 1) / 10) + 1); - send_server_packet(new AOPacket("AN#" + next_packet_number + "#%")); - } - - } else if (header == "EI") { if (!courtroom_constructed) @@ -387,7 +367,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet) if (musics_time) { - w_courtroom->append_music(f_music); + AOPacketLoadMusicThreading *music_load = new AOPacketLoadMusicThreading(this, f_music, true); + QThreadPool::globalInstance()->start(music_load); } else { @@ -397,11 +378,11 @@ void AOApplication::server_packet_received(AOPacket *p_packet) } else { - w_courtroom->append_area(f_music); + AOPacketLoadMusicThreading *area_load = new AOPacketLoadMusicThreading(this, f_music, false); + QThreadPool::globalInstance()->start(area_load); areas++; } } - for (int area_n = 0; area_n < areas; area_n++) { w_courtroom->arup_append(0, "Unknown", "Unknown", "Unknown"); @@ -410,7 +391,12 @@ void AOApplication::server_packet_received(AOPacket *p_packet) int total_loading_size = char_list_size * 2 + evidence_list_size + music_list_size; int loading_value = int(((loaded_chars + generated_chars + loaded_music + loaded_evidence) / static_cast(total_loading_size)) * 100); w_lobby->set_loading_value(loading_value); + if(QThreadPool::globalInstance()->activeThreadCount() == QThreadPool::globalInstance()->maxThreadCount()) + { + QThreadPool::globalInstance()->waitForDone(); //out of order music is bad + } } + QThreadPool::globalInstance()->waitForDone(); QString next_packet_number = QString::number(((loaded_music - 1) / 10) + 1); send_server_packet(new AOPacket("AM#" + next_packet_number + "#%")); @@ -475,7 +461,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet) if (musics_time) { - w_courtroom->append_music(f_contents.at(n_element)); + AOPacketLoadMusicThreading *area_load = new AOPacketLoadMusicThreading(this, f_contents.at(n_element), true); + QThreadPool::globalInstance()->start(area_load); } else { @@ -485,7 +472,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet) } else { - w_courtroom->append_area(f_contents.at(n_element)); + AOPacketLoadMusicThreading *area_load = new AOPacketLoadMusicThreading(this, f_contents.at(n_element), false); + QThreadPool::globalInstance()->start(area_load); areas++; } } @@ -499,6 +487,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet) int loading_value = int(((loaded_chars + generated_chars + loaded_music + loaded_evidence) / static_cast(total_loading_size)) * 100); w_lobby->set_loading_value(loading_value); } + QThreadPool::globalInstance()->waitForDone(); send_server_packet(new AOPacket("RD#%")); } -- cgit From f9406d0a7f2363843d9d7c09a9e8d3422c967a64 Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Wed, 23 Jan 2019 01:56:56 -0800 Subject: multithread the music **harder** --- include/aoapplication.h | 1 + src/packet_distribution.cpp | 103 ++++++++------------------------------------ 2 files changed, 18 insertions(+), 86 deletions(-) diff --git a/include/aoapplication.h b/include/aoapplication.h index 22c6c23..095dafd 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -95,6 +95,7 @@ public: int loaded_evidence = 0; int music_list_size = 0; int loaded_music = 0; + int area_count = 0; bool courtroom_loaded = false; diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp index 1820547..0cbf463 100644 --- a/src/packet_distribution.cpp +++ b/src/packet_distribution.cpp @@ -20,7 +20,6 @@ public: } void run() { - qDebug() << "Processing " << filename << " on thread " << QThread::currentThread(); if(ismusic) { myapp->w_courtroom->append_music(filename); @@ -28,6 +27,11 @@ public: else { myapp->w_courtroom->append_area(filename); + myapp->area_count++; + } + for (int area_n = 0; area_n < myapp->area_count; area_n++) + { + myapp->w_courtroom->arup_append(0, "Unknown", "Unknown", "Unknown"); } } }; @@ -343,64 +347,6 @@ void AOApplication::server_packet_received(AOPacket *p_packet) send_server_packet(new AOPacket("AE#" + next_packet_number + "#%")); } - else if (header == "EM") - { - if (!courtroom_constructed) - goto end; - - bool musics_time = false; - int areas = 0; - - for (int n_element = 0 ; n_element < f_contents.size() ; n_element += 2) - { - if (f_contents.at(n_element).toInt() != loaded_music) - break; - - if (n_element == f_contents.size() - 1) - break; - - QString f_music = f_contents.at(n_element + 1); - - ++loaded_music; - - w_lobby->set_loading_text("Loading music:\n" + QString::number(loaded_music) + "/" + QString::number(music_list_size)); - - if (musics_time) - { - AOPacketLoadMusicThreading *music_load = new AOPacketLoadMusicThreading(this, f_music, true); - QThreadPool::globalInstance()->start(music_load); - } - else - { - if (f_contents.at(n_element) == "===MUSIC START===.mp3") - { - musics_time = true; - } - else - { - AOPacketLoadMusicThreading *area_load = new AOPacketLoadMusicThreading(this, f_music, false); - QThreadPool::globalInstance()->start(area_load); - areas++; - } - } - for (int area_n = 0; area_n < areas; area_n++) - { - w_courtroom->arup_append(0, "Unknown", "Unknown", "Unknown"); - } - - int total_loading_size = char_list_size * 2 + evidence_list_size + music_list_size; - int loading_value = int(((loaded_chars + generated_chars + loaded_music + loaded_evidence) / static_cast(total_loading_size)) * 100); - w_lobby->set_loading_value(loading_value); - if(QThreadPool::globalInstance()->activeThreadCount() == QThreadPool::globalInstance()->maxThreadCount()) - { - QThreadPool::globalInstance()->waitForDone(); //out of order music is bad - } - } - QThreadPool::globalInstance()->waitForDone(); - - QString next_packet_number = QString::number(((loaded_music - 1) / 10) + 1); - send_server_packet(new AOPacket("AM#" + next_packet_number + "#%")); - } else if (header == "CharsCheck") { if (!courtroom_constructed) @@ -451,41 +397,26 @@ void AOApplication::server_packet_received(AOPacket *p_packet) goto end; bool musics_time = false; - int areas = 0; + area_count = 0; for (int n_element = 0 ; n_element < f_contents.size() ; ++n_element) { - ++loaded_music; - - w_lobby->set_loading_text("Loading music:\n" + QString::number(loaded_music) + "/" + QString::number(music_list_size)); - - if (musics_time) - { - AOPacketLoadMusicThreading *area_load = new AOPacketLoadMusicThreading(this, f_contents.at(n_element), true); - QThreadPool::globalInstance()->start(area_load); - } - else + if (!musics_time && f_contents.at(n_element) == "===MUSIC START===.mp3") { - if (f_contents.at(n_element) == "===MUSIC START===.mp3") - { - musics_time = true; - } - else - { - AOPacketLoadMusicThreading *area_load = new AOPacketLoadMusicThreading(this, f_contents.at(n_element), false); - QThreadPool::globalInstance()->start(area_load); - areas++; - } - } - - for (int area_n = 0; area_n < areas; area_n++) - { - w_courtroom->arup_append(0, "Unknown", "Unknown", "Unknown"); + musics_time = true; + continue; } - + AOPacketLoadMusicThreading *music_load = new AOPacketLoadMusicThreading(this, f_contents.at(n_element), musics_time); + QThreadPool::globalInstance()->start(music_load); + ++loaded_music; int total_loading_size = char_list_size * 2 + evidence_list_size + music_list_size; int loading_value = int(((loaded_chars + generated_chars + loaded_music + loaded_evidence) / static_cast(total_loading_size)) * 100); w_lobby->set_loading_value(loading_value); + w_lobby->set_loading_text("Loading music:\n" + QString::number(loaded_music) + "/" + QString::number(music_list_size)); + if(QThreadPool::globalInstance()->activeThreadCount() == QThreadPool::globalInstance()->maxThreadCount()) + { + QThreadPool::globalInstance()->waitForDone(); //out of order music is bad + } } QThreadPool::globalInstance()->waitForDone(); -- cgit From 0649e7b28e16a054072d8656a5046c7cc3cfefb6 Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Wed, 23 Jan 2019 07:35:29 -0800 Subject: Case Announcer: Witness Support also some other shit --- include/aocaseannouncerdialog.h | 1 + include/courtroom.h | 8 +++-- src/aocaseannouncerdialog.cpp | 6 +++- src/aocharmovie.cpp | 1 - src/aoevidencebutton.cpp | 4 --- src/aomusicplayer.cpp | 2 -- src/charselect.cpp | 8 +++++ src/courtroom.cpp | 75 +++++++++++++++++++++++------------------ src/main.cpp | 2 +- src/packet_distribution.cpp | 25 +++++++++++--- 10 files changed, 84 insertions(+), 48 deletions(-) diff --git a/include/aocaseannouncerdialog.h b/include/aocaseannouncerdialog.h index a238c3f..da26fab 100644 --- a/include/aocaseannouncerdialog.h +++ b/include/aocaseannouncerdialog.h @@ -36,6 +36,7 @@ private: QCheckBox *ui_judge_needed; QCheckBox *ui_juror_needed; QCheckBox *ui_steno_needed; + QCheckBox *ui_witness_needed; public slots: void ok_pressed(); diff --git a/include/courtroom.h b/include/courtroom.h index be37869..e00e454 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -59,6 +59,7 @@ #include #include #include +#include #include class AOApplication; @@ -194,6 +195,9 @@ public: //properly sets up some varibles: resets user state void enter_courtroom(int p_cid); + // mfw this didnt fucking exist yet + void set_character(int char_id); + //helper function that populates ui_music_list with the contents of music_list void list_music(); void list_areas(); @@ -234,7 +238,7 @@ public: //Toggles the judge buttons, whether they should appear or not. void toggle_judge_buttons(bool is_on); - void announce_case(QString title, bool def, bool pro, bool jud, bool jur, bool steno); + void announce_case(QString title, bool def, bool pro, bool jud, bool jur, bool steno, bool wit); void check_connection_received(); void doScreenShake(); @@ -575,7 +579,7 @@ public slots: void mod_called(QString p_ip); - void case_called(QString msg, bool def, bool pro, bool jud, bool jur, bool steno); + void case_called(QString msg, bool def, bool pro, bool jud, bool jur, bool steno, bool witness); private slots: void start_chat_ticking(); diff --git a/src/aocaseannouncerdialog.cpp b/src/aocaseannouncerdialog.cpp index 5b82b64..4b36fe6 100644 --- a/src/aocaseannouncerdialog.cpp +++ b/src/aocaseannouncerdialog.cpp @@ -54,12 +54,15 @@ AOCaseAnnouncerDialog::AOCaseAnnouncerDialog(QWidget *parent, AOApplication *p_a ui_juror_needed->setText(tr("Jurors needed")); ui_steno_needed = new QCheckBox(this); ui_steno_needed->setText(tr("Stenographer needed")); + ui_witness_needed = new QCheckBox(this); + ui_witness_needed->setText(tr("Witness needed")); ui_form_layout->setWidget(1, QFormLayout::FieldRole, ui_defense_needed); ui_form_layout->setWidget(2, QFormLayout::FieldRole, ui_prosecutor_needed); ui_form_layout->setWidget(3, QFormLayout::FieldRole, ui_judge_needed); ui_form_layout->setWidget(4, QFormLayout::FieldRole, ui_juror_needed); ui_form_layout->setWidget(5, QFormLayout::FieldRole, ui_steno_needed); + ui_form_layout->setWidget(6, QFormLayout::FieldRole, ui_witness_needed); setUpdatesEnabled(true); } @@ -71,7 +74,8 @@ void AOCaseAnnouncerDialog::ok_pressed() ui_prosecutor_needed->isChecked(), ui_judge_needed->isChecked(), ui_juror_needed->isChecked(), - ui_steno_needed->isChecked()); + ui_steno_needed->isChecked(), + ui_witness_needed->isChecked()); done(0); } diff --git a/src/aocharmovie.cpp b/src/aocharmovie.cpp index 3d65055..7fed6b0 100644 --- a/src/aocharmovie.cpp +++ b/src/aocharmovie.cpp @@ -48,7 +48,6 @@ void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix) m_movie->setFileName(gif_path); m_movie->jumpToFrame(0); this->LoadImageWithStupidMethodForFlipSupport(m_movie->currentImage()); - qDebug() << "playing file path: " << gif_path; this->show(); this->play_frame_sfx(); ticker->start(m_movie->nextFrameDelay()); diff --git a/src/aoevidencebutton.cpp b/src/aoevidencebutton.cpp index 924aeb8..ab654bf 100644 --- a/src/aoevidencebutton.cpp +++ b/src/aoevidencebutton.cpp @@ -89,15 +89,11 @@ void AOEvidenceButton::mouseDoubleClickEvent(QMouseEvent *e) void AOEvidenceButton::dragLeaveEvent(QMouseEvent *e) { //QWidget::dragLeaveEvent(e); - - qDebug() << "drag leave event"; } void AOEvidenceButton::dragEnterEvent(QMouseEvent *e) { //QWidget::dragEnterEvent(e); - - qDebug() << "drag enter event"; } void AOEvidenceButton::enterEvent(QEvent * e) diff --git a/src/aomusicplayer.cpp b/src/aomusicplayer.cpp index 2a35f0b..fca3c16 100644 --- a/src/aomusicplayer.cpp +++ b/src/aomusicplayer.cpp @@ -35,7 +35,6 @@ void AOMusicPlayer::play(QString p_song) double time=BASS_ChannelBytes2Seconds(m_stream, len); // the length in seconds if(time > 0) { - qDebug() << "Will loop in " << time << " seconds."; music_loop_timer->start(time*1000); } } @@ -57,7 +56,6 @@ QString AOMusicPlayer::get_path() void AOMusicPlayer::restart_loop() { - qDebug() << "Restarting Music"; /* m_stream = BASS_StreamCreateFile(FALSE, f_path.utf16(), 0, 0, BASS_STREAM_AUTOFREE | BASS_UNICODE | BASS_ASYNCFILE); if (ao_app->get_audio_output_device() != "default") diff --git a/src/charselect.cpp b/src/charselect.cpp index c5a10bd..6edd87e 100644 --- a/src/charselect.cpp +++ b/src/charselect.cpp @@ -253,6 +253,10 @@ void Courtroom::character_loading_finished() AOCharButton* character = new AOCharButton(ui_char_buttons, ao_app, 0, 0, char_list.at(n).taken); AOCharSelectGenerationThreading *char_generate = new AOCharSelectGenerationThreading(this, n, character); QThreadPool::globalInstance()->start(char_generate); + if(QThreadPool::globalInstance()->activeThreadCount() == QThreadPool::globalInstance()->maxThreadCount()) + { + QThreadPool::globalInstance()->waitForDone(); + } } QThreadPool::globalInstance()->waitForDone(); filter_character_list(); @@ -265,6 +269,10 @@ void Courtroom::filter_character_list() { AOCharSelectFilterThreading *char_filter = new AOCharSelectFilterThreading(this, i); QThreadPool::globalInstance()->start(char_filter); + if(QThreadPool::globalInstance()->activeThreadCount() == QThreadPool::globalInstance()->maxThreadCount()) + { + QThreadPool::globalInstance()->waitForDone(); + } } QThreadPool::globalInstance()->waitForDone(); diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 19caa8d..8c25a2d 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -1,5 +1,4 @@ #include "courtroom.h" - Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() { ao_app = p_ao_app; @@ -28,7 +27,6 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() } } } - keepalive_timer = new QTimer(this); keepalive_timer->start(60000); @@ -854,45 +852,58 @@ void Courtroom::set_background(QString p_background) } } -void Courtroom::enter_courtroom(int p_cid) -{ - m_cid = p_cid; +void Courtroom::set_character(int char_id) // can you fucking believe this didn't exist yet +{ + m_cid = char_id; - QString f_char; + QString f_char; - if (m_cid == -1) - { - if (ao_app->is_discord_enabled()) - ao_app->discord->state_spectate(); - f_char = ""; - } - else - { - f_char = ao_app->get_char_name(char_list.at(m_cid).name); + if (m_cid == -1) + { + if (ao_app->is_discord_enabled()) + ao_app->discord->state_spectate(); + f_char = ""; + } + else + { + f_char = ao_app->get_char_name(char_list.at(m_cid).name); - if (ao_app->is_discord_enabled()) - ao_app->discord->state_character(f_char.toStdString()); - } + if (ao_app->is_discord_enabled()) + ao_app->discord->state_character(f_char.toStdString()); + } - current_char = f_char; + current_char = f_char; - current_emote_page = 0; - current_emote = 0; + current_emote_page = 0; + current_emote = 0; - if (m_cid == -1) - ui_emotes->hide(); - else - ui_emotes->show(); + if (m_cid == -1) + ui_emotes->hide(); + else + ui_emotes->show(); + + set_emote_page(); + set_emote_dropdown(); - set_emote_page(); - set_emote_dropdown(); + if (ao_app->custom_objection_enabled && + (file_exists(ao_app->get_character_path(current_char, "custom.gif")) || + file_exists(ao_app->get_character_path(current_char, "custom.apng"))) && + file_exists(ao_app->get_character_path(current_char, "custom.wav"))) + ui_custom_objection->show(); + else + ui_custom_objection->hide(); +} + +void Courtroom::enter_courtroom(int p_cid) +{ + this->set_character(p_cid); current_evidence_page = 0; current_evidence = 0; set_evidence_page(); - QString side = ao_app->get_char_side(f_char); + QString side = ao_app->get_char_side(current_char); if (side == "jud") { @@ -1085,7 +1096,6 @@ void Courtroom::append_server_chatmessage(QString p_name, QString p_message, QSt colour = ao_app->get_color("ooc_default_color", "courtroom_design.ini").name(); if (p_colour == "1") colour = ao_app->get_color("ooc_server_color", "courtroom_design.ini").name(); - qDebug() << p_message; if(p_message == "Logged in as a moderator.") { ui_guard->show(); @@ -2955,7 +2965,7 @@ void Courtroom::mod_called(QString p_ip) } } -void Courtroom::case_called(QString msg, bool def, bool pro, bool jud, bool jur, bool steno) +void Courtroom::case_called(QString msg, bool def, bool pro, bool jud, bool jur, bool steno, bool witness) { if (ui_casing->isChecked()) { @@ -3674,7 +3684,7 @@ void Courtroom::on_char_select_right_clicked() void Courtroom::on_spectator_clicked() { - enter_courtroom(-1); + this->set_character(-1); ui_emotes->hide(); @@ -3820,7 +3830,7 @@ void Courtroom::on_casing_clicked() } } -void Courtroom::announce_case(QString title, bool def, bool pro, bool jud, bool jur, bool steno) +void Courtroom::announce_case(QString title, bool def, bool pro, bool jud, bool jur, bool steno, bool wit) { if (ao_app->casing_alerts_enabled) { @@ -3832,6 +3842,7 @@ void Courtroom::announce_case(QString title, bool def, bool pro, bool jud, bool f_packet.append(QString::number(jud)); f_packet.append(QString::number(jur)); f_packet.append(QString::number(steno)); + f_packet.append(QString::number(wit)); ao_app->send_server_packet(new AOPacket("CASEA", f_packet)); } diff --git a/src/main.cpp b/src/main.cpp index 80ea93b..5aae5c6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -18,7 +18,7 @@ int main(int argc, char *argv[]) AOApplication main_app(argc, argv); main_app.construct_lobby(); - main_app.net_manager->connect_to_master(); main_app.w_lobby->show(); + main_app.net_manager->connect_to_master(); return main_app.exec(); } diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp index 0cbf463..7ad2473 100644 --- a/src/packet_distribution.cpp +++ b/src/packet_distribution.cpp @@ -460,9 +460,24 @@ void AOApplication::server_packet_received(AOPacket *p_packet) { if (f_contents.size() < 3) goto end; - - if (courtroom_constructed) - w_courtroom->enter_courtroom(f_contents.at(2).toInt()); + if(f_contents.size() < 4){ + if (courtroom_constructed) + w_courtroom->enter_courtroom(f_contents.at(2).toInt()); + } + else + { + if (courtroom_constructed) + { + if(f_contents.at(3) == "True") + { + w_courtroom->set_character(f_contents.at(2).toInt()); + } + else + { + w_courtroom->enter_courtroom(f_contents.at(2).toInt()); + } + } + } } else if (header == "MS") { @@ -577,8 +592,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet) } else if (header == "CASEA") { - if (courtroom_constructed && f_contents.size() > 6) - w_courtroom->case_called(f_contents.at(0), f_contents.at(1) == "1", f_contents.at(2) == "1", f_contents.at(3) == "1", f_contents.at(4) == "1", f_contents.at(5) == "1"); + if (courtroom_constructed && f_contents.size() > 7) + w_courtroom->case_called(f_contents.at(0), f_contents.at(1) == "1", f_contents.at(2) == "1", f_contents.at(3) == "1", f_contents.at(4) == "1", f_contents.at(5) == "1", f_contents.at(6) == "1"); } end: -- cgit From fc984fcfe2a4416274810de81a8f36fe77b0dba9 Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Fri, 1 Feb 2019 16:28:14 -0800 Subject: bugfixes and shit --- base/sounds/general/case_announced.ogg | Bin 0 -> 15790 bytes base/themes/default/courtroom_sounds.ini | 3 ++- include/aoapplication.h | 3 +++ include/aomusicplayer.h | 3 --- include/aooptionsdialog.h | 2 ++ include/aosfxplayer.h | 3 --- src/aomusicplayer.cpp | 31 +++++++------------------------ src/aooptionsdialog.cpp | 16 ++++++++++++++-- src/aosfxplayer.cpp | 26 ++++++-------------------- src/courtroom.cpp | 13 ++++++------- src/text_file_functions.cpp | 6 ++++++ 11 files changed, 46 insertions(+), 60 deletions(-) create mode 100644 base/sounds/general/case_announced.ogg diff --git a/base/sounds/general/case_announced.ogg b/base/sounds/general/case_announced.ogg new file mode 100644 index 0000000..1e9c3d4 Binary files /dev/null and b/base/sounds/general/case_announced.ogg differ diff --git a/base/themes/default/courtroom_sounds.ini b/base/themes/default/courtroom_sounds.ini index 050576e..eba07a6 100644 --- a/base/themes/default/courtroom_sounds.ini +++ b/base/themes/default/courtroom_sounds.ini @@ -5,4 +5,5 @@ evidence_present = sfx-evidenceshoop.wav word_call = sfx-gaspen-yeah!.wav mod_call = adminhelp.ogg not_guilty = sfx-notguilty.wav -guilty = sfx-guilty.wav \ No newline at end of file +guilty = sfx-guilty.wav +case_call = case_announced.ogg \ No newline at end of file diff --git a/include/aoapplication.h b/include/aoapplication.h index 095dafd..19eb474 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -323,6 +323,9 @@ public: // Same for CM. bool get_casing_cm_enabled(); + // Same for witnesses. + bool get_casing_wit_enabled(); + // Get the message for the CM for casing alerts. QString get_casing_can_host_cases(); diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h index 24ea0c5..a88cb79 100644 --- a/include/aomusicplayer.h +++ b/include/aomusicplayer.h @@ -26,14 +26,11 @@ public: private: QWidget *m_parent; AOApplication *ao_app; - QTimer *music_loop_timer; int m_volume = 0; QString f_path; HSTREAM m_stream; -private slots: - void restart_loop(); }; #endif // AOMUSICPLAYER_H diff --git a/include/aooptionsdialog.h b/include/aooptionsdialog.h index 175b804..53bd309 100644 --- a/include/aooptionsdialog.h +++ b/include/aooptionsdialog.h @@ -106,6 +106,8 @@ private: QCheckBox *ui_casing_steno_cb; QLabel *ui_casing_cm_lbl; QCheckBox *ui_casing_cm_cb; + QLabel *ui_casing_wit_lbl; + QCheckBox *ui_casing_wit_cb; QLabel *ui_casing_cm_cases_lbl; QLineEdit *ui_casing_cm_cases_textbox; diff --git a/include/aosfxplayer.h b/include/aosfxplayer.h index 5c6f108..39bea0d 100644 --- a/include/aosfxplayer.h +++ b/include/aosfxplayer.h @@ -22,13 +22,10 @@ public: private: QWidget *m_parent; AOApplication *ao_app; - QTimer *sfx_loop_timer; int m_volume = 0; bool looping_sfx = false; HSTREAM m_stream; -private slots: - void restart_loop(); }; #endif // AOSFXPLAYER_H diff --git a/src/aomusicplayer.cpp b/src/aomusicplayer.cpp index fca3c16..7fcb277 100644 --- a/src/aomusicplayer.cpp +++ b/src/aomusicplayer.cpp @@ -5,9 +5,6 @@ AOMusicPlayer::AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app): QObject( { m_parent = parent; ao_app = p_ao_app; - music_loop_timer = new QTimer(this); - music_loop_timer->setSingleShot(true); - connect(music_loop_timer, SIGNAL(timeout()), this, SLOT(restart_loop())); } AOMusicPlayer::~AOMusicPlayer() @@ -27,17 +24,16 @@ void AOMusicPlayer::play(QString p_song) if (ao_app->get_audio_output_device() != "default") BASS_ChannelSetDevice(m_stream, BASS_GetDevice()); - BASS_ChannelPlay(m_stream, false); - music_loop_timer->stop(); if(enable_looping) { - QWORD len=BASS_ChannelGetLength(m_stream, BASS_POS_BYTE); // the length in bytes - double time=BASS_ChannelBytes2Seconds(m_stream, len); // the length in seconds - if(time > 0) - { - music_loop_timer->start(time*1000); - } + BASS_ChannelFlags(m_stream, BASS_SAMPLE_LOOP, BASS_SAMPLE_LOOP); + } + else + { + BASS_ChannelFlags(m_stream, 0, BASS_SAMPLE_LOOP); } + BASS_ChannelPlay(m_stream, false); + } @@ -54,21 +50,8 @@ QString AOMusicPlayer::get_path() return f_path; } -void AOMusicPlayer::restart_loop() -{ - /* - m_stream = BASS_StreamCreateFile(FALSE, f_path.utf16(), 0, 0, BASS_STREAM_AUTOFREE | BASS_UNICODE | BASS_ASYNCFILE); - if (ao_app->get_audio_output_device() != "default") - BASS_ChannelSetDevice(m_stream, BASS_GetDevice());*/ - QWORD len=BASS_ChannelGetLength(m_stream, BASS_POS_BYTE); // the length in bytes - double time=BASS_ChannelBytes2Seconds(m_stream, len); // the length in seconds - music_loop_timer->start(time*1000); - BASS_ChannelPlay(m_stream, true); -} - void AOMusicPlayer::kill_loop() { - music_loop_timer->stop(); BASS_ChannelStop(m_stream); } diff --git a/src/aooptionsdialog.cpp b/src/aooptionsdialog.cpp index 247a231..03b4e67 100644 --- a/src/aooptionsdialog.cpp +++ b/src/aooptionsdialog.cpp @@ -467,6 +467,18 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) : QDi ui_casing_layout->setWidget(7, QFormLayout::FieldRole, ui_casing_cm_cb); + ui_casing_wit_lbl = new QLabel(ui_casing_widget); + ui_casing_wit_lbl->setText(tr("Witness:")); + ui_casing_wit_lbl->setToolTip(tr("If checked, you will appear amongst the potential " + "witnesses on the server.")); + + ui_casing_layout->setWidget(8, QFormLayout::LabelRole, ui_casing_wit_lbl); + + ui_casing_wit_cb = new QCheckBox(ui_casing_widget); + ui_casing_wit_cb->setChecked(ao_app->get_casing_wit_enabled()); + + ui_casing_layout->setWidget(8, QFormLayout::FieldRole, ui_casing_wit_cb); + // -- CM CASES ANNOUNCEMENTS ui_casing_cm_cases_lbl = new QLabel(ui_casing_widget); @@ -474,12 +486,12 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) : QDi ui_casing_cm_cases_lbl->setToolTip(tr("If you're a CM, enter what cases you are " "willing to host.")); - ui_casing_layout->setWidget(8, QFormLayout::LabelRole, ui_casing_cm_cases_lbl); + ui_casing_layout->setWidget(9, QFormLayout::LabelRole, ui_casing_cm_cases_lbl); ui_casing_cm_cases_textbox = new QLineEdit(ui_casing_widget); ui_casing_cm_cases_textbox->setText(ao_app->get_casing_can_host_cases()); - ui_casing_layout->setWidget(8, QFormLayout::FieldRole, ui_casing_cm_cases_textbox); + ui_casing_layout->setWidget(9, QFormLayout::FieldRole, ui_casing_cm_cases_textbox); // When we're done, we should continue the updates! setUpdatesEnabled(true); diff --git a/src/aosfxplayer.cpp b/src/aosfxplayer.cpp index e219c03..e39071e 100644 --- a/src/aosfxplayer.cpp +++ b/src/aosfxplayer.cpp @@ -5,9 +5,6 @@ AOSfxPlayer::AOSfxPlayer(QWidget *parent, AOApplication *p_ao_app): QObject() { m_parent = parent; ao_app = p_ao_app; - sfx_loop_timer = new QTimer(this); - sfx_loop_timer->setSingleShot(true); - connect(sfx_loop_timer, SIGNAL(timeout()), this, SLOT(restart_loop())); } void AOSfxPlayer::play(QString p_sfx, QString p_char, QString shout) @@ -39,12 +36,13 @@ void AOSfxPlayer::play(QString p_sfx, QString p_char, QString shout) if (ao_app->get_audio_output_device() != "default") BASS_ChannelSetDevice(m_stream, BASS_GetDevice()); BASS_ChannelPlay(m_stream, false); - sfx_loop_timer->stop(); - QWORD len=BASS_ChannelGetLength(m_stream, BASS_POS_BYTE); // the length in bytes - double time=BASS_ChannelBytes2Seconds(m_stream, len); // the length in seconds - if(time > 0 && looping_sfx && ao_app->get_looping_sfx()) + if(looping_sfx && ao_app->get_looping_sfx()) { - sfx_loop_timer->start(time*1000); + BASS_ChannelFlags(m_stream, BASS_SAMPLE_LOOP, BASS_SAMPLE_LOOP); + } + else + { + BASS_ChannelFlags(m_stream, 0, BASS_SAMPLE_LOOP); } } @@ -56,18 +54,6 @@ void AOSfxPlayer::setLooping(bool is_looping) void AOSfxPlayer::stop() { BASS_ChannelStop(m_stream); - sfx_loop_timer->stop(); -} - -void AOSfxPlayer::restart_loop() -{ - if(ao_app->get_looping_sfx() && looping_sfx) - { - QWORD len=BASS_ChannelGetLength(m_stream, BASS_POS_BYTE); // the length in bytes - double time=BASS_ChannelBytes2Seconds(m_stream, len); // the length in seconds - sfx_loop_timer->start(time*1000); - BASS_ChannelPlay(m_stream, true); - } } void AOSfxPlayer::set_volume(int p_value) diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 8c25a2d..a082e6b 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -984,12 +984,10 @@ void Courtroom::list_music() for (int n_song = 0 ; n_song < music_list.size() ; ++n_song) { QString i_song = music_list.at(n_song); - QString i_song_listname = i_song; - i_song_listname = i_song_listname.left(i_song_listname.lastIndexOf(".")); if (i_song.toLower().contains(ui_music_search->text().toLower())) { - ui_music_list->addItem(i_song_listname); + ui_music_list->addItem(i_song); music_row_to_number.append(n_song); QString song_path = ao_app->get_music_path(i_song); @@ -2825,7 +2823,6 @@ void Courtroom::handle_song(QStringList *p_contents) QString f_song = f_contents.at(0); QString f_song_clear = f_song; - f_song_clear = f_song_clear.left(f_song_clear.lastIndexOf(".")); int n_char = f_contents.at(1).toInt(); if (n_char < 0 || n_char >= char_list.size()) @@ -2865,7 +2862,7 @@ void Courtroom::handle_song(QStringList *p_contents) ic_chatlog_history.removeFirst(); } - append_ic_text(f_song_clear, str_show, true); + append_ic_text(f_song, str_show, true); music_player->play(f_song); } } @@ -2974,7 +2971,8 @@ void Courtroom::case_called(QString msg, bool def, bool pro, bool jud, bool jur, (ao_app->get_casing_prosecution_enabled() && pro) || (ao_app->get_casing_judge_enabled() && jud) || (ao_app->get_casing_juror_enabled() && jur) || - (ao_app->get_casing_steno_enabled() && steno)) + (ao_app->get_casing_steno_enabled() && steno) || + (ao_app->get_casing_wit_enabled() && witness)) { modcall_player->play(ao_app->get_sfx("case_call")); ao_app->alert(this); @@ -3822,11 +3820,12 @@ void Courtroom::on_casing_clicked() f_packet.append(QString::number(ao_app->get_casing_judge_enabled())); f_packet.append(QString::number(ao_app->get_casing_juror_enabled())); f_packet.append(QString::number(ao_app->get_casing_steno_enabled())); + f_packet.append(QString::number(ao_app->get_casing_wit_enabled())); ao_app->send_server_packet(new AOPacket("SETCASE", f_packet)); } else - ao_app->send_server_packet(new AOPacket("SETCASE#\"\"#0#0#0#0#0#0#%")); + ao_app->send_server_packet(new AOPacket("SETCASE#\"\"#0#0#0#0#0#0#0#%")); } } diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp index 68d0a04..a5eb273 100644 --- a/src/text_file_functions.cpp +++ b/src/text_file_functions.cpp @@ -685,6 +685,12 @@ bool AOApplication::get_casing_steno_enabled() return result.startsWith("true"); } +bool AOApplication::get_casing_wit_enabled() +{ + QString result = configini->value("casing_wit_enabled", "false").value(); + return result.startsWith("true"); +} + bool AOApplication::get_casing_cm_enabled() { QString result = configini->value("casing_cm_enabled", "false").value(); -- cgit From 4eb0d18c6651047b133165237b6f4b350d557c8f Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Fri, 1 Feb 2019 17:16:43 -0800 Subject: whoops --- src/aooptionsdialog.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/aooptionsdialog.cpp b/src/aooptionsdialog.cpp index 03b4e67..b0e1e99 100644 --- a/src/aooptionsdialog.cpp +++ b/src/aooptionsdialog.cpp @@ -540,6 +540,7 @@ void AOOptionsDialog::save_pressed() configini->setValue("casing_juror_enabled", ui_casing_jur_cb->isChecked()); configini->setValue("casing_steno_enabled", ui_casing_steno_cb->isChecked()); configini->setValue("casing_cm_enabled", ui_casing_cm_cb->isChecked()); + configini->setValue("casing_wit_enabled", ui_casing_wit_cb->isChecked()); configini->setValue("casing_can_host_cases", ui_casing_cm_cases_textbox->text()); callwordsini->close(); -- cgit From 0dcf8a7f179069dabae8aa61ba69675ad5182d76 Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Fri, 1 Feb 2019 17:20:08 -0800 Subject: bump the version number to 2.7.2 --- Attorney_Online.pro | 2 +- include/aoapplication.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Attorney_Online.pro b/Attorney_Online.pro index 73d3534..8f15ad0 100644 --- a/Attorney_Online.pro +++ b/Attorney_Online.pro @@ -3,7 +3,7 @@ QT += core gui widgets multimedia network TARGET = Attorney_Online TEMPLATE = app -VERSION = 2.6.1.0 +VERSION = 2.7.2.0 INCLUDEPATH += $$PWD/include DESTDIR = $$PWD/bin diff --git a/include/aoapplication.h b/include/aoapplication.h index 19eb474..f1c4190 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -332,7 +332,7 @@ public: private: const int RELEASE = 2; const int MAJOR_VERSION = 7; - const int MINOR_VERSION = 1; + const int MINOR_VERSION = 2; QString current_theme = "default"; -- cgit From e6cb5bd2cf241d638941ad5b403ab5fd7490335c Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Sat, 23 Mar 2019 14:33:31 -0700 Subject: Fixes Objections hiding the current character, instead of overlaying on top of it. Adds screenshake to objects. --- src/courtroom.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/courtroom.cpp b/src/courtroom.cpp index a082e6b..636df5a 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -1517,7 +1517,6 @@ void Courtroom::handle_chatmessage(QStringList *p_contents) text_state = 0; anim_state = 0; ui_vp_objection->stop(); - ui_vp_player_char->stop(); chat_tick_timer->stop(); ui_vp_evidence_display->reset(); @@ -1564,16 +1563,19 @@ void Courtroom::handle_chatmessage(QStringList *p_contents) case 1: ui_vp_objection->play("holdit", f_char, f_custom_theme); objection_player->play("holdit.wav", f_char, f_custom_theme); + this->doScreenShake(); break; case 2: ui_vp_objection->play("objection", f_char, f_custom_theme); objection_player->play("objection.wav", f_char, f_custom_theme); + this->doScreenShake(); if(ao_app->get_objectmusic()) music_player->kill_loop(); break; case 3: ui_vp_objection->play("takethat", f_char, f_custom_theme); objection_player->play("takethat.wav", f_char, f_custom_theme); + this->doScreenShake(); break; //case 4 is AO2 only case 4: -- cgit From 2d9fff2e969a952d1e83c1ade04d6beed2420dbc Mon Sep 17 00:00:00 2001 From: iamgoofball Date: Mon, 25 Mar 2019 11:14:53 -0700 Subject: Reverts screenshake on object, was controversial --- src/courtroom.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 636df5a..0905528 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -1563,19 +1563,16 @@ void Courtroom::handle_chatmessage(QStringList *p_contents) case 1: ui_vp_objection->play("holdit", f_char, f_custom_theme); objection_player->play("holdit.wav", f_char, f_custom_theme); - this->doScreenShake(); break; case 2: ui_vp_objection->play("objection", f_char, f_custom_theme); objection_player->play("objection.wav", f_char, f_custom_theme); - this->doScreenShake(); if(ao_app->get_objectmusic()) music_player->kill_loop(); break; case 3: ui_vp_objection->play("takethat", f_char, f_custom_theme); objection_player->play("takethat.wav", f_char, f_custom_theme); - this->doScreenShake(); break; //case 4 is AO2 only case 4: -- cgit From 1a0d7a7cc4b18047f5afd853428921f32618e42e Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Fri, 26 Jul 2019 02:04:30 +0200 Subject: update gitignore to leave out obj files and the base folder --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 6ac11d6..1adb744 100644 --- a/.gitignore +++ b/.gitignore @@ -5,12 +5,15 @@ *.so *.pro.autosave base_override.h +.DS_Store base-full/ +base/ bass.lib bin/ bins/ +build/ release/ debug/ -- cgit From e3d6d5e3a453864ef7567044ab26b9f9a038bb7a Mon Sep 17 00:00:00 2001 From: Paradox <25272926+Parazoid@users.noreply.github.com> Date: Mon, 23 Dec 2019 01:07:26 +0100 Subject: add flash and screenshake documentation Updated README to document the screenshake and flash in-character markup options. --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 0416e4a..5d8e2c6 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,14 @@ If you begin a message with `~~` (two tildes), the two tildes are removed and th If two players are in the same position and select each other's characters using the in-game pair list (or with `/pair [id]`), they will appear alongside each other. You can set the offset of your character using the provided spinbox (or with `/offset [percentage]`). +### Screenflash (2.6+) + +Placing a `$` (dollar symbol) at any point in the message will cause a white flash to appear at that point, and the symbol will disappear. You can do this multiple times in one message and stack it up with any other markup symbol. The flash will be silent, unlike the equivalent button. + +### Screenshake (2.6+) + +Placing an `@` (at symbol) at any point in the message will cause the screen to shake at that point, and the symbol will disappear. You can do this multiple times in one message and stack it up with any other markup symbol (including the screenflash). + ### Non-interrupting preanimations (2.6+) When checked, this will force text to immediately begin displaying without waiting for the preanimation to finish. -- cgit From abbbb43c985271c6d66b94ee384c6a401e43de8d Mon Sep 17 00:00:00 2001 From: sD Date: Thu, 26 Dec 2019 16:34:47 +0100 Subject: redundant headers in projectfile --- Attorney_Online.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Attorney_Online.pro b/Attorney_Online.pro index 8f15ad0..c11b5fd 100644 --- a/Attorney_Online.pro +++ b/Attorney_Online.pro @@ -11,7 +11,7 @@ OBJECTS_DIR = $$PWD/build MOC_DIR = $$PWD/build SOURCES += $$files($$PWD/src/*.cpp) -HEADERS += $$files($$PWD/include/*.h) $$PWD/include/aomusicplayer.h $$PWD/include/aosfxplayer.h +HEADERS += $$files($$PWD/include/*.h) LIBS += -L$$PWD/lib -lbass -ldiscord-rpc CONFIG += c++11 -- cgit From cb1ed6d60dc394f293f90f06ad9988de053feecb Mon Sep 17 00:00:00 2001 From: sD Date: Fri, 21 Feb 2020 16:43:40 +0100 Subject: put minor version back --- include/aoapplication.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/aoapplication.h b/include/aoapplication.h index 280b731..e4f2ee6 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -342,6 +342,7 @@ public: private: const int RELEASE = 2; const int MAJOR_VERSION = 7; + const int MINOR_VERSION = 0; QString current_theme = "default"; -- cgit From c8b11b398a7db6d8f45a88136e8a45e35b44320e Mon Sep 17 00:00:00 2001 From: sD Date: Fri, 21 Feb 2020 16:48:11 +0100 Subject: fix audio --- include/aomusicplayer.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h index 71ae604..255cc45 100644 --- a/include/aomusicplayer.h +++ b/include/aomusicplayer.h @@ -6,6 +6,7 @@ #elif defined(QTAUDIO) #include #endif + #include "aoapplication.h" #include @@ -14,12 +15,14 @@ #include #include +#if defined(BASSAUDIO) class AOMusicPlayer : public QObject { Q_OBJECT public: AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app); virtual ~AOMusicPlayer(); + void play(QString p_song); void set_volume(int p_value); @@ -30,6 +33,7 @@ public: private: QWidget *m_parent; AOApplication *ao_app; + int m_volume = 0; QString f_path; @@ -46,12 +50,18 @@ public: void play(QString p_song); void set_volume(int p_value); + void kill_loop(); + QString get_path(); + bool enable_looping = true; + private: - QMediaPlayer m_player; QWidget *m_parent; AOApplication *ao_app; + QMediaPlayer m_player; + int m_volume = 0; + QString f_path; }; #else class AOMusicPlayer : public QObject @@ -63,9 +73,16 @@ public: void play(QString p_song); void set_volume(int p_value); + void kill_loop(); + QString get_path(); + bool enable_looping = true; + private: QWidget *m_parent; AOApplication *ao_app; + + int m_volume = 0; + QString f_path; }; #endif -- cgit From 0afca9243a47f30a946c69a974c4d257574d85e5 Mon Sep 17 00:00:00 2001 From: sD Date: Fri, 21 Feb 2020 16:53:56 +0100 Subject: looping wasnt in --- src/aosfxplayer.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/aosfxplayer.cpp b/src/aosfxplayer.cpp index 80b6ea3..d2140e3 100644 --- a/src/aosfxplayer.cpp +++ b/src/aosfxplayer.cpp @@ -107,6 +107,11 @@ void AOSfxPlayer::play(QString p_sfx, QString p_char, QString shout) } } +void AOSfxPlayer::setLooping(bool is_looping) +{ + this->looping_sfx = is_looping; +} + void AOSfxPlayer::stop() { m_sfx.stop(); @@ -134,6 +139,11 @@ void AOSfxPlayer::play(QString p_sfx, QString p_char, QString shout) } +void AOSfxPlayer::setLooping(bool is_looping) +{ + this->looping_sfx = is_looping; +} + void AOSfxPlayer::stop() { -- cgit From 6c154841c37d6d97ba97a8f8c3e78e248434760f Mon Sep 17 00:00:00 2001 From: sD Date: Fri, 21 Feb 2020 16:54:06 +0100 Subject: area count got renamed --- src/packet_distribution.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp index fe26849..246166b 100644 --- a/src/packet_distribution.cpp +++ b/src/packet_distribution.cpp @@ -397,7 +397,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet) { musics_time = true; areas--; - w_courtroom->fix_last_area(); + //w_courtroom->fix_last_area(); w_courtroom->append_music(f_music); } else @@ -491,18 +491,18 @@ void AOApplication::server_packet_received(AOPacket *p_packet) f_contents.at(n_element).endsWith(".opus")) { musics_time = true; - w_courtroom->fix_last_area(); + // w_courtroom->fix_last_area(); w_courtroom->append_music(f_contents.at(n_element)); - areas--; + area_count--; } else { w_courtroom->append_area(f_contents.at(n_element)); - areas++; + area_count++; } } - for (int area_n = 0; area_n < areas; area_n++) + for (int area_n = 0; area_n < area_count; area_n++) { musics_time = true; continue; -- cgit From 8d6b69e2f26dd0d365a10d15381946f989df0875 Mon Sep 17 00:00:00 2001 From: sD Date: Fri, 21 Feb 2020 17:02:55 +0100 Subject: replace mycourt_fuck --- src/charselect.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/charselect.cpp b/src/charselect.cpp index 875c8a5..b71d9b7 100644 --- a/src/charselect.cpp +++ b/src/charselect.cpp @@ -8,11 +8,11 @@ class AOCharSelectGenerationThreading : public QRunnable { public: - Courtroom *mycourt_fuck; + Courtroom *thisCourtroom; int char_num; AOCharButton *char_button; AOCharSelectGenerationThreading(Courtroom *my_courtroom, int character_number, AOCharButton *charbut){ - mycourt_fuck = my_courtroom; + thisCourtroom = my_courtroom; char_num = character_number; char_button = charbut; } @@ -21,40 +21,40 @@ public: AOCharButton* character = char_button; character->reset(); character->hide(); - character->set_image(mycourt_fuck->char_list.at(char_num).name); - mycourt_fuck->ui_char_button_list.append(character); + character->set_image(thisCourtroom->char_list.at(char_num).name); + thisCourtroom->ui_char_button_list.append(character); - mycourt_fuck->connect(character, SIGNAL(clicked()), mycourt_fuck->char_button_mapper, SLOT(map())); - mycourt_fuck->char_button_mapper->setMapping(character, mycourt_fuck->ui_char_button_list.size() - 1); + thisCourtroom->connect(character, SIGNAL(clicked()), thisCourtroom->char_button_mapper, SLOT(map())); + thisCourtroom->char_button_mapper->setMapping(character, thisCourtroom->ui_char_button_list.size() - 1); } }; class AOCharSelectFilterThreading : public QRunnable { public: - Courtroom *mycourt_fuck; + Courtroom *thisCourtroom; int char_num; AOCharSelectFilterThreading(Courtroom *my_courtroom, int character_number){ - mycourt_fuck = my_courtroom; + thisCourtroom = my_courtroom; char_num = character_number; } void run() { - AOCharButton* current_char = mycourt_fuck->ui_char_button_list.at(char_num); + AOCharButton* current_char = thisCourtroom->ui_char_button_list.at(char_num); - if (!mycourt_fuck->ui_char_taken->isChecked() && mycourt_fuck->char_list.at(char_num).taken) + if (!thisCourtroom->ui_char_taken->isChecked() && thisCourtroom->char_list.at(char_num).taken) return; - if (!mycourt_fuck->char_list.at(char_num).name.contains(mycourt_fuck->ui_char_search->text(), Qt::CaseInsensitive)) + if (!thisCourtroom->char_list.at(char_num).name.contains(thisCourtroom->ui_char_search->text(), Qt::CaseInsensitive)) return; // We only really need to update the fact that a character is taken // for the buttons that actually appear. // You'd also update the passwordedness and etc. here later. current_char->reset(); - current_char->set_taken(mycourt_fuck->char_list.at(char_num).taken); + current_char->set_taken(thisCourtroom->char_list.at(char_num).taken); - mycourt_fuck->ui_char_button_list_filtered.append(current_char); + thisCourtroom->ui_char_button_list_filtered.append(current_char); } }; -- cgit From f93459ed0eec6c7c64bece75cb6e8de627c605b9 Mon Sep 17 00:00:00 2001 From: sD Date: Fri, 21 Feb 2020 17:18:25 +0100 Subject: remove fuck --- include/courtroom.h | 2 +- include/lobby.h | 2 +- src/aocharmovie.cpp | 31 +++++++++++++++-------------- src/courtroom.cpp | 56 ++++++++++++++++++++++++++--------------------------- src/lobby.cpp | 4 ++-- 5 files changed, 48 insertions(+), 47 deletions(-) diff --git a/include/courtroom.h b/include/courtroom.h index 587d963..37d3f6f 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -197,7 +197,7 @@ public: //properly sets up some varibles: resets user state void enter_courtroom(int p_cid); - // mfw this didnt fucking exist yet + // set the character using an ID void set_character(int char_id); //helper function that populates ui_music_list with the contents of music_list diff --git a/include/lobby.h b/include/lobby.h index 06cd798..d32debe 100644 --- a/include/lobby.h +++ b/include/lobby.h @@ -79,7 +79,7 @@ private: void set_size_and_pos(QWidget *p_widget, QString p_identifier); public slots: - void fucking_threading_goddamn_it(QString fuckshitassgoddamnfuck); + void lobbyThreadHandler(QString loadingText); private slots: void on_public_servers_clicked(); void on_favorites_clicked(); diff --git a/src/aocharmovie.cpp b/src/aocharmovie.cpp index 7fed6b0..6aa6e35 100644 --- a/src/aocharmovie.cpp +++ b/src/aocharmovie.cpp @@ -88,10 +88,10 @@ void AOCharMovie::play_frame_sfx() void AOCharMovie::realization_two_network_boogaloo() { int current_frame = m_movie->currentFrameNumber(); - QStringList fucking_garbage = this->frame_realization_hellstring.split("^"); - for (int i = 0; i < fucking_garbage.length(); i++) { - QString fucking_christ = fucking_garbage.at(i); - QStringList extra_garbage = fucking_christ.split("|"); + QStringList realizationList = this->frame_realization_hellstring.split("^"); + for (int i = 0; i < realizationList.length(); i++) { + QString screenshakeList = realizationList.at(i); + QStringList extra_garbage = screenshakeList.split("|"); if(extra_garbage.at(0) != current_emote){ continue; } @@ -108,10 +108,10 @@ void AOCharMovie::realization_two_network_boogaloo() void AOCharMovie::screenshake_two_network_boogaloo() { int current_frame = m_movie->currentFrameNumber(); - QStringList fucking_garbage = this->frame_screenshake_hellstring.split("^"); - for (int i = 0; i < fucking_garbage.length(); i++) { - QString fucking_christ = fucking_garbage.at(i); - QStringList extra_garbage = fucking_christ.split("|"); + QStringList realizationList = this->frame_screenshake_hellstring.split("^"); + for (int i = 0; i < realizationList.length(); i++) { + QString screenshakeList = realizationList.at(i); + QStringList extra_garbage = screenshakeList.split("|"); if(extra_garbage.at(0) != current_emote){ continue; } @@ -128,10 +128,10 @@ void AOCharMovie::screenshake_two_network_boogaloo() void AOCharMovie::sfx_two_network_boogaloo() { int current_frame = m_movie->currentFrameNumber(); - QStringList fucking_garbage = this->frame_sfx_hellstring.split("^"); - for (int i = 0; i < fucking_garbage.length(); i++) { - QString fucking_christ = fucking_garbage.at(i); - QStringList extra_garbage = fucking_christ.split("|"); + QStringList realizationList = this->frame_sfx_hellstring.split("^"); + for (int i = 0; i < realizationList.length(); i++) { + QString screenshakeList = realizationList.at(i); + QStringList extra_garbage = screenshakeList.split("|"); if(extra_garbage.at(0) != current_emote){ continue; } @@ -168,8 +168,9 @@ void AOCharMovie::movie_ticker() { m_movie->jumpToNextFrame(); } - this->LoadImageWithStupidMethodForFlipSupport(m_movie->currentImage()); // imagine if QT had sane stuff like "mirror on QMovie" or "resize the image on QT" or "interface with the current QMovie image" or anything else - // ps: fuck private functions/variables as a concept, freedom 2 do dangerous things 5ever + this->LoadImageWithStupidMethodForFlipSupport(m_movie->currentImage()); + // imagine if QT had sane stuff like "mirror on QMovie" or "resize the image on QT" or "interface with the current QMovie image" or anything else + this->play_frame_sfx(); if(!apng){ ticker->start(m_movie->nextFrameDelay()); @@ -180,7 +181,7 @@ void AOCharMovie::movie_ticker() void AOCharMovie::LoadImageWithStupidMethodForFlipSupport(QImage image) { QPixmap f_pixmap; - if(m_flipped) // imagine if QT wasn't handicapped harder than people who think MLP is good + if(m_flipped) f_pixmap = QPixmap::fromImage(image.mirrored(true, false)); else f_pixmap = QPixmap::fromImage(image); diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 054603d..e62f6c6 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -76,7 +76,7 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() misc_sfx_player->set_volume(0); frame_emote_sfx_player = new AOSfxPlayer(this, ao_app); frame_emote_sfx_player->set_volume(0); - pair_frame_emote_sfx_player = new AOSfxPlayer(this, ao_app); // todo: recode pair // todo: recode fucking everything + pair_frame_emote_sfx_player = new AOSfxPlayer(this, ao_app); // todo: recode pair pair_frame_emote_sfx_player->set_volume(0); blip_player = new AOBlipPlayer(this, ao_app); @@ -878,7 +878,7 @@ void Courtroom::set_background(QString p_background) } } -void Courtroom::set_character(int char_id) // can you fucking believe this didn't exist yet +void Courtroom::set_character(int char_id) { m_cid = char_id; @@ -1129,62 +1129,62 @@ void Courtroom::append_server_chatmessage(QString p_name, QString p_message, QSt ui_server_chatlog->append_chatmessage(p_name, p_message, colour); } -class AOFrameThreadingBullshitPre : public QRunnable +class AOFrameThreadingPre : public QRunnable { public: - Courtroom *mycourt_fuck; + Courtroom *thisCourtroom; int my_frameNumber; - AOFrameThreadingBullshitPre(Courtroom *my_courtroom, int frameNumber){ - mycourt_fuck = my_courtroom; + AOFrameThreadingPre(Courtroom *my_courtroom, int frameNumber){ + thisCourtroom = my_courtroom; my_frameNumber = frameNumber; } void run() { qDebug() << my_frameNumber << " FRAME NUMBER" << " from" << QThread::currentThread(); - QString sfx_to_play = mycourt_fuck->ao_app->get_frame_sfx_name(mycourt_fuck->current_char, mycourt_fuck->ao_app->get_pre_emote(mycourt_fuck->current_char, mycourt_fuck->current_emote), my_frameNumber); - QString screenshake_to_play = mycourt_fuck->ao_app->get_screenshake_frame(mycourt_fuck->current_char, mycourt_fuck->ao_app->get_pre_emote(mycourt_fuck->current_char, mycourt_fuck->current_emote), my_frameNumber); - QString realization_to_play = mycourt_fuck->ao_app->get_realization_frame(mycourt_fuck->current_char, mycourt_fuck->ao_app->get_pre_emote(mycourt_fuck->current_char, mycourt_fuck->current_emote), my_frameNumber); + QString sfx_to_play = thisCourtroom->ao_app->get_frame_sfx_name(thisCourtroom->current_char, thisCourtroom->ao_app->get_pre_emote(thisCourtroom->current_char, thisCourtroom->current_emote), my_frameNumber); + QString screenshake_to_play = thisCourtroom->ao_app->get_screenshake_frame(thisCourtroom->current_char, thisCourtroom->ao_app->get_pre_emote(thisCourtroom->current_char, thisCourtroom->current_emote), my_frameNumber); + QString realization_to_play = thisCourtroom->ao_app->get_realization_frame(thisCourtroom->current_char, thisCourtroom->ao_app->get_pre_emote(thisCourtroom->current_char, thisCourtroom->current_emote), my_frameNumber); if(sfx_to_play != "") { - mycourt_fuck->threading_sfx += "|" + QString::number(my_frameNumber) + "=" + sfx_to_play; + thisCourtroom->threading_sfx += "|" + QString::number(my_frameNumber) + "=" + sfx_to_play; } if(screenshake_to_play != "") { - mycourt_fuck->threading_shake += "|" + QString::number(my_frameNumber) + "=" + screenshake_to_play; + thisCourtroom->threading_shake += "|" + QString::number(my_frameNumber) + "=" + screenshake_to_play; } if(realization_to_play != "") { - mycourt_fuck->threading_flash += "|" + QString::number(my_frameNumber) + "=" + realization_to_play; + thisCourtroom->threading_flash += "|" + QString::number(my_frameNumber) + "=" + realization_to_play; } } }; -class AOFrameThreadingBullshit : public QRunnable +class AOFrameThreading : public QRunnable { public: - Courtroom *mycourt_fuck; + Courtroom *thisCourtroom; int my_frameNumber; - AOFrameThreadingBullshit(Courtroom *my_courtroom, int frameNumber){ - mycourt_fuck = my_courtroom; + AOFrameThreading(Courtroom *my_courtroom, int frameNumber){ + thisCourtroom = my_courtroom; my_frameNumber = frameNumber; } void run() { - QString sfx_to_play = mycourt_fuck->ao_app->get_frame_sfx_name(mycourt_fuck->current_char, mycourt_fuck->threading_prefix + mycourt_fuck->ao_app->get_emote(mycourt_fuck->current_char, mycourt_fuck->current_emote), my_frameNumber); - QString screenshake_to_play = mycourt_fuck->ao_app->get_screenshake_frame(mycourt_fuck->current_char, mycourt_fuck->threading_prefix + mycourt_fuck->ao_app->get_emote(mycourt_fuck->current_char, mycourt_fuck->current_emote), my_frameNumber); - QString realization_to_play = mycourt_fuck->ao_app->get_realization_frame(mycourt_fuck->current_char, mycourt_fuck->threading_prefix + mycourt_fuck->ao_app->get_emote(mycourt_fuck->current_char, mycourt_fuck->current_emote), my_frameNumber); + QString sfx_to_play = thisCourtroom->ao_app->get_frame_sfx_name(thisCourtroom->current_char, thisCourtroom->threading_prefix + thisCourtroom->ao_app->get_emote(thisCourtroom->current_char, thisCourtroom->current_emote), my_frameNumber); + QString screenshake_to_play = thisCourtroom->ao_app->get_screenshake_frame(thisCourtroom->current_char, thisCourtroom->threading_prefix + thisCourtroom->ao_app->get_emote(thisCourtroom->current_char, thisCourtroom->current_emote), my_frameNumber); + QString realization_to_play = thisCourtroom->ao_app->get_realization_frame(thisCourtroom->current_char, thisCourtroom->threading_prefix + thisCourtroom->ao_app->get_emote(thisCourtroom->current_char, thisCourtroom->current_emote), my_frameNumber); if(sfx_to_play != "") { - mycourt_fuck->threading_sfx += "|" + QString::number(my_frameNumber) + "=" + sfx_to_play; + thisCourtroom->threading_sfx += "|" + QString::number(my_frameNumber) + "=" + sfx_to_play; } if(screenshake_to_play != "") { - mycourt_fuck->threading_shake += "|" + QString::number(my_frameNumber) + "=" + screenshake_to_play; + thisCourtroom->threading_shake += "|" + QString::number(my_frameNumber) + "=" + screenshake_to_play; } if(realization_to_play != "") { - mycourt_fuck->threading_flash += "|" + QString::number(my_frameNumber) + "=" + realization_to_play; + thisCourtroom->threading_flash += "|" + QString::number(my_frameNumber) + "=" + realization_to_play; } } }; @@ -1393,7 +1393,7 @@ void Courtroom::on_chat_return_pressed() frame_emote_checker = new QMovie(this); frame_emote_checker->setFileName(preemote); frame_emote_checker->jumpToFrame(0); - qDebug() << "Premote fuck: " << frame_emote_checker->frameCount(); + qDebug() << "Premote: " << frame_emote_checker->frameCount(); preemote_sfx += ao_app->get_pre_emote(current_char, current_emote); preemote_shake += ao_app->get_pre_emote(current_char, current_emote); @@ -1404,7 +1404,7 @@ void Courtroom::on_chat_return_pressed() threading_flash = preemote_flash; for(int i=0; i < frame_emote_checker->frameCount(); i++){ - AOFrameThreadingBullshitPre *testfuck = new AOFrameThreadingBullshitPre(this, i); + AOFrameThreadingPre *testfuck = new AOFrameThreadingPre(this, i); QThreadPool::globalInstance()->start(testfuck); } QThreadPool::globalInstance()->waitForDone(); @@ -1425,7 +1425,7 @@ void Courtroom::on_chat_return_pressed() frame_emote_checker = new QMovie(this); frame_emote_checker->setFileName(talkemote_to_check); frame_emote_checker->jumpToFrame(0); - qDebug() << "TALK fuck: " << frame_emote_checker->frameCount(); + qDebug() << "Talk: " << frame_emote_checker->frameCount(); threading_sfx = talkemote_sfx; threading_shake = talkemote_shake; @@ -1433,7 +1433,7 @@ void Courtroom::on_chat_return_pressed() threading_prefix = QString("(b)"); for(int i=0; i < frame_emote_checker->frameCount(); i++){ - AOFrameThreadingBullshit *testfuck = new AOFrameThreadingBullshit(this, i); + AOFrameThreading *testfuck = new AOFrameThreading(this, i); QThreadPool::globalInstance()->start(testfuck); } QThreadPool::globalInstance()->waitForDone(); @@ -1455,14 +1455,14 @@ void Courtroom::on_chat_return_pressed() frame_emote_checker = new QMovie(this); frame_emote_checker->setFileName(idleemote_to_check); frame_emote_checker->jumpToFrame(0); - qDebug() << "idle fuck: " << frame_emote_checker->frameCount(); + qDebug() << "idle: " << frame_emote_checker->frameCount(); threading_sfx = idleemote_sfx; threading_shake = idleemote_shake; threading_flash = idleemote_flash; threading_prefix = QString("(a)"); for(int i=0; i < frame_emote_checker->frameCount(); i++){ - AOFrameThreadingBullshit *testfuck = new AOFrameThreadingBullshit(this, i); + AOFrameThreading *testfuck = new AOFrameThreading(this, i); QThreadPool::globalInstance()->start(testfuck); } QThreadPool::globalInstance()->waitForDone(); diff --git a/src/lobby.cpp b/src/lobby.cpp index 17a07a7..8744d6b 100644 --- a/src/lobby.cpp +++ b/src/lobby.cpp @@ -173,8 +173,8 @@ void Lobby::set_size_and_pos(QWidget *p_widget, QString p_identifier) } } -void Lobby::fucking_threading_goddamn_it(QString text){ - this->set_loading_text(text); +void Lobby::lobbyThreadHandler(QString loadingText){ + this->set_loading_text(loadingText); } void Lobby::set_loading_text(QString p_text) -- cgit From 9f5343e0bd93bc735bf6b4b4feea644ce8e048f8 Mon Sep 17 00:00:00 2001 From: sD Date: Fri, 21 Feb 2020 17:18:39 +0100 Subject: put the old char loading back --- src/packet_distribution.cpp | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp index 246166b..e0b91d8 100644 --- a/src/packet_distribution.cpp +++ b/src/packet_distribution.cpp @@ -323,6 +323,51 @@ void AOApplication::server_packet_received(AOPacket *p_packet) if (is_discord_enabled()) discord->state_server(server_name.toStdString(), hash.result().toBase64().toStdString()); } + else if (header == "CI") + { + if (!courtroom_constructed) + goto end; + + for (int n_element = 0 ; n_element < f_contents.size() ; n_element += 2) + { + if (f_contents.at(n_element).toInt() != loaded_chars) + break; + + //this means we are on the last element and checking n + 1 element will be game over so + if (n_element == f_contents.size() - 1) + break; + + QStringList sub_elements = f_contents.at(n_element + 1).split("&"); + if (sub_elements.size() < 2) + break; + + char_type f_char; + f_char.name = sub_elements.at(0); + f_char.description = sub_elements.at(1); + f_char.evidence_string = sub_elements.at(3); + //temporary. the CharsCheck packet sets this properly + f_char.taken = false; + + ++loaded_chars; + + w_lobby->set_loading_text("Loading chars:\n" + QString::number(loaded_chars) + "/" + QString::number(char_list_size)); + + w_courtroom->append_char(f_char); + + int total_loading_size = char_list_size * 2 + evidence_list_size + music_list_size; + int loading_value = int(((loaded_chars + generated_chars + loaded_music + loaded_evidence) / static_cast(total_loading_size)) * 100); + w_lobby->set_loading_value(loading_value); + } + + if (improved_loading_enabled) + send_server_packet(new AOPacket("RE#%")); + else + { + QString next_packet_number = QString::number(((loaded_chars - 1) / 10) + 1); + send_server_packet(new AOPacket("AN#" + next_packet_number + "#%")); + } + + } else if (header == "EI") { if (!courtroom_constructed) -- cgit From 87e359487d7e7d75cb696736f2a5da21d9648898 Mon Sep 17 00:00:00 2001 From: sD Date: Fri, 21 Feb 2020 17:57:46 +0100 Subject: combine these conditions --- src/courtroom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/courtroom.cpp b/src/courtroom.cpp index e62f6c6..64c288c 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -2374,7 +2374,7 @@ void Courtroom::chat_tick() f_message.remove(0,2); } - if (f_message.size() == 0) + if (f_message.size() == 0 || tick_pos >= f_message.size()) { text_state = 2; if (anim_state != 4) -- cgit From 2716416b62ce6ffec89d2a8b4b984b709cb5221a Mon Sep 17 00:00:00 2001 From: sD Date: Fri, 21 Feb 2020 18:00:23 +0100 Subject: only load bass plugins when bass is included --- include/courtroom.h | 2 ++ src/courtroom.cpp | 9 ++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/courtroom.h b/include/courtroom.h index 37d3f6f..4d271e4 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -688,7 +688,9 @@ private slots: void ping_server(); + #ifdef BASSAUDIO void load_bass_opus_plugin(); + #endif }; #endif // COURTROOM_H diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 64c288c..6510ca7 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -3955,30 +3955,25 @@ Courtroom::~Courtroom() delete blip_player; } - +#ifdef BASSAUDIO #if (defined (_WIN32) || defined (_WIN64)) void Courtroom::load_bass_opus_plugin() { - #ifdef BASSAUDIO BASS_PluginLoad("bassopus.dll", 0); - #endif } #elif (defined (LINUX) || defined (__linux__)) void Courtroom::load_bass_opus_plugin() { - #ifdef BASSAUDIO BASS_PluginLoad("libbassopus.so", 0); - #endif } #elif defined __APPLE__ void Courtroom::load_bass_opus_plugin() { QString libpath = ao_app->get_base_path() + "../../Frameworks/libbassopus.dylib"; QByteArray ba = libpath.toLocal8Bit(); - #ifdef BASSAUDIO BASS_PluginLoad(ba.data(), 0); - #endif } #else #error This operating system is unsupported for bass plugins. #endif +#endif -- cgit From 4580816f96a59ed4a7fb8b5f50f86022d97707a1 Mon Sep 17 00:00:00 2001 From: sD Date: Fri, 21 Feb 2020 18:29:36 +0100 Subject: character is a little nondescriptive for the button --- src/charselect.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/charselect.cpp b/src/charselect.cpp index b71d9b7..fb8b987 100644 --- a/src/charselect.cpp +++ b/src/charselect.cpp @@ -250,8 +250,8 @@ void Courtroom::character_loading_finished() // Later on, we'll be revealing buttons as we need them. for (int n = 0; n < char_list.size(); n++) { - AOCharButton* character = new AOCharButton(ui_char_buttons, ao_app, 0, 0, char_list.at(n).taken); - AOCharSelectGenerationThreading *char_generate = new AOCharSelectGenerationThreading(this, n, character); + AOCharButton* characterButton = new AOCharButton(ui_char_buttons, ao_app, 0, 0, char_list.at(n).taken); + AOCharSelectGenerationThreading *char_generate = new AOCharSelectGenerationThreading(this, n, characterButton); QThreadPool::globalInstance()->start(char_generate); if(QThreadPool::globalInstance()->activeThreadCount() == QThreadPool::globalInstance()->maxThreadCount()) { -- cgit From ed240c6ab010712bb67bdbbe37540c4d3d3b629d Mon Sep 17 00:00:00 2001 From: sD Date: Fri, 21 Feb 2020 18:33:04 +0100 Subject: same here --- src/charselect.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/charselect.cpp b/src/charselect.cpp index fb8b987..e0a3052 100644 --- a/src/charselect.cpp +++ b/src/charselect.cpp @@ -18,14 +18,14 @@ public: } void run() { - AOCharButton* character = char_button; - character->reset(); - character->hide(); - character->set_image(thisCourtroom->char_list.at(char_num).name); - thisCourtroom->ui_char_button_list.append(character); - - thisCourtroom->connect(character, SIGNAL(clicked()), thisCourtroom->char_button_mapper, SLOT(map())); - thisCourtroom->char_button_mapper->setMapping(character, thisCourtroom->ui_char_button_list.size() - 1); + AOCharButton* thisCharacterButton = char_button; + thisCharacterButton->reset(); + thisCharacterButton->hide(); + thisCharacterButton->set_image(thisCourtroom->char_list.at(char_num).name); + thisCourtroom->ui_char_button_list.append(thisCharacterButton); + + thisCourtroom->connect(thisCharacterButton, SIGNAL(clicked()), thisCourtroom->char_button_mapper, SLOT(map())); + thisCourtroom->char_button_mapper->setMapping(thisCharacterButton, thisCourtroom->ui_char_button_list.size() - 1); } }; -- cgit From b5c514100787d630c7d4f6eadad16734186c80f7 Mon Sep 17 00:00:00 2001 From: sD Date: Fri, 21 Feb 2020 18:47:46 +0100 Subject: make network debug depend on if its a debug build or not --- Attorney_Online.pro | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Attorney_Online.pro b/Attorney_Online.pro index 488ddd1..941f89b 100644 --- a/Attorney_Online.pro +++ b/Attorney_Online.pro @@ -34,6 +34,10 @@ contains(DEFINES, QTAUDIO) { QT += multimedia } +contains(CONFIG, qml_debug) { +DEFINES += DEBUG_NETWORK +} + macx:LIBS += -framework CoreFoundation -framework Foundation -framework CoreServices -- cgit From 0b16ac863cd3e90475e8bcb170a238350b060f20 Mon Sep 17 00:00:00 2001 From: sD Date: Sun, 23 Feb 2020 02:56:57 +0100 Subject: the charselect works again --- src/courtroom.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 6510ca7..61f74e9 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -63,6 +63,8 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() testimony_hide_timer = new QTimer(this); testimony_hide_timer->setSingleShot(true); + char_button_mapper = new QSignalMapper(this); + music_player = new AOMusicPlayer(this, ao_app); music_player->set_volume(0); -- cgit From 5cf1fdcc2dda1a6d9e7ec1261c8f20a9fbe79816 Mon Sep 17 00:00:00 2001 From: sD Date: Sun, 23 Feb 2020 03:13:07 +0100 Subject: connect the signal to char_clicked --- src/charselect.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/charselect.cpp b/src/charselect.cpp index e0a3052..1ea484a 100644 --- a/src/charselect.cpp +++ b/src/charselect.cpp @@ -97,6 +97,7 @@ void Courtroom::construct_char_select() set_size_and_pos(ui_char_buttons, "char_buttons"); + connect(char_button_mapper, SIGNAL(mapped(int)), this, SLOT(char_clicked(int))); connect(ui_back_to_lobby, SIGNAL(clicked()), this, SLOT(on_back_to_lobby_clicked())); connect(ui_char_select_left, SIGNAL(clicked()), this, SLOT(on_char_select_left_clicked())); -- cgit From 0123b4d1924a495827f91eef72f1427119cf1651 Mon Sep 17 00:00:00 2001 From: sD Date: Sun, 23 Feb 2020 03:19:05 +0100 Subject: move the click event back to the slots --- include/courtroom.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/courtroom.h b/include/courtroom.h index 4d271e4..41e88e7 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -560,7 +561,6 @@ private: void construct_char_select(); void set_char_select(); void set_char_select_page(); - void char_clicked(int n_char); void put_button_in_place(int starting, int chars_on_this_page); void filter_character_list(); @@ -682,6 +682,8 @@ private slots: void on_spectator_clicked(); + void char_clicked(int n_char); + void on_switch_area_music_clicked(); void on_casing_clicked(); -- cgit From 16bd89b6ada161e47b7acb8219e6c39c1baa3a1e Mon Sep 17 00:00:00 2001 From: sD Date: Sun, 23 Feb 2020 11:35:32 +0100 Subject: detect == as music start --- src/packet_distribution.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp index e0b91d8..ffc1b1c 100644 --- a/src/packet_distribution.cpp +++ b/src/packet_distribution.cpp @@ -529,7 +529,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet) } else { - if (f_contents.at(n_element).endsWith(".wav") || + if (f_contents.at(n_element).startsWith("==") || + f_contents.at(n_element).endsWith(".wav") || f_contents.at(n_element).endsWith(".mp3") || f_contents.at(n_element).endsWith(".mp4") || f_contents.at(n_element).endsWith(".ogg") || @@ -547,11 +548,6 @@ void AOApplication::server_packet_received(AOPacket *p_packet) } } - for (int area_n = 0; area_n < area_count; area_n++) - { - musics_time = true; - continue; - } AOPacketLoadMusicThreading *music_load = new AOPacketLoadMusicThreading(this, f_contents.at(n_element), musics_time); QThreadPool::globalInstance()->start(music_load); ++loaded_music; -- cgit From 444b0ff60f479b9fa0df6e7e6682c1f79b4025aa Mon Sep 17 00:00:00 2001 From: sD Date: Sun, 23 Feb 2020 11:43:41 +0100 Subject: replace music loading --- src/packet_distribution.cpp | 75 +++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 47 deletions(-) diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp index ffc1b1c..4bfc715 100644 --- a/src/packet_distribution.cpp +++ b/src/packet_distribution.cpp @@ -511,58 +511,39 @@ void AOApplication::server_packet_received(AOPacket *p_packet) } else if (header == "SM") { - if (!courtroom_constructed) - goto end; - - bool musics_time = false; - area_count = 0; + if (!courtroom_constructed) + goto end; - for (int n_element = 0 ; n_element < f_contents.size() ; ++n_element) - { - ++loaded_music; + bool musics_time = false; + area_count = 0; - w_lobby->set_loading_text(tr("Loading music:\n%1/%2").arg(QString::number(loaded_music)).arg(QString::number(music_list_size))); - - if (musics_time) - { - w_courtroom->append_music(f_contents.at(n_element)); - } - else - { - if (f_contents.at(n_element).startsWith("==") || - f_contents.at(n_element).endsWith(".wav") || - f_contents.at(n_element).endsWith(".mp3") || - f_contents.at(n_element).endsWith(".mp4") || - f_contents.at(n_element).endsWith(".ogg") || - f_contents.at(n_element).endsWith(".opus")) - { - musics_time = true; - // w_courtroom->fix_last_area(); - w_courtroom->append_music(f_contents.at(n_element)); - area_count--; - } - else + for (int n_element = 0 ; n_element < f_contents.size() ; ++n_element) { - w_courtroom->append_area(f_contents.at(n_element)); - area_count++; + if (!musics_time && (f_contents.at(n_element).startsWith("==") || + f_contents.at(n_element).endsWith(".wav") || + f_contents.at(n_element).endsWith(".mp3") || + f_contents.at(n_element).endsWith(".mp4") || + f_contents.at(n_element).endsWith(".ogg") || + f_contents.at(n_element).endsWith(".opus"))) + { + musics_time = true; + continue; + } + AOPacketLoadMusicThreading *music_load = new AOPacketLoadMusicThreading(this, f_contents.at(n_element), musics_time); + QThreadPool::globalInstance()->start(music_load); + ++loaded_music; + int total_loading_size = char_list_size * 2 + evidence_list_size + music_list_size; + int loading_value = int(((loaded_chars + generated_chars + loaded_music + loaded_evidence) / static_cast(total_loading_size)) * 100); + w_lobby->set_loading_value(loading_value); + w_lobby->set_loading_text("Loading music:\n" + QString::number(loaded_music) + "/" + QString::number(music_list_size)); + if(QThreadPool::globalInstance()->activeThreadCount() == QThreadPool::globalInstance()->maxThreadCount()) + { + QThreadPool::globalInstance()->waitForDone(); //out of order music is bad + } } - } - - AOPacketLoadMusicThreading *music_load = new AOPacketLoadMusicThreading(this, f_contents.at(n_element), musics_time); - QThreadPool::globalInstance()->start(music_load); - ++loaded_music; - int total_loading_size = char_list_size * 2 + evidence_list_size + music_list_size; - int loading_value = int(((loaded_chars + generated_chars + loaded_music + loaded_evidence) / static_cast(total_loading_size)) * 100); - w_lobby->set_loading_value(loading_value); - w_lobby->set_loading_text("Loading music:\n" + QString::number(loaded_music) + "/" + QString::number(music_list_size)); - if(QThreadPool::globalInstance()->activeThreadCount() == QThreadPool::globalInstance()->maxThreadCount()) - { - QThreadPool::globalInstance()->waitForDone(); //out of order music is bad - } - } - QThreadPool::globalInstance()->waitForDone(); + QThreadPool::globalInstance()->waitForDone(); - send_server_packet(new AOPacket("RD#%")); + send_server_packet(new AOPacket("RD#%")); } else if (header == "DONE") { -- cgit From 1291e776b628b6847045b18998c75c2afb474581 Mon Sep 17 00:00:00 2001 From: sD Date: Sun, 23 Feb 2020 12:25:10 +0100 Subject: handle all types of musiclists --- src/path_functions.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/path_functions.cpp b/src/path_functions.cpp index c2c15a2..72b7acc 100644 --- a/src/path_functions.cpp +++ b/src/path_functions.cpp @@ -96,22 +96,31 @@ QString AOApplication::get_sounds_path(QString p_file) QString AOApplication::get_music_path(QString p_song) { + QString withending_check = get_base_path() + "sounds/music/" + p_song; QString mp3_check = get_base_path() + "sounds/music/" + p_song + ".mp3"; QString opus_check = get_base_path() + "sounds/music/" + p_song + ".opus"; if (file_exists(opus_check)) { #ifndef CASE_SENSITIVE_FILESYSTEM - return get_base_path() + "sounds/music/" + p_song + ".opus"; + return opus_check; #else - return get_case_sensitive_path(get_base_path() + "sounds/music/" + p_song + ".opus"); + return get_case_sensitive_path(opus_check); #endif } else if (file_exists(mp3_check)) { #ifndef CASE_SENSITIVE_FILESYSTEM - return get_base_path() + "sounds/music/" + p_song + ".mp3"; + return mp3_check; #else - return get_case_sensitive_path(get_base_path() + "sounds/music/" + p_song + ".mp3"); + return get_case_sensitive_path(mp3_check); + #endif + } + else if (file_exists(withending_check)) + { + #ifndef CASE_SENSITIVE_FILESYSTEM + return withending_check; + #else + return get_case_sensitive_path(withending_check); #endif } #ifndef CASE_SENSITIVE_FILESYSTEM -- cgit From 4af8ba9c38fcab44fc29bf39299a8341ddbb389a Mon Sep 17 00:00:00 2001 From: sD Date: Sun, 23 Feb 2020 12:28:07 +0100 Subject: what was graphmeme even fot --- src/courtroom.cpp | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 61f74e9..953b050 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -2361,7 +2361,6 @@ void Courtroom::chat_tick() //do not perform heavy operations here QString f_message = m_chatmessage[MESSAGE]; - f_message.remove(0, tick_pos); // Due to our new text speed system, we always need to stop the timer now. chat_tick_timer->stop(); @@ -2376,7 +2375,7 @@ void Courtroom::chat_tick() f_message.remove(0,2); } - if (f_message.size() == 0 || tick_pos >= f_message.size()) + if (tick_pos >= f_message.size()) { text_state = 2; if (anim_state != 4) @@ -2388,21 +2387,9 @@ void Courtroom::chat_tick() else { - QTextBoundaryFinder tbf(QTextBoundaryFinder::Grapheme, f_message); - QString f_character; - int f_char_length; - - tbf.toNextBoundary(); - - if (tbf.position() == -1) - f_character = f_message; - else - f_character = f_message.left(tbf.position()); - - f_char_length = f_character.length(); + QString f_character = f_message.at(tick_pos); f_character = f_character.toHtmlEscaped(); - if (f_character == " ") ui_vp_message->insertPlainText(" "); @@ -2507,7 +2494,7 @@ void Courtroom::chat_tick() else { next_character_is_not_special = true; - tick_pos -= f_char_length; + tick_pos--; } } @@ -2528,7 +2515,7 @@ void Courtroom::chat_tick() else { next_character_is_not_special = true; - tick_pos -= f_char_length; + tick_pos--; } } @@ -2572,7 +2559,11 @@ void Courtroom::chat_tick() case INLINE_GREY: ui_vp_message->insertHtml("" + f_character + ""); break; + default: + ui_vp_message->insertHtml(f_character); + break; } + } else { @@ -2623,7 +2614,7 @@ void Courtroom::chat_tick() if(blank_blip) qDebug() << "blank_blip found true"; - if (f_character != ' ' || blank_blip) + if (f_message.at(tick_pos) != ' ' || blank_blip) { if (blip_pos % blip_rate == 0 && !formatting_char) @@ -2635,7 +2626,7 @@ void Courtroom::chat_tick() ++blip_pos; } - tick_pos += f_char_length; + ++tick_pos; // Restart the timer, but according to the newly set speeds, if there were any. // Keep the speed at bay. @@ -2662,7 +2653,6 @@ void Courtroom::chat_tick() } } - void Courtroom::show_testimony() { if (!testimony_in_progress || m_chatmessage[SIDE] != "wit") @@ -2862,6 +2852,8 @@ void Courtroom::handle_song(QStringList *p_contents) QString f_song_clear = f_song; int n_char = f_contents.at(1).toInt(); + qDebug() << "playing song "+f_song; + if (n_char < 0 || n_char >= char_list.size()) { music_player->play(f_song); -- cgit From 1d10cf1a08e992db68195a72f412490c415d3e09 Mon Sep 17 00:00:00 2001 From: sD Date: Sun, 23 Feb 2020 12:52:59 +0100 Subject: make UI buttons wider to make localizations fit --- base/themes/default/courtroom_design.ini | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/base/themes/default/courtroom_design.ini b/base/themes/default/courtroom_design.ini index f2dd2d7..d0495be 100644 --- a/base/themes/default/courtroom_design.ini +++ b/base/themes/default/courtroom_design.ini @@ -104,12 +104,12 @@ pos_dropdown = 200, 470, 80, 20 pre = 5, 490, 80, 21 ; Flip button -flip = 104, 490, 51, 21 +flip = 104, 490, 61, 21 ; Guard button guard = 200, 580, 81, 21 -pre_no_interrupt = 200, 490, 80, 21 +pre_no_interrupt = 200, 490, 85, 21 ; Penalty bars and judge's buttons for penalizing. Other than the bars, these ; ONLY show up on a character with /pos jud @@ -125,9 +125,9 @@ witness_testimony = 290, 470, 85, 42 cross_examination = 290, 515, 85, 42 ; Buttons to change character/Reload theme/Call Mod -change_character = 5, 610, 120, 23 -reload_theme = 5, 637, 94, 23 -call_mod = 104, 637, 64, 23 +change_character = 5, 610, 110, 23 +reload_theme = 5, 637, 110, 23 +call_mod = 120, 637, 90, 23 ; Mute button mute_button = 150, 515, 42, 42 @@ -198,11 +198,11 @@ ao2_ic_chat_name = 200, 534, 78, 23 ; This is useful if you suspect someone is impersonating others, for example, ; and they are using this in combination with ini-swapping to 'duplicate' a ; character. -showname_enable = 200, 510, 80, 21 +showname_enable = 200, 510, 85, 21 ; A simple button that opens up the settings menu. ; Equivalent to typing /settings in the OOC chat. -settings = 130, 610, 60, 23 +settings = 120, 610, 90, 23 ; The character search text input in the character selecton screen. ; The moment you enter some text, it immediately starts filtering. @@ -245,4 +245,4 @@ area_locked_color = 165, 43, 43 ; "casing_button" is an interface to help you announce a case (you have to be ; a CM first to be able to announce cases). casing = 200, 560, 80, 21 -casing_button = 173, 637, 60, 23 \ No newline at end of file +casing_button = 215, 637, 50, 23 \ No newline at end of file -- cgit From ea099a51418de869ac89284f4dd61eeb283271c9 Mon Sep 17 00:00:00 2001 From: sD Date: Sun, 23 Feb 2020 12:59:20 +0100 Subject: loading lost in translation --- src/courtroom.cpp | 2 +- src/packet_distribution.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 953b050..ecfc304 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -2835,7 +2835,7 @@ void Courtroom::set_ban(int p_cid) if (p_cid != m_cid && p_cid != -1) return; - call_notice("You have been banned."); + call_notice(tr("You have been banned.")); ao_app->construct_lobby(); ao_app->destruct_courtroom(); diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp index 4bfc715..d1c51bd 100644 --- a/src/packet_distribution.cpp +++ b/src/packet_distribution.cpp @@ -350,7 +350,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet) ++loaded_chars; - w_lobby->set_loading_text("Loading chars:\n" + QString::number(loaded_chars) + "/" + QString::number(char_list_size)); + w_lobby->set_loading_text(tr("Loading chars:\n%1/%2").arg(QString::number(loaded_chars)).arg(QString::number(char_list_size))); w_courtroom->append_char(f_char); @@ -535,7 +535,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet) int total_loading_size = char_list_size * 2 + evidence_list_size + music_list_size; int loading_value = int(((loaded_chars + generated_chars + loaded_music + loaded_evidence) / static_cast(total_loading_size)) * 100); w_lobby->set_loading_value(loading_value); - w_lobby->set_loading_text("Loading music:\n" + QString::number(loaded_music) + "/" + QString::number(music_list_size)); + w_lobby->set_loading_text(tr("Loading music:\n%1/%2").arg(QString::number(loaded_music)).arg(QString::number(music_list_size))); if(QThreadPool::globalInstance()->activeThreadCount() == QThreadPool::globalInstance()->maxThreadCount()) { QThreadPool::globalInstance()->waitForDone(); //out of order music is bad -- cgit From 3c30098360b2598dc049d779e4ffc6dbba0d1d44 Mon Sep 17 00:00:00 2001 From: sD Date: Sun, 23 Feb 2020 13:08:19 +0100 Subject: translate char not found --- src/charselect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/charselect.cpp b/src/charselect.cpp index 1ea484a..d6ee044 100644 --- a/src/charselect.cpp +++ b/src/charselect.cpp @@ -179,7 +179,7 @@ void Courtroom::char_clicked(int n_char) if (!file_exists(char_ini_path)) { - call_notice("Could not find " + char_ini_path); + call_notice(tr("Could not find %1").arg(char_ini_path, 1)); return; } -- cgit From aaf3f6f0432f6193dc97c38a9b9d3a4d61bb6a0f Mon Sep 17 00:00:00 2001 From: sD Date: Sun, 23 Feb 2020 13:08:31 +0100 Subject: thanks qt linguini --- resource/translations/ao_de.ts | 347 +++++++++++++++++++++++----------------- resource/translations/ao_en.ts | 350 +++++++++++++++++++++++----------------- resource/translations/ao_es.ts | 353 ++++++++++++++++++++++++----------------- resource/translations/ao_jp.ts | 348 +++++++++++++++++++++++----------------- resource/translations/ao_pl.ts | 351 +++++++++++++++++++++++----------------- resource/translations/ao_ru.ts | 351 +++++++++++++++++++++++----------------- 6 files changed, 1216 insertions(+), 884 deletions(-) diff --git a/resource/translations/ao_de.ts b/resource/translations/ao_de.ts index 1c0675b..4d800ad 100644 --- a/resource/translations/ao_de.ts +++ b/resource/translations/ao_de.ts @@ -27,67 +27,68 @@ Wir verwenden mehrere Master Server um Ausfälle zu verhindern, jedoch hat der C Bitte prüfe deine Internetverbindung und Firewall, und versuche es erneut. - + Outdated version! Your version: %1 Please go to aceattorneyonline.com to update. Version zu alt! Deine Version: %1 Bitte besuche aceattorneyonline.com für ein Update. - + You have been exiled from AO. Have a nice day. Du wurdest von AO befreit. Schönen Urlaub. - + Attorney Online 2 Attorney Online 2 - + Loading Laden - + Loading evidence: %1/%2 Lade Beweisstücke: %1/%2 - - + + Loading music: %1/%2 Lade Musik: %1/%2 - + + Loading chars: %1/%2 Lade Charaktere: %1/%2 - + You have been kicked from the server. Reason: %1 Du wurdest von diesem Server geschmissen. Grund: %1 - + You have been banned from the server. Reason: %1 Du wurdest von diesem Server verbannt. Grund: %1 - + You are banned on this server. Reason: %1 Du bist von diesem Server verbannt. @@ -151,271 +152,316 @@ Grund: Stenographer needed Stenograph benötigt + + + Witness needed + + AOOptionsDialog - + Settings Einstellungen - + Gameplay Spiel - + Theme: Theme: - + Sets the theme used in-game. If the new theme changes the lobby's look as well, you'll need to reload the lobby for the changes to take effect, such as by joining a server and leaving it. Setzt das Theme. Wenn das neue Theme auch das Aussehen der Lobby verändert, must du diese neu laden um die Änderungen zu sehen. - + Log goes downwards: Verlauf geht nach unten: - + If ticked, new messages will appear at the bottom (like the OOC chatlog). The traditional (AO1) behaviour is equivalent to this being unticked. Wenn angehakt werden neue Nachrichten unten erscheinen (wie beim OOC). Das traditionelle (AO1) Verhalten wäre nicht angehakt. - + Log length: Länge: - + The amount of messages the IC chatlog will keep before deleting older messages. A value of 0 or below counts as 'infinite'. Die Menge an Nachrichten die aufgehoben werden bevor alte gelöscht werden. 0 bedeutet unendlich. - + Default username: Standard Benutzername: - + Your OOC name will be automatically set to this value when you join a server. Dein OOC Name wird automatisch auf dies gesetzt. - + Custom shownames: Eigener Anzeigename: - + Gives the default value for the in-game 'Custom shownames' tickbox, which in turn determines whether the client should display custom in-character names. Standardwert für die Anzeigename Box, welche den In-Charakter Namen bestimmt. - + Backup MS: Rückfall MS: - + If the built-in server lookups fail, the game will try the address given here and use it as a backup master server address. Wenn dereingebaute Master Server fehlschlägt, wird das Spiel diesen hier verwenden. - + Discord: Discord: - + Allows others on Discord to see what server you are in, what character are you playing, and how long you have been playing for. Erlaubt anderen auf Discord zu sehen auf welchem Server du spielst, welchen Charakter du spielst und wie lange. + + + Allow Shake/Flash: + + + Allows screenshaking and flashing. Disable this if you have concerns or issues with photosensitivity and/or seizures. + + + + Language: Sprache: - + Sets the language if you don't want to use your system language. Setzte die Sprache falls du nicht die Systemsprache verwenden möchtest. - + Callwords Alarmwörter - + <html><head/><body>Enter as many callwords as you would like. These are case insensitive. Make sure to leave every callword in its own line!<br>Do not leave a line with a space at the end -- you will be alerted everytime someone uses a space in their messages.</body></html> <html><head/><body>Gib so viele Alarmwörter ein wie du möchtest. Groß/Kleinschreibung ist egal. Für jede Wort nur eine Zeile!<br>Bitte keine leere Zeile am Ende -- du bekommst sonst bei jeder Nachricht einen Alarm.</body></html> - + Audio Audio - + Audio device: Audiogerät: - + Sets the audio device for all sounds. Setzt das Audiogerät für all Geräusche. - + Music: Musik: - + Sets the music's default volume. Setzt die Musiklautstärke. - + SFX: SFX: - + Sets the SFX's default volume. Interjections and actual sound effects count as 'SFX'. Setzt die Lautstärke der Soundeffekte wie Einsprüche und die Geräusche der Charaktere. - + Blips: Blips: - + Sets the volume of the blips, the talking sound effects. Setzt die Lautstärke der Blips, das ist das Geräusch das die Charaktere beim Reden machen. - + Blip rate: Bliprate: - + Sets the delay between playing the blip sounds. Setzt die Pause zwischen einzelnen Blips. - + Blank blips: Leere Blips: - + If true, the game will play a blip sound even when a space is 'being said'. Wenn angehakt wird das Spiel auch bei einem Leerzeichen einen Blip machen. - + + Enable Looping SFX: + + + + + If true, the game will allow looping sound effects to play on preanimations. + + + + + Kill Music On Objection: + + + + + If true, the game will stop music when someone objects, like in the actual games. + + + + Casing Fälle - + This server supports case alerts. Dieser Server unterstützt Fallalarme. - + This server does not support case alerts. Dieser Server unterstützt Fallalarme nicht. - + Pretty self-explanatory. Eigentlich selbsterklärend. - + Casing: Fälle: - + If checked, you will get alerts about case announcements. Wenn angehakt wirst du benachrichtigt wenn ein Fall angekündigt wird. - + Defense: Verteidigung: - + If checked, you will get alerts about case announcements if a defense spot is open. Wenn angehakt wirst du benachrichtigt wenn ein Verteidiger benötigt wird. - + Prosecution: Kläger: - + If checked, you will get alerts about case announcements if a prosecutor spot is open. Wenn angehakt wirst du benachrichtigt wenn ein Kläger benötigt wird. - + Judge: Richter: - + If checked, you will get alerts about case announcements if the judge spot is open. Wenn angehakt wirst du benachrichtigt wenn ein Richter benötigt wird. - + Juror: Jury: - + If checked, you will get alerts about case announcements if a juror spot is open. Wenn angehakt wirst du benachrichtigt wenn eine Jury benötigt wird. - + Stenographer: Stenograph: - + If checked, you will get alerts about case announcements if a stenographer spot is open. Wenn angehakt wirst du benachrichtigt wenn ein Stenograph benötigt wird. - + CM: CM: - + If checked, you will appear amongst the potential CMs on the server. Wenn angehakt wirst du als potentielle CM angezeigt. - + + Witness: + + + + + If checked, you will appear amongst the potential witnesses on the server. + + + + Hosting cases: Fallleitung: - + If you're a CM, enter what cases you are willing to host. Wenn du CM bist, gib ein welche Fälle du spielen möchtest. @@ -423,36 +469,35 @@ Grund: Courtroom - + Password Passwort - + Spectator Zuschauer - - + + Search Suche - + Passworded Gesperrt - + Taken Benutzt - Generating chars: %1/%2 - Generiere Charaktere: + Generiere Charaktere: %1/%2 @@ -462,176 +507,182 @@ Grund: + Could not find %1 - Konnte %1 nicht finden. + Konnte %1 nicht finden. - + Showname Anzeigename - + Message Nachricht - + Name Name - + Pre Vor - + Flip Spiegeln - Guard - Wache + Wache - - + + Disable Modcalls + + + + + Casing Fall - + Shownames Anzeigenamen - + No Interrupt Keine Unterbrechung - + White Weiß - + Green Grün - + Red Rot - + Orange Orange - + Blue Blau - + Yellow Gelb - + Music Musik - + Sfx Sfx - + Blips Blips - + Log limit Verlaufsgrenze - - + + Server Server - + Change character Charakter ändern - + Reload theme Aussehen neu laden - + Call mod Moderator rufen - + Settings Einstellungen - + A/M A/M - + Preanim Voranimation - + Back to Lobby Zurück zur Lobby + You have been banned. - Du wurdest verbannt. + Du wurdest verbannt. %1 has played a song: %2 %1 hat ein Lied gespielt: %2 - + Rainbow Regenbogen - + Pink Pink - + Cyan Cyan - + % offset % Abstand - + You were granted the Guard button. Dir wurde der Wache Knopf gegeben. @@ -640,104 +691,104 @@ Grund: Dies bewirkt nichts, aber egal. - + This does nothing, but there you go. Dies bewirkt nichts, aber egal. - + You opened the settings menu. Du hast die Einstellungen geöffnet. - + You will now pair up with Du wirst nun mit - + if they also choose your character in return. gepaart, wenn der andere dies auch tut. - + You are no longer paired with anyone. Du bist nicht mehr gepaart. - + Are you sure you typed that well? The char ID could not be recognised. Hast du dich vertippt? Die ID konnte nicht erkannt werden. - + You have set your offset to Dein Abstand ist auf - + Your offset must be between -100% and 100%! Der Abstand muss zwischen -100% und 100% liegen! - + That offset does not look like one. Das sieht nicht wie ein Abstand aus. - + You switched your music and area list. Du hast zwischen Musik- und Gebitsliste umgeschaltet. - + You have forcefully enabled features that the server may not support. You may not be able to talk IC, or worse, because of this. Du hast Funktionen erzwungen die der Server eventuell nicht unterstützt. Möglicherweise wirst du nicht mehr sprechen können. - + Your pre-animations interrupt again. Deine Voranimation unterbrechen nun Text. - + Your pre-animations will not interrupt text. Deine Voranimation unterbrechen Text nicht. - + Couldn't open chatlog.txt to write into. Konnte chatlog.txt nicht öffnen. - + The IC chatlog has been saved. Der IC Verlauf wurde gespeichert. - + You don't have a `base/cases/` folder! It was just made for you, but seeing as it WAS just made for you, it's likely the case file you're looking for can't be found in there. Du hattest keinen 'base/cases' Ordner! Ich hab ihn nun angelegt aber bedenke das er leer sein wird. - + You need to give a filename to load (extension not needed)! Make sure that it is in the `base/cases/` folder, and that it is a correctly formatted ini. Cases you can load: %1 Du musst einen Dateinamen angeben (ohne .ini). Stelle sicher das er im 'base/cases' Ordner ist und das er korrekt formatiert ist. Verfügbare Fälle: %1 - + Case made by %1. Fall von %1. - + Navigate to %1 for the CM doc. Gehe zu %1 für das CM Dokument. - + Your case "%1" was loaded! Dein Fall "%1" wurde geladen! @@ -748,7 +799,7 @@ Cases you can load: Verfügbare Fälle: - + Too many arguments to load a case! You only need one filename, without extension. Zu viele Argumente! Du brauchst nur den Dateinamen, ohne Erweiterung. @@ -773,53 +824,53 @@ Verfügbare Fälle: " wurde geladen! - + You don't have a `base/cases/` folder! It was just made for you, but seeing as it WAS just made for you, it's likely that you somehow deleted it. Du hattest keinen 'base/cases' Ordner! Ich hab ihn nun angelegt aber bedenke das er leer sein wird. - + You need to give a filename to save (extension not needed) and the courtroom status! Du musst einen Dateinamen (ohne Erweiterung) angebenn, sowie den Gebietsstatus! - + Too many arguments to save a case! You only need a filename without extension and the courtroom status! Zu viele Argumente! Du brauchst nur den Dateinamen, ohne Erweiterung sowie den Gebietsstatus! - + Succesfully saved, edit doc and cmdoc link on the ini! Erfolgreich gespeichert! - + Master Master - + Reason: Grund: - + Call Moderator Moderator rufen - - + + Error Fehler - + You must provide a reason. Du musst einen Grund angeben. - + The message is too long. Die Nachricht ist zu lang. @@ -883,34 +934,34 @@ Verfügbare Fälle: Name - + It doesn't look like your client is set up correctly. Did you download all resources correctly from tiny.cc/getao, including the large 'base' folder? Dein Client ist nicht korrekt eingerichtet. Hast du ALLES von tiny.cc/getao heruntergeladen und entpackt, auch den großen 'base' Ordner? - + Version: %1 Version: %1 - + Loading Laden - + Cancel Abbrechen - + <h2>Attorney Online %1</h2>The courtroom drama simulator<p><b>Source code:</b> <a href='https://github.com/AttorneyOnline/AO2-Client'>https://github.com/AttorneyOnline/AO2-Client</a><p><b>Major development:</b><br>OmniTroid, stonedDiscord, longbyte1, gameboyprinter, Cerapter<p><b>Special thanks:</b><br>Remy, Iamgoofball, Hibiki, Qubrick (webAO), Ruekasu (UI design), Draxirch (UI design), Unishred, Argoneus (tsuserver), Fiercy, Noevain, Cronnicossy <h2>Attorney Online %1</h2>Der Gerichtsdrama Simulator<p><b>Quelltext:</b> <a href='https://github.com/AttorneyOnline/AO2-Client'>https://github.com/AttorneyOnline/AO2-Client</a><p><b>Leitende Entwicklung:</b><br>OmniTroid, stonedDiscord, longbyte1, gameboyprinter, Cerapter<p><b>Danksagungen:</b><br>Remy, Iamgoofball, Hibiki, Qubrick (webAO), Ruekasu (UI design), Draxirch (UI design), Unishred, Argoneus (tsuserver), Fiercy, Noevain, Cronnicossy - + Online: %1/%2 Online: %1/%2 @@ -955,8 +1006,8 @@ Noevain Cronnicossy - - + + Offline Offline diff --git a/resource/translations/ao_en.ts b/resource/translations/ao_en.ts index b917a41..7ea610b 100644 --- a/resource/translations/ao_en.ts +++ b/resource/translations/ao_en.ts @@ -21,60 +21,61 @@ Please check your Internet connection and firewall, and please try again. - + Outdated version! Your version: %1 Please go to aceattorneyonline.com to update. - + You have been exiled from AO. Have a nice day. - + Attorney Online 2 - + Loading - + Loading evidence: %1/%2 - - + + Loading music: %1/%2 - + + Loading chars: %1/%2 - + You have been kicked from the server. Reason: %1 - + You have been banned from the server. Reason: %1 - + You are banned on this server. Reason: %1 @@ -117,271 +118,316 @@ Reason: %1 Stenographer needed + + + Witness needed + + AOOptionsDialog - + Settings - + Gameplay - + Theme: - + Sets the theme used in-game. If the new theme changes the lobby's look as well, you'll need to reload the lobby for the changes to take effect, such as by joining a server and leaving it. - + Log goes downwards: - + If ticked, new messages will appear at the bottom (like the OOC chatlog). The traditional (AO1) behaviour is equivalent to this being unticked. - + Log length: - + The amount of messages the IC chatlog will keep before deleting older messages. A value of 0 or below counts as 'infinite'. - + Default username: - + Your OOC name will be automatically set to this value when you join a server. - + Custom shownames: - + Gives the default value for the in-game 'Custom shownames' tickbox, which in turn determines whether the client should display custom in-character names. - + Backup MS: - + If the built-in server lookups fail, the game will try the address given here and use it as a backup master server address. - + Discord: - + Allows others on Discord to see what server you are in, what character are you playing, and how long you have been playing for. + + + Allow Shake/Flash: + + + Allows screenshaking and flashing. Disable this if you have concerns or issues with photosensitivity and/or seizures. + + + + Language: - + Sets the language if you don't want to use your system language. - + Callwords - + <html><head/><body>Enter as many callwords as you would like. These are case insensitive. Make sure to leave every callword in its own line!<br>Do not leave a line with a space at the end -- you will be alerted everytime someone uses a space in their messages.</body></html> - + Audio - + Audio device: - + Sets the audio device for all sounds. - + Music: - + Sets the music's default volume. - + SFX: - + Sets the SFX's default volume. Interjections and actual sound effects count as 'SFX'. - + Blips: - + Sets the volume of the blips, the talking sound effects. - + Blip rate: - + Sets the delay between playing the blip sounds. - + Blank blips: - + If true, the game will play a blip sound even when a space is 'being said'. - + + Enable Looping SFX: + + + + + If true, the game will allow looping sound effects to play on preanimations. + + + + + Kill Music On Objection: + + + + + If true, the game will stop music when someone objects, like in the actual games. + + + + Casing - + This server supports case alerts. - + This server does not support case alerts. - + Pretty self-explanatory. - + Casing: - + If checked, you will get alerts about case announcements. - + Defense: - + If checked, you will get alerts about case announcements if a defense spot is open. - + Prosecution: - + If checked, you will get alerts about case announcements if a prosecutor spot is open. - + Judge: - + If checked, you will get alerts about case announcements if the judge spot is open. - + Juror: - + If checked, you will get alerts about case announcements if a juror spot is open. - + Stenographer: - + If checked, you will get alerts about case announcements if a stenographer spot is open. - + CM: - + If checked, you will appear amongst the potential CMs on the server. - + + Witness: + + + + + If checked, you will appear amongst the potential witnesses on the server. + + + + Hosting cases: - + If you're a CM, enter what cases you are willing to host. @@ -389,353 +435,357 @@ Reason: %1 Courtroom - + Password - + Spectator - - + + Search - + Passworded - + Taken - - Generating chars: -%1/%2 + + Could not find %1 - + Showname - + Message - + Name - + Pre - + Flip - - Guard - - - - - + + Casing - + Shownames - + No Interrupt - + White - + Green - + Red - + Orange - + Blue - + Yellow - + This does nothing, but there you go. - + You need to give a filename to load (extension not needed)! Make sure that it is in the `base/cases/` folder, and that it is a correctly formatted ini. Cases you can load: %1 - + Case made by %1. - + Navigate to %1 for the CM doc. - + Your case "%1" was loaded! - - + + Server - + Back to Lobby - + Rainbow - + + Disable Modcalls + + + + Pink - + Cyan - + % offset - + Music - + Sfx - + Blips - + Log limit - + Change character - + Reload theme - + Call mod - + Settings - + A/M - + Preanim - + + You have been banned. + + + + You were granted the Guard button. - + You opened the settings menu. - + You will now pair up with - + if they also choose your character in return. - + You are no longer paired with anyone. - + Are you sure you typed that well? The char ID could not be recognised. - + You have set your offset to - + Your offset must be between -100% and 100%! - + That offset does not look like one. - + You switched your music and area list. - + You have forcefully enabled features that the server may not support. You may not be able to talk IC, or worse, because of this. - + Your pre-animations interrupt again. - + Your pre-animations will not interrupt text. - + Couldn't open chatlog.txt to write into. - + The IC chatlog has been saved. - + You don't have a `base/cases/` folder! It was just made for you, but seeing as it WAS just made for you, it's likely the case file you're looking for can't be found in there. - + Too many arguments to load a case! You only need one filename, without extension. - + You don't have a `base/cases/` folder! It was just made for you, but seeing as it WAS just made for you, it's likely that you somehow deleted it. - + You need to give a filename to save (extension not needed) and the courtroom status! - + Too many arguments to save a case! You only need a filename without extension and the courtroom status! - + Succesfully saved, edit doc and cmdoc link on the ini! - + Master - + Reason: - + Call Moderator - - + + Error - + You must provide a reason. - + The message is too long. @@ -768,39 +818,39 @@ Cases you can load: %1 - + It doesn't look like your client is set up correctly. Did you download all resources correctly from tiny.cc/getao, including the large 'base' folder? - + Version: %1 - + Loading - + Cancel - + <h2>Attorney Online %1</h2>The courtroom drama simulator<p><b>Source code:</b> <a href='https://github.com/AttorneyOnline/AO2-Client'>https://github.com/AttorneyOnline/AO2-Client</a><p><b>Major development:</b><br>OmniTroid, stonedDiscord, longbyte1, gameboyprinter, Cerapter<p><b>Special thanks:</b><br>Remy, Iamgoofball, Hibiki, Qubrick (webAO), Ruekasu (UI design), Draxirch (UI design), Unishred, Argoneus (tsuserver), Fiercy, Noevain, Cronnicossy - + Online: %1/%2 - - + + Offline diff --git a/resource/translations/ao_es.ts b/resource/translations/ao_es.ts index 9c14710..aefae56 100644 --- a/resource/translations/ao_es.ts +++ b/resource/translations/ao_es.ts @@ -1,6 +1,6 @@ - + AOApplication @@ -22,66 +22,67 @@ Please check your Internet connection and firewall, and please try again.Hubo un error al obtener la lista de servidores. Verifique su conexión a Internet y firewall, y vuelva a intentarlo. - + Outdated version! Your version: %1 Please go to aceattorneyonline.com to update. ¡Versión desactualizada! Su versión: %1 Vaya a aceattorneyonline.com para actualizar. - + You have been exiled from AO. Have a nice day. Has sido exiliado de AO. Que tengas un buen día. - + Attorney Online 2 Attorney Online 2 - + Loading Cargando - + Loading evidence: %1/%2 Cargando evidencia: %1/%2 - - + + Loading music: %1/%2 Cargando música: %1/%2 - + + Loading chars: %1/%2 Cargando personajes: %1/%2 - + You have been kicked from the server. Reason: %1 Has sido expulsado del servidor. Razón: %1 - + You have been banned from the server. Reason: %1 Has sido bloqueado de este servidor. Razón: %1 - + You are banned on this server. Reason: %1 Has sido bloqueado en este servidor. @@ -137,271 +138,316 @@ Razón: Stenographer needed Se necesita taquígrafo + + + Witness needed + + AOOptionsDialog - + Settings Ajustes - + Gameplay Jugabilidad - + Theme: Tema visual: - + Sets the theme used in-game. If the new theme changes the lobby's look as well, you'll need to reload the lobby for the changes to take effect, such as by joining a server and leaving it. Establece el tema visual utilizado en el juego. Si el nuevo tema también cambia el aspecto del lobby, deberá volver a cargar el lobby para que los cambios surtan efecto, como unirse a un servidor y volver al lobby. - + Log goes downwards: Invertir historial IC: - + If ticked, new messages will appear at the bottom (like the OOC chatlog). The traditional (AO1) behaviour is equivalent to this being unticked. Si está marcado, los nuevos mensajes aparecerán en la parte inferior (como el chat OOC). - + Log length: Limite del historial: - + The amount of messages the IC chatlog will keep before deleting older messages. A value of 0 or below counts as 'infinite'. La cantidad de mensajes que mantendrá el historial del chat IC antes de eliminar mensajes más antiguos. 0 significa 'infinito'. - + Default username: Usuario predeterminado: - + Your OOC name will be automatically set to this value when you join a server. Su nombre OOC se establecerá automáticamente a este cuando se una a un servidor. - + Custom shownames: Mostrar nombres: - + Gives the default value for the in-game 'Custom shownames' tickbox, which in turn determines whether the client should display custom in-character names. Activa la casilla 'Mostrar nombres' de forma predeterminada en el juego, que a su vez determina si el cliente debe mostrar nombres personalizados en los personajes. - + Backup MS: Master SV de respaldo: - + If the built-in server lookups fail, the game will try the address given here and use it as a backup master server address. Si la lista de servidores predeterminada falla, el juego probará la dirección proporcionada aquí. - + Discord: Discord: - + Allows others on Discord to see what server you are in, what character are you playing, and how long you have been playing for. Permite a otros en Discord ver en qué servidor estás, qué personaje juegas y cuánto tiempo has estado jugando. + + + Allow Shake/Flash: + + + Allows screenshaking and flashing. Disable this if you have concerns or issues with photosensitivity and/or seizures. + + + + Language: Idioma: - + Sets the language if you don't want to use your system language. Establece el idioma si no desea utilizar el idioma de su sistema. - + Callwords Palabras clave - + <html><head/><body>Enter as many callwords as you would like. These are case insensitive. Make sure to leave every callword in its own line!<br>Do not leave a line with a space at the end -- you will be alerted everytime someone uses a space in their messages.</body></html> <html><head/><body>Ingrese tantas palabras de llamada como desee.<br>Esto no distingue entre mayúsculas y minúsculas. ¡Asegúrese de dejar cada palabra en su propia línea!<br>No deje una línea con un espacio al final; recibirá una alerta cada vez que alguien use un espacio en sus mensajes.</body></html> - + Audio Audio - + Audio device: Dispositivo: - + Sets the audio device for all sounds. Establece el dispositivo de audio. - + Music: Música: - + Sets the music's default volume. Establece el volumen predeterminado de la música. - + SFX: SFX: - + Sets the SFX's default volume. Interjections and actual sound effects count as 'SFX'. Establece el volumen predeterminado de SFX. Las interjecciones y los efectos de sonido reales cuentan como 'SFX'. - + Blips: Blips: - + Sets the volume of the blips, the talking sound effects. Establece el volumen de los blips, el sonido al hablar. - + Blip rate: Tasa de blips: - + Sets the delay between playing the blip sounds. Establece el retraso entre la reproducción de los sonidos blip. - + Blank blips: Blips en blanco: - + If true, the game will play a blip sound even when a space is 'being said'. Si está marcada, el juego reproducirá un sonido blip incluso cuando se 'dice' un espacio. - + + Enable Looping SFX: + + + + + If true, the game will allow looping sound effects to play on preanimations. + + + + + Kill Music On Objection: + + + + + If true, the game will stop music when someone objects, like in the actual games. + + + + Casing Caso - + This server supports case alerts. Este servidor admite alertas de casos. - + This server does not support case alerts. Este servidor no admite alertas de casos. - + Pretty self-explanatory. Bastante autoexplicativo. - + Casing: Caso: - + If checked, you will get alerts about case announcements. Si está marcado, recibirá anuncios de casos. - + Defense: Abogado: - + If checked, you will get alerts about case announcements if a defense spot is open. Si está marcado, recibirá alertas sobre anuncios de casos si hay un lugar de abogado libre. - + Prosecution: Fiscal: - + If checked, you will get alerts about case announcements if a prosecutor spot is open. Si está marcada, recibirá alertas sobre anuncios de casos si hay un puesto de fiscal libre. - + Judge: Juez: - + If checked, you will get alerts about case announcements if the judge spot is open. Si está marcado, recibirá alertas sobre anuncios de casos si el puesto de juez está libre. - + Juror: Jurado: - + If checked, you will get alerts about case announcements if a juror spot is open. Si está marcado, recibirá alertas sobre anuncios de casos si hay un puesto de jurado libre. - + Stenographer: Taquígrafo: - + If checked, you will get alerts about case announcements if a stenographer spot is open. Si está marcado, recibirá alertas sobre anuncios de casos si hay un lugar de taquígrafo libre. - + CM: CM: - + If checked, you will appear amongst the potential CMs on the server. Si está marcado, aparecerá entre los posibles CM en el servidor. - + + Witness: + + + + + If checked, you will appear amongst the potential witnesses on the server. + + + + Hosting cases: Casos: - + If you're a CM, enter what cases you are willing to host. Si eres un CM, ingresa qué casos estás dispuesto a organizar. @@ -409,36 +455,40 @@ Razón: Courtroom - + Password Contraseña - + Spectator Espectador - - + + Search Buscar - + Passworded Contraseña - + Taken En uso - + + Could not find %1 + + + Generating chars: %1/%2 - Generando personajes: + Generando personajes: %1/%2 @@ -448,260 +498,264 @@ Razón: - + Showname - + Message Mensaje - + Name Nombre - + Pre - + Flip - Guard - Guardia + Guardia - - + + Casing Caso - + Shownames - + No Interrupt - + White Blanco - + Green Verde - + Red Rojo - + Orange Naranja - + Blue Azul - + Yellow Amarillo - + Rainbow Arcoíris - + Pink Rosado - + Cyan Cian - + % offset % desplazamiento - + Music - + Sfx - + Blips - + Log limit - + Change character - + Reload theme - + Call mod - + Settings Ajustes - + A/M A/M - + Preanim - + Back to Lobby Volver al lobby - + + You have been banned. + + + + You were granted the Guard button. Te ha sido otorgado el botón Guardia. - + This does nothing, but there you go. Esto no hace nada, pero ahí lo tienes. - + You opened the settings menu. Abriste el menú de configuración. - + You will now pair up with Ahora te emparejarás con - + if they also choose your character in return. si ellos también eligen a tu personaje a cambio. - + You are no longer paired with anyone. Ya no estás emparejado con nadie. - + Are you sure you typed that well? The char ID could not be recognised. ¿Estás seguro de que lo escribiste bien? El ID de personaje no pudo ser reconocido. - + You have set your offset to Ha configurado su desplazamiento en - + Your offset must be between -100% and 100%! ¡Su desplazamiento debe estar entre -100% y 100%! - + That offset does not look like one. Ese desplazamiento no se parece a uno. - + You switched your music and area list. Cambiaste tu lista de música y área. - + You have forcefully enabled features that the server may not support. You may not be able to talk IC, or worse, because of this. Ha habilitado forzosamente funciones que el servidor puede no admitir. Es posible que no pueda hablar IC, o peor, debido a esto. - + Your pre-animations interrupt again. Sus pre-animaciones interrumpen de nuevo. - + Your pre-animations will not interrupt text. Sus pre-animaciones no interrumpirán el texto. - + Couldn't open chatlog.txt to write into. No se pudo abrir chatlog.txt para escribir. - + The IC chatlog has been saved. El chat IC se ha guardado. - + You don't have a `base/cases/` folder! It was just made for you, but seeing as it WAS just made for you, it's likely the case file you're looking for can't be found in there. ¡No tienes una carpeta `base/cases /`! Ha sido creada para ti. Pero debido a que no existia la carpeta, tampoco habían casos guardados ahí. - + You need to give a filename to load (extension not needed)! Make sure that it is in the `base/cases/` folder, and that it is a correctly formatted ini. Cases you can load: %1 ¡Debe dar un nombre de archivo para cargar (no se necesita extensión)! Asegúrese de que esté en la carpeta `base/cases/` y de que tenga el formato correcto. Casos que puede cargar: %1 - + Case made by %1. Caso hecho por %1. - + Navigate to %1 for the CM doc. Navegue a %1 para el documento del CM. - + Your case "%1" was loaded! Su caso "%1" fue cargado! @@ -712,7 +766,7 @@ Cases you can load: Casos que puede cargar: - + Too many arguments to load a case! You only need one filename, without extension. ¡Demasiados argumentos para cargar un caso! Solo necesita un nombre de archivo, sin extensión. @@ -737,60 +791,65 @@ Casos que puede cargar: " fue cargado! - + You don't have a `base/cases/` folder! It was just made for you, but seeing as it WAS just made for you, it's likely that you somehow deleted it. ¡No tienes una carpeta `base/cases /`! Fue creada para ti. - + You need to give a filename to save (extension not needed) and the courtroom status! ¡Debe dar un nombre de archivo para guardar (no se necesita la extensión) y el estado de la sala del tribunal! - + Too many arguments to save a case! You only need a filename without extension and the courtroom status! why two exclamations, seems excesive. ¡Demasiados argumentos para salvar un caso! Solo necesita un nombre de archivo sin extensión y el estado de la sala del tribunal. - + Succesfully saved, edit doc and cmdoc link on the ini! ¡Guardado con éxito, puede editar el doc y doc link en el archivo ini! - + Master - - + + Server - + + Disable Modcalls + + + + Reason: Razón: - + Call Moderator Llamar Moderador - - + + Error Error - + You must provide a reason. Debes proporcionar una razón. - + The message is too long. El mensaje es muy largo. @@ -823,40 +882,40 @@ Casos que puede cargar: Nombre - + It doesn't look like your client is set up correctly. Did you download all resources correctly from tiny.cc/getao, including the large 'base' folder? No parece que su cliente esté configurado correctamente. ¿Descargó todos los recursos correctamente desde tiny.cc/getao, incluida la gran carpeta 'base'? - + Version: %1 Versión: %1 - + Loading Cargando - + Cancel Cancelar - + <h2>Attorney Online %1</h2>The courtroom drama simulator<p><b>Source code:</b> <a href='https://github.com/AttorneyOnline/AO2-Client'>https://github.com/AttorneyOnline/AO2-Client</a><p><b>Major development:</b><br>OmniTroid, stonedDiscord, longbyte1, gameboyprinter, Cerapter<p><b>Special thanks:</b><br>Remy, Iamgoofball, Hibiki, Qubrick (webAO), Ruekasu (UI design), Draxirch (UI design), Unishred, Argoneus (tsuserver), Fiercy, Noevain, Cronnicossy <h2>Attorney Online %1</h2>El simulador de drama legal<p><b>Código fuente:</b> <a href='https://github.com/AttorneyOnline/AO2-Client'>https: //github.com/AttorneyOnline/AO2-Client</a><p><b>Desarrollo mayor:</b> <br>OmniTroid, stonedDiscord, longbyte1, gameboyprinter, Cerapter<p><b>Agradecimiento especial:</b><br>Remy, Iamgoofball, Hibiki, Qubrick (webAO), Ruekasu (diseño de interfaz de usuario), Draxirch (diseño de interfaz de usuario), Unishred, Argoneus (tsuserver), Fiercy, Noevain, Cronnicossy - + Online: %1/%2 En línea: %1/%2 - - + + Offline Fuera de línea diff --git a/resource/translations/ao_jp.ts b/resource/translations/ao_jp.ts index 4f8153a..5e1e8b8 100644 --- a/resource/translations/ao_jp.ts +++ b/resource/translations/ao_jp.ts @@ -21,60 +21,61 @@ Please check your Internet connection and firewall, and please try again. - + Outdated version! Your version: %1 Please go to aceattorneyonline.com to update. - + You have been exiled from AO. Have a nice day. - + Attorney Online 2 - + Loading ロード中 - + Loading evidence: %1/%2 証拠がロード中: %1/%2 - - + + Loading music: %1/%2 音楽がロード中: %1/%2 - + + Loading chars: %1/%2 キャラがロード中: %1/%2 - + You have been kicked from the server. Reason: %1 - + You have been banned from the server. Reason: %1 - + You are banned on this server. Reason: %1 @@ -117,271 +118,316 @@ Reason: %1 Stenographer needed + + + Witness needed + + AOOptionsDialog - + Settings - + Gameplay - + Theme: - + Sets the theme used in-game. If the new theme changes the lobby's look as well, you'll need to reload the lobby for the changes to take effect, such as by joining a server and leaving it. - + Log goes downwards: - + If ticked, new messages will appear at the bottom (like the OOC chatlog). The traditional (AO1) behaviour is equivalent to this being unticked. - + Log length: - + The amount of messages the IC chatlog will keep before deleting older messages. A value of 0 or below counts as 'infinite'. - + Default username: - + Your OOC name will be automatically set to this value when you join a server. - + Custom shownames: - + Gives the default value for the in-game 'Custom shownames' tickbox, which in turn determines whether the client should display custom in-character names. - + Backup MS: - + If the built-in server lookups fail, the game will try the address given here and use it as a backup master server address. - + Discord: - + Allows others on Discord to see what server you are in, what character are you playing, and how long you have been playing for. + + + Allow Shake/Flash: + + + Allows screenshaking and flashing. Disable this if you have concerns or issues with photosensitivity and/or seizures. + + + + Language: - + Sets the language if you don't want to use your system language. - + Callwords - + <html><head/><body>Enter as many callwords as you would like. These are case insensitive. Make sure to leave every callword in its own line!<br>Do not leave a line with a space at the end -- you will be alerted everytime someone uses a space in their messages.</body></html> - + Audio - + Audio device: - + Sets the audio device for all sounds. - + Music: 音楽: - + Sets the music's default volume. - + SFX: 効果音: - + Sets the SFX's default volume. Interjections and actual sound effects count as 'SFX'. - + Blips: ブリップ: - + Sets the volume of the blips, the talking sound effects. - + Blip rate: - + Sets the delay between playing the blip sounds. - + Blank blips: - + If true, the game will play a blip sound even when a space is 'being said'. - + + Enable Looping SFX: + + + + + If true, the game will allow looping sound effects to play on preanimations. + + + + + Kill Music On Objection: + + + + + If true, the game will stop music when someone objects, like in the actual games. + + + + Casing - + This server supports case alerts. - + This server does not support case alerts. - + Pretty self-explanatory. - + Casing: - + If checked, you will get alerts about case announcements. - + Defense: - + If checked, you will get alerts about case announcements if a defense spot is open. - + Prosecution: - + If checked, you will get alerts about case announcements if a prosecutor spot is open. - + Judge: - + If checked, you will get alerts about case announcements if the judge spot is open. - + Juror: - + If checked, you will get alerts about case announcements if a juror spot is open. - + Stenographer: - + If checked, you will get alerts about case announcements if a stenographer spot is open. - + CM: - + If checked, you will appear amongst the potential CMs on the server. - + + Witness: + + + + + If checked, you will appear amongst the potential witnesses on the server. + + + + Hosting cases: - + If you're a CM, enter what cases you are willing to host. @@ -389,353 +435,361 @@ Reason: %1 Courtroom - + Password - + Spectator 観客 - - + + Search - + Passworded - + Taken - - Generating chars: -%1/%2 + + Could not find %1 - + Showname - + Message - + Name 名前 - + Pre 前 - + Flip フリップ - Guard - ガード + ガード - - + + Casing - + Shownames - + No Interrupt - + White 白 - + Green 緑 - + Red 赤 - + Orange オレンジ - + Blue 青 - + Yellow 黄色 - + This does nothing, but there you go. - + You need to give a filename to load (extension not needed)! Make sure that it is in the `base/cases/` folder, and that it is a correctly formatted ini. Cases you can load: %1 - + Case made by %1. - + Navigate to %1 for the CM doc. - + Your case "%1" was loaded! - - + + Server - + Back to Lobby ロビーに戻る - + Rainbow 虹 - + + Disable Modcalls + + + + Pink - + Cyan - + % offset - + Music 音楽 - + Sfx 効果音 - + Blips ブリップ - + Log limit - + Change character - + Reload theme - + Call mod - + Settings - + A/M - + Preanim - + + You have been banned. + + + + You were granted the Guard button. - + You opened the settings menu. - + You will now pair up with - + if they also choose your character in return. - + You are no longer paired with anyone. - + Are you sure you typed that well? The char ID could not be recognised. - + You have set your offset to - + Your offset must be between -100% and 100%! - + That offset does not look like one. - + You switched your music and area list. - + You have forcefully enabled features that the server may not support. You may not be able to talk IC, or worse, because of this. - + Your pre-animations interrupt again. - + Your pre-animations will not interrupt text. - + Couldn't open chatlog.txt to write into. - + The IC chatlog has been saved. - + You don't have a `base/cases/` folder! It was just made for you, but seeing as it WAS just made for you, it's likely the case file you're looking for can't be found in there. - + Too many arguments to load a case! You only need one filename, without extension. - + You don't have a `base/cases/` folder! It was just made for you, but seeing as it WAS just made for you, it's likely that you somehow deleted it. - + You need to give a filename to save (extension not needed) and the courtroom status! - + Too many arguments to save a case! You only need a filename without extension and the courtroom status! - + Succesfully saved, edit doc and cmdoc link on the ini! - + Master マスター - + Reason: - + Call Moderator モデレーターを呼ぶ - - + + Error エラー - + You must provide a reason. - + The message is too long. @@ -791,39 +845,39 @@ Cases you can load: %1 名前 - + It doesn't look like your client is set up correctly. Did you download all resources correctly from tiny.cc/getao, including the large 'base' folder? - + Version: %1 - + Loading ロード中 - + Cancel キャンセル - + <h2>Attorney Online %1</h2>The courtroom drama simulator<p><b>Source code:</b> <a href='https://github.com/AttorneyOnline/AO2-Client'>https://github.com/AttorneyOnline/AO2-Client</a><p><b>Major development:</b><br>OmniTroid, stonedDiscord, longbyte1, gameboyprinter, Cerapter<p><b>Special thanks:</b><br>Remy, Iamgoofball, Hibiki, Qubrick (webAO), Ruekasu (UI design), Draxirch (UI design), Unishred, Argoneus (tsuserver), Fiercy, Noevain, Cronnicossy - + Online: %1/%2 - - + + Offline オフライン diff --git a/resource/translations/ao_pl.ts b/resource/translations/ao_pl.ts index 307c604..720288e 100644 --- a/resource/translations/ao_pl.ts +++ b/resource/translations/ao_pl.ts @@ -23,67 +23,68 @@ Używamy wielu głównych serwerów, aby zminimalizować każdą możliwą przer Proszę sprawdzić swoje połączenie internetowe oraz zaporę ogniową i spróbować ponownie. - + Outdated version! Your version: %1 Please go to aceattorneyonline.com to update. Nieaktualna wersja! Twoja wersja: %1 Proszę udać się do aceattorneyonline.com, aby zaktualizować. - + You have been exiled from AO. Have a nice day. Zostałeś wygnany z AO2. Życzę miłego dnia. - + Attorney Online 2 - + Loading Ładowanie - + Loading evidence: %1/%2 Ładowanie dowodów: %1/%2 - - + + Loading music: %1/%2 Ładowanie muzyki: %1/%2 - + + Loading chars: %1/%2 Ładowanie postaci: %1/%2 - + You have been kicked from the server. Reason: %1 Zostałeś wyrzucony z tego serwera. Powód: %1 - + You have been banned from the server. Reason: %1 Zostałeś zbanowany z tego serwera. Powód: %1 - + You are banned on this server. Reason: %1 Jesteś zbanowany na tym serwerze. @@ -127,272 +128,317 @@ Powód: %1 Stenographer needed Potrzebny stenograf + + + Witness needed + + AOOptionsDialog - + Settings Ustawienia - + Gameplay Rozgrywka - + Theme: Motyw: - + Sets the theme used in-game. If the new theme changes the lobby's look as well, you'll need to reload the lobby for the changes to take effect, such as by joining a server and leaving it. Ustawia motyw używany w grze. Jeżeli nowy motyw równiesz zmienia wygląd poczekalni, musisz odświeżyć poczekalnię, aby zmiany zaczęły działać, np. poprzez dołączenie do serwera i wyjście z niego. - + Log goes downwards: Dziennik idzie w dół: - + If ticked, new messages will appear at the bottom (like the OOC chatlog). The traditional (AO1) behaviour is equivalent to this being unticked. Jeżeli zaznaczone, nowe wiadomości zaczną się pojawiać na dole (tak jak na czacie OOC). Tradycyjne (AO1) zachowanie jest równoważne do tego bycia nie zaznaczonym. - + Log length: Długość dziennika: - + The amount of messages the IC chatlog will keep before deleting older messages. A value of 0 or below counts as 'infinite'. Ilość wiadomości, jakie czat IC będzie zostawiał zanim usunie starsze wiadomości. Wartośc 0 albo niżej, liczy się jako 'nieskończone'. - + Default username: Domyślna nazwa użytkownika: - + Your OOC name will be automatically set to this value when you join a server. Twoja nazwa OOC będzie ustawiana automatycznie do tej wartości, kiedy dołączysz na serwer. - + Custom shownames: Niestandardowe ksywki: - + Gives the default value for the in-game 'Custom shownames' tickbox, which in turn determines whether the client should display custom in-character names. Daje domyślną wartość przyciskowi wyboru 'Niestandardowe ksywki', który określa czy klient powinien pokazywać niestandardowe IC nazwy. - + Backup MS: Kopia zapasowa głównego serwera: - + If the built-in server lookups fail, the game will try the address given here and use it as a backup master server address. Jeśli wbudowane szukanie serwerów zawiedzie, gra spróbuje użyć adresu podanego tutaj i użyje go jako adresu zapasowego głównego serwera. - + Discord: - + Allows others on Discord to see what server you are in, what character are you playing, and how long you have been playing for. Pozwala innym na Discordzie zobaczyć na jakim serwerze się znajdujesz, jaką postać używasz i jak długo grałeś. + + + Allow Shake/Flash: + + + Allows screenshaking and flashing. Disable this if you have concerns or issues with photosensitivity and/or seizures. + + + + Language: Język: - + Sets the language if you don't want to use your system language. Ustawia język, jeśli nie chcesz używać języka systemowego. - + Callwords Zawołania - + <html><head/><body>Enter as many callwords as you would like. These are case insensitive. Make sure to leave every callword in its own line!<br>Do not leave a line with a space at the end -- you will be alerted everytime someone uses a space in their messages.</body></html> <html><head/><body>Wpisz tyle zawołań, ile dusza zapragnie. Wielkość liter nie ma znaczenia. Miej na uwadze, aby każde zawołanie było na swojej lini!<br>Nie zostawiaj spacji na końcu -- zostaniesz zaalarmowany za każdym razem, kiedy ktoś użyje spacji w swojej wiadomości.</body></html> - + Audio Dźwięk - + Audio device: Urządzenie dźwiękowe: - + Sets the audio device for all sounds. Ustawia urządzenie dźwiękowe na wszystkie dźwięki. - + Music: Muzyka: - + Sets the music's default volume. Ustawia domyślną głośność muzyki. - + SFX: Efekty dźwiękowe (SFX): - + Sets the SFX's default volume. Interjections and actual sound effects count as 'SFX'. Ustawia domyślną głośność efektów specjalnych (SFX). Wtrącenia się i same efekty specjalne są zaliczane jako 'SFX'. - + Blips: Blipy: - + Sets the volume of the blips, the talking sound effects. Ustawia głośność blipów, efektów dźwiękowych mówienia. - + Blip rate: Szybkość blipów: - + Sets the delay between playing the blip sounds. Ustawia opóźnienie pomiędzy graniem blipów. - + Blank blips: The 'blip' isn't an accurate polish representation of this english word. Puste blipy: - + If true, the game will play a blip sound even when a space is 'being said'. Jeśli prawdziwe, gra zagra dźwięk blip za każdym razem spacja 'jest mówiona'. - + + Enable Looping SFX: + + + + + If true, the game will allow looping sound effects to play on preanimations. + + + + + Kill Music On Objection: + + + + + If true, the game will stop music when someone objects, like in the actual games. + + + + Casing Rozprawa - + This server supports case alerts. Ten serwer wspiera komunikaty rozpraw. - + This server does not support case alerts. Ten serwer nie wspiera komunikatów rozpraw. - + Pretty self-explanatory. Dosyć oczywiste. - + Casing: Rozprawy: - + If checked, you will get alerts about case announcements. Jeżeli zaznaczone, dostaniesz komunikaty o ogłoszeniach rozpraw. - + Defense: Obrona: - + If checked, you will get alerts about case announcements if a defense spot is open. Jeżeli zaznaczone, dostaniesz komunikaty o ogłoszeniach rozpraw, jeśli miejsce obrony jest otwarte. - + Prosecution: Prokuratura: - + If checked, you will get alerts about case announcements if a prosecutor spot is open. Jeżeli zaznaczone, dostaniesz komunikaty o ogłoszeniach rozpraw, jeśli miejsce prokuratury jest otwarte. - + Judge: Sędzia: - + If checked, you will get alerts about case announcements if the judge spot is open. Jeśli zaznaczone, dostaniesz komunikaty o ogłoszeniach rozpraw, jeśli miejsce sędzi jest otwarte. - + Juror: Ławnik: - + If checked, you will get alerts about case announcements if a juror spot is open. Jeśli zaznaczone, dostaniesz komunikaty o ogłoszeniach rozpraw, jeśli miejsce ławnika jest otwarte. - + Stenographer: Stenograf: - + If checked, you will get alerts about case announcements if a stenographer spot is open. Jeśli zaznaczone, dostaniesz komunikaty o ogłoszeniach rozpraw, jeśli miejsce stenografa jest otwarte. - + CM: Mistrz rozpraw (CM): - + If checked, you will appear amongst the potential CMs on the server. Jeśli zaznaczone, pojawisz się wśród potencjalnych mistrzów rozpraw (CM) na serwerze. - + + Witness: + + + + + If checked, you will appear amongst the potential witnesses on the server. + + + + Hosting cases: Hostowane rozprawy: - + If you're a CM, enter what cases you are willing to host. Jeśli jesteś mistrzem rozpraw (CM), wpisz jakie rozprawy jesteś chętny hostowania. @@ -400,356 +446,369 @@ Powód: %1 Courtroom - + Password Hasło - + Spectator Widz - - + + Search Wyszukaj - + Passworded Zahasłowany - + Taken Zajęty - + + Could not find %1 + + + Generating chars: %1/%2 - Generowanie postaci: + Generowanie postaci: %1.%2 - + Showname Ksywka - + Message Wiadomość - + Name Nazwa - + Pre przed- - + Flip Odwróć - Guard - Na Służbie (mod) + Na Służbie (mod) - - + + Casing Rozprawa - + Shownames Ksywki - + No Interrupt Bez przerwy - + White Biały - + Green Zielony - + Red Czerwony - + Orange Pomarańczowy - + Blue Niebieski - + Yellow Żółty - + This does nothing, but there you go. To nic nie robi, ale proszę bardzo. - + You need to give a filename to load (extension not needed)! Make sure that it is in the `base/cases/` folder, and that it is a correctly formatted ini. Cases you can load: %1 Musisz podać nazwę pliku, którego chcesz załadować (rozszerzenie nie potrzebne!) Upewnij się, że jest w folderze `base/cases/` i że jest to poprawnie sformatowane ini. Rozprawy które możesz załadować: %1 - + Case made by %1. Rozprawa zrobiona przez %1. - + Navigate to %1 for the CM doc. Przejdź do %1, aby dojść do dokumentu CM. - + Your case "%1" was loaded! Twoja rozprawa "%1" została wczytana! - - + + Server Serwer - + Back to Lobby Powrót do poczekalni - + Rainbow Tęczowy - + + Disable Modcalls + + + + Pink Różowy - + Cyan Turkusowy - + % offset % wyrówanie - + Music Muzyka - + Sfx Sfx - + Blips Blipy - + Log limit Limit dziennika - + Change character Zmiena postaci - + Reload theme Odśwież motyw - + Call mod Wezwij moda - + Settings Ustawienia - + A/M O meaning 'Obszar' and M meaning 'Muzyka'. O/M - + Preanim przed-animacja - + + You have been banned. + + + + You were granted the Guard button. Zostałeś obdarzonym przyciskiem Na Służbie. - + You opened the settings menu. Otworzyłeś opcje. - + You will now pair up with Będzie teraz w parze z - + if they also choose your character in return. jeżeli oni również wybiorą ciebie spowrotem. - + You are no longer paired with anyone. Nie jesteś już w parze z kimkolwiek. - + Are you sure you typed that well? The char ID could not be recognised. Czy jesteś pewien, że dobrze to napisałeś? ID postaci nie zostało rozpoznane. - + You have set your offset to Musisz ustawić swoje wyrównanie do - + Your offset must be between -100% and 100%! Twoje wyrównanie musi być między -100%, a 100%! - + That offset does not look like one. To wyrównanie nie wygląda na jedno. - + You switched your music and area list. Przełączyłeś swoją listę obszarów i muzyki. - + You have forcefully enabled features that the server may not support. You may not be able to talk IC, or worse, because of this. Włączyłeś funkcje, które ten serwer może nie wspierać. Możliwe że, nie możesz rozmawiać na czacie IC lub gorzej przez to. - + Your pre-animations interrupt again. Twoje przed-animacje przerywają tekst spowrotem. - + Your pre-animations will not interrupt text. Twoje przed-animacje nie będą przerywać tekstu. - + Couldn't open chatlog.txt to write into. Nie można było otworzyć chatlog.txt, aby zapisać do niego. - + The IC chatlog has been saved. Dziennik czatu IC został zapisany. - + You don't have a `base/cases/` folder! It was just made for you, but seeing as it WAS just made for you, it's likely the case file you're looking for can't be found in there. Nie masz folderu `base/cases/`! Został zrobiony tylko dla ciebie, ale widząc, że ZOSTAŁ zrobiony tylko dla ciebie, prawdopodobnie plik rozpraw, którego szukasz nie został znaleziony tutaj. - + Too many arguments to load a case! You only need one filename, without extension. Za dużo parametrów, aby załadować rozprawę! Potrzebujesz tylko jedną nazwę pliku, bez rozszerzenia nazwy pliku. - + You don't have a `base/cases/` folder! It was just made for you, but seeing as it WAS just made for you, it's likely that you somehow deleted it. Nie masz folderu `base/cases/`! Został zrobiony tylko dla ciebie, ale widząc, że ZOSTAŁ zrobiony tylko dla ciebie, prawdopodobnie jakoś usunąłeś go. - + You need to give a filename to save (extension not needed) and the courtroom status! Musisz podać nazwę pliku, aby go zapisać (rozszerzenie nie potrzebne) i status sali sądowej! - + Too many arguments to save a case! You only need a filename without extension and the courtroom status! Za dużo parametrów, aby zapisać rozprawę! Potrzebujesz tylko jedną nazwę pliku, bez rozszerzenia nazwy pliku i statusu sali sądowej! - + Succesfully saved, edit doc and cmdoc link on the ini! Zapisano pomyślnie, edytuj dokument i link cmdoc w .ini! - + Master Główny - + Reason: Powód: - + Call Moderator Wezwij Moderatora - - + + Error Błąd - + You must provide a reason. Musisz podać przyczynę. - + The message is too long. Ta wiadomość jest za długa. @@ -782,40 +841,40 @@ Rozprawy które możesz załadować: %1 Nazwa - + It doesn't look like your client is set up correctly. Did you download all resources correctly from tiny.cc/getao, including the large 'base' folder? Wygłąda na to, że twój klient nie jest ustawiony poprawnie. Czy pobrałeś wszystkie zasoby poprawnie z tiny.cc/getao, włączając duży folder 'base'? - + Version: %1 Wersja: %1 - + Loading Ładowanie - + Cancel Anuluj - + <h2>Attorney Online %1</h2>The courtroom drama simulator<p><b>Source code:</b> <a href='https://github.com/AttorneyOnline/AO2-Client'>https://github.com/AttorneyOnline/AO2-Client</a><p><b>Major development:</b><br>OmniTroid, stonedDiscord, longbyte1, gameboyprinter, Cerapter<p><b>Special thanks:</b><br>Remy, Iamgoofball, Hibiki, Qubrick (webAO), Ruekasu (UI design), Draxirch (UI design), Unishred, Argoneus (tsuserver), Fiercy, Noevain, Cronnicossy <h2>Attorney Online: %1</h2>Symulator dramy sądowej<p><b>Kod żródłowy:</b> <a href='https://github.com/AttorneyOnline/AO2-Client'>https://github.com/AttorneyOnline/AO2-Client</a><p><b>Główny rozwój:</b><br>OmniTroid, stonedDiscord, longbyte1, gameboyprinter, Cerapter<p><b>Szczególne podziękowania:</b><br>Remy, Iamgoofball, Hibiki, Qubrick (webAO), Ruekasu (UI design), Draxirch (UI design), Unishred, Argoneus (tsuserver), Fiercy, Noevain, Cronnicossy - + Online: %1/%2 - - + + Offline diff --git a/resource/translations/ao_ru.ts b/resource/translations/ao_ru.ts index 9714c9d..da481ae 100644 --- a/resource/translations/ao_ru.ts +++ b/resource/translations/ao_ru.ts @@ -22,66 +22,67 @@ Please check your Internet connection and firewall, and please try again. - + Outdated version! Your version: %1 Please go to aceattorneyonline.com to update. Устаревшая версия! У вас установлена %1 Проследуйте на сайт aceattorneyonline.com для обновления. - + You have been exiled from AO. Have a nice day. Из AO вас отправили в жизнь. Хорошего дня. - + Attorney Online 2 Attorney Online 2 - + Loading Загрузка - + Loading evidence: %1/%2 Загрузка вещдоков: %1/%2 - - + + Loading music: %1/%2 Загрузка музыки: %1/%2 - + + Loading chars: %1/%2 Загрузка персонажей: %1/%2 - + You have been kicked from the server. Reason: %1 Вас выпнули с сервера. Причина: %1 - + You have been banned from the server. Reason: %1 - + You are banned on this server. Reason: %1 Вас отправили в баню. @@ -137,271 +138,316 @@ Reason: Stenographer needed Нужен стенографист? + + + Witness needed + + AOOptionsDialog - + Settings Настройки - + Gameplay Игра - + Theme: Тема: - + Sets the theme used in-game. If the new theme changes the lobby's look as well, you'll need to reload the lobby for the changes to take effect, such as by joining a server and leaving it. Устанавливает внешний вид игры. Может понадобиться перезайти на сервер. - + Log goes downwards: Портянку вниз: - + If ticked, new messages will appear at the bottom (like the OOC chatlog). The traditional (AO1) behaviour is equivalent to this being unticked. Отметьте галочку, если хотите, чтобы сообщения в игровом чате отображались снизу, а не сверху. - + Log length: Длина игрового чата: - + The amount of messages the IC chatlog will keep before deleting older messages. A value of 0 or below counts as 'infinite'. Количество сообщений, максимально хранимых в игровом чате. Значение, равное 0 или меньше, будет расценено как снятие такого ограничения. - + Default username: Никнейм по умолчанию: - + Your OOC name will be automatically set to this value when you join a server. Псевдоним, используемый при соединении с сервером. В основном, его видно в чате сервера. - + Custom shownames: Произвольные имена: - + Gives the default value for the in-game 'Custom shownames' tickbox, which in turn determines whether the client should display custom in-character names. Отображать произвольные имена персонажей, установленные самими игроками. - + Backup MS: Запасной ГС: - + If the built-in server lookups fail, the game will try the address given here and use it as a backup master server address. Отображать перечень серверов от главного сервера, указанного здесь, когда не удалось соединиться с первичным ГС. - + Discord: Discord: - + Allows others on Discord to see what server you are in, what character are you playing, and how long you have been playing for. Показать в Discord сервер, на котором вы играете, каким персонажем управляете и время игры. + + + Allow Shake/Flash: + + + Allows screenshaking and flashing. Disable this if you have concerns or issues with photosensitivity and/or seizures. + + + + Language: Язык: - + Sets the language if you don't want to use your system language. - + Callwords Позывные - + <html><head/><body>Enter as many callwords as you would like. These are case insensitive. Make sure to leave every callword in its own line!<br>Do not leave a line with a space at the end -- you will be alerted everytime someone uses a space in their messages.</body></html> <html><head/><body>Введите на отдельных строках свои позывные, при указании которых в сообщениях будет подан звуковой сигнал.</body></html> - + Audio Аудио - + Audio device: Устройство воспроизведения: - + Sets the audio device for all sounds. Куда вещать звук из игры. - + Music: Музыка: - + Sets the music's default volume. Громкость музыки по умолчанию. - + SFX: Звук. эффекты: - + Sets the SFX's default volume. Interjections and actual sound effects count as 'SFX'. Громкость звуковых эффектов по умолчанию. - + Blips: Сигналы: - + Sets the volume of the blips, the talking sound effects. Громкость сигналов, заменяющих голос, по умолчанию. - + Blip rate: Пер. сигналов: - + Sets the delay between playing the blip sounds. Период между сигналами, заменяющими голос, по умолчанию. - + Blank blips: Пустые сигналы: - + If true, the game will play a blip sound even when a space is 'being said'. Проигрывать сигналы даже для пробелов. - + + Enable Looping SFX: + + + + + If true, the game will allow looping sound effects to play on preanimations. + + + + + Kill Music On Objection: + + + + + If true, the game will stop music when someone objects, like in the actual games. + + + + Casing Заседание - + This server supports case alerts. Этот сервер поддерживает объявление заседания. - + This server does not support case alerts. Этот сервер не поддерживает объявление заседания. - + Pretty self-explanatory. Весьма доходчиво. - + Casing: Новое дело: - + If checked, you will get alerts about case announcements. При заведении дела вы получите уведомление. - + Defense: Защита: - + If checked, you will get alerts about case announcements if a defense spot is open. При заведении дела, в котором нужна сторона защиты, вы получите уведомление. - + Prosecution: Обвинение: - + If checked, you will get alerts about case announcements if a prosecutor spot is open. При заведении дела, в котором нужна сторона обвинения, вы получите уведомление. - + Judge: Судья: - + If checked, you will get alerts about case announcements if the judge spot is open. При заведении дела, в котором нужен судья, вы получите уведомление. - + Juror: Присяжный: - + If checked, you will get alerts about case announcements if a juror spot is open. При заведении дела, в котором нужны присяжные заседатели, вы получите уведомление. - + Stenographer: Стенографист: - + If checked, you will get alerts about case announcements if a stenographer spot is open. При заведении дела, в котором нужна стенография, вы получите уведомление. - + CM: ПД: - + If checked, you will appear amongst the potential CMs on the server. Отметьте, если вы хотите состоять в числе производителей дел. - + + Witness: + + + + + If checked, you will appear amongst the potential witnesses on the server. + + + + Hosting cases: ПД акт.: - + If you're a CM, enter what cases you are willing to host. Будучи производителем дела (ПД), вы можете войти в зону и заниматься её оркестровкой. @@ -409,36 +455,40 @@ Reason: Courtroom - + Password Пароль - + Spectator Наблюдатель - - + + Search Поиск - + Passworded Ограничен паролем - + Taken Занят - + + Could not find %1 + + + Generating chars: %1/%2 - Генерация персонажей: + Генерация персонажей: %1/%2 @@ -448,322 +498,331 @@ Reason: - + Showname Имя - + Message Сообщение - + Name Никнейм - + Pre Пред. - + Flip Разв. - Guard - Охрана + Охрана - - + + Casing Дело - + Shownames Произв. имена - + No Interrupt Говорить сразу - + White Белый - + Green Зелëный - + Red Красный - + Orange Оранжевый - + Blue Синий - + Yellow Жëлтый - + This does nothing, but there you go. В общем-то, это ни на что не влияет... - + You need to give a filename to load (extension not needed)! Make sure that it is in the `base/cases/` folder, and that it is a correctly formatted ini. Cases you can load: %1 Укажите имя файла с делом (без расширения) для загрузки. Убедитесь, что оно расположено в папке `base/cases`. Были найдены: %1 - + Case made by %1. Дело завëл игрок: %1. - + Navigate to %1 for the CM doc. Перейдите к %1 для получения материалов дела. - + Your case "%1" was loaded! Дело под кодовым названием "%1" готово! - - + + Server Сервер - + Back to Lobby Назад в лобби - + Rainbow Радужный - + + Disable Modcalls + + + + Pink Розовый - + Cyan Голубой - + % offset % сдвига - + Music Музыка - + Sfx Звук. эффекты - + Blips Сигналы - + Log limit - + Change character - + Reload theme - + Call mod - + Settings Настройки - + A/M - + Preanim - + + You have been banned. + + + + You were granted the Guard button. Теперь у вас есть кнопка "Охрана". - + You opened the settings menu. Вы открыли меню настроек. - + You will now pair up with Вы встанете парой с персонажем по имени - + if they also choose your character in return. (если он выберет вас в ответ). - + You are no longer paired with anyone. Теперь вы не стоите в парах. - + Are you sure you typed that well? The char ID could not be recognised. Кажется, вам нужно поменять запрос: такой идентификатор персонажа не был найден. - + You have set your offset to Вы установили сдвиг персонажа на - + Your offset must be between -100% and 100%! Сдвиг персонажа должен быть между -100% и 100%! - + That offset does not look like one. Неверный сдвиг персонажа. - + You switched your music and area list. Вы переключили перечень зон и музыки. - + You have forcefully enabled features that the server may not support. You may not be able to talk IC, or worse, because of this. Из-за того, что вы включили не поддержимаемые сервером возможности, он может не принять ваши сообщения. - + Your pre-animations interrupt again. Персонаж будет говорить только после анимации. - + Your pre-animations will not interrupt text. Персонаж будет говорить и во время анимации. - + Couldn't open chatlog.txt to write into. Не могу открыть `chatlog.txt` для записи лога. - + The IC chatlog has been saved. Лог игрового чата сохранëн. - + You don't have a `base/cases/` folder! It was just made for you, but seeing as it WAS just made for you, it's likely the case file you're looking for can't be found in there. Файл с делом не найден. Если найдëте, положите его в папку `base/cases/`, которую мы для вас создали. - + Too many arguments to load a case! You only need one filename, without extension. Введите имя файла без расширения. - + You don't have a `base/cases/` folder! It was just made for you, but seeing as it WAS just made for you, it's likely that you somehow deleted it. Папка `base/cases/` отсутствует! - + You need to give a filename to save (extension not needed) and the courtroom status! Введите имя файла (без расширения) и предоставьте статус зоны. - + Too many arguments to save a case! You only need a filename without extension and the courtroom status! Убедитесь, что имя файла не содержит расширение. - + Succesfully saved, edit doc and cmdoc link on the ini! Сохранение прошло успешно! - + Master Мастер - + Reason: Причина: - + Call Moderator Позвать модератора - - + + Error Ошибка - + You must provide a reason. Укажите причину. - + The message is too long. Слишком длинный текст. @@ -796,40 +855,40 @@ Cases you can load: %1 Никнейм - + It doesn't look like your client is set up correctly. Did you download all resources correctly from tiny.cc/getao, including the large 'base' folder? Не похоже, что ваш клиент установлен правильно. Скачали ли вы все ресурсы (tiny.cc/getao), включая огромную папку `base`? - + Version: %1 Версия: %1 - + Loading Загрузка - + Cancel Отмена - + <h2>Attorney Online %1</h2>The courtroom drama simulator<p><b>Source code:</b> <a href='https://github.com/AttorneyOnline/AO2-Client'>https://github.com/AttorneyOnline/AO2-Client</a><p><b>Major development:</b><br>OmniTroid, stonedDiscord, longbyte1, gameboyprinter, Cerapter<p><b>Special thanks:</b><br>Remy, Iamgoofball, Hibiki, Qubrick (webAO), Ruekasu (UI design), Draxirch (UI design), Unishred, Argoneus (tsuserver), Fiercy, Noevain, Cronnicossy <h2>Attorney Online %1</h2>Симулятор судебной драмы<p><b>Исходный код:</b> <a href='https://github.com/AttorneyOnline/AO2-Client'>https://github.com/AttorneyOnline/AO2-Client</a><p><b>Основной разработкой занимались:</b><br>OmniTroid, stonedDiscord, longbyte1, gameboyprinter, Cerapter<p><b>Особенная благодарность:</b><br>Remy, Iamgoofball, Hibiki, Qubrick (webAO), Ruekasu (дизайн интерфейса), Draxirch (дизайн интерфейса), Unishred, Argoneus (tsuserver), Fiercy, Noevain, Cronnicossy - + Online: %1/%2 Онлайн: %1/%2 - - + + Offline Вне сети -- cgit From f9442709c2a7fbb47dad354391b387ce7b844ba7 Mon Sep 17 00:00:00 2001 From: sD Date: Sun, 23 Feb 2020 13:14:54 +0100 Subject: missing german localizations --- resource/translations/ao_de.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/resource/translations/ao_de.ts b/resource/translations/ao_de.ts index 4d800ad..c9efd1d 100644 --- a/resource/translations/ao_de.ts +++ b/resource/translations/ao_de.ts @@ -155,7 +155,7 @@ Grund: Witness needed - + Zeuge benötigt @@ -243,12 +243,12 @@ Grund: Allow Shake/Flash: - + Schütteln/Geistesblitz erlauben: Allows screenshaking and flashing. Disable this if you have concerns or issues with photosensitivity and/or seizures. - + Erlaubt schütteln des Bildschirms und weiße Blitze. Deaktiviere dies falls du Bedenken wegen Photosensitivität hast. @@ -338,22 +338,22 @@ Grund: Enable Looping SFX: - + Wiederholende Soundeffekte: If true, the game will allow looping sound effects to play on preanimations. - + Wenn aktiviert, werden wiederholende Soundeffekte bei den Voranimationen erlaubt. Kill Music On Objection: - + Stoppe Musik bei Einspruch: If true, the game will stop music when someone objects, like in the actual games. - + Hält die Musik an wenn jemand "Einspruch" ruft, wie im echten Spiel. @@ -448,12 +448,12 @@ Grund: Witness: - + Zeuge: If checked, you will appear amongst the potential witnesses on the server. - + Wenn angehakt wirst du als potentielle Zeuge angezeigt. @@ -543,7 +543,7 @@ Grund: Disable Modcalls - + Deaktiviere Moderatorenrufe -- cgit From b6eb61c187e3159bd53651e229d954adc2b237cd Mon Sep 17 00:00:00 2001 From: sD Date: Sun, 23 Feb 2020 13:18:51 +0100 Subject: move language setting to the correct position --- src/aooptionsdialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aooptionsdialog.cpp b/src/aooptionsdialog.cpp index 30146c9..37d4957 100644 --- a/src/aooptionsdialog.cpp +++ b/src/aooptionsdialog.cpp @@ -180,7 +180,7 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) : QDi ui_language_label = new QLabel(ui_form_layout_widget); ui_language_label->setText(tr("Language:")); ui_language_label->setToolTip(tr("Sets the language if you don't want to use your system language.")); - ui_gameplay_form->setWidget(10, QFormLayout::LabelRole, ui_language_label); + ui_gameplay_form->setWidget(11, QFormLayout::LabelRole, ui_language_label); ui_language_combobox = new QComboBox(ui_form_layout_widget); ui_language_combobox->addItem(configini->value("language", " ").value() + " - Keep current setting"); @@ -190,7 +190,7 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) : QDi ui_language_combobox->addItem("es - Español"); ui_language_combobox->addItem("jp - 日本語"); ui_language_combobox->addItem("ru - Русский"); - ui_gameplay_form->setWidget(10, QFormLayout::FieldRole, ui_language_combobox); + ui_gameplay_form->setWidget(11, QFormLayout::FieldRole, ui_language_combobox); // Here we start the callwords tab. ui_callwords_tab = new QWidget(); -- cgit From ad80e6413f7bc81177605c125eaf9c408aac94c6 Mon Sep 17 00:00:00 2001 From: sD Date: Sun, 23 Feb 2020 13:21:05 +0100 Subject: disable modcalls is longer than guiard --- base/themes/default/courtroom_design.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/themes/default/courtroom_design.ini b/base/themes/default/courtroom_design.ini index d0495be..96abd8d 100644 --- a/base/themes/default/courtroom_design.ini +++ b/base/themes/default/courtroom_design.ini @@ -107,7 +107,7 @@ pre = 5, 490, 80, 21 flip = 104, 490, 61, 21 ; Guard button -guard = 200, 580, 81, 21 +guard = 200, 580, 100, 21 pre_no_interrupt = 200, 490, 85, 21 -- cgit