Skip to content
This repository was archived by the owner on Jul 24, 2025. It is now read-only.
Open
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
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,32 @@
This is the official client used, it is a derivative of [Attorney-Online-Client-Remake](https://github.com/AttorneyOnline/AO2-Client).

## Qt
This project uses Qt 5.15.2 (5.12.8 for Linux), 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.
This project uses Qt 5.15.2 (5.12.8 for Linux, and 5.15.13 for MacOS via [Homebrew](https://brew.sh/)), 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) 2022 The Qt Company Ltd.

## BASS
This project uses [BASS shared library](http://www.un4seen.com/).

Copyright (c) 1999-2022 Un4seen Developments Ltd. All rights reserved.

## Discord-RPC
This project uses the deprecated [discord-rpc library](https://github.com/discord/discord-rpc).

## VLC-Qt
This project uses [VLC-Qt 1.1.0](https://vlc-qt.tano.si/) in order to play videos with bundled codecs. You may find the source code and the binaries here: https://github.com/vlc-qt/vlc-qt

Copyright (C) 2010-2016 Tadej Novak

## Recommended Compilers in QtCreator

For development work on Windows to make 64-bit binaries, please use the MSVC2019 compiler. You will need to install the MSVC2019 Build Tools from the following website:
https://learn.microsoft.com/en-au/visualstudio/releases/2019/history

For development work on Windows to make 32-bit binaries, please use the MingW32-bit compiler.

For development work on the Mac to make 64-bit Silicon binaries, please use Clang (C/C++ arm 64bit).

For development work on the Mac to make 64-bit Intel binaries, please use Apple Clang (x64_64).

NOTE: If you get a `windeployqt` or `macdeployqt` not found error, you need to manually go to "QtCreator > Projects > Edit Build Configuration (Release) > Build Environment > Edit Path" and add the folder containing the correct version of the deployqt script (be sure to use the one matching the compiler and Qt version). For example, on Windows if using the default installation path, the path for MSVC2019 64-bit is `C:\Qt\5.15.2\msvc2019_64\bin`
65 changes: 55 additions & 10 deletions dronline-client.pro
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,26 @@ VERSION = 2.0.0
TARGET = dro-client

RC_ICONS = icon.ico
TARGETPLATFORM = unknown

INCLUDEPATH += $$PWD/include $$PWD/src $$PWD/3rd
DEPENDPATH += $$PWD/include $$PWD/src $$PWD/3rd
INCLUDEPATH += $$PWD/include $$PWD/src
DEPENDPATH += $$PWD/include $$PWD/src

win32 {
!contains(QMAKE_HOST.arch, x86_64) {
TARGETPLATFORM = win32
} else {
TARGETPLATFORM = win64
}
}
macx {
TARGETPLATFORM = macx64
}

message("TARGETPLATFORM = $$TARGETPLATFORM")

INCLUDEPATH += $$PWD/3rd/$$TARGETPLATFORM
DEPENDPATH += $$PWD/3rd/$$TARGETPLATFORM

HEADERS += \
src/aoapplication.h \
Expand Down Expand Up @@ -281,14 +298,6 @@ SOURCES += \
src/utils.cpp \
src/version.cpp

# 1. You need to get BASS and put the x86 bass DLL/headers in the project root folder
# AND the compilation output folder. If you want a static link, you'll probably
# need the .lib file too. MinGW-GCC is really finicky finding BASS, it seems.
# 2. You need to compile the Discord Rich Presence SDK separately and add the lib/headers
# in the same way as BASS. Discord RPC uses CMake, which does not play nicely with
# QMake, so this step must be manual.
LIBS += -L$$PWD/3rd -lbass -lbassopus -ldiscord-rpc

RESOURCES += \
res.qrc

Expand All @@ -304,3 +313,39 @@ FORMS += \
# Mac stuff
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13
ICON = icon.icns

# 1. You need to get BASS and put the x86 bass DLL/headers in the project root folder
# AND the compilation output folder. If you want a static link, you'll probably
# need the .lib file too. MinGW-GCC is really finicky finding BASS, it seems.
# 2. You need to compile the Discord Rich Presence SDK separately and add the lib/headers
# in the same way as BASS. Discord RPC uses CMake, which does not play nicely with
# QMake, so this step must be manual.
# 3. You need to get VLC-Qt and place them in the 3rd folder too. Be sure to include the
# plugins folder too which contains all the codecs that VLC uses. If you're compiling
# on MacOS, copy the framework folders directly
win32 {
LIBS += -L$$PWD/3rd/$$TARGETPLATFORM -lbass -lbassopus -ldiscord-rpc -lVLCQtCore -lVLCQtWidgets
}
macx {
LIBS += -L$$PWD/3rd/$$TARGETPLATFORM -lbass -lbassopus -ldiscord-rpc
LIBS += -F$$PWD/3rd/$$TARGETPLATFORM -framework VLCQtCore -framework VLCQtWidgets
QMAKE_APPLE_DEVICE_ARCHS = x86_64
}

CONFIG( debug, debug|release ) {
# debug, copy 3rd party libraries only for windows
win32 {
QMAKE_POST_LINK += $$quote(python3 $$PWD/post-build-script.py $$TARGETPLATFORM$$escape_expand(\n\t))
}
} else {
# release, copy 3rd party libraries always
QMAKE_POST_LINK += $$quote(python3 $$PWD/post-build-script.py $$TARGETPLATFORM$$escape_expand(\n\t))

# Run deployqt to copy Qt libraries
win32 {
QMAKE_POST_LINK += windeployqt $$shell_quote($$shell_path($${OUT_PWD}/release/$${TARGET}.exe))$$escape_expand(\n\t)
}
macx {
QMAKE_POST_LINK += macdeployqt $$shell_quote($$shell_path($${OUT_PWD}/$${TARGET}.app)) -dmg -always-overwrite$$escape_expand(\n\t)
}
}
53 changes: 53 additions & 0 deletions post-build-script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import os
import sys
import glob
import shutil

if len(sys.argv) != 2:
print('This script takes exactly one argument: win32, win64 or macx64')
exit(1)

libs_dir = sys.argv[1]
pro_dir = os.path.dirname(os.path.realpath(__file__))
build_dir = os.getcwd()

# Check what platform the build directory is
if glob.glob(build_dir + '/release/*.exe'):
platform = 'win'
type_dir = 'release'
print('Windows release build detected. Proceeding to copy Windows libraries')
elif glob.glob(build_dir + '/debug/*.exe'):
platform = 'win'
type_dir = 'debug'
print('Windows debug build detected. Proceeding to copy Windows libraries')
elif glob.glob(build_dir + '/*.app'):
platform = 'mac'
macapp_dir = glob.glob(build_dir + '/*.app')[0]
print('MacOS build detected. Proceeding to copy MacOS libraries')
else:
platform = 'unknown'
print('Unable to detect platform of build binary.')
exit(1)

# Copies all the DLLs over
if platform == 'win':
for file in glob.glob(pro_dir + '/3rd/' + libs_dir + '/*.dll'):
print('Copying', file)
shutil.copy2(file, build_dir + '/' + type_dir + '/')
for file in glob.glob(pro_dir + '/3rd/' + libs_dir + '/*.lib'):
print('Copying', file)
shutil.copy2(file, build_dir + '/' + type_dir + '/')
print('Copying directory ' + pro_dir + '/3rd/' + libs_dir + '/plugins')
shutil.copytree(pro_dir + '/3rd/' + libs_dir + '/plugins', build_dir + '/' + type_dir + '/plugins', dirs_exist_ok=True, symlinks=True, ignore_dangling_symlinks=True)
elif platform == 'mac':
if not os.path.isdir(macapp_dir + '/Contents/Frameworks/'):
os.makedirs(macapp_dir + '/Contents/Frameworks/')
for file in glob.glob(pro_dir + '/3rd/' + libs_dir + '/*.dylib'):
print('Copying', file)
shutil.copy2(file, macapp_dir + '/Contents/Frameworks/')
for file in glob.glob(pro_dir + '/3rd/' + libs_dir + '/*.framework'):
print('Copying', file)
dest_dir = macapp_dir + '/Contents/Frameworks/' + os.path.basename(file)
if os.path.isdir(dest_dir):
shutil.rmtree(dest_dir)
shutil.copytree(file, dest_dir, dirs_exist_ok=True, symlinks=True, ignore_dangling_symlinks=True)
34 changes: 30 additions & 4 deletions res/ui/config_panel.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>890</width>
<height>544</height>
<height>572</height>
</rect>
</property>
<property name="sizePolicy">
Expand Down Expand Up @@ -62,7 +62,7 @@
</size>
</property>
<property name="currentIndex">
<number>3</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
Expand Down Expand Up @@ -116,6 +116,32 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="minimumSize">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
<property name="title">
<string>Video</string>
</property>
<widget class="QCheckBox" name="video_backend_vlc">
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>691</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Use libvlc to play videos (better support for MacOS)</string>
</property>
</widget>
</widget>
</item>
<item>
<widget class="QLabel" name="translationCredit">
<property name="text">
Expand Down Expand Up @@ -1628,8 +1654,8 @@
<rect>
<x>10</x>
<y>190</y>
<width>247</width>
<height>26</height>
<width>262</width>
<height>32</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
Expand Down
3 changes: 2 additions & 1 deletion src/aoapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class AOApplication : public QApplication
AOApplication(int &argc, char **argv);
~AOApplication();

AOConfig *ao_config = nullptr;

int get_client_id() const;
void set_client_id(int id);

Expand Down Expand Up @@ -219,7 +221,6 @@ public slots:
void server_status_changed(ServerStatus);

private:
AOConfig *ao_config = nullptr;
AOConfigPanel *ao_config_panel = nullptr;
DRDiscord *dr_discord = nullptr;

Expand Down
39 changes: 39 additions & 0 deletions src/aoconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ private slots:
int fade_duration;
bool blank_blips;

// video
bool is_video_backend_vlc;

// audio sync
DRAudioEngine *audio_engine = nullptr;
};
Expand Down Expand Up @@ -240,6 +243,26 @@ void AOConfigPrivate::load_file()
SceneManager::get().setFadeDuration(fade_duration);
blank_blips = cfg.value("blank_blips").toBool();

#ifdef QT_DEBUG
#ifdef Q_CC_MSVC
is_video_backend_vlc = false;
qWarning() << "NOTE: libvlc automatically turned off for MSVC debug mode because it VLC-Qt seems to crash with it.";
#else
#ifdef Q_OS_MAC
is_video_backend_vlc = cfg.value("video_backend", "vlc").toString() == "vlc";
#else
is_video_backend_vlc = cfg.value("video_backend", "qt").toString() == "vlc";
#endif
#endif
#else
// video
#ifdef Q_OS_MAC
is_video_backend_vlc = cfg.value("video_backend", "vlc").toString() == "vlc";
#else
is_video_backend_vlc = cfg.value("video_backend", "qt").toString() == "vlc";
#endif
#endif

// audio update
audio_engine->set_volume(master_volume);
audio_engine->get_family(DRAudio::Family::FSystem)->set_volume(system_volume);
Expand Down Expand Up @@ -351,6 +374,9 @@ void AOConfigPrivate::save_file()
cfg.setValue("fade_duration", fade_duration);
cfg.setValue("blank_blips", blank_blips);

// video
cfg.setValue("video_backend", is_video_backend_vlc ? "vlc" : "qt");

cfg.remove("character_ini");
{ // ini swap
cfg.beginGroup("character_ini");
Expand Down Expand Up @@ -751,6 +777,11 @@ int AOConfig::fade_duration() const
return d->fade_duration;
}

bool AOConfig::video_backend_vlc() const
{
return d->is_video_backend_vlc;
}

void AOConfig::load_file()
{
d->load_file();
Expand Down Expand Up @@ -1252,5 +1283,13 @@ void AOConfig::setFadeDuration(int duration)
d->invoke_signal("fade_duration_changed", Q_ARG(int, duration));
}

void AOConfig::set_video_backend_vlc(bool p_video_backend_vlc)
{
if (d->is_video_backend_vlc == p_video_backend_vlc)
return;
d->is_video_backend_vlc = p_video_backend_vlc;
d->invoke_signal("fade_duration_changed", Q_ARG(bool, d->is_video_backend_vlc));
}

// moc
#include "aoconfig.moc"
12 changes: 12 additions & 0 deletions src/aoconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define AOCONFIG_H

#include "datatypes.h"
#include "aoapplication.h"

#include <QObject>

Expand All @@ -15,6 +16,8 @@ class AOConfig : public QObject
AOConfig(QObject *p_parent = nullptr);
~AOConfig();

AOApplication* ao_app = nullptr;

// generic getters
QString get_string(QString p_name, QString p_default = nullptr) const;
bool get_bool(QString p_name, bool p_default = false) const;
Expand Down Expand Up @@ -85,6 +88,9 @@ class AOConfig : public QObject
double theme_resize() const;
int fade_duration() const;

// video
bool video_backend_vlc() const;

// io
public slots:
void load_file();
Expand Down Expand Up @@ -155,6 +161,9 @@ public slots:
void setThemeResize(double resize);
void setFadeDuration(int duration);

// video
void set_video_backend_vlc(bool p_video_backend_vlc);

// signals
signals:
// meta
Expand Down Expand Up @@ -226,6 +235,9 @@ public slots:
void punctuation_delay_changed(int);
void blank_blips_changed(bool);

// video
void video_backend_vlc_changed(bool);

//Theme
void theme_resize_changed(double);
void fade_duration_changed(int);
Expand Down
Loading