diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/aoblipplayer.cpp | 19 | ||||
| -rw-r--r-- | src/aooptionsdialog.cpp | 1 | ||||
| -rw-r--r-- | src/aosfxplayer.cpp | 5 | ||||
| -rw-r--r-- | src/courtroom.cpp | 24 | ||||
| -rw-r--r-- | src/evidence.cpp | 4 | ||||
| -rw-r--r-- | src/hardware_functions.cpp | 3 | ||||
| -rw-r--r-- | src/lobby.cpp | 10 | ||||
| -rw-r--r-- | src/main.cpp | 1 | ||||
| -rw-r--r-- | src/packet_distribution.cpp | 6 | ||||
| -rw-r--r-- | src/path_functions.cpp | 2 |
10 files changed, 32 insertions, 43 deletions
diff --git a/src/aoblipplayer.cpp b/src/aoblipplayer.cpp index 6affc28..39158fd 100644 --- a/src/aoblipplayer.cpp +++ b/src/aoblipplayer.cpp @@ -22,7 +22,7 @@ void AOBlipPlayer::set_blips(QString p_sfx) FALSE, f_path.utf16(), 0, 0, BASS_UNICODE | BASS_ASYNCFILE); } - set_volume_internal(m_volume); + set_volume(m_volume); } void AOBlipPlayer::blip_tick() @@ -42,11 +42,9 @@ void AOBlipPlayer::blip_tick() BASS_ChannelPlay(f_stream, false); } -void AOBlipPlayer::set_volume(qreal p_value) +void AOBlipPlayer::set_volume(int p_value) { - m_volume = p_value / 100; - set_volume_internal(m_volume); -} + m_volume = p_value; void AOBlipPlayer::set_volume_internal(qreal p_value) { @@ -71,7 +69,7 @@ void AOBlipPlayer::set_blips(QString p_sfx) m_blips.setSource(QUrl::fromLocalFile(f_path)); } - set_volume_internal(m_volume); + set_volume(m_volume); } void AOBlipPlayer::blip_tick() @@ -84,14 +82,9 @@ void AOBlipPlayer::blip_tick() m_blips.play(); } -void AOBlipPlayer::set_volume(qreal p_value) -{ - m_volume = p_value / 100; - set_volume_internal(m_volume); -} - -void AOBlipPlayer::set_volume_internal(qreal p_value) +void AOBlipPlayer::set_volume(int p_value) { + m_volume = p_value; m_blips.setVolume(m_volume); } #else // No audio diff --git a/src/aooptionsdialog.cpp b/src/aooptionsdialog.cpp index 18556f3..e911963 100644 --- a/src/aooptionsdialog.cpp +++ b/src/aooptionsdialog.cpp @@ -1,5 +1,6 @@ #include "aooptionsdialog.h" #include "aoapplication.h" +#include "bass.h" AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) : QDialog(parent) diff --git a/src/aosfxplayer.cpp b/src/aosfxplayer.cpp index 3afd704..6db6f37 100644 --- a/src/aosfxplayer.cpp +++ b/src/aosfxplayer.cpp @@ -65,7 +65,7 @@ void AOSfxPlayer::play(QString p_sfx, QString p_char, QString shout, FALSE, f_path.utf16(), 0, 0, BASS_STREAM_AUTOFREE | BASS_UNICODE | BASS_ASYNCFILE); - set_volume_internal(m_volume); + set_volume(m_volume); if (ao_app->get_audio_output_device() != "default") BASS_ChannelSetDevice(m_stream_list[m_channel], BASS_GetDevice()); @@ -86,7 +86,7 @@ void AOSfxPlayer::set_volume(qreal p_value) set_volume_internal(m_volume); } -void AOSfxPlayer::set_volume_internal(qreal p_value) +void AOSfxPlayer::set_volume(int p_value) { float volume = static_cast<float>(p_value); for (int n_stream = 0; n_stream < m_channelmax; ++n_stream) { @@ -160,6 +160,7 @@ void AOSfxPlayer::set_volume(qreal p_value) void AOSfxPlayer::set_volume_internal(qreal p_value) { + m_volume = p_value; m_sfx.setVolume(m_volume); } #else diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 63d7f5e..bcd3b47 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -164,7 +164,7 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() ui_ooc_chat_name = new QLineEdit(this); ui_ooc_chat_name->setFrame(false); - ui_ooc_chat_name->setPlaceholderText(tr("Name")); + ui_ooc_chat_name->setPlaceholderText("Name"); ui_ooc_chat_name->setMaxLength(30); ui_ooc_chat_name->setText(p_ao_app->get_default_username()); @@ -214,14 +214,14 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() ui_switch_area_music = new AOButton(this, ao_app); ui_pre = new QCheckBox(this); - ui_pre->setText(tr("Pre")); + ui_pre->setText("Pre"); ui_flip = new QCheckBox(this); - ui_flip->setText(tr("Flip")); + ui_flip->setText("Flip"); ui_flip->hide(); ui_guard = new QCheckBox(this); - ui_guard->setText(tr("Guard")); + ui_guard->setText("Guard"); ui_guard->hide(); ui_additive = new QCheckBox(this); @@ -739,11 +739,11 @@ void Courtroom::set_widgets() QString::number(prosecution_bar_state)); set_size_and_pos(ui_music_label, "music_label"); - ui_music_label->setText(tr("Music")); + ui_music_label->setText("Music"); set_size_and_pos(ui_sfx_label, "sfx_label"); - ui_sfx_label->setText(tr("Sfx")); + ui_sfx_label->setText("Sfx"); set_size_and_pos(ui_blip_label, "blip_label"); - ui_blip_label->setText(tr("Blips")); + ui_blip_label->setText("Blips"); set_size_and_pos(ui_hold_it, "hold_it"); ui_hold_it->setText(tr("Hold It!")); @@ -3192,9 +3192,9 @@ void Courtroom::on_ooc_return_pressed() if (ok) { if (whom > -1) { other_charid = whom; - QString msg = tr("You will now pair up with "); + QString msg = "You will now pair up with "; msg.append(char_list.at(whom).name); - msg.append(tr(" if they also choose your character in return.")); + msg.append(" if they also choose your character in return."); append_server_chatmessage("CLIENT", msg, "1"); } else { @@ -4416,8 +4416,8 @@ void Courtroom::on_call_mod_clicked() QInputDialog input; input.setWindowFlags(Qt::WindowSystemMenuHint); - input.setLabelText(tr("Reason:")); - input.setWindowTitle(tr("Call Moderator")); + input.setLabelText("Reason:"); + input.setWindowTitle("Call Moderator"); auto code = input.exec(); if (code != QDialog::Accepted) @@ -4425,7 +4425,7 @@ void Courtroom::on_call_mod_clicked() QString text = input.textValue(); if (text.isEmpty()) { - errorBox.critical(nullptr, tr("Error"), tr("You must provide a reason.")); + errorBox.critical(nullptr, "Error", "You must provide a reason."); return; } else if (text.length() > 256) { diff --git a/src/evidence.cpp b/src/evidence.cpp index edfad5d..dffe848 100644 --- a/src/evidence.cpp +++ b/src/evidence.cpp @@ -31,7 +31,7 @@ void Courtroom::initialize_evidence() ui_evidence_delete->setToolTip(tr("Destroy this piece of evidence")); ui_evidence_image_name = new AOLineEdit(ui_evidence_overlay); ui_evidence_image_button = new AOButton(ui_evidence_overlay, ao_app); - ui_evidence_image_button->setText(tr("Choose...")); + ui_evidence_image_button->setText("Choose.."); ui_evidence_x = new AOButton(ui_evidence_overlay, ao_app); ui_evidence_x->setToolTip( tr("Close the evidence display/editing overlay.\n" @@ -476,7 +476,7 @@ void Courtroom::on_evidence_hover(int p_id, bool p_state) if (p_state) { if (final_id == local_evidence_list.size()) - ui_evidence_name->setText(tr("Add new evidence...")); + ui_evidence_name->setText("Add new evidence..."); else if (final_id < local_evidence_list.size()) ui_evidence_name->setText(local_evidence_list.at(final_id).name); } diff --git a/src/hardware_functions.cpp b/src/hardware_functions.cpp index 96c72eb..c898aef 100644 --- a/src/hardware_functions.cpp +++ b/src/hardware_functions.cpp @@ -49,9 +49,6 @@ QString get_hdid() } #elif defined __APPLE__ -#include <CoreFoundation/CoreFoundation.h> -#include <IOKit/IOKitLib.h> - QString get_hdid() { CFStringRef serial; diff --git a/src/lobby.cpp b/src/lobby.cpp index 99172a9..81e4086 100644 --- a/src/lobby.cpp +++ b/src/lobby.cpp @@ -9,7 +9,7 @@ Lobby::Lobby(AOApplication *p_ao_app) : QMainWindow() { ao_app = p_ao_app; - this->setWindowTitle(tr("Attorney Online 2")); + this->setWindowTitle("Attorney Online 2"); this->setWindowIcon(QIcon(":/logo.png")); ui_background = new AOImage(this, ao_app); @@ -36,7 +36,7 @@ Lobby::Lobby(AOApplication *p_ao_app) : QMainWindow() ui_chatbox = new AOTextArea(this); ui_chatbox->setOpenExternalLinks(true); ui_chatname = new QLineEdit(this); - ui_chatname->setPlaceholderText(tr("Name")); + ui_chatname->setPlaceholderText("Name"); ui_chatname->setText(ao_app->get_ooc_name()); ui_chatmessage = new QLineEdit(this); ui_loading_background = new AOImage(this, ao_app); @@ -139,7 +139,7 @@ void Lobby::set_widgets() ui_server_search->setStyleSheet("background-color: rgba(0, 0, 0, 0);"); set_size_and_pos(ui_player_count, "player_count"); - ui_player_count->setText(tr("Offline")); + ui_player_count->setText("Offline"); ui_player_count->setStyleSheet("font: bold;" "color: white;" "qproperty-alignment: AlignCenter;"); @@ -173,11 +173,11 @@ void Lobby::set_widgets() ui_loading_text->setFrameStyle(QFrame::NoFrame); ui_loading_text->setStyleSheet("background-color: rgba(0, 0, 0, 0);" "color: rgba(255, 128, 0, 255);"); - ui_loading_text->append(tr("Loading")); + ui_loading_text->append("Loading"); set_size_and_pos(ui_progress_bar, "progress_bar"); set_size_and_pos(ui_cancel, "cancel"); - ui_cancel->setText(tr("Cancel")); + ui_cancel->setText("Cancel"); ui_loading_background->hide(); diff --git a/src/main.cpp b/src/main.cpp index ba5b516..364377b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,3 +1,4 @@ + #include "aoapplication.h" #include "courtroom.h" diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp index 81a9a30..a7bdbab 100644 --- a/src/packet_distribution.cpp +++ b/src/packet_distribution.cpp @@ -157,8 +157,6 @@ void AOApplication::server_packet_received(AOPacket *p_packet) s_pv = f_contents.at(0).toInt(); server_software = f_contents.at(1); - w_lobby->enable_connect_button(); - send_server_packet(new AOPacket("ID#AO2#" + get_version_string() + "#%")); } else if (header == "CT") { @@ -234,7 +232,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet) courtroom_loaded = false; - QString window_title = tr("Attorney Online 2"); + QString window_title = "Attorney Online 2"; int selected_server = w_lobby->get_selected_server(); QString server_address = "", server_name = ""; @@ -262,7 +260,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet) w_courtroom->set_window_title(window_title); w_lobby->show_loading_overlay(); - w_lobby->set_loading_text(tr("Loading")); + w_lobby->set_loading_text("Loading"); w_lobby->set_loading_value(0); AOPacket *f_packet; diff --git a/src/path_functions.cpp b/src/path_functions.cpp index 07c9517..811ca76 100644 --- a/src/path_functions.cpp +++ b/src/path_functions.cpp @@ -30,8 +30,6 @@ QString AOApplication::get_base_path() QString external_storage = getenv("EXTERNAL_STORAGE"); base_path = external_storage + "/AO2/"; } -#elif defined __APPLE__ - base_path = applicationDirPath() + "/../../../base/"; #else base_path = applicationDirPath() + "/base/"; #endif |
