Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
17bbde9
add fade code, add void behind bg
Aug 24, 2021
0b3b609
add invert effect
Aug 24, 2021
1d58170
fix clazy warning
Aug 24, 2021
58f9708
Excise server list
in1tiate Jul 15, 2022
820cb0a
branding, move About button to settings, alter version string
in1tiate Jul 16, 2022
66b18a2
Remove FL and all AO2 compat code
in1tiate Jul 16, 2022
ca624cd
Merge branch 'fade-effects' of https://github.com/AttorneyOnline/AO2-…
in1tiate Jul 16, 2022
f8e96fc
Merge branch 'AttorneyOnline-fade-effects'
in1tiate Jul 16, 2022
8c75b2d
Rename project file
in1tiate Jul 16, 2022
b03aaea
Add subpositions
in1tiate Jul 16, 2022
e7db52e
simplify centering math, remove incorrect docs
in1tiate Jul 16, 2022
2306292
fix math again, add some todos
in1tiate Jul 17, 2022
a146079
fix screenshake, resolve clazy warnings
in1tiate Jul 17, 2022
cf1cd27
More screenshake code cleanup
in1tiate Jul 18, 2022
44c7e4f
Merge branch 'master' of https://github.com/AttorneyOnline/AO2-Client…
in1tiate Jul 18, 2022
e397626
Merge branch 'AttorneyOnline-master'
in1tiate Jul 18, 2022
6e2855c
Remove merge conflicts
in1tiate Jul 18, 2022
2544527
rudimentary screen transition code
in1tiate Jul 19, 2022
6bfde0c
add IC integration, half-finished sideplayer code
in1tiate Jul 19, 2022
1af2e25
this doesn't work
in1tiate Jul 19, 2022
0af83fb
Remove stinky compatibility code that broke things
in1tiate Jul 21, 2022
2f8d318
remove extraneous debug print
in1tiate Jul 21, 2022
eb394d6
transition fixes
in1tiate Jul 21, 2022
076477a
more transition progress
in1tiate Jul 21, 2022
04bd7f6
more progress
in1tiate Jul 22, 2022
60f31ab
BIG progress
in1tiate Aug 3, 2022
170cb9f
make it work with offsets
in1tiate Aug 3, 2022
fed09bc
cleanup
in1tiate Aug 5, 2022
c449967
more cleanup
in1tiate Aug 5, 2022
9aaaed2
fix transitions playing only once
in1tiate Aug 5, 2022
f94504a
Remove pairing
in1tiate Aug 5, 2022
14d1bb4
remove pairing cruft
in1tiate Aug 5, 2022
69fbe2e
Switch to easing curves for better accuracy
in1tiate Aug 7, 2022
53374ca
scale offsets with the background Only
in1tiate Aug 7, 2022
1e1959d
cleanup
in1tiate Aug 7, 2022
8ac72c8
Fix characters wider than the viewport being offset incorrectly
in1tiate Aug 8, 2022
d19c064
Update README.md
in1tiate Jun 13, 2023
5dc4eaa
Merge branch 'master' of https://github.com/AttorneyOnline/AO2-Client…
in1tiate Jun 13, 2023
692233a
Merge branch 'AttorneyOnline-master'
in1tiate Jun 13, 2023
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
53 changes: 2 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,2 @@
# Attorney Online

![CI build](https://github.com/AttorneyOnline/AO2-Client/actions/workflows/build.yml/badge.svg?event=push) ![license](https://img.shields.io/github/license/AttorneyOnline/AO2-Client?color=blue) ![contributors](https://img.shields.io/github/contributors/AttorneyOnline/AO2-Client)<br>

[Attorney Online](https://aceattorneyonline.com) is an online version of the world-renowned courtroom drama simulator that allows you to create and play out cases in an off-the-cuff format.

**[Refer to the docs](https://github.com/AttorneyOnline/docs/blob/master/docs/index.md) for more information.**

Linux users will need to install the system dependencies related to Qt. These are the commands to run on a terminal for some distributions:
* Ubuntu 22.04 LTS:
```
$ sudo apt-get install qt5-base-dev libqt5websockets5 qt5-image-formats-plugins libqt5svg5
```
* Arch:
```
$ sudo pacman -Syu qt5-base qt5-websockets qt5-imageformats qt5-svg
```
* Fedora:
```
$ sudo dnf install qt5-qtbase qt5-qtwebsockets qt5-qtimageformats qt5-qtsvg
```

## Credits

This is a open-source remake of Attorney Online written by OmniTroid. The original Attorney Online client was written by FanatSors in Delphi.

The logo (`logo.png` and `logo.ico`) was designed by Lucas Carbi. The characters depicted in the logo are owned by Capcom.

### Project

The project is dual-licensed; you are free to copy, modify and distribute AO2 under the GPLv3 or the MIT license.

Copyright (c) 2016-2018 David "OmniTroid" Skoland

Modifications copyright (c) 2017-2018 oldmud0

Case Café additions copyright (c) 2018 Cerapter

Killing Fever Online additions copyright (c) 2019 Crystalwarrior

### Qt

This project uses Qt 5, which is licensed under the [GNU Lesser General Public License](https://www.gnu.org/licenses/lgpl-3.0.txt) with [certain licensing restrictions and exceptions](https://www.qt.io/qt-licensing-terms/). To comply with licensing requirements for static linking, object code is available if you would like to relink with an alternative version of Qt, and the source code for Qt may be found at https://github.com/qt/qtbase, http://code.qt.io/cgit/, or at https://qt.io.

Copyright (c) 2016 The Qt Company Ltd.

### BASS

This project depends on the BASS shared library. Get it here: http://www.un4seen.com/

Copyright (c) 1999-2016 Un4seen Developments Ltd. All rights reserved.
### Misairu
This is an open-source conversion of the Attorney Online 2 chat client into a standalone casemaking engine. See that repository for more technical information as this project builds up its own documentation over time.
29 changes: 9 additions & 20 deletions include/aoapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,25 +85,6 @@ class AOApplication : public QApplication {
qint64 latency = 0;
QString window_title;

/////////////////server metadata//////////////////

bool yellow_text_supported = false;
bool prezoom_supported = false;
bool flipping_supported = false;
bool custom_objection_supported = false;
bool desk_mod_supported = false;
bool evidence_supported = false;
bool cccc_ic_supported = false;
bool arup_supported = false;
bool casing_alerts_supported = false;
bool modcall_reason_supported = false;
bool looping_sfx_supported = false;
bool additive_text_supported = false;
bool effects_supported = false;
bool y_offset_supported = false;
bool expanded_desk_mods_supported = false;
bool auth_packet_supported = false;

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

// client ID. Not useful, to be removed eventually
Expand Down Expand Up @@ -157,7 +138,7 @@ class AOApplication : public QApplication {
QString get_asset(QString p_element, QString p_theme="", QString p_subtheme="", QString p_default_theme="", QString p_misc="", QString p_character="", QString p_placeholder="");
QString get_image(QString p_element, QString p_theme="", QString p_subtheme="", QString p_default_theme="", QString p_misc="", QString p_character="", QString p_placeholder="", bool static_image=false);
QString get_sfx(QString p_sfx, QString p_misc="", QString p_character="");
QString get_pos_path(const QString& pos, bool desk = false);
QPair<QString, int> get_pos_path(const QString& pos, bool desk = false);
QString get_case_sensitive_path(QString p_file);
QString get_real_path(const VPath &vpath, const QStringList &suffixes={""});
void invalidate_lookup_cache();
Expand Down Expand Up @@ -295,6 +276,14 @@ class AOApplication : public QApplication {
// Returns whether the given pos is a judge position
bool get_pos_is_judge(const QString &p_pos);

/**
* @brief Returns the duration of the transition animation between the two given positions, if it exists
*/
int get_pos_transition_duration(const QString &old_pos, const QString &new_pos);

// Returns the name of p_char
QString get_char_name(QString p_char);

// Returns the total amount of emotes of p_char
int get_emote_number(QString p_char);

Expand Down
52 changes: 45 additions & 7 deletions include/aolayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <QtConcurrent/QtConcurrentRun>
#include <QMutex>
#include <QWaitCondition>
#include <QGraphicsEffect>
#include <QPropertyAnimation>

class AOApplication;
class VPath;
Expand Down Expand Up @@ -72,6 +74,12 @@ class AOLayer : public QLabel {
// Stop the movie and clear all vectors
void kill();

// Start playback of the movie (if animated).
void play();

// Freeze the movie at the current frame.
void freeze();

// Set the m_flipped variable to true/false
void set_flipped(bool p_flipped) { m_flipped = p_flipped; }

Expand All @@ -84,17 +92,33 @@ class AOLayer : public QLabel {
// Move the label and center it
void move_and_center(int ax, int ay);

// Returns the scaling factor
float get_scaling_factor();

// This is somewhat pointless now as there's no "QMovie" object to resize, aka
// no "combo" to speak of
void combo_resize(int w, int h);

// Return the frame delay adjusted for speed
int get_frame_delay(int delay);

/**
* @brief Returns the x offset to use to ensure proper centering in the viewport.
* This is used by courtroom transition code to know exactly where to put the characters at the start and end of the animation.
* @return The offset to center the pixmap in the viewport
*/
int get_centered_offset();

// iterate through a list of paths and return the first entry that exists. if
// none exist, return NULL (safe because we check again for existence later)
QString find_image(QStringList p_list);

void fade(bool in, int duration);

QPropertyAnimation* slide(int newcenter, int duration);

void invert();

protected:
AOApplication *ao_app;
QVector<QPixmap> movie_frames;
Expand All @@ -117,6 +141,8 @@ class AOLayer : public QLabel {
int f_w = 0;
int f_h = 0;

float scaling_factor = 0.0;

int frame = 0;
int max_frames = 0;
int last_max_frames = 0;
Expand All @@ -127,20 +153,26 @@ class AOLayer : public QLabel {

int duration = 0;

// Start playback of the movie (if animated).
void play();

// Freeze the movie at the current frame.
void freeze();

// Retreive a pixmap adjused for mirroring/aspect ratio shenanigans from a
// provided QImage
QPixmap get_pixmap(QImage image);

// Set the movie's frame to provided pixmap
void set_frame(QPixmap f_pixmap);

// If set to anything other than -1, overrides center_pixmap to use it as a pixel position to center at
// Currently only used by background layers
int g_center = -1;
int last_center = -1; // g_center from the last image.
int centered_offset = 0;
// Center the QLabel in the viewport based on the dimensions of f_pixmap
void center_pixmap(QPixmap f_pixmap);
/*!
@brief Get the position to move us to, given the pixel X position of the point in the original image that we'd like to be centered.

@return The position to move to.
*/
int get_pos_from_center(int f_center);

private:
// Populates the frame and delay vectors.
Expand All @@ -161,13 +193,19 @@ protected slots:
virtual void preanim_done();
void shfx_timer_done();
virtual void movie_ticker();
virtual void fadeout_finished();
virtual void fadein_finished();
};

class BackgroundLayer : public AOLayer {
Q_OBJECT
public:
BackgroundLayer(QWidget *p_parent, AOApplication *p_ao_app);
void load_image(QString p_filename);
void load_image(QString p_filename, int center = -1);
signals:
void hide_void();
protected:
void fadein_finished() override; // overridden to send the courtroom a signal to hide the void element
};

class CharLayer : public AOLayer {
Expand Down
44 changes: 23 additions & 21 deletions include/courtroom.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "lobby.h"
#include "scrolltext.h"
#include "eventfilters.h"
#include "aoemotepreview.h"
#include "misc_functions.h"

#include <QCheckBox>
#include <QCloseEvent>
Expand Down Expand Up @@ -187,14 +187,11 @@ class Courtroom : public QMainWindow {
// sets the local mute list based on characters available on the server
void set_mute_list();

// Sets the local pair list based on the characters available on the server.
void set_pair_list();

// sets desk and bg based on pos in chatmessage
void set_scene(bool show_desk, QString f_side);

// sets ui_vp_player_char according to SELF_OFFSET, only a function bc it's used with desk_mod 4 and 5
void set_self_offset(const QString& p_list);
// sets p_layer according to SELF_OFFSET, only a function bc it's used with desk_mod 4 and 5
void set_self_offset(const QString& p_list, AOLayer* p_layer);

// takes in serverD-formatted IP list as prints a converted version to server
// OOC admittedly poorly named
Expand Down Expand Up @@ -264,12 +261,12 @@ class Courtroom : public QMainWindow {
// Handle the stuff that comes when the character appears on screen and starts animating (preanims etc.)
void handle_ic_message();

// Start the logic for doing a courtroom pan transition
void do_transition(QString desk_mod, QString old_pos, QString new_pos);

// Display the character.
void display_character();

// Display the character's pair if present.
void display_pair_character(QString other_charid, QString other_offset);

// Handle the emote modifier value and proceed through the logic accordingly.
void handle_emote_mod(int emote_mod, bool p_immediate);

Expand Down Expand Up @@ -365,6 +362,9 @@ class Courtroom : public QMainWindow {
QParallelAnimationGroup *screenshake_animation_group =
new QParallelAnimationGroup;

QParallelAnimationGroup *transition_animation_group = new QParallelAnimationGroup;


bool next_character_is_not_special = false; // If true, write the
// next character as it is.

Expand All @@ -383,9 +383,6 @@ class Courtroom : public QMainWindow {
// The vertical offset this user has given.
int char_vert_offset = 0;

// 0 = in front, 1 = behind
int pair_order = 0;

QVector<char_type> char_list;
QVector<evi_type> evidence_list;
QVector<QString> music_list;
Expand Down Expand Up @@ -496,6 +493,11 @@ class Courtroom : public QMainWindow {
static const int MS_MAXIMUM = 30;
QString m_chatmessage[MS_MAXIMUM];

/**
* @brief The amount of time to wait at the start and end of transition animations
*/
static const int TRANSITION_BOOKEND_DELAY = 300;

QString previous_ic_message = "";
QString additive_previous = "";

Expand Down Expand Up @@ -626,6 +628,11 @@ class Courtroom : public QMainWindow {
QString current_background = "default";
QString current_side = "";

// used for courtroom transition logic
QString last_side = "";
int last_offset = 0;
int last_v_offset = 0;

QString last_music_search = "";
QString last_area_search = "";

Expand All @@ -647,6 +654,7 @@ class Courtroom : public QMainWindow {
AOImage *ui_background;

QWidget *ui_viewport;
QLabel *ui_vp_void;
BackgroundLayer *ui_vp_background;
SplashLayer *ui_vp_speedlines;
CharLayer *ui_vp_player_char;
Expand Down Expand Up @@ -679,13 +687,9 @@ class Courtroom : public QMainWindow {
static const int max_clocks = 5;
AOClockLabel *ui_clock[max_clocks];

AOButton *ui_pair_button;
QListWidget *ui_pair_list;
QSpinBox *ui_pair_offset_spinbox;
QSpinBox *ui_pair_vert_offset_spinbox;

QComboBox *ui_pair_order_dropdown;

QLineEdit *ui_ic_chat_message;
AOLineEditFilter *ui_ic_chat_message_filter;
QLineEdit *ui_ic_chat_name;
Expand Down Expand Up @@ -840,6 +844,7 @@ public slots:
void objection_done();
void preanim_done();
void do_screenshake();
void on_transition_finish();
void do_flash();
void do_effect(QString fx_path, QString fx_sound, QString p_char,
QString p_folder);
Expand All @@ -858,7 +863,6 @@ private slots:
void chat_tick();

void on_mute_list_clicked(QModelIndex p_index);
void on_pair_list_clicked(QModelIndex p_index);

void on_chat_return_pressed();

Expand Down Expand Up @@ -938,8 +942,6 @@ private slots:
void on_screenshake_clicked();

void on_mute_clicked();
void on_pair_clicked();
void on_pair_order_dropdown_changed(int p_index);

void on_defense_minus_clicked();
void on_defense_plus_clicked();
Expand Down Expand Up @@ -1015,8 +1017,8 @@ private slots:
// Proceed to parse the oldest chatmessage and remove it from the stack
void chatmessage_dequeue();

void preview_emote(QString emote);
void update_emote_preview();
// After attempting to play a transition animation, clean up the viewport objects for everyone else and continue the IC processing callstack
void post_transition_cleanup();
};

#endif // COURTROOM_H
2 changes: 1 addition & 1 deletion include/datatypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ enum CHAT_MESSAGE {
REALIZATION,
TEXT_COLOR,
SHOWNAME,
OTHER_CHARID,
TRANSITION, // formerly OTHER_CHARID
OTHER_NAME,
OTHER_EMOTE,
SELF_OFFSET,
Expand Down
3 changes: 2 additions & 1 deletion include/misc_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#define MISC_FUNCTIONS_H

#include <QCoreApplication>
#include <QTime>
#include <QEventLoop>
#include <QTimer>

void delay(int p_milliseconds);

Expand Down
Loading