added adjustable blip rate and judge buttons on /pos jud
This commit is contained in:
parent
55803c520d
commit
26ea00e7fc
@ -13,7 +13,7 @@ RC_ICONS = logo.ico
|
||||
TARGET = Attorney_Online_remake
|
||||
TEMPLATE = app
|
||||
|
||||
VERSION = 2.2.0.0
|
||||
VERSION = 2.2.1.0
|
||||
|
||||
SOURCES += main.cpp\
|
||||
lobby.cpp \
|
||||
|
@ -96,7 +96,9 @@ public:
|
||||
QString get_evidence_path();
|
||||
|
||||
//implementation in text_file_functions.cpp
|
||||
QString read_config(QString searchline);
|
||||
QString read_user_theme();
|
||||
int read_blip_rate();
|
||||
void write_to_serverlist_txt(QString p_line);
|
||||
QVector<server_type> read_serverlist_txt();
|
||||
pos_size_type get_element_dimensions(QString p_identifier, QString p_file);
|
||||
@ -123,7 +125,7 @@ public:
|
||||
private:
|
||||
const int RELEASE = 2;
|
||||
const int MAJOR_VERSION = 2;
|
||||
const int MINOR_VERSION = 0;
|
||||
const int MINOR_VERSION = 1;
|
||||
|
||||
QString user_theme = "default";
|
||||
|
||||
|
@ -97,13 +97,16 @@ void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration)
|
||||
}
|
||||
qDebug() << "% mod: " << percentage_modifier;
|
||||
|
||||
if (full_duration < real_duration)
|
||||
if (full_duration == 0 || full_duration >= real_duration)
|
||||
{
|
||||
play_once = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
play_once = false;
|
||||
preanim_timer->start(full_duration);
|
||||
}
|
||||
else
|
||||
play_once = true;
|
||||
|
||||
|
||||
m_movie->setSpeed(static_cast<int>(percentage_modifier));
|
||||
play(p_char, p_emote, "");
|
||||
|
@ -328,6 +328,8 @@ void Courtroom::set_mute_list()
|
||||
|
||||
void Courtroom::set_widgets()
|
||||
{
|
||||
blip_rate = ao_app->read_blip_rate();
|
||||
|
||||
QString filename = "courtroom_design.ini";
|
||||
|
||||
pos_size_type f_courtroom = ao_app->get_element_dimensions("courtroom", filename);
|
||||
@ -1254,6 +1256,7 @@ void Courtroom::start_chat_ticking()
|
||||
ui_vp_chatbox->show();
|
||||
|
||||
tick_pos = 0;
|
||||
blip_pos = 0;
|
||||
chat_tick_timer->start(chat_tick_interval);
|
||||
|
||||
QString f_gender = ao_app->get_gender(m_chatmessage[CHAR_NAME]);
|
||||
@ -1282,14 +1285,22 @@ void Courtroom::chat_tick()
|
||||
else
|
||||
{
|
||||
ui_vp_message->insertPlainText(f_message.at(tick_pos));
|
||||
//ui_vp_message->app
|
||||
|
||||
QScrollBar *scroll = ui_vp_message->verticalScrollBar();
|
||||
scroll->setValue(scroll->maximum());
|
||||
scroll->hide();
|
||||
|
||||
if (f_message.at(tick_pos) != ' ')
|
||||
blip_player->blip_tick();
|
||||
{
|
||||
|
||||
if (blip_pos % blip_rate == 0)
|
||||
{
|
||||
blip_pos = 0;
|
||||
blip_player->blip_tick();
|
||||
}
|
||||
|
||||
++blip_pos;
|
||||
}
|
||||
|
||||
++tick_pos;
|
||||
}
|
||||
@ -1531,6 +1542,28 @@ void Courtroom::on_ooc_return_pressed()
|
||||
if (ui_ooc_chat_message->text() == "" || ui_ooc_chat_name->text() == "")
|
||||
return;
|
||||
|
||||
if (ui_ooc_chat_message->text().startsWith("/pos"))
|
||||
{
|
||||
if (ui_ooc_chat_message->text().startsWith("/pos jud"))
|
||||
{
|
||||
ui_witness_testimony->show();
|
||||
ui_cross_examination->show();
|
||||
ui_defense_minus->show();
|
||||
ui_defense_plus->show();
|
||||
ui_prosecution_minus->show();
|
||||
ui_prosecution_plus->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
ui_witness_testimony->hide();
|
||||
ui_cross_examination->hide();
|
||||
ui_defense_minus->hide();
|
||||
ui_defense_plus->hide();
|
||||
ui_prosecution_minus->hide();
|
||||
ui_prosecution_plus->hide();
|
||||
}
|
||||
}
|
||||
|
||||
//cheap, but it works
|
||||
if (ui_ooc_chat_message->text().startsWith("/login"))
|
||||
ui_guard->show();
|
||||
|
@ -119,6 +119,9 @@ private:
|
||||
int chat_tick_interval = 60;
|
||||
//which tick position(character in chat message) we are at
|
||||
int tick_pos = 0;
|
||||
//used to determine how often blips sound
|
||||
int blip_pos = 0;
|
||||
int blip_rate = 1;
|
||||
|
||||
//delay before chat messages starts ticking
|
||||
QTimer *text_delay_timer;
|
||||
|
@ -35,6 +35,7 @@ Lobby::Lobby(AOApplication *p_ao_app) : QMainWindow()
|
||||
ui_progress_bar = new QProgressBar(ui_loading_background);
|
||||
ui_progress_bar->setMinimum(0);
|
||||
ui_progress_bar->setMaximum(100);
|
||||
ui_progress_bar->setStyleSheet("QProgressBar{ color: white; }");
|
||||
ui_cancel = new AOButton(ui_loading_background, ao_app);
|
||||
|
||||
connect(ui_public_servers, SIGNAL(clicked()), this, SLOT(on_public_servers_clicked()));
|
||||
|
@ -7,27 +7,59 @@
|
||||
#include <QVector>
|
||||
#include <QDebug>
|
||||
|
||||
QString AOApplication::read_user_theme(){
|
||||
QString AOApplication::read_config(QString searchline)
|
||||
{
|
||||
QString return_value = "";
|
||||
|
||||
QFile config_file(get_base_path() + "config.ini");
|
||||
if (!config_file.open(QIODevice::ReadOnly))
|
||||
return "default";
|
||||
return return_value;
|
||||
|
||||
QTextStream in(&config_file);
|
||||
|
||||
while(!in.atEnd())
|
||||
{
|
||||
QString line = in.readLine();
|
||||
QString f_line = in.readLine();
|
||||
|
||||
if (line.startsWith("theme"))
|
||||
{
|
||||
QStringList line_elements = line.split("=");
|
||||
if (!f_line.startsWith(searchline))
|
||||
continue;
|
||||
|
||||
if (line_elements.size() > 1)
|
||||
return line_elements.at(1).trimmed();
|
||||
}
|
||||
QStringList line_elements = f_line.split("=");
|
||||
|
||||
if (line_elements.at(0).trimmed() != searchline)
|
||||
continue;
|
||||
|
||||
if (line_elements.size() < 2)
|
||||
continue;
|
||||
|
||||
return_value = line_elements.at(1).trimmed();
|
||||
break;
|
||||
}
|
||||
|
||||
return "default";
|
||||
config_file.close();
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
QString AOApplication::read_user_theme()
|
||||
{
|
||||
QString result = read_config("theme");
|
||||
|
||||
if (result == "")
|
||||
return "default";
|
||||
else
|
||||
return result;
|
||||
}
|
||||
|
||||
int AOApplication::read_blip_rate()
|
||||
{
|
||||
QString result = read_config("blip_rate");
|
||||
|
||||
//note: the empty string converted to int will return 0
|
||||
if (result.toInt() <= 0)
|
||||
return 1;
|
||||
else
|
||||
return result.toInt();
|
||||
}
|
||||
|
||||
void AOApplication::write_to_serverlist_txt(QString p_line)
|
||||
|
Loading…
Reference in New Issue
Block a user