Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

well #2

Merged
merged 14 commits into from
Jan 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*~
*.db
*.user
2 changes: 0 additions & 2 deletions Attorney_Online_remake.pro
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ SOURCES += main.cpp\
hardware_functions.cpp

HEADERS += lobby.h \
text_file_functions.h \
path_functions.h \
aoimage.h \
file_functions.h \
aobutton.h \
Expand Down
25 changes: 20 additions & 5 deletions aoapplication.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#include <QDebug>
#include "aoapplication.h"

#include "lobby.h"
#include "courtroom.h"
#include "networkmanager.h"
#include "text_file_functions.h"

#include "aoapplication.h"
#include <QDebug>
#include <QRect>
#include <QDesktopWidget>

AOApplication::AOApplication(int &argc, char **argv) : QApplication(argc, argv)
{
Expand All @@ -29,6 +30,11 @@ void AOApplication::construct_lobby()
w_lobby = new Lobby(this);
lobby_constructed = true;

QRect screenGeometry = QApplication::desktop()->screenGeometry();
int x = (screenGeometry.width()-w_lobby->width()) / 2;
int y = (screenGeometry.height()-w_lobby->height()) / 2;
w_lobby->move(x, y);

w_lobby->show();
}

Expand All @@ -55,8 +61,10 @@ void AOApplication::construct_courtroom()
w_courtroom = new Courtroom(this);
courtroom_constructed = true;

//D3BUG
w_courtroom->show();
QRect screenGeometry = QApplication::desktop()->screenGeometry();
int x = (screenGeometry.width()-w_courtroom->width()) / 2;
int y = (screenGeometry.height()-w_courtroom->height()) / 2;
w_courtroom->move(x, y);
}

void AOApplication::destruct_courtroom()
Expand Down Expand Up @@ -100,3 +108,10 @@ void AOApplication::add_favorite_server(int p_server)

write_to_serverlist_txt(server_line);
}

void AOApplication::loading_cancelled()
{
destruct_courtroom();

w_lobby->hide_loading_overlay();
}
22 changes: 18 additions & 4 deletions aoapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,20 @@ class AOApplication : public QApplication
unsigned int s_decryptor = 5;
bool encryption_needed = true;
bool ao2_features = false;

///////////////loading info///////////////////

//player number, it's hardly used but might be needed for some old servers
bool s_pv = 0;
int s_pv = 0;

//////////////////////////////////////////////////
int char_list_size = 0;
int loaded_chars = 0;
int evidence_list_size = 0;
int loaded_evidence = 0;
int music_list_size = 0;
int loaded_music = 0;

//////////////////versioning///////////////

int get_release() {return RELEASE;}
int get_major_version() {return MAJOR_VERSION;}
Expand All @@ -64,18 +74,19 @@ class AOApplication : public QApplication
void set_user_theme();
QString get_user_theme() {return user_theme;}

//path functions
//implementation in path_functions.cpp
QString get_base_path();
QString get_theme_path();
QString get_default_theme_path();
QString get_character_path(QString p_character);
QString get_demothings_path();

//text file functions
//implementation in text_file_functions.cpp
QString read_user_theme();
void write_to_serverlist_txt(QString p_line);
QVector<server_type> read_serverlist_txt();
pos_size_type get_pos_and_size(QString p_identifier, QString p_design_path);
QString get_char_side(QString p_char);

private:
const int RELEASE = 2;
Expand All @@ -86,6 +97,9 @@ class AOApplication : public QApplication

QVector<server_type> server_list;
QVector<server_type> favorite_list;

public slots:
void loading_cancelled();
};

#endif // AOAPPLICATION_H
1 change: 0 additions & 1 deletion aobutton.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "aobutton.h"

#include "debug_functions.h"
#include "path_functions.h"
#include "file_functions.h"

#include <QDebug>
Expand Down
59 changes: 57 additions & 2 deletions aocharbutton.cpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,62 @@
#include "aocharbutton.h"

#include "path_functions.h"
#include "file_functions.h"

#include <QFile>

AOCharButton::AOCharButton(QWidget *parent, AOApplication *p_ao_app) : QPushButton(parent)
AOCharButton::AOCharButton(QWidget *parent, AOApplication *p_ao_app, int x_pos, int y_pos) : QPushButton(parent)
{
m_parent = parent;

ao_app = p_ao_app;

this->resize(60, 60);
this->move(x_pos, y_pos);

ui_taken = new AOImage(this, ao_app);
ui_taken->resize(60, 60);
ui_taken->set_image("char_taken.png");
ui_taken->setAttribute(Qt::WA_TransparentForMouseEvents);
ui_taken->hide();

ui_passworded = new AOImage(this, ao_app);
ui_passworded->resize(60, 60);
ui_passworded->set_image("char_passworded");
ui_passworded->setAttribute(Qt::WA_TransparentForMouseEvents);
ui_passworded->hide();

ui_selector = new AOImage(parent, ao_app);
ui_selector->resize(62, 62);
ui_selector->move(x_pos - 1, y_pos - 1);
ui_selector->set_image("char_selector.png");
ui_selector->setAttribute(Qt::WA_TransparentForMouseEvents);
ui_selector->hide();
}

void AOCharButton::reset()
{
ui_taken->hide();
ui_passworded->hide();
ui_selector->hide();
}

void AOCharButton::set_taken()
{
ui_taken->show();
}

void AOCharButton::set_passworded()
{
ui_passworded->show();
}

void AOCharButton::set_image(QString p_character)
{
QString image_path = ao_app->get_character_path(p_character) + "char_icon.png";
QString legacy_path = ao_app->get_demothings_path() + p_character.toLower() + "_char_icon.png";

this->setText("");

if (file_exists(image_path))
this->setStyleSheet("border-image:url(\"" + image_path + "\")");
else if (file_exists(legacy_path))
Expand All @@ -33,3 +71,20 @@ void AOCharButton::set_image(QString p_character)
this->setText(p_character);
}
}

void AOCharButton::enterEvent(QEvent * e)
{
ui_selector->raise();
ui_selector->show();

setFlat(false);
QPushButton::enterEvent(e);
}

void AOCharButton::leaveEvent(QEvent * e)
{
ui_selector->hide();
QPushButton::leaveEvent(e);
}


15 changes: 14 additions & 1 deletion aocharbutton.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,33 @@
#include <QPushButton>
#include <QString>
#include <QWidget>
#include "aoimage.h"

class AOCharButton : public QPushButton
{
Q_OBJECT

public:
AOCharButton(QWidget *parent, AOApplication *p_ao_app);
AOCharButton(QWidget *parent, AOApplication *p_ao_app, int x_pos, int y_pos);

AOApplication *ao_app;

void reset();
void set_taken();
void set_passworded();

void set_image(QString p_character);

private:
QWidget *m_parent;

AOImage *ui_taken;
AOImage *ui_passworded;
AOImage *ui_selector;

protected:
void enterEvent(QEvent *e);
void leaveEvent(QEvent *e);
};

#endif // AOCHARBUTTON_H
2 changes: 0 additions & 2 deletions aoimage.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#include "file_functions.h"
#include "path_functions.h"
#include "global_variables.h"

#include "aoimage.h"

Expand Down
Binary file removed base/background/gs4/bancoacusacion.gif
Binary file not shown.
Binary file removed base/background/gs4/bancoacusacion.png
Binary file not shown.
Binary file removed base/background/gs4/bancodefensa.gif
Binary file not shown.
Binary file removed base/background/gs4/bancodefensa.png
Binary file not shown.
Binary file removed base/background/gs4/defenseempty.png
Binary file not shown.
Binary file removed base/background/gs4/estrado.gif
Binary file not shown.
Binary file removed base/background/gs4/estrado.png
Binary file not shown.
Binary file removed base/background/gs4/gallery.gif
Binary file not shown.
Binary file removed base/background/gs4/helperstand.png
Binary file not shown.
Binary file removed base/background/gs4/judgestand.png
Binary file not shown.
Binary file removed base/background/gs4/prohelperstand.png
Binary file not shown.
Binary file removed base/background/gs4/prosecutorempty.png
Binary file not shown.
Binary file removed base/background/gs4/speedlineupclose.png
Binary file not shown.
Binary file removed base/background/gs4/super anim.png
Binary file not shown.
Binary file removed base/background/gs4/tribunal.gif
Binary file not shown.
Binary file removed base/background/gs4/witnessempty.png
Binary file not shown.
1 change: 0 additions & 1 deletion base/config.ini~

This file was deleted.

4 changes: 4 additions & 0 deletions base/serverlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
10.0.0.1:27071:the shit server
88.203.168.170:27777:Demon Server For Demons! Vanilla! 1.8+
24.193.75.13:27053:The Flaming Phoenix
51.255.160.217:50000:Attorney Online Vidya(Dedicated)
7 changes: 4 additions & 3 deletions base/themes/default/courtroom_design.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ area_list = 266, 494, 224, 174
music_list = 490, 342, 224, 326
ic_chat_message = 0, 192, 255, 23
ooc_chat_message = 492, 281, 222, 19
ooc_chat_name = 492, 300, 32, 19
ooc_chat_name = 492, 300, 85, 19
area_password = 266, 471, 224, 23
music_search = 490, 319, 226, 23
emote_left = 0, 253, 20, 20
Expand All @@ -20,6 +20,7 @@ sfx_label = 260, 410, 21, 16
blip_label = 260, 430, 31, 16
hold_it = 10, 312, 76, 28
objection = 90, 312, 76, 28
take_that = 170, 312, 76, 28
ooc_toggle = 580, 300, 133, 19
witness_testimony = 5, 345, 85, 42
cross_examination = 95, 345, 85, 42
Expand All @@ -30,8 +31,8 @@ pre = 187, 345, 51, 21
flip = 187, 362, 51, 21
guard = 187, 379, 61, 21
custom_objection = 250, 325, 40, 40
realization = 295, 323, 40, 40
mute = 340, 325, 40, 40
realization = 295, 325, 40, 40
mute_button = 340, 325, 40, 40
defense_plus = 477, 325, 9, 9
defense_minus = 385, 325, 9, 9
prosecution_plus = 477, 342, 9, 9
Expand Down
28 changes: 0 additions & 28 deletions base/themes/default/design.ini

This file was deleted.

Binary file added base/themes/default/loadingbackground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions base/themes/default/lobby_design.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
lobby = 0, 0, 517, 666
public_servers = 46, 88, 114, 30
favorites = 164, 88, 114, 30
refresh = 56, 381, 132, 28
add_to_fav = 194, 381, 132, 28
connect = 332, 381, 132, 28
about = 428, 1, 88, 21
server_list = 20, 125, 286, 240
player_count = 336, 91, 173, 16
description = 337, 109, 173, 245
chatbox = 2, 445, 515, 198
chatname = 3, 646, 85, 19
chatmessage = 93, 646, 424, 19
loading_label = 135, 92, 254, 95
progress_bar = 135, 188, 254, 21
cancel = 220, 220, 80, 20
Binary file modified base/themes/default/muted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added base/themes/default/muted_old.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading