Merge pull request #33 from AttorneyOnline/mega-merge
AOV/Case Cafe feature parity
19
.gitignore
vendored
@ -7,3 +7,22 @@ base_override.h
|
|||||||
|
|
||||||
base-full/
|
base-full/
|
||||||
bass.lib
|
bass.lib
|
||||||
|
|
||||||
|
bins/
|
||||||
|
release/
|
||||||
|
debug/
|
||||||
|
|
||||||
|
.qmake.stash
|
||||||
|
|
||||||
|
Makefile*
|
||||||
|
object_script*
|
||||||
|
/Attorney_Online_remake_resource.rc
|
||||||
|
/attorney_online_remake_plugin_import.cpp
|
||||||
|
|
||||||
|
server/__pycache__
|
||||||
|
discord/
|
||||||
|
|
||||||
|
*.o
|
||||||
|
moc*
|
||||||
|
/Attorney_Online_CC_resource.rc
|
||||||
|
/attorney_online_cc_plugin_import.cpp
|
||||||
|
@ -5,15 +5,14 @@
|
|||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
|
|
||||||
QT += core gui multimedia network
|
QT += core gui multimedia network
|
||||||
|
|
||||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||||
|
|
||||||
RC_ICONS = logo.ico
|
RC_ICONS = logo.ico
|
||||||
|
|
||||||
TARGET = Attorney_Online_remake
|
TARGET = Attorney_Online
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
|
|
||||||
VERSION = 2.4.10.0
|
VERSION = 2.6.0.0
|
||||||
|
|
||||||
SOURCES += main.cpp\
|
SOURCES += main.cpp\
|
||||||
lobby.cpp \
|
lobby.cpp \
|
||||||
@ -48,7 +47,10 @@ SOURCES += main.cpp\
|
|||||||
aolineedit.cpp \
|
aolineedit.cpp \
|
||||||
aotextedit.cpp \
|
aotextedit.cpp \
|
||||||
aoevidencedisplay.cpp \
|
aoevidencedisplay.cpp \
|
||||||
discord_rich_presence.cpp
|
discord_rich_presence.cpp \
|
||||||
|
aooptionsdialog.cpp \
|
||||||
|
chatlogpiece.cpp \
|
||||||
|
aocaseannouncerdialog.cpp
|
||||||
|
|
||||||
HEADERS += lobby.h \
|
HEADERS += lobby.h \
|
||||||
aoimage.h \
|
aoimage.h \
|
||||||
@ -78,18 +80,36 @@ HEADERS += lobby.h \
|
|||||||
aotextedit.h \
|
aotextedit.h \
|
||||||
aoevidencedisplay.h \
|
aoevidencedisplay.h \
|
||||||
discord_rich_presence.h \
|
discord_rich_presence.h \
|
||||||
discord-rpc.h
|
discord-rpc.h \
|
||||||
|
aooptionsdialog.h \
|
||||||
|
text_file_functions.h \
|
||||||
|
chatlogpiece.h \
|
||||||
|
aocaseannouncerdialog.h
|
||||||
|
|
||||||
# You need to compile the Discord Rich Presence SDK separately and add the lib/headers.
|
# 1. You need to get BASS and put the x86 bass DLL/headers in the project root folder
|
||||||
# Discord RPC uses CMake, which does not play nicely with QMake, so this step must be manual.
|
# AND the compilation output folder. If you are compiling statically, you'll probably
|
||||||
|
# need the .lib file too. MinGW-GCC is really finicky finding BASS, it seems. However,
|
||||||
unix:LIBS += -L$$PWD -ldiscord-rpc
|
# even with the .lib file, you still need the DLL in the final output.
|
||||||
win32:LIBS += -L$$PWD -ldiscord-rpc #"$$PWD/discord-rpc.dll"
|
# 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. If you are compiling dynamically, it's fine to
|
||||||
|
# use the prebuilt libraries.
|
||||||
|
# 3. You also need to build QtApng (https://github.com/Skycoder42/QtApng).
|
||||||
|
# Optionally, you may install it in /usr/share/qt5/plugins/imageformats, but if you do
|
||||||
|
# so, then you must patch qapng.pri, qapngd.pri, png.pri, pngd.pri, z.pri, and zd.pri
|
||||||
|
# such that they no longer point to the builds in the original project directory
|
||||||
|
# (by removing those respective entries in QMAKE_PRL_LIBS and replacing them with
|
||||||
|
# something like `-L$$[QT_INSTALL_LIBS] -lpng -lz`).
|
||||||
|
#
|
||||||
|
# Naturally, the build process becomes significantly less convoluted if you simply
|
||||||
|
# compile dynamically. If your primary distribution method is via the launcher, then
|
||||||
|
# a simple dynamic compilation is recommended.
|
||||||
|
unix:LIBS += -L$$PWD -lbass -ldiscord-rpc
|
||||||
|
win32:LIBS += -L$$PWD "$$PWD/bass.dll" -ldiscord-rpc
|
||||||
|
INCLUDEPATH += $$PWD/include
|
||||||
|
|
||||||
CONFIG += c++11
|
CONFIG += c++11
|
||||||
|
|
||||||
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
|
|
||||||
|
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
resources.qrc
|
resources.qrc
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2018 David Skoland, oldmud0
|
Copyright (c) 2018 David Skoland, oldmud0, Cerapter
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
238
README.md
@ -1,9 +1,232 @@
|
|||||||
# Attorney-Online-Client-Remake
|
# Attorney Online 2
|
||||||
|
|
||||||
|
[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.
|
||||||
|
|
||||||
|
## Introduction for beginners
|
||||||
|
|
||||||
|
You may already be familiar with roleplaying in forums, Roll20, and/or [AAO](http://aaonline.fr/) (the online casemaker). In this sense, Attorney Online is nothing more than a medium - an animated chatroom client - that allows cases to be played out as if it were an Ace Attorney game.
|
||||||
|
|
||||||
|
Not unlike other roleplaying games, cases can last an absurd amount of time (between 4 to 6 hours) and generally follow a roleplaying format directed by a case sheet.
|
||||||
|
|
||||||
|
An implied expectation for fast typing and real-time communication may seem daunting at first, but due to the number of people in the courtroom, things get hectic very quickly even with only a few people talking. Therefore, you should not feel pressured to talk constantly: only when you have the attention of the court (or when you have an objection to make) should you feel the need to speak.
|
||||||
|
|
||||||
|
It is recommended, but not strictly necessary, to have played an Ace Attorney game before creating your own case. You should also try to spectate or take part in a community case in order to get a grasp of how cases are done in practice.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Basic features
|
||||||
|
|
||||||
|
### In-character chat
|
||||||
|
|
||||||
|
Type in a message in the gray box under the viewport, select an emote, and press Enter.
|
||||||
|
|
||||||
|
### Emotes
|
||||||
|
|
||||||
|
An emote represents a set of animations played while the character is speaking and idle. Some emotes also contain a preanimation, which is played before the text is said by the character.
|
||||||
|
|
||||||
|
### Interjections (shouts)
|
||||||
|
|
||||||
|
Select an interjection to toggle it. When you send a message, it will interrupt all other dialogue and interject with your message.
|
||||||
|
|
||||||
|
### Out-of-character chat
|
||||||
|
|
||||||
|
This is a general-purpose chat isolated within areas to discuss matters without interrupting cases. You must enter a name before chatting.
|
||||||
|
|
||||||
|
### Music list
|
||||||
|
|
||||||
|
Double-click a track to play it. Some servers automatically loop the track. Green tracks are available locally; red tracks are not.
|
||||||
|
|
||||||
|
### Areas
|
||||||
|
|
||||||
|
Servers have multiple areas to hold multiple cases simultaneously. Double-click an area in the music list to switch to it. (The reason that
|
||||||
|
areas are in the music list is a historical one.)
|
||||||
|
|
||||||
|
### Judge controls
|
||||||
|
|
||||||
|
The judge can set health bars and play the Witness Testimony, Cross Examination, Guilty, and Not Guilty animations.
|
||||||
|
|
||||||
|
### Mod calls
|
||||||
|
|
||||||
|
Calling a mod notifies moderators currently in the server of an incident. (Mod call reasons require 2.6+ server-side support.) Logged-in moderators can toggle the Guard option to be notified of mod calls.
|
||||||
|
|
||||||
|
### Muting
|
||||||
|
|
||||||
|
Click on a character in the mute list to ignore any in-character chat from the specified character.
|
||||||
|
|
||||||
|
### Positions
|
||||||
|
|
||||||
|
All characters have a default position within the courtroom, but they can nonetheless be changed within the interface.
|
||||||
|
|
||||||
|
Available positions:
|
||||||
|
|
||||||
|
- `def` - Defense
|
||||||
|
- `pro` - Prosecution
|
||||||
|
- `hld` - Helper defense
|
||||||
|
- `hlp` - Helper prosecution
|
||||||
|
- `jud` - Judge
|
||||||
|
- `wit` - Witness
|
||||||
|
- `jur` - Juror (2.6+)
|
||||||
|
- `sea` - Seance (2.6+)
|
||||||
|
|
||||||
|
## Advanced features
|
||||||
|
|
||||||
|
### Markup language
|
||||||
|
|
||||||
|
2.6.0 introduces a markup language for in-character chat. It does not require server-side support.
|
||||||
|
|
||||||
|
#### Color
|
||||||
|
|
||||||
|
Wrapping text with these characters will set the text inside of them to the associated color.
|
||||||
|
|
||||||
|
- `(` and `)` (parentheses) - blue
|
||||||
|
- \` (backtick) - green
|
||||||
|
- `|` (vertical bar) - orange
|
||||||
|
- `[` and `]` (square brackets) - grey
|
||||||
|
|
||||||
|
#### Speed
|
||||||
|
|
||||||
|
Type `{` to slow down the text a bit, and `}` to speed it up. This takes effect after the character has been typed, so the text may take up different speeds at different points. Both of these can be stacked up to three times, and even against each other.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
```
|
||||||
|
Hello there! This text goes at normal speed.} Now, it's a bit faster!{ Now, it's back to normal.}}} Now it goes at maximum speed! {{Now it's only a little bit faster than normal.
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Position
|
||||||
|
|
||||||
|
If you begin a message with `~~` (two tildes), the two tildes are removed and the message is centered.
|
||||||
|
|
||||||
|
### Pairing (2.6+)
|
||||||
|
|
||||||
|
If two players are in the same position and select each other's characters using the in-game pair list (or with `/pair [id]`), they will appear alongside each other. You can set the offset of your character using the provided spinbox (or with `/offset [percentage]`).
|
||||||
|
|
||||||
|
### Non-interrupting preanimations (2.6+)
|
||||||
|
|
||||||
|
When checked, this will force text to immediately begin displaying without waiting for the preanimation to finish.
|
||||||
|
|
||||||
|
### Custom IC names (shownames) (2.6+)
|
||||||
|
|
||||||
|
You can set a custom in-character name using the provided text box. An option in the interface (or `/force_nonint_pres`) is also present to disable custom IC names for other players to prevent impersonation.
|
||||||
|
|
||||||
|
### Extended area support (2.6+)
|
||||||
|
|
||||||
|
Areas can be listed by clicking the A/M button (or `/switch_am`). The statuses of such areas are displayed (and updated automatically) if the server has 2.6+ support.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Upgrade guide for 2.6
|
||||||
|
|
||||||
|
2.6 inherits features from the Case Café custom client and server. Old themes and servers will still work, but they will not expose the new additions to players.
|
||||||
|
|
||||||
|
### Server
|
||||||
|
|
||||||
|
2.6 support has only been developed for tsuserver3. serverD is currently not equipped at all for such support.
|
||||||
|
|
||||||
|
- Apply the new code changes.
|
||||||
|
- In `areas.yaml`:
|
||||||
|
- You may add `shouts_allowed` to any of the areas to enable / disable shouts (and judge buttons, and realisation). By default, it's `shouts_allowed: true`.
|
||||||
|
- You may add `jukebox` to any of the areas to enable the jukebox in there, but you can also use `/jukebox_toggle` in game as a mod to do the same thing. By default, it's `jukebox: false`.
|
||||||
|
- You may add `showname_changes_allowed` to any of the areas to allow custom shownames used in there. If it's forbidden, players can't send messages or change music as long as they have a custom name set. By default, it's `showname_changes_allowed: false`.
|
||||||
|
- You may add `abbreviation` to override the server-generated abbreviation of the area. Instead of area numbers, this server-pack uses area abbreviations in server messages for easier understanding (but still uses area IDs in commands, of course). No default here, but here is an example: `abbreviation: SIN` gives the area the abbreviation of 'SIN'.
|
||||||
|
- You may add `noninterrupting_pres` to force users to use non-interrupting pres only. 2.6 users will see the pres play as the text goes; pre-2.6 users will not see pres at all. The default is `noninterrupting_pres: false`.
|
||||||
|
|
||||||
|
### Client themes
|
||||||
|
|
||||||
|
- You'll need the following, additional images:
|
||||||
|
- `notguilty.gif` - Not Guilty verdict animation
|
||||||
|
- `guilty.gif` - Guilty verdict animation
|
||||||
|
- `notguilty.png` - Not Guilty button
|
||||||
|
- `guilty.png` - Guilty button
|
||||||
|
- `pair_button.png` - Pair button
|
||||||
|
- `pair_button_pressed.png` - Pair button (selected)
|
||||||
|
- In your `courtroom_sounds.ini`:
|
||||||
|
- Add a sound effect for `not_guilty`, for example: `not_guilty = sfx-notguilty.wav`.
|
||||||
|
- Add a sound effect for `guilty`, for example: `guilty = sfx-guilty.wav`.
|
||||||
|
- Add a sound effect for the case alerts. They work similarly to modcall alerts, or callword alerts. For example: `case_call = sfx-triplegavel-soj.wav`.
|
||||||
|
- In your `courtroom_design.ini`, place the following new UI elements as desired:
|
||||||
|
- `log_limit_label`, which is a simple text that explains what the spinbox with the numbers is. Needs an X, Y, width, height number.
|
||||||
|
- `log_limit_spinbox`, which is the spinbox for the log limit, allowing you to set the size of the log limit in-game. Needs the same stuff as above.
|
||||||
|
- `ic_chat_name`, which is an input field for your custom showname. Needs the same stuff.
|
||||||
|
- `ao2_ic_chat_name`, which is the same as above, but comes into play when the background has a desk.
|
||||||
|
- Further comments on this: all `ao2_` UI elements come into play when the background has a desk. However, in AO2 nowadays, it's customary for every background to have a desk, even if it's just an empty gif. So you most likely have never seen the `ao2_`-less UI elements ever come into play, unless someone mis-named a desk or something.
|
||||||
|
- `showname_enable` is a tickbox that toggles whether you should see shownames or not. This does not influence whether you can USE custom shownames or not, so you can have it off, while still showing a custom showname to everyone else. Needs X, Y, width, height as usual.
|
||||||
|
- `settings` is a plain button that takes up the OS's looks, like the 'Call mod' button. Takes the same arguments as above.
|
||||||
|
- You can also just type `/settings` in OOC.
|
||||||
|
- `char_search` is a text input box on the character selection screen, which allows you to filter characters down to name. Needs the same arguments.
|
||||||
|
- `char_passworded` is a tickbox, that when ticked, shows all passworded characters on the character selection screen. Needs the same as above.
|
||||||
|
- `char_taken` is another tickbox, that does the same, but for characters that are taken.
|
||||||
|
- `not_guilty` is a button similar to the CE / WT buttons, that if pressed, plays the Not Guilty verdict animation. Needs the same arguments.
|
||||||
|
- `guilty` is similar to `not_guilty`, but for the Guilty verdict.
|
||||||
|
- `pair_button` is a toggleable button, that shows and hides the pairing list and the offset spinbox. Works similarly to the mute button.
|
||||||
|
- `pair_list` is a list of all characters in alphabetical order, shown when the user presses the Pair button. If a character is clicked on it, it is selected as the character the user wants to pair up with.
|
||||||
|
- `pair_offset_spinbox` is a spinbox that allows the user to choose between offsets of -100% to 100%.
|
||||||
|
- `switch_area_music` is a button with the text 'A/M', that toggles between the music list and the areas list. Though the two are different, they are programmed to take the same space.
|
||||||
|
- `pre_no_interrupt` is a tickbox with the text 'No Intrpt', that toggles whether preanimations should delay the text or not.
|
||||||
|
- `area_free_color` is a combination of red, green, and blue values ranging from 0 to 255. This determines the colour of the area in the Area list if it's free, and has a status of `IDLE`.
|
||||||
|
- `area_lfp_color` determines the colour of the area if its status is `LOOKING-FOR-PLAYERS`.
|
||||||
|
- `area_casing_color` determines the colour of the area if its status is `CASING`.
|
||||||
|
- `area_recess_color` determines the colour of the area if its status is `RECESS`.
|
||||||
|
- `area_rp_color` determines the colour of the area if its status is `RP`.
|
||||||
|
- `area_gaming_color` determines the colour of the area if its status is `GAMING`.
|
||||||
|
- `area_locked_color` determines the colour of the area if it is locked, regardless of status.
|
||||||
|
- `ooc_default_color` determines the colour of the username in the OOC chat if the message doesn't come from the server.
|
||||||
|
- `ooc_server_color` determines the colour of the username if the message arrived from the server.
|
||||||
|
- `casing_button` is a button with the text 'Casing' that when clicked, brings up the Case Announcements dialog. You can give the case a name, and tick whom do you want to alert. You need to be a CM for it to go through. Only people who have at least one of the roles ticked will get the alert.
|
||||||
|
- `casing` is a tickbox with the text 'Casing'. If ticked, you will get the case announcements alerts you should get, in accordance to the above. In the settings, you can change your defaults on the 'Casing' tab. (That's a buncha things titled 'Casing'!)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Compiling
|
||||||
|
|
||||||
|
The traditional route is by undergoing the [AO2 Rite of Passage](https://gist.github.com/oldmud0/6c645bd1667370c3e92686f7d0642c38). Recently, however, it has become more feasible to get away with a dynamic compilation, which is much easier for beginners and requires less setup.
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
- [QtApng](https://github.com/Skycoder42/QtApng)
|
||||||
|
- [BASS](http://un4seen.com) (proprietary, but will become optional in the future; see #35)
|
||||||
|
- [Discord Rich Presence](https://github.com/discordapp/discord-rpc)
|
||||||
|
|
||||||
|
## Release instructions
|
||||||
|
|
||||||
|
Follow these steps to make a new full release:
|
||||||
|
|
||||||
|
- Set a new AO version in the `.pro` file and in `aoapplication.h`.
|
||||||
|
- Compile the project.
|
||||||
|
- Commit the version bump and and create a tag for the commit.
|
||||||
|
- Rename the executable to `Attorney_Online`.
|
||||||
|
- Create a temp directory.
|
||||||
|
- Copy a fresh `base` folder to the temp dir. Ensure that the timestamps are consistent.
|
||||||
|
- Ignore this step if creating a client-only release.
|
||||||
|
- Copy the repository's `base` folder to the temp dir.
|
||||||
|
- Append `.sample` to the names of all `.ini` files, including `serverlist.txt`.
|
||||||
|
- Copy the game executable to the temp dir.
|
||||||
|
- Copy `bass.dll`, `discord-rpc.dll`, and `qapng.dll` if applicable.
|
||||||
|
- Copy `README.md` as `README.md.txt` with CRLF line endings.
|
||||||
|
- Copy `LICENSE` as `LICENSE.txt` with CRLF line endings.
|
||||||
|
- Compress the contents of the temp dir to an archive with maximum compression, but
|
||||||
|
be sure that the contents are placed inside the root directory of the archive and not
|
||||||
|
within a subdirectory.
|
||||||
|
- Compute the SHA-1 hash of the archive.
|
||||||
|
- Upload the archive to the Wasabi bucket and an additional mirror (e.g. MEGA or OneDrive)
|
||||||
|
(if this is a full release).
|
||||||
|
- Publish a GitHub release and upload the archive there (if this is a client-only release).
|
||||||
|
- Add the new version to the `program.json` manifest for the respective platform
|
||||||
|
(if this is a client-only release).
|
||||||
|
- Update the following on the website for the respective platform:
|
||||||
|
- Full download links (Wasabi and mirror)
|
||||||
|
- Client download link
|
||||||
|
- Full download hash
|
||||||
|
- Client download hash
|
||||||
|
|
||||||
|
Repeat for each platform (currently 32-bit Windows and 64-bit Linux). Once you're done, don't forget to announce your release!
|
||||||
|
|
||||||
|
## Credits
|
||||||
|
|
||||||
This is a open-source remake of Attorney Online written by OmniTroid. The original Attorney Online client was written by FanatSors in Delphi.
|
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.
|
The logo (`logo.png` and `logo.ico`) was designed by Lucas Carbi. The characters depicted in the logo are owned by Capcom.
|
||||||
|
|
||||||
## License
|
### Project
|
||||||
|
|
||||||
The project is dual-licensed; you are free to copy, modify and distribute AO2 under the GPLv3 or the MIT license.
|
The project is dual-licensed; you are free to copy, modify and distribute AO2 under the GPLv3 or the MIT license.
|
||||||
|
|
||||||
@ -11,7 +234,16 @@ Copyright (c) 2016-2018 David "OmniTroid" Skoland
|
|||||||
|
|
||||||
Modifications copyright (c) 2017-2018 oldmud0
|
Modifications copyright (c) 2017-2018 oldmud0
|
||||||
|
|
||||||
## Qt
|
Case Café additions copyright (c) 2018 Cerapter
|
||||||
|
|
||||||
|
### 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.
|
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.
|
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.
|
||||||
|
@ -1,79 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<manifest package="com.aceattorneyonline.ao2" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.3.5.0" android:versionCode="2" android:installLocation="auto">
|
|
||||||
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="Attorney Online 2" android:icon="@drawable/icon">
|
|
||||||
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="Attorney Online 2 Lobby" android:screenOrientation="unspecified" android:launchMode="singleTop">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
|
||||||
</intent-filter>
|
|
||||||
|
|
||||||
<!-- Application arguments -->
|
|
||||||
<!-- meta-data android:name="android.app.arguments" android:value="arg1 arg2 arg3"/ -->
|
|
||||||
<!-- Application arguments -->
|
|
||||||
|
|
||||||
<meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
|
|
||||||
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
|
|
||||||
<meta-data android:name="android.app.repository" android:value="default"/>
|
|
||||||
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
|
|
||||||
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
|
|
||||||
<!-- Deploy Qt libs as part of package -->
|
|
||||||
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
|
|
||||||
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
|
|
||||||
<meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
|
|
||||||
<!-- Run with local libs -->
|
|
||||||
<meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
|
|
||||||
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
|
|
||||||
<meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/>
|
|
||||||
<meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
|
|
||||||
<meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
|
|
||||||
<!-- Messages maps -->
|
|
||||||
<meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
|
|
||||||
<meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
|
|
||||||
<meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
|
|
||||||
<!-- Messages maps -->
|
|
||||||
|
|
||||||
<!-- Splash screen -->
|
|
||||||
<!-- meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/ -->
|
|
||||||
<!-- meta-data android:name="android.app.splash_screen_sticky" android:value="true"/ -->
|
|
||||||
<!-- Splash screen -->
|
|
||||||
|
|
||||||
<!-- Background running -->
|
|
||||||
<!-- Warning: changing this value to true may cause unexpected crashes if the
|
|
||||||
application still try to draw after
|
|
||||||
"applicationStateChanged(Qt::ApplicationSuspended)"
|
|
||||||
signal is sent! -->
|
|
||||||
<meta-data android:name="android.app.background_running" android:value="false"/>
|
|
||||||
<!-- Background running -->
|
|
||||||
|
|
||||||
<!-- auto screen scale factor -->
|
|
||||||
<meta-data android:name="android.app.auto_screen_scale_factor" android:value="false"/>
|
|
||||||
<!-- auto screen scale factor -->
|
|
||||||
|
|
||||||
<!-- extract android style -->
|
|
||||||
<!-- available android:values :
|
|
||||||
* full - useful QWidget & Quick Controls 1 apps
|
|
||||||
* minimal - useful for Quick Controls 2 apps, it is much faster than "full"
|
|
||||||
* none - useful for apps that don't use any of the above Qt modules
|
|
||||||
-->
|
|
||||||
<meta-data android:name="android.app.extract_android_style" android:value="full"/>
|
|
||||||
<!-- extract android style -->
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
<!-- For adding service(s) please check: https://wiki.qt.io/AndroidServices -->
|
|
||||||
|
|
||||||
</application>
|
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23"/>
|
|
||||||
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
|
|
||||||
|
|
||||||
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
|
|
||||||
Remove the comment if you do not require these default permissions. -->
|
|
||||||
|
|
||||||
|
|
||||||
<!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
|
|
||||||
Remove the comment if you do not require these default features. -->
|
|
||||||
<!-- %%INSERT_FEATURES -->
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
|
||||||
</manifest>
|
|
@ -1 +0,0 @@
|
|||||||
target=android-21
|
|
@ -5,8 +5,14 @@
|
|||||||
#include "networkmanager.h"
|
#include "networkmanager.h"
|
||||||
#include "debug_functions.h"
|
#include "debug_functions.h"
|
||||||
|
|
||||||
|
#include "aooptionsdialog.h"
|
||||||
|
#include "aocaseannouncerdialog.h"
|
||||||
|
|
||||||
AOApplication::AOApplication(int &argc, char **argv) : QApplication(argc, argv)
|
AOApplication::AOApplication(int &argc, char **argv) : QApplication(argc, argv)
|
||||||
{
|
{
|
||||||
|
// Create the QSettings class that points to the config.ini.
|
||||||
|
configini = new QSettings(get_base_path() + "config.ini", QSettings::IniFormat);
|
||||||
|
|
||||||
net_manager = new NetworkManager(this);
|
net_manager = new NetworkManager(this);
|
||||||
discord = new AttorneyOnline::Discord();
|
discord = new AttorneyOnline::Discord();
|
||||||
QObject::connect(net_manager, SIGNAL(ms_connect_finished(bool, bool)),
|
QObject::connect(net_manager, SIGNAL(ms_connect_finished(bool, bool)),
|
||||||
@ -36,7 +42,7 @@ void AOApplication::construct_lobby()
|
|||||||
int y = (screenGeometry.height()-w_lobby->height()) / 2;
|
int y = (screenGeometry.height()-w_lobby->height()) / 2;
|
||||||
w_lobby->move(x, y);
|
w_lobby->move(x, y);
|
||||||
|
|
||||||
if(is_discord_enabled())
|
if (is_discord_enabled())
|
||||||
discord->state_lobby();
|
discord->state_lobby();
|
||||||
|
|
||||||
w_lobby->show();
|
w_lobby->show();
|
||||||
@ -151,8 +157,9 @@ void AOApplication::ms_connect_finished(bool connected, bool will_retry)
|
|||||||
{
|
{
|
||||||
if (will_retry)
|
if (will_retry)
|
||||||
{
|
{
|
||||||
w_lobby->append_error("Error connecting to master server. Will try again in "
|
if (w_lobby != nullptr)
|
||||||
+ QString::number(net_manager->ms_reconnect_delay_ms / 1000.f) + " seconds.");
|
w_lobby->append_error("Error connecting to master server. Will try again in "
|
||||||
|
+ QString::number(net_manager->ms_reconnect_delay_ms / 1000.f) + " seconds.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -164,3 +171,15 @@ void AOApplication::ms_connect_finished(bool connected, bool will_retry)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AOApplication::call_settings_menu()
|
||||||
|
{
|
||||||
|
AOOptionsDialog settings(nullptr, this);
|
||||||
|
settings.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AOApplication::call_announce_menu(Courtroom *court)
|
||||||
|
{
|
||||||
|
AOCaseAnnouncerDialog announcer(nullptr, this, court);
|
||||||
|
announcer.exec();
|
||||||
|
}
|
||||||
|
113
aoapplication.h
@ -8,10 +8,21 @@
|
|||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QSettings>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QRect>
|
#include <QRect>
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
|
|
||||||
|
#include <QCryptographicHash>
|
||||||
|
|
||||||
|
#include <QDir>
|
||||||
|
#include <QStandardPaths>
|
||||||
|
|
||||||
|
#include <QTextStream>
|
||||||
|
#include <QStringList>
|
||||||
|
#include <QColor>
|
||||||
|
|
||||||
class NetworkManager;
|
class NetworkManager;
|
||||||
class Lobby;
|
class Lobby;
|
||||||
class Courtroom;
|
class Courtroom;
|
||||||
@ -44,6 +55,9 @@ public:
|
|||||||
void send_ms_packet(AOPacket *p_packet);
|
void send_ms_packet(AOPacket *p_packet);
|
||||||
void send_server_packet(AOPacket *p_packet, bool encoded = true);
|
void send_server_packet(AOPacket *p_packet, bool encoded = true);
|
||||||
|
|
||||||
|
void call_settings_menu();
|
||||||
|
void call_announce_menu(Courtroom *court);
|
||||||
|
|
||||||
/////////////////server metadata//////////////////
|
/////////////////server metadata//////////////////
|
||||||
|
|
||||||
unsigned int s_decryptor = 5;
|
unsigned int s_decryptor = 5;
|
||||||
@ -56,6 +70,10 @@ public:
|
|||||||
bool improved_loading_enabled = false;
|
bool improved_loading_enabled = false;
|
||||||
bool desk_mod_enabled = false;
|
bool desk_mod_enabled = false;
|
||||||
bool evidence_enabled = false;
|
bool evidence_enabled = false;
|
||||||
|
bool cccc_ic_support_enabled = false;
|
||||||
|
bool arup_enabled = false;
|
||||||
|
bool casing_alerts_enabled = false;
|
||||||
|
bool modcall_reason_enabled = false;
|
||||||
|
|
||||||
///////////////loading info///////////////////
|
///////////////loading info///////////////////
|
||||||
|
|
||||||
@ -66,6 +84,7 @@ public:
|
|||||||
|
|
||||||
int char_list_size = 0;
|
int char_list_size = 0;
|
||||||
int loaded_chars = 0;
|
int loaded_chars = 0;
|
||||||
|
int generated_chars = 0;
|
||||||
int evidence_list_size = 0;
|
int evidence_list_size = 0;
|
||||||
int loaded_evidence = 0;
|
int loaded_evidence = 0;
|
||||||
int music_list_size = 0;
|
int music_list_size = 0;
|
||||||
@ -75,9 +94,9 @@ public:
|
|||||||
|
|
||||||
//////////////////versioning///////////////
|
//////////////////versioning///////////////
|
||||||
|
|
||||||
int get_release() {return RELEASE;}
|
constexpr int get_release() const { return RELEASE; }
|
||||||
int get_major_version() {return MAJOR_VERSION;}
|
constexpr int get_major_version() const { return MAJOR_VERSION; }
|
||||||
int get_minor_version() {return MINOR_VERSION;}
|
constexpr int get_minor_version() const { return MINOR_VERSION; }
|
||||||
QString get_version_string();
|
QString get_version_string();
|
||||||
|
|
||||||
///////////////////////////////////////////
|
///////////////////////////////////////////
|
||||||
@ -98,21 +117,22 @@ public:
|
|||||||
//implementation in path_functions.cpp
|
//implementation in path_functions.cpp
|
||||||
QString get_base_path();
|
QString get_base_path();
|
||||||
QString get_data_path();
|
QString get_data_path();
|
||||||
QString get_theme_path();
|
QString get_theme_path(QString p_file);
|
||||||
QString get_default_theme_path();
|
QString get_default_theme_path(QString p_file);
|
||||||
QString get_character_path(QString p_character);
|
QString get_custom_theme_path(QString p_theme, QString p_file);
|
||||||
QString get_demothings_path();
|
QString get_character_path(QString p_char, QString p_file);
|
||||||
QString get_sounds_path();
|
QString get_sounds_path(QString p_file);
|
||||||
QString get_music_path(QString p_song);
|
QString get_music_path(QString p_song);
|
||||||
QString get_background_path();
|
QString get_background_path(QString p_file);
|
||||||
QString get_default_background_path();
|
QString get_default_background_path(QString p_file);
|
||||||
QString get_evidence_path();
|
QString get_evidence_path(QString p_file);
|
||||||
|
QString get_case_sensitive_path(QString p_file);
|
||||||
|
|
||||||
////// Functions for reading and writing files //////
|
////// Functions for reading and writing files //////
|
||||||
// Implementations file_functions.cpp
|
// Implementations file_functions.cpp
|
||||||
|
|
||||||
//Returns the config value for the passed searchline from a properly formatted config ini file
|
// Instead of reinventing the wheel, we'll use a QSettings class.
|
||||||
QString read_config(QString searchline);
|
QSettings *configini;
|
||||||
|
|
||||||
//Reads the theme from config.ini and loads it into the current_theme variable
|
//Reads the theme from config.ini and loads it into the current_theme variable
|
||||||
QString read_theme();
|
QString read_theme();
|
||||||
@ -135,11 +155,26 @@ public:
|
|||||||
//Returns the value of default_blip in config.ini
|
//Returns the value of default_blip in config.ini
|
||||||
int get_default_blip();
|
int get_default_blip();
|
||||||
|
|
||||||
//Returns true if discord is enabled in config.ini and false otherwise
|
// Returns the value of whether Discord should be enabled on startup
|
||||||
|
// from the config.ini.
|
||||||
bool is_discord_enabled();
|
bool is_discord_enabled();
|
||||||
|
|
||||||
//Returns true if reverse IC is enabled in config.ini and false otherwise
|
// Returns the value of the maximum amount of lines the IC chatlog
|
||||||
bool ic_scroll_down_enabled();
|
// may contain, from config.ini.
|
||||||
|
int get_max_log_size();
|
||||||
|
|
||||||
|
// Returns whether the log should go upwards (new behaviour)
|
||||||
|
// or downwards (vanilla behaviour).
|
||||||
|
bool get_log_goes_downwards();
|
||||||
|
|
||||||
|
// Returns the username the user may have set in config.ini.
|
||||||
|
QString get_default_username();
|
||||||
|
|
||||||
|
// Returns the audio device used for the client.
|
||||||
|
QString get_audio_output_device();
|
||||||
|
|
||||||
|
// Returns whether the user would like to have custom shownames on by default.
|
||||||
|
bool get_showname_enabled_by_default();
|
||||||
|
|
||||||
//Returns the list of words in callwords.ini
|
//Returns the list of words in callwords.ini
|
||||||
QStringList get_call_words();
|
QStringList get_call_words();
|
||||||
@ -165,11 +200,20 @@ public:
|
|||||||
//Returns the color with p_identifier from p_file
|
//Returns the color with p_identifier from p_file
|
||||||
QColor get_color(QString p_identifier, QString p_file);
|
QColor get_color(QString p_identifier, QString p_file);
|
||||||
|
|
||||||
|
// Returns the colour from the misc folder.
|
||||||
|
QColor get_chat_color(QString p_identifier, QString p_chat);
|
||||||
|
|
||||||
//Returns the sfx with p_identifier from sounds.ini in the current theme path
|
//Returns the sfx with p_identifier from sounds.ini in the current theme path
|
||||||
QString get_sfx(QString p_identifier);
|
QString get_sfx(QString p_identifier);
|
||||||
|
|
||||||
|
//Figure out if we can opus this or if we should fall back to wav
|
||||||
|
QString get_sfx_suffix(QString sound_to_check);
|
||||||
|
|
||||||
|
// Can we use APNG for this? If not, fall back to a gif.
|
||||||
|
QString get_image_suffix(QString path_to_check);
|
||||||
|
|
||||||
//Returns the value of p_search_line within target_tag and terminator_tag
|
//Returns the value of p_search_line within target_tag and terminator_tag
|
||||||
QString read_char_ini(QString p_char, QString p_search_line, QString target_tag, QString terminator_tag);
|
QString read_char_ini(QString p_char, QString p_search_line, QString target_tag);
|
||||||
|
|
||||||
//Returns the side of the p_char character from that characters ini file
|
//Returns the side of the p_char character from that characters ini file
|
||||||
QString get_char_side(QString p_char);
|
QString get_char_side(QString p_char);
|
||||||
@ -192,6 +236,9 @@ public:
|
|||||||
//Not in use
|
//Not in use
|
||||||
int get_text_delay(QString p_char, QString p_emote);
|
int get_text_delay(QString p_char, QString p_emote);
|
||||||
|
|
||||||
|
// Returns the custom realisation used by the character.
|
||||||
|
QString get_custom_realization(QString p_char);
|
||||||
|
|
||||||
//Returns the name of p_char
|
//Returns the name of p_char
|
||||||
QString get_char_name(QString p_char);
|
QString get_char_name(QString p_char);
|
||||||
|
|
||||||
@ -222,10 +269,38 @@ public:
|
|||||||
//Returns p_char's gender
|
//Returns p_char's gender
|
||||||
QString get_gender(QString p_char);
|
QString get_gender(QString p_char);
|
||||||
|
|
||||||
|
// ======
|
||||||
|
// These are all casing-related settings.
|
||||||
|
// ======
|
||||||
|
|
||||||
|
// Returns if the user has casing alerts enabled.
|
||||||
|
bool get_casing_enabled();
|
||||||
|
|
||||||
|
// Returns if the user wants to get alerts for the defence role.
|
||||||
|
bool get_casing_defence_enabled();
|
||||||
|
|
||||||
|
// Same for prosecution.
|
||||||
|
bool get_casing_prosecution_enabled();
|
||||||
|
|
||||||
|
// Same for judge.
|
||||||
|
bool get_casing_judge_enabled();
|
||||||
|
|
||||||
|
// Same for juror.
|
||||||
|
bool get_casing_juror_enabled();
|
||||||
|
|
||||||
|
// Same for steno.
|
||||||
|
bool get_casing_steno_enabled();
|
||||||
|
|
||||||
|
// Same for CM.
|
||||||
|
bool get_casing_cm_enabled();
|
||||||
|
|
||||||
|
// Get the message for the CM for casing alerts.
|
||||||
|
QString get_casing_can_host_cases();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const int RELEASE = 2;
|
const int RELEASE = 2;
|
||||||
const int MAJOR_VERSION = 4;
|
const int MAJOR_VERSION = 6;
|
||||||
const int MINOR_VERSION = 10;
|
const int MINOR_VERSION = 0;
|
||||||
|
|
||||||
QString current_theme = "default";
|
QString current_theme = "default";
|
||||||
|
|
||||||
|
@ -2,32 +2,46 @@
|
|||||||
|
|
||||||
AOBlipPlayer::AOBlipPlayer(QWidget *parent, AOApplication *p_ao_app)
|
AOBlipPlayer::AOBlipPlayer(QWidget *parent, AOApplication *p_ao_app)
|
||||||
{
|
{
|
||||||
m_sfxplayer = new QSoundEffect;
|
|
||||||
m_parent = parent;
|
m_parent = parent;
|
||||||
ao_app = p_ao_app;
|
ao_app = p_ao_app;
|
||||||
}
|
}
|
||||||
|
|
||||||
AOBlipPlayer::~AOBlipPlayer()
|
|
||||||
{
|
|
||||||
m_sfxplayer->stop();
|
|
||||||
m_sfxplayer->deleteLater();
|
|
||||||
}
|
|
||||||
|
|
||||||
void AOBlipPlayer::set_blips(QString p_sfx)
|
void AOBlipPlayer::set_blips(QString p_sfx)
|
||||||
{
|
{
|
||||||
m_sfxplayer->stop();
|
QString f_path = ao_app->get_sounds_path(p_sfx);
|
||||||
QString f_path = ao_app->get_sounds_path() + p_sfx.toLower();
|
|
||||||
m_sfxplayer->setSource(QUrl::fromLocalFile(f_path));
|
for (int n_stream = 0 ; n_stream < 5 ; ++n_stream)
|
||||||
|
{
|
||||||
|
BASS_StreamFree(m_stream_list[n_stream]);
|
||||||
|
|
||||||
|
m_stream_list[n_stream] = BASS_StreamCreateFile(FALSE, f_path.utf16(), 0, 0, BASS_UNICODE | BASS_ASYNCFILE);
|
||||||
|
}
|
||||||
|
|
||||||
set_volume(m_volume);
|
set_volume(m_volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AOBlipPlayer::blip_tick()
|
void AOBlipPlayer::blip_tick()
|
||||||
{
|
{
|
||||||
m_sfxplayer->play();
|
int f_cycle = m_cycle++;
|
||||||
|
|
||||||
|
if (m_cycle == 5)
|
||||||
|
m_cycle = 0;
|
||||||
|
|
||||||
|
HSTREAM f_stream = m_stream_list[f_cycle];
|
||||||
|
|
||||||
|
if (ao_app->get_audio_output_device() != "default")
|
||||||
|
BASS_ChannelSetDevice(f_stream, BASS_GetDevice());
|
||||||
|
BASS_ChannelPlay(f_stream, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AOBlipPlayer::set_volume(int p_value)
|
void AOBlipPlayer::set_volume(int p_value)
|
||||||
{
|
{
|
||||||
m_volume = p_value;
|
m_volume = p_value;
|
||||||
m_sfxplayer->setVolume(p_value / 100.0);
|
|
||||||
|
float volume = p_value / 100.0f;
|
||||||
|
|
||||||
|
for (int n_stream = 0 ; n_stream < 5 ; ++n_stream)
|
||||||
|
{
|
||||||
|
BASS_ChannelSetAttribute(m_stream_list[n_stream], BASS_ATTRIB_VOL, volume);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,17 @@
|
|||||||
#ifndef AOBLIPPLAYER_H
|
#ifndef AOBLIPPLAYER_H
|
||||||
#define AOBLIPPLAYER_H
|
#define AOBLIPPLAYER_H
|
||||||
|
|
||||||
|
#include "bass.h"
|
||||||
#include "aoapplication.h"
|
#include "aoapplication.h"
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QSoundEffect>
|
|
||||||
|
|
||||||
class AOBlipPlayer
|
class AOBlipPlayer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AOBlipPlayer(QWidget *parent, AOApplication *p_ao_app);
|
AOBlipPlayer(QWidget *parent, AOApplication *p_ao_app);
|
||||||
~AOBlipPlayer();
|
|
||||||
|
|
||||||
void set_blips(QString p_sfx);
|
void set_blips(QString p_sfx);
|
||||||
void blip_tick();
|
void blip_tick();
|
||||||
@ -23,9 +22,9 @@ public:
|
|||||||
private:
|
private:
|
||||||
QWidget *m_parent;
|
QWidget *m_parent;
|
||||||
AOApplication *ao_app;
|
AOApplication *ao_app;
|
||||||
QSoundEffect *m_sfxplayer;
|
|
||||||
|
|
||||||
int m_volume;
|
int m_volume;
|
||||||
|
HSTREAM m_stream_list[5];
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // AOBLIPPLAYER_H
|
#endif // AOBLIPPLAYER_H
|
||||||
|
@ -15,8 +15,8 @@ AOButton::~AOButton()
|
|||||||
|
|
||||||
void AOButton::set_image(QString p_image)
|
void AOButton::set_image(QString p_image)
|
||||||
{
|
{
|
||||||
QString image_path = ao_app->get_theme_path() + p_image;
|
QString image_path = ao_app->get_theme_path(p_image);
|
||||||
QString default_image_path = ao_app->get_default_theme_path() + p_image;
|
QString default_image_path = ao_app->get_default_theme_path(p_image);
|
||||||
|
|
||||||
if (file_exists(image_path))
|
if (file_exists(image_path))
|
||||||
this->setStyleSheet("border-image:url(\"" + image_path + "\")");
|
this->setStyleSheet("border-image:url(\"" + image_path + "\")");
|
||||||
|
82
aocaseannouncerdialog.cpp
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
#include "aocaseannouncerdialog.h"
|
||||||
|
|
||||||
|
AOCaseAnnouncerDialog::AOCaseAnnouncerDialog(QWidget *parent, AOApplication *p_ao_app, Courtroom *p_court)
|
||||||
|
: QDialog(parent)
|
||||||
|
{
|
||||||
|
ao_app = p_ao_app;
|
||||||
|
court = p_court;
|
||||||
|
|
||||||
|
setWindowTitle(tr("Case Announcer"));
|
||||||
|
resize(405, 235);
|
||||||
|
|
||||||
|
ui_announcer_buttons = new QDialogButtonBox(this);
|
||||||
|
|
||||||
|
QSizePolicy sizepolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||||
|
sizepolicy.setHorizontalStretch(0);
|
||||||
|
sizepolicy.setVerticalStretch(0);
|
||||||
|
sizepolicy.setHeightForWidth(ui_announcer_buttons->sizePolicy().hasHeightForWidth());
|
||||||
|
ui_announcer_buttons->setSizePolicy(sizepolicy);
|
||||||
|
ui_announcer_buttons->setOrientation(Qt::Horizontal);
|
||||||
|
ui_announcer_buttons->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||||
|
|
||||||
|
QObject::connect(ui_announcer_buttons, SIGNAL(accepted()), this, SLOT(ok_pressed()));
|
||||||
|
QObject::connect(ui_announcer_buttons, SIGNAL(rejected()), this, SLOT(cancel_pressed()));
|
||||||
|
|
||||||
|
setUpdatesEnabled(false);
|
||||||
|
|
||||||
|
ui_vbox_layout = new QVBoxLayout(this);
|
||||||
|
|
||||||
|
ui_form_layout = new QFormLayout(this);
|
||||||
|
ui_form_layout->setLabelAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter);
|
||||||
|
ui_form_layout->setFormAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignTop);
|
||||||
|
ui_form_layout->setContentsMargins(6, 6, 6, 6);
|
||||||
|
|
||||||
|
ui_vbox_layout->addItem(ui_form_layout);
|
||||||
|
ui_vbox_layout->addWidget(ui_announcer_buttons);
|
||||||
|
|
||||||
|
ui_case_title_label = new QLabel(this);
|
||||||
|
ui_case_title_label->setText(tr("Case title:"));
|
||||||
|
|
||||||
|
ui_form_layout->setWidget(0, QFormLayout::LabelRole, ui_case_title_label);
|
||||||
|
|
||||||
|
ui_case_title_textbox = new QLineEdit(this);
|
||||||
|
ui_case_title_textbox->setMaxLength(50);
|
||||||
|
|
||||||
|
ui_form_layout->setWidget(0, QFormLayout::FieldRole, ui_case_title_textbox);
|
||||||
|
|
||||||
|
ui_defense_needed = new QCheckBox(this);
|
||||||
|
ui_defense_needed->setText(tr("Defense needed"));
|
||||||
|
ui_prosecutor_needed = new QCheckBox(this);
|
||||||
|
ui_prosecutor_needed->setText(tr("Prosecution needed"));
|
||||||
|
ui_judge_needed = new QCheckBox(this);
|
||||||
|
ui_judge_needed->setText(tr("Judge needed"));
|
||||||
|
ui_juror_needed = new QCheckBox(this);
|
||||||
|
ui_juror_needed->setText(tr("Jurors needed"));
|
||||||
|
ui_steno_needed = new QCheckBox(this);
|
||||||
|
ui_steno_needed->setText(tr("Stenographer needed"));
|
||||||
|
|
||||||
|
ui_form_layout->setWidget(1, QFormLayout::FieldRole, ui_defense_needed);
|
||||||
|
ui_form_layout->setWidget(2, QFormLayout::FieldRole, ui_prosecutor_needed);
|
||||||
|
ui_form_layout->setWidget(3, QFormLayout::FieldRole, ui_judge_needed);
|
||||||
|
ui_form_layout->setWidget(4, QFormLayout::FieldRole, ui_juror_needed);
|
||||||
|
ui_form_layout->setWidget(5, QFormLayout::FieldRole, ui_steno_needed);
|
||||||
|
|
||||||
|
setUpdatesEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AOCaseAnnouncerDialog::ok_pressed()
|
||||||
|
{
|
||||||
|
court->announce_case(ui_case_title_textbox->text(),
|
||||||
|
ui_defense_needed->isChecked(),
|
||||||
|
ui_prosecutor_needed->isChecked(),
|
||||||
|
ui_judge_needed->isChecked(),
|
||||||
|
ui_juror_needed->isChecked(),
|
||||||
|
ui_steno_needed->isChecked());
|
||||||
|
|
||||||
|
done(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AOCaseAnnouncerDialog::cancel_pressed()
|
||||||
|
{
|
||||||
|
done(0);
|
||||||
|
}
|
45
aocaseannouncerdialog.h
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
#ifndef AOCASEANNOUNCERDIALOG_H
|
||||||
|
#define AOCASEANNOUNCERDIALOG_H
|
||||||
|
|
||||||
|
#include "aoapplication.h"
|
||||||
|
#include "courtroom.h"
|
||||||
|
|
||||||
|
#include <QtWidgets/QDialog>
|
||||||
|
#include <QDialogButtonBox>
|
||||||
|
#include <QtWidgets/QVBoxLayout>
|
||||||
|
#include <QtWidgets/QFormLayout>
|
||||||
|
#include <QtWidgets/QCheckBox>
|
||||||
|
#include <QtWidgets/QLabel>
|
||||||
|
#include <QtWidgets/QLineEdit>
|
||||||
|
|
||||||
|
class AOCaseAnnouncerDialog : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit AOCaseAnnouncerDialog(QWidget *parent = nullptr, AOApplication *p_ao_app = nullptr, Courtroom *p_court = nullptr);
|
||||||
|
|
||||||
|
private:
|
||||||
|
AOApplication *ao_app;
|
||||||
|
Courtroom *court;
|
||||||
|
|
||||||
|
QDialogButtonBox *ui_announcer_buttons;
|
||||||
|
|
||||||
|
QVBoxLayout *ui_vbox_layout;
|
||||||
|
QFormLayout *ui_form_layout;
|
||||||
|
|
||||||
|
QLabel *ui_case_title_label;
|
||||||
|
QLineEdit *ui_case_title_textbox;
|
||||||
|
|
||||||
|
QCheckBox *ui_defense_needed;
|
||||||
|
QCheckBox *ui_prosecutor_needed;
|
||||||
|
QCheckBox *ui_judge_needed;
|
||||||
|
QCheckBox *ui_juror_needed;
|
||||||
|
QCheckBox *ui_steno_needed;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void ok_pressed();
|
||||||
|
void cancel_pressed();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // AOCASEANNOUNCERDIALOG_H
|
@ -2,12 +2,14 @@
|
|||||||
|
|
||||||
#include "file_functions.h"
|
#include "file_functions.h"
|
||||||
|
|
||||||
AOCharButton::AOCharButton(QWidget *parent, AOApplication *p_ao_app, int x_pos, int y_pos) : QPushButton(parent)
|
AOCharButton::AOCharButton(QWidget *parent, AOApplication *p_ao_app, int x_pos, int y_pos, bool is_taken) : QPushButton(parent)
|
||||||
{
|
{
|
||||||
m_parent = parent;
|
m_parent = parent;
|
||||||
|
|
||||||
ao_app = p_ao_app;
|
ao_app = p_ao_app;
|
||||||
|
|
||||||
|
taken = is_taken;
|
||||||
|
|
||||||
this->resize(60, 60);
|
this->resize(60, 60);
|
||||||
this->move(x_pos, y_pos);
|
this->move(x_pos, y_pos);
|
||||||
|
|
||||||
@ -38,9 +40,22 @@ void AOCharButton::reset()
|
|||||||
ui_selector->hide();
|
ui_selector->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AOCharButton::set_taken()
|
void AOCharButton::set_taken(bool is_taken)
|
||||||
{
|
{
|
||||||
ui_taken->show();
|
taken = is_taken;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AOCharButton::apply_taken_image()
|
||||||
|
{
|
||||||
|
if (taken)
|
||||||
|
{
|
||||||
|
ui_taken->move(0,0);
|
||||||
|
ui_taken->show();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui_taken->hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AOCharButton::set_passworded()
|
void AOCharButton::set_passworded()
|
||||||
@ -50,20 +65,12 @@ void AOCharButton::set_passworded()
|
|||||||
|
|
||||||
void AOCharButton::set_image(QString p_character)
|
void AOCharButton::set_image(QString p_character)
|
||||||
{
|
{
|
||||||
QString image_path = ao_app->get_character_path(p_character) + "char_icon.png";
|
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";
|
|
||||||
QString alt_path = ao_app->get_demothings_path() + p_character.toLower() + "_off.png";
|
|
||||||
|
|
||||||
this->setText("");
|
this->setText("");
|
||||||
|
|
||||||
if (file_exists(image_path))
|
if (file_exists(image_path))
|
||||||
this->setStyleSheet("border-image:url(\"" + image_path + "\")");
|
this->setStyleSheet("border-image:url(\"" + image_path + "\")");
|
||||||
else if (file_exists(legacy_path))
|
|
||||||
{
|
|
||||||
this->setStyleSheet("border-image:url(\"" + legacy_path + "\")");
|
|
||||||
//ninja optimization
|
|
||||||
QFile::copy(legacy_path, image_path);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->setStyleSheet("border-image:url()");
|
this->setStyleSheet("border-image:url()");
|
||||||
@ -73,6 +80,7 @@ void AOCharButton::set_image(QString p_character)
|
|||||||
|
|
||||||
void AOCharButton::enterEvent(QEvent * e)
|
void AOCharButton::enterEvent(QEvent * e)
|
||||||
{
|
{
|
||||||
|
ui_selector->move(this->x() - 1, this->y() - 1);
|
||||||
ui_selector->raise();
|
ui_selector->raise();
|
||||||
ui_selector->show();
|
ui_selector->show();
|
||||||
|
|
||||||
|
@ -14,17 +14,22 @@ class AOCharButton : public QPushButton
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AOCharButton(QWidget *parent, AOApplication *p_ao_app, int x_pos, int y_pos);
|
AOCharButton(QWidget *parent, AOApplication *p_ao_app, int x_pos, int y_pos, bool is_taken);
|
||||||
|
|
||||||
AOApplication *ao_app;
|
AOApplication *ao_app;
|
||||||
|
|
||||||
|
void refresh();
|
||||||
void reset();
|
void reset();
|
||||||
void set_taken();
|
void set_taken(bool is_taken);
|
||||||
void set_passworded();
|
void set_passworded();
|
||||||
|
|
||||||
|
void apply_taken_image();
|
||||||
|
|
||||||
void set_image(QString p_character);
|
void set_image(QString p_character);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool taken;
|
||||||
|
|
||||||
QWidget *m_parent;
|
QWidget *m_parent;
|
||||||
|
|
||||||
AOImage *ui_taken;
|
AOImage *ui_taken;
|
||||||
|
@ -19,13 +19,16 @@ AOCharMovie::AOCharMovie(QWidget *p_parent, AOApplication *p_ao_app) : QLabel(p_
|
|||||||
|
|
||||||
void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix)
|
void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix)
|
||||||
{
|
{
|
||||||
QString original_path = ao_app->get_character_path(p_char) + emote_prefix + p_emote.toLower() + ".gif";
|
QString original_path = ao_app->get_character_path(p_char, emote_prefix + p_emote + ".gif");
|
||||||
QString alt_path = ao_app->get_character_path(p_char) + p_emote.toLower() + ".png";
|
QString alt_path = ao_app->get_character_path(p_char, p_emote + ".png");
|
||||||
QString placeholder_path = ao_app->get_theme_path() + "placeholder.gif";
|
QString apng_path = ao_app->get_character_path(p_char, emote_prefix + p_emote + ".apng");
|
||||||
QString placeholder_default_path = ao_app->get_default_theme_path() + "placeholder.gif";
|
QString placeholder_path = ao_app->get_theme_path("placeholder.gif");
|
||||||
|
QString placeholder_default_path = ao_app->get_default_theme_path("placeholder.gif");
|
||||||
QString gif_path;
|
QString gif_path;
|
||||||
|
|
||||||
if (file_exists(original_path))
|
if (file_exists(apng_path))
|
||||||
|
gif_path = apng_path;
|
||||||
|
else if (file_exists(original_path))
|
||||||
gif_path = original_path;
|
gif_path = original_path;
|
||||||
else if (file_exists(alt_path))
|
else if (file_exists(alt_path))
|
||||||
gif_path = alt_path;
|
gif_path = alt_path;
|
||||||
@ -58,7 +61,7 @@ void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix)
|
|||||||
|
|
||||||
void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration)
|
void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration)
|
||||||
{
|
{
|
||||||
QString gif_path = ao_app->get_character_path(p_char) + p_emote.toLower();
|
QString gif_path = ao_app->get_character_path(p_char, p_emote);
|
||||||
|
|
||||||
m_movie->stop();
|
m_movie->stop();
|
||||||
this->clear();
|
this->clear();
|
||||||
@ -75,8 +78,11 @@ void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration)
|
|||||||
real_duration += m_movie->nextFrameDelay();
|
real_duration += m_movie->nextFrameDelay();
|
||||||
m_movie->jumpToFrame(n_frame + 1);
|
m_movie->jumpToFrame(n_frame + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG_GIF
|
||||||
qDebug() << "full_duration: " << full_duration;
|
qDebug() << "full_duration: " << full_duration;
|
||||||
qDebug() << "real_duration: " << real_duration;
|
qDebug() << "real_duration: " << real_duration;
|
||||||
|
#endif
|
||||||
|
|
||||||
double percentage_modifier = 100.0;
|
double percentage_modifier = 100.0;
|
||||||
|
|
||||||
@ -88,7 +94,10 @@ void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration)
|
|||||||
if (percentage_modifier > 100.0)
|
if (percentage_modifier > 100.0)
|
||||||
percentage_modifier = 100.0;
|
percentage_modifier = 100.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG_GIF
|
||||||
qDebug() << "% mod: " << percentage_modifier;
|
qDebug() << "% mod: " << percentage_modifier;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (full_duration == 0 || full_duration >= real_duration)
|
if (full_duration == 0 || full_duration >= real_duration)
|
||||||
{
|
{
|
||||||
@ -107,7 +116,7 @@ void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration)
|
|||||||
|
|
||||||
void AOCharMovie::play_talking(QString p_char, QString p_emote)
|
void AOCharMovie::play_talking(QString p_char, QString p_emote)
|
||||||
{
|
{
|
||||||
QString gif_path = ao_app->get_character_path(p_char) + "(b)" + p_emote.toLower();
|
QString gif_path = ao_app->get_character_path(p_char, "(b)" + p_emote);
|
||||||
|
|
||||||
m_movie->stop();
|
m_movie->stop();
|
||||||
this->clear();
|
this->clear();
|
||||||
@ -120,7 +129,7 @@ void AOCharMovie::play_talking(QString p_char, QString p_emote)
|
|||||||
|
|
||||||
void AOCharMovie::play_idle(QString p_char, QString p_emote)
|
void AOCharMovie::play_idle(QString p_char, QString p_emote)
|
||||||
{
|
{
|
||||||
QString gif_path = ao_app->get_character_path(p_char) + "(a)" + p_emote.toLower();
|
QString gif_path = ao_app->get_character_path(p_char, "(a)" + p_emote);
|
||||||
|
|
||||||
m_movie->stop();
|
m_movie->stop();
|
||||||
this->clear();
|
this->clear();
|
||||||
@ -146,14 +155,31 @@ void AOCharMovie::combo_resize(int w, int h)
|
|||||||
m_movie->setScaledSize(f_size);
|
m_movie->setScaledSize(f_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AOCharMovie::move(int ax, int ay)
|
||||||
|
{
|
||||||
|
x = ax;
|
||||||
|
y = ay;
|
||||||
|
QLabel::move(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
void AOCharMovie::frame_change(int n_frame)
|
void AOCharMovie::frame_change(int n_frame)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (movie_frames.size() > n_frame)
|
if (movie_frames.size() > n_frame)
|
||||||
{
|
{
|
||||||
QPixmap f_pixmap = QPixmap::fromImage(movie_frames.at(n_frame));
|
QPixmap f_pixmap = QPixmap::fromImage(movie_frames.at(n_frame));
|
||||||
|
auto aspect_ratio = Qt::KeepAspectRatio;
|
||||||
|
|
||||||
this->setPixmap(f_pixmap.scaled(this->width(), this->height()));
|
if (f_pixmap.size().width() > f_pixmap.size().height())
|
||||||
}
|
aspect_ratio = Qt::KeepAspectRatioByExpanding;
|
||||||
|
|
||||||
|
if (f_pixmap.size().width() > this->size().width() || f_pixmap.size().height() > this->size().height())
|
||||||
|
this->setPixmap(f_pixmap.scaled(this->width(), this->height(), aspect_ratio, Qt::SmoothTransformation));
|
||||||
|
else
|
||||||
|
this->setPixmap(f_pixmap.scaled(this->width(), this->height(), aspect_ratio, Qt::FastTransformation));
|
||||||
|
|
||||||
|
QLabel::move(x + (this->width() - this->pixmap()->width())/2, y);
|
||||||
|
}
|
||||||
|
|
||||||
if (m_movie->frameCount() - 1 == n_frame && play_once)
|
if (m_movie->frameCount() - 1 == n_frame && play_once)
|
||||||
{
|
{
|
||||||
|
@ -25,6 +25,8 @@ public:
|
|||||||
|
|
||||||
void stop();
|
void stop();
|
||||||
|
|
||||||
|
void move(int ax, int ay);
|
||||||
|
|
||||||
void combo_resize(int w, int h);
|
void combo_resize(int w, int h);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -36,6 +38,10 @@ private:
|
|||||||
|
|
||||||
const int time_mod = 62;
|
const int time_mod = 62;
|
||||||
|
|
||||||
|
// These are the X and Y values before they are fixed based on the sprite's width.
|
||||||
|
int x = 0;
|
||||||
|
int y = 0;
|
||||||
|
|
||||||
bool m_flipped = false;
|
bool m_flipped = false;
|
||||||
|
|
||||||
bool play_once = true;
|
bool play_once = true;
|
||||||
|
@ -16,19 +16,13 @@ AOEmoteButton::AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x
|
|||||||
void AOEmoteButton::set_image(QString p_char, int p_emote, QString suffix)
|
void AOEmoteButton::set_image(QString p_char, int p_emote, QString suffix)
|
||||||
{
|
{
|
||||||
QString emotion_number = QString::number(p_emote + 1);
|
QString emotion_number = QString::number(p_emote + 1);
|
||||||
QString image_path = ao_app->get_character_path(p_char) + "emotions/ao2/button" + emotion_number + suffix;
|
QString image_path = ao_app->get_character_path(p_char, "emotions/button" + emotion_number + suffix);
|
||||||
QString alt_path = ao_app->get_character_path(p_char) + "emotions/button" + emotion_number + suffix;
|
|
||||||
|
|
||||||
if (file_exists(image_path))
|
if (file_exists(image_path))
|
||||||
{
|
{
|
||||||
this->setText("");
|
this->setText("");
|
||||||
this->setStyleSheet("border-image:url(\"" + image_path + "\")");
|
this->setStyleSheet("border-image:url(\"" + image_path + "\")");
|
||||||
}
|
}
|
||||||
else if (file_exists(alt_path))
|
|
||||||
{
|
|
||||||
this->setText("");
|
|
||||||
this->setStyleSheet("border-image:url(\"" + alt_path + "\")");
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->setText(ao_app->get_emote_comment(p_char, p_emote));
|
this->setText(ao_app->get_emote_comment(p_char, p_emote));
|
||||||
|
@ -37,7 +37,7 @@ void AOEvidenceButton::reset()
|
|||||||
|
|
||||||
void AOEvidenceButton::set_image(QString p_image)
|
void AOEvidenceButton::set_image(QString p_image)
|
||||||
{
|
{
|
||||||
QString image_path = ao_app->get_evidence_path() + p_image;
|
QString image_path = ao_app->get_evidence_path(p_image);
|
||||||
|
|
||||||
if (file_exists(image_path))
|
if (file_exists(image_path))
|
||||||
{
|
{
|
||||||
@ -53,8 +53,8 @@ void AOEvidenceButton::set_image(QString p_image)
|
|||||||
|
|
||||||
void AOEvidenceButton::set_theme_image(QString p_image)
|
void AOEvidenceButton::set_theme_image(QString p_image)
|
||||||
{
|
{
|
||||||
QString theme_image_path = ao_app->get_theme_path() + p_image;
|
QString theme_image_path = ao_app->get_theme_path(p_image);
|
||||||
QString default_image_path = ao_app->get_default_theme_path() + p_image;
|
QString default_image_path = ao_app->get_default_theme_path(p_image);
|
||||||
|
|
||||||
QString final_image_path;
|
QString final_image_path;
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ void AOEvidenceDisplay::show_evidence(QString p_evidence_image, bool is_left_sid
|
|||||||
|
|
||||||
sfx_player->set_volume(p_volume);
|
sfx_player->set_volume(p_volume);
|
||||||
|
|
||||||
QString f_evidence_path = ao_app->get_evidence_path() + p_evidence_image;
|
QString f_evidence_path = ao_app->get_evidence_path(p_evidence_image);
|
||||||
|
|
||||||
QPixmap f_pixmap(f_evidence_path);
|
QPixmap f_pixmap(f_evidence_path);
|
||||||
|
|
||||||
@ -47,8 +47,8 @@ void AOEvidenceDisplay::show_evidence(QString p_evidence_image, bool is_left_sid
|
|||||||
|
|
||||||
evidence_icon->setPixmap(f_pixmap.scaled(evidence_icon->width(), evidence_icon->height(), Qt::IgnoreAspectRatio));
|
evidence_icon->setPixmap(f_pixmap.scaled(evidence_icon->width(), evidence_icon->height(), Qt::IgnoreAspectRatio));
|
||||||
|
|
||||||
QString f_default_gif_path = ao_app->get_default_theme_path() + gif_name;
|
QString f_default_gif_path = ao_app->get_default_theme_path(gif_name);
|
||||||
QString f_gif_path = ao_app->get_theme_path() + gif_name;
|
QString f_gif_path = ao_app->get_theme_path(gif_name);
|
||||||
|
|
||||||
if (file_exists(f_gif_path))
|
if (file_exists(f_gif_path))
|
||||||
final_gif_path = f_gif_path;
|
final_gif_path = f_gif_path;
|
||||||
|
@ -15,8 +15,8 @@ AOImage::~AOImage()
|
|||||||
|
|
||||||
void AOImage::set_image(QString p_image)
|
void AOImage::set_image(QString p_image)
|
||||||
{
|
{
|
||||||
QString theme_image_path = ao_app->get_theme_path() + p_image;
|
QString theme_image_path = ao_app->get_theme_path(p_image);
|
||||||
QString default_image_path = ao_app->get_default_theme_path() + p_image;
|
QString default_image_path = ao_app->get_default_theme_path(p_image);
|
||||||
|
|
||||||
QString final_image_path;
|
QString final_image_path;
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ void AOImage::set_image(QString p_image)
|
|||||||
|
|
||||||
void AOImage::set_image_from_path(QString p_path)
|
void AOImage::set_image_from_path(QString p_path)
|
||||||
{
|
{
|
||||||
QString default_path = ao_app->get_default_theme_path() + "chatmed.png";
|
QString default_path = ao_app->get_default_theme_path("chatmed.png");
|
||||||
|
|
||||||
QString final_path;
|
QString final_path;
|
||||||
|
|
||||||
|
17
aomovie.cpp
@ -28,18 +28,21 @@ void AOMovie::play(QString p_gif, QString p_char, QString p_custom_theme)
|
|||||||
|
|
||||||
QString custom_path;
|
QString custom_path;
|
||||||
if (p_gif == "custom")
|
if (p_gif == "custom")
|
||||||
custom_path = ao_app->get_character_path(p_char) + p_gif + ".gif";
|
custom_path = ao_app->get_image_suffix(ao_app->get_character_path(p_char, p_gif));
|
||||||
else
|
else
|
||||||
custom_path = ao_app->get_character_path(p_char) + p_gif + "_bubble.gif";
|
custom_path = ao_app->get_image_suffix(ao_app->get_character_path(p_char, p_gif + "_bubble"));
|
||||||
|
|
||||||
QString custom_theme_path = ao_app->get_base_path() + "themes/" + p_custom_theme + "/" + p_gif + ".gif";
|
QString misc_path = ao_app->get_base_path() + "misc/" + p_custom_theme + "/" + p_gif + "_bubble.gif";
|
||||||
QString theme_path = ao_app->get_theme_path() + p_gif + ".gif";
|
QString custom_theme_path = ao_app->get_custom_theme_path(p_custom_theme, p_gif + ".gif");
|
||||||
QString default_theme_path = ao_app->get_default_theme_path() + p_gif + ".gif";
|
QString theme_path = ao_app->get_theme_path(p_gif + ".gif");
|
||||||
QString placeholder_path = ao_app->get_theme_path() + "placeholder.gif";
|
QString default_theme_path = ao_app->get_default_theme_path(p_gif + ".gif");
|
||||||
QString default_placeholder_path = ao_app->get_default_theme_path() + "placeholder.gif";
|
QString placeholder_path = ao_app->get_theme_path("placeholder.gif");
|
||||||
|
QString default_placeholder_path = ao_app->get_default_theme_path("placeholder.gif");
|
||||||
|
|
||||||
if (file_exists(custom_path))
|
if (file_exists(custom_path))
|
||||||
gif_path = custom_path;
|
gif_path = custom_path;
|
||||||
|
else if (file_exists(misc_path))
|
||||||
|
gif_path = misc_path;
|
||||||
else if (file_exists(custom_theme_path))
|
else if (file_exists(custom_theme_path))
|
||||||
gif_path = custom_theme_path;
|
gif_path = custom_theme_path;
|
||||||
else if (file_exists(theme_path))
|
else if (file_exists(theme_path))
|
||||||
|
@ -4,24 +4,31 @@ AOMusicPlayer::AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app)
|
|||||||
{
|
{
|
||||||
m_parent = parent;
|
m_parent = parent;
|
||||||
ao_app = p_ao_app;
|
ao_app = p_ao_app;
|
||||||
m_player = new QMediaPlayer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AOMusicPlayer::~AOMusicPlayer()
|
AOMusicPlayer::~AOMusicPlayer()
|
||||||
{
|
{
|
||||||
m_player->stop();
|
BASS_ChannelStop(m_stream);
|
||||||
m_player->deleteLater();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AOMusicPlayer::play(QString p_song)
|
void AOMusicPlayer::play(QString p_song)
|
||||||
{
|
{
|
||||||
m_player->setMedia(QUrl::fromLocalFile(ao_app->get_music_path(p_song)));
|
BASS_ChannelStop(m_stream);
|
||||||
|
|
||||||
|
QString f_path = ao_app->get_music_path(p_song);
|
||||||
|
|
||||||
|
m_stream = BASS_StreamCreateFile(FALSE, f_path.utf16(), 0, 0, BASS_STREAM_AUTOFREE | BASS_UNICODE | BASS_ASYNCFILE);
|
||||||
|
|
||||||
this->set_volume(m_volume);
|
this->set_volume(m_volume);
|
||||||
m_player->play();
|
|
||||||
|
if (ao_app->get_audio_output_device() != "default")
|
||||||
|
BASS_ChannelSetDevice(m_stream, BASS_GetDevice());
|
||||||
|
BASS_ChannelPlay(m_stream, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AOMusicPlayer::set_volume(int p_value)
|
void AOMusicPlayer::set_volume(int p_value)
|
||||||
{
|
{
|
||||||
m_volume = p_value;
|
m_volume = p_value;
|
||||||
m_player->setVolume(p_value);
|
float volume = m_volume / 100.0f;
|
||||||
|
BASS_ChannelSetAttribute(m_stream, BASS_ATTRIB_VOL, volume);
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
#ifndef AOMUSICPLAYER_H
|
#ifndef AOMUSICPLAYER_H
|
||||||
#define AOMUSICPLAYER_H
|
#define AOMUSICPLAYER_H
|
||||||
|
|
||||||
|
#include "bass.h"
|
||||||
#include "aoapplication.h"
|
#include "aoapplication.h"
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QMediaPlayer>
|
|
||||||
|
|
||||||
class AOMusicPlayer
|
class AOMusicPlayer
|
||||||
{
|
{
|
||||||
@ -21,8 +21,8 @@ private:
|
|||||||
QWidget *m_parent;
|
QWidget *m_parent;
|
||||||
AOApplication *ao_app;
|
AOApplication *ao_app;
|
||||||
|
|
||||||
QMediaPlayer *m_player;
|
|
||||||
int m_volume = 0;
|
int m_volume = 0;
|
||||||
|
HSTREAM m_stream;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // AOMUSICPLAYER_H
|
#endif // AOMUSICPLAYER_H
|
||||||
|
517
aooptionsdialog.cpp
Normal file
@ -0,0 +1,517 @@
|
|||||||
|
#include "aooptionsdialog.h"
|
||||||
|
#include "aoapplication.h"
|
||||||
|
#include "bass.h"
|
||||||
|
|
||||||
|
AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) : QDialog(parent)
|
||||||
|
{
|
||||||
|
ao_app = p_ao_app;
|
||||||
|
|
||||||
|
// Setting up the basics.
|
||||||
|
// setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
setWindowTitle(tr("Settings"));
|
||||||
|
resize(398, 320);
|
||||||
|
|
||||||
|
ui_settings_buttons = new QDialogButtonBox(this);
|
||||||
|
|
||||||
|
QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||||
|
sizePolicy1.setHorizontalStretch(0);
|
||||||
|
sizePolicy1.setVerticalStretch(0);
|
||||||
|
sizePolicy1.setHeightForWidth(ui_settings_buttons->sizePolicy().hasHeightForWidth());
|
||||||
|
ui_settings_buttons->setSizePolicy(sizePolicy1);
|
||||||
|
ui_settings_buttons->setOrientation(Qt::Horizontal);
|
||||||
|
ui_settings_buttons->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Save);
|
||||||
|
|
||||||
|
QObject::connect(ui_settings_buttons, SIGNAL(accepted()), this, SLOT(save_pressed()));
|
||||||
|
QObject::connect(ui_settings_buttons, SIGNAL(rejected()), this, SLOT(discard_pressed()));
|
||||||
|
|
||||||
|
// We'll stop updates so that the window won't flicker while it's being made.
|
||||||
|
setUpdatesEnabled(false);
|
||||||
|
|
||||||
|
// First of all, we want a tabbed dialog, so let's add some layout.
|
||||||
|
ui_vertical_layout = new QVBoxLayout(this);
|
||||||
|
ui_settings_tabs = new QTabWidget(this);
|
||||||
|
|
||||||
|
ui_vertical_layout->addWidget(ui_settings_tabs);
|
||||||
|
ui_vertical_layout->addWidget(ui_settings_buttons);
|
||||||
|
|
||||||
|
// Let's add the tabs one by one.
|
||||||
|
// First, we'll start with 'Gameplay'.
|
||||||
|
ui_gameplay_tab = new QWidget();
|
||||||
|
ui_settings_tabs->addTab(ui_gameplay_tab, tr("Gameplay"));
|
||||||
|
|
||||||
|
ui_form_layout_widget = new QWidget(ui_gameplay_tab);
|
||||||
|
ui_form_layout_widget->setGeometry(QRect(10, 10, 361, 211));
|
||||||
|
|
||||||
|
ui_gameplay_form = new QFormLayout(ui_form_layout_widget);
|
||||||
|
ui_gameplay_form->setLabelAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter);
|
||||||
|
ui_gameplay_form->setFormAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop);
|
||||||
|
ui_gameplay_form->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
|
ui_theme_label = new QLabel(ui_form_layout_widget);
|
||||||
|
ui_theme_label->setText(tr("Theme:"));
|
||||||
|
ui_theme_label->setToolTip(tr("Sets the theme used in-game. If the new theme changes "
|
||||||
|
"the lobby's look as well, you'll need to reload the "
|
||||||
|
"lobby for the changes to take effect, such as by joining "
|
||||||
|
"a server and leaving it."));
|
||||||
|
ui_gameplay_form->setWidget(0, QFormLayout::LabelRole, ui_theme_label);
|
||||||
|
|
||||||
|
ui_theme_combobox = new QComboBox(ui_form_layout_widget);
|
||||||
|
|
||||||
|
// Fill the combobox with the names of the themes.
|
||||||
|
QDirIterator it(p_ao_app->get_base_path() + "themes", QDir::Dirs, QDirIterator::NoIteratorFlags);
|
||||||
|
while (it.hasNext())
|
||||||
|
{
|
||||||
|
QString actualname = QDir(it.next()).dirName();
|
||||||
|
if (actualname != "." && actualname != "..")
|
||||||
|
ui_theme_combobox->addItem(actualname);
|
||||||
|
if (actualname == p_ao_app->read_theme())
|
||||||
|
ui_theme_combobox->setCurrentIndex(ui_theme_combobox->count()-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ui_gameplay_form->setWidget(0, QFormLayout::FieldRole, ui_theme_combobox);
|
||||||
|
|
||||||
|
ui_theme_log_divider = new QFrame(ui_form_layout_widget);
|
||||||
|
ui_theme_log_divider->setMidLineWidth(0);
|
||||||
|
ui_theme_log_divider->setFrameShape(QFrame::HLine);
|
||||||
|
ui_theme_log_divider->setFrameShadow(QFrame::Sunken);
|
||||||
|
|
||||||
|
ui_gameplay_form->setWidget(1, QFormLayout::FieldRole, ui_theme_log_divider);
|
||||||
|
|
||||||
|
ui_downwards_lbl = new QLabel(ui_form_layout_widget);
|
||||||
|
ui_downwards_lbl->setText(tr("Log goes downwards:"));
|
||||||
|
ui_downwards_lbl->setToolTip(tr("If ticked, new messages will appear at "
|
||||||
|
"the bottom (like the OOC chatlog). The traditional "
|
||||||
|
"(AO1) behaviour is equivalent to this being unticked."));
|
||||||
|
|
||||||
|
ui_gameplay_form->setWidget(2, QFormLayout::LabelRole, ui_downwards_lbl);
|
||||||
|
|
||||||
|
ui_downwards_cb = new QCheckBox(ui_form_layout_widget);
|
||||||
|
ui_downwards_cb->setChecked(p_ao_app->get_log_goes_downwards());
|
||||||
|
|
||||||
|
ui_gameplay_form->setWidget(2, QFormLayout::FieldRole, ui_downwards_cb);
|
||||||
|
|
||||||
|
ui_length_lbl = new QLabel(ui_form_layout_widget);
|
||||||
|
ui_length_lbl->setText(tr("Log length:"));
|
||||||
|
ui_length_lbl->setToolTip(tr("The amount of messages the IC chatlog will keep before "
|
||||||
|
"deleting older messages. A value of 0 or below counts as 'infinite'."));
|
||||||
|
|
||||||
|
ui_gameplay_form->setWidget(3, QFormLayout::LabelRole, ui_length_lbl);
|
||||||
|
|
||||||
|
ui_length_spinbox = new QSpinBox(ui_form_layout_widget);
|
||||||
|
ui_length_spinbox->setMaximum(10000);
|
||||||
|
ui_length_spinbox->setValue(p_ao_app->get_max_log_size());
|
||||||
|
|
||||||
|
ui_gameplay_form->setWidget(3, QFormLayout::FieldRole, ui_length_spinbox);
|
||||||
|
|
||||||
|
ui_log_names_divider = new QFrame(ui_form_layout_widget);
|
||||||
|
ui_log_names_divider->setFrameShape(QFrame::HLine);
|
||||||
|
ui_log_names_divider->setFrameShadow(QFrame::Sunken);
|
||||||
|
|
||||||
|
ui_gameplay_form->setWidget(4, QFormLayout::FieldRole, ui_log_names_divider);
|
||||||
|
|
||||||
|
ui_username_lbl = new QLabel(ui_form_layout_widget);
|
||||||
|
ui_username_lbl->setText(tr("Default username:"));
|
||||||
|
ui_username_lbl->setToolTip(tr("Your OOC name will be automatically set to this value "
|
||||||
|
"when you join a server."));
|
||||||
|
|
||||||
|
ui_gameplay_form->setWidget(5, QFormLayout::LabelRole, ui_username_lbl);
|
||||||
|
|
||||||
|
ui_username_textbox = new QLineEdit(ui_form_layout_widget);
|
||||||
|
ui_username_textbox->setMaxLength(30);
|
||||||
|
ui_username_textbox->setText(p_ao_app->get_default_username());
|
||||||
|
|
||||||
|
ui_gameplay_form->setWidget(5, QFormLayout::FieldRole, ui_username_textbox);
|
||||||
|
|
||||||
|
ui_showname_lbl = new QLabel(ui_form_layout_widget);
|
||||||
|
ui_showname_lbl->setText(tr("Custom shownames:"));
|
||||||
|
ui_showname_lbl->setToolTip(tr("Gives the default value for the in-game 'Custom shownames' "
|
||||||
|
"tickbox, which in turn determines whether the client should "
|
||||||
|
"display custom in-character names."));
|
||||||
|
|
||||||
|
ui_gameplay_form->setWidget(6, QFormLayout::LabelRole, ui_showname_lbl);
|
||||||
|
|
||||||
|
ui_showname_cb = new QCheckBox(ui_form_layout_widget);
|
||||||
|
ui_showname_cb->setChecked(p_ao_app->get_showname_enabled_by_default());
|
||||||
|
|
||||||
|
ui_gameplay_form->setWidget(6, QFormLayout::FieldRole, ui_showname_cb);
|
||||||
|
|
||||||
|
ui_net_divider = new QFrame(ui_form_layout_widget);
|
||||||
|
ui_net_divider->setFrameShape(QFrame::HLine);
|
||||||
|
ui_net_divider->setFrameShadow(QFrame::Sunken);
|
||||||
|
|
||||||
|
ui_gameplay_form->setWidget(7, QFormLayout::FieldRole, ui_net_divider);
|
||||||
|
|
||||||
|
ui_ms_lbl = new QLabel(ui_form_layout_widget);
|
||||||
|
ui_ms_lbl->setText(tr("Backup MS:"));
|
||||||
|
ui_ms_lbl->setToolTip(tr("If the built-in server lookups fail, the game will try the "
|
||||||
|
"address given here and use it as a backup master server address."));
|
||||||
|
|
||||||
|
ui_gameplay_form->setWidget(8, QFormLayout::LabelRole, ui_ms_lbl);
|
||||||
|
|
||||||
|
QSettings* configini = ao_app->configini;
|
||||||
|
ui_ms_textbox = new QLineEdit(ui_form_layout_widget);
|
||||||
|
ui_ms_textbox->setText(configini->value("master", "").value<QString>());
|
||||||
|
|
||||||
|
ui_gameplay_form->setWidget(8, QFormLayout::FieldRole, ui_ms_textbox);
|
||||||
|
|
||||||
|
ui_discord_lbl = new QLabel(ui_form_layout_widget);
|
||||||
|
ui_discord_lbl->setText(tr("Discord:"));
|
||||||
|
ui_discord_lbl->setToolTip(tr("Allows others on Discord to see what server you are in, "
|
||||||
|
"what character are you playing, and how long you have "
|
||||||
|
"been playing for."));
|
||||||
|
|
||||||
|
ui_gameplay_form->setWidget(9, QFormLayout::LabelRole, ui_discord_lbl);
|
||||||
|
|
||||||
|
ui_discord_cb = new QCheckBox(ui_form_layout_widget);
|
||||||
|
ui_discord_cb->setChecked(ao_app->is_discord_enabled());
|
||||||
|
|
||||||
|
ui_gameplay_form->setWidget(9, QFormLayout::FieldRole, ui_discord_cb);
|
||||||
|
|
||||||
|
// Here we start the callwords tab.
|
||||||
|
ui_callwords_tab = new QWidget();
|
||||||
|
ui_settings_tabs->addTab(ui_callwords_tab, tr("Callwords"));
|
||||||
|
|
||||||
|
ui_callwords_widget = new QWidget(ui_callwords_tab);
|
||||||
|
ui_callwords_widget->setGeometry(QRect(10, 10, 361, 211));
|
||||||
|
|
||||||
|
ui_callwords_layout = new QVBoxLayout(ui_callwords_widget);
|
||||||
|
ui_callwords_layout->setContentsMargins(0,0,0,0);
|
||||||
|
|
||||||
|
ui_callwords_textbox = new QPlainTextEdit(ui_callwords_widget);
|
||||||
|
QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
sizePolicy.setHorizontalStretch(0);
|
||||||
|
sizePolicy.setVerticalStretch(0);
|
||||||
|
sizePolicy.setHeightForWidth(ui_callwords_textbox->sizePolicy().hasHeightForWidth());
|
||||||
|
ui_callwords_textbox->setSizePolicy(sizePolicy);
|
||||||
|
|
||||||
|
// Let's fill the callwords text edit with the already present callwords.
|
||||||
|
ui_callwords_textbox->document()->clear();
|
||||||
|
foreach (QString callword, p_ao_app->get_call_words()) {
|
||||||
|
ui_callwords_textbox->appendPlainText(callword);
|
||||||
|
}
|
||||||
|
|
||||||
|
ui_callwords_layout->addWidget(ui_callwords_textbox);
|
||||||
|
|
||||||
|
ui_callwords_explain_lbl = new QLabel(ui_callwords_widget);
|
||||||
|
ui_callwords_explain_lbl->setWordWrap(true);
|
||||||
|
ui_callwords_explain_lbl->setText(tr("<html><head/><body>Enter as many callwords as you would like. These are case insensitive. Make sure to leave every callword in its own line!<br>Do not leave a line with a space at the end -- you will be alerted everytime someone uses a space in their messages.</body></html>"));
|
||||||
|
|
||||||
|
ui_callwords_layout->addWidget(ui_callwords_explain_lbl);
|
||||||
|
|
||||||
|
// The audio tab.
|
||||||
|
ui_audio_tab = new QWidget();
|
||||||
|
ui_settings_tabs->addTab(ui_audio_tab, tr("Audio"));
|
||||||
|
|
||||||
|
ui_audio_widget = new QWidget(ui_audio_tab);
|
||||||
|
ui_audio_widget->setGeometry(QRect(10, 10, 361, 211));
|
||||||
|
|
||||||
|
ui_audio_layout = new QFormLayout(ui_audio_widget);
|
||||||
|
ui_audio_layout->setLabelAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter);
|
||||||
|
ui_audio_layout->setFormAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop);
|
||||||
|
ui_audio_layout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
|
ui_audio_device_lbl = new QLabel(ui_audio_widget);
|
||||||
|
ui_audio_device_lbl->setText(tr("Audio device:"));
|
||||||
|
ui_audio_device_lbl->setToolTip(tr("Sets the audio device for all sounds."));
|
||||||
|
|
||||||
|
ui_audio_layout->setWidget(0, QFormLayout::LabelRole, ui_audio_device_lbl);
|
||||||
|
|
||||||
|
ui_audio_device_combobox = new QComboBox(ui_audio_widget);
|
||||||
|
|
||||||
|
// Let's fill out the combobox with the available audio devices.
|
||||||
|
int a = 0;
|
||||||
|
BASS_DEVICEINFO info;
|
||||||
|
|
||||||
|
if (needs_default_audiodev())
|
||||||
|
{
|
||||||
|
ui_audio_device_combobox->addItem("default");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (a = 0; BASS_GetDeviceInfo(a, &info); a++)
|
||||||
|
{
|
||||||
|
ui_audio_device_combobox->addItem(info.name);
|
||||||
|
if (p_ao_app->get_audio_output_device() == info.name)
|
||||||
|
ui_audio_device_combobox->setCurrentIndex(ui_audio_device_combobox->count()-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
ui_audio_layout->setWidget(0, QFormLayout::FieldRole, ui_audio_device_combobox);
|
||||||
|
|
||||||
|
ui_audio_volume_divider = new QFrame(ui_audio_widget);
|
||||||
|
ui_audio_volume_divider->setFrameShape(QFrame::HLine);
|
||||||
|
ui_audio_volume_divider->setFrameShadow(QFrame::Sunken);
|
||||||
|
|
||||||
|
ui_audio_layout->setWidget(1, QFormLayout::FieldRole, ui_audio_volume_divider);
|
||||||
|
|
||||||
|
ui_music_volume_lbl = new QLabel(ui_audio_widget);
|
||||||
|
ui_music_volume_lbl->setText(tr("Music:"));
|
||||||
|
ui_music_volume_lbl->setToolTip(tr("Sets the music's default volume."));
|
||||||
|
|
||||||
|
ui_audio_layout->setWidget(2, QFormLayout::LabelRole, ui_music_volume_lbl);
|
||||||
|
|
||||||
|
ui_music_volume_spinbox = new QSpinBox(ui_audio_widget);
|
||||||
|
ui_music_volume_spinbox->setValue(p_ao_app->get_default_music());
|
||||||
|
ui_music_volume_spinbox->setMaximum(100);
|
||||||
|
ui_music_volume_spinbox->setSuffix("%");
|
||||||
|
|
||||||
|
ui_audio_layout->setWidget(2, QFormLayout::FieldRole, ui_music_volume_spinbox);
|
||||||
|
|
||||||
|
ui_sfx_volume_lbl = new QLabel(ui_audio_widget);
|
||||||
|
ui_sfx_volume_lbl->setText(tr("SFX:"));
|
||||||
|
ui_sfx_volume_lbl->setToolTip(tr("Sets the SFX's default volume. "
|
||||||
|
"Interjections and actual sound effects count as 'SFX'."));
|
||||||
|
|
||||||
|
ui_audio_layout->setWidget(3, QFormLayout::LabelRole, ui_sfx_volume_lbl);
|
||||||
|
|
||||||
|
ui_sfx_volume_spinbox = new QSpinBox(ui_audio_widget);
|
||||||
|
ui_sfx_volume_spinbox->setValue(p_ao_app->get_default_sfx());
|
||||||
|
ui_sfx_volume_spinbox->setMaximum(100);
|
||||||
|
ui_sfx_volume_spinbox->setSuffix("%");
|
||||||
|
|
||||||
|
ui_audio_layout->setWidget(3, QFormLayout::FieldRole, ui_sfx_volume_spinbox);
|
||||||
|
|
||||||
|
ui_blips_volume_lbl = new QLabel(ui_audio_widget);
|
||||||
|
ui_blips_volume_lbl->setText(tr("Blips:"));
|
||||||
|
ui_blips_volume_lbl->setToolTip(tr("Sets the volume of the blips, the talking sound effects."));
|
||||||
|
|
||||||
|
ui_audio_layout->setWidget(4, QFormLayout::LabelRole, ui_blips_volume_lbl);
|
||||||
|
|
||||||
|
ui_blips_volume_spinbox = new QSpinBox(ui_audio_widget);
|
||||||
|
ui_blips_volume_spinbox->setValue(p_ao_app->get_default_blip());
|
||||||
|
ui_blips_volume_spinbox->setMaximum(100);
|
||||||
|
ui_blips_volume_spinbox->setSuffix("%");
|
||||||
|
|
||||||
|
ui_audio_layout->setWidget(4, QFormLayout::FieldRole, ui_blips_volume_spinbox);
|
||||||
|
|
||||||
|
ui_volume_blip_divider = new QFrame(ui_audio_widget);
|
||||||
|
ui_volume_blip_divider->setFrameShape(QFrame::HLine);
|
||||||
|
ui_volume_blip_divider->setFrameShadow(QFrame::Sunken);
|
||||||
|
|
||||||
|
ui_audio_layout->setWidget(5, QFormLayout::FieldRole, ui_volume_blip_divider);
|
||||||
|
|
||||||
|
ui_bliprate_lbl = new QLabel(ui_audio_widget);
|
||||||
|
ui_bliprate_lbl->setText(tr("Blip rate:"));
|
||||||
|
ui_bliprate_lbl->setToolTip(tr("Sets the delay between playing the blip sounds."));
|
||||||
|
|
||||||
|
ui_audio_layout->setWidget(6, QFormLayout::LabelRole, ui_bliprate_lbl);
|
||||||
|
|
||||||
|
ui_bliprate_spinbox = new QSpinBox(ui_audio_widget);
|
||||||
|
ui_bliprate_spinbox->setValue(p_ao_app->read_blip_rate());
|
||||||
|
ui_bliprate_spinbox->setMinimum(1);
|
||||||
|
|
||||||
|
ui_audio_layout->setWidget(6, QFormLayout::FieldRole, ui_bliprate_spinbox);
|
||||||
|
|
||||||
|
ui_blank_blips_lbl = new QLabel(ui_audio_widget);
|
||||||
|
ui_blank_blips_lbl->setText(tr("Blank blips:"));
|
||||||
|
ui_blank_blips_lbl->setToolTip(tr("If true, the game will play a blip sound even "
|
||||||
|
"when a space is 'being said'."));
|
||||||
|
|
||||||
|
ui_audio_layout->setWidget(7, QFormLayout::LabelRole, ui_blank_blips_lbl);
|
||||||
|
|
||||||
|
ui_blank_blips_cb = new QCheckBox(ui_audio_widget);
|
||||||
|
ui_blank_blips_cb->setChecked(p_ao_app->get_blank_blip());
|
||||||
|
|
||||||
|
ui_audio_layout->setWidget(7, QFormLayout::FieldRole, ui_blank_blips_cb);
|
||||||
|
|
||||||
|
// The casing tab!
|
||||||
|
ui_casing_tab = new QWidget();
|
||||||
|
ui_settings_tabs->addTab(ui_casing_tab, tr("Casing"));
|
||||||
|
|
||||||
|
ui_casing_widget = new QWidget(ui_casing_tab);
|
||||||
|
ui_casing_widget->setGeometry(QRect(10,10, 361, 211));
|
||||||
|
|
||||||
|
ui_casing_layout = new QFormLayout(ui_casing_widget);
|
||||||
|
ui_casing_layout->setLabelAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter);
|
||||||
|
ui_casing_layout->setFormAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop);
|
||||||
|
ui_casing_layout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
|
// -- SERVER SUPPORTS CASING
|
||||||
|
|
||||||
|
ui_casing_supported_lbl = new QLabel(ui_casing_widget);
|
||||||
|
if (ao_app->casing_alerts_enabled)
|
||||||
|
ui_casing_supported_lbl->setText(tr("This server supports case alerts."));
|
||||||
|
else
|
||||||
|
ui_casing_supported_lbl->setText(tr("This server does not support case alerts."));
|
||||||
|
ui_casing_supported_lbl->setToolTip(tr("Pretty self-explanatory."));
|
||||||
|
|
||||||
|
ui_casing_layout->setWidget(0, QFormLayout::FieldRole, ui_casing_supported_lbl);
|
||||||
|
|
||||||
|
// -- CASE ANNOUNCEMENTS
|
||||||
|
|
||||||
|
ui_casing_enabled_lbl = new QLabel(ui_casing_widget);
|
||||||
|
ui_casing_enabled_lbl->setText(tr("Casing:"));
|
||||||
|
ui_casing_enabled_lbl->setToolTip(tr("If checked, you will get alerts about case "
|
||||||
|
"announcements."));
|
||||||
|
|
||||||
|
ui_casing_layout->setWidget(1, QFormLayout::LabelRole, ui_casing_enabled_lbl);
|
||||||
|
|
||||||
|
ui_casing_enabled_cb = new QCheckBox(ui_casing_widget);
|
||||||
|
ui_casing_enabled_cb->setChecked(ao_app->get_casing_enabled());
|
||||||
|
|
||||||
|
ui_casing_layout->setWidget(1, QFormLayout::FieldRole, ui_casing_enabled_cb);
|
||||||
|
|
||||||
|
// -- DEFENSE ANNOUNCEMENTS
|
||||||
|
|
||||||
|
ui_casing_def_lbl = new QLabel(ui_casing_widget);
|
||||||
|
ui_casing_def_lbl->setText(tr("Defense:"));
|
||||||
|
ui_casing_def_lbl->setToolTip(tr("If checked, you will get alerts about case "
|
||||||
|
"announcements if a defense spot is open."));
|
||||||
|
|
||||||
|
ui_casing_layout->setWidget(2, QFormLayout::LabelRole, ui_casing_def_lbl);
|
||||||
|
|
||||||
|
ui_casing_def_cb = new QCheckBox(ui_casing_widget);
|
||||||
|
ui_casing_def_cb->setChecked(ao_app->get_casing_defence_enabled());
|
||||||
|
|
||||||
|
ui_casing_layout->setWidget(2, QFormLayout::FieldRole, ui_casing_def_cb);
|
||||||
|
|
||||||
|
// -- PROSECUTOR ANNOUNCEMENTS
|
||||||
|
|
||||||
|
ui_casing_pro_lbl = new QLabel(ui_casing_widget);
|
||||||
|
ui_casing_pro_lbl->setText(tr("Prosecution:"));
|
||||||
|
ui_casing_pro_lbl->setToolTip(tr("If checked, you will get alerts about case "
|
||||||
|
"announcements if a prosecutor spot is open."));
|
||||||
|
|
||||||
|
ui_casing_layout->setWidget(3, QFormLayout::LabelRole, ui_casing_pro_lbl);
|
||||||
|
|
||||||
|
ui_casing_pro_cb = new QCheckBox(ui_casing_widget);
|
||||||
|
ui_casing_pro_cb->setChecked(ao_app->get_casing_prosecution_enabled());
|
||||||
|
|
||||||
|
ui_casing_layout->setWidget(3, QFormLayout::FieldRole, ui_casing_pro_cb);
|
||||||
|
|
||||||
|
// -- JUDGE ANNOUNCEMENTS
|
||||||
|
|
||||||
|
ui_casing_jud_lbl = new QLabel(ui_casing_widget);
|
||||||
|
ui_casing_jud_lbl->setText(tr("Judge:"));
|
||||||
|
ui_casing_jud_lbl->setToolTip(tr("If checked, you will get alerts about case "
|
||||||
|
"announcements if the judge spot is open."));
|
||||||
|
|
||||||
|
ui_casing_layout->setWidget(4, QFormLayout::LabelRole, ui_casing_jud_lbl);
|
||||||
|
|
||||||
|
ui_casing_jud_cb = new QCheckBox(ui_casing_widget);
|
||||||
|
ui_casing_jud_cb->setChecked(ao_app->get_casing_judge_enabled());
|
||||||
|
|
||||||
|
ui_casing_layout->setWidget(4, QFormLayout::FieldRole, ui_casing_jud_cb);
|
||||||
|
|
||||||
|
// -- JUROR ANNOUNCEMENTS
|
||||||
|
|
||||||
|
ui_casing_jur_lbl = new QLabel(ui_casing_widget);
|
||||||
|
ui_casing_jur_lbl->setText(tr("Juror:"));
|
||||||
|
ui_casing_jur_lbl->setToolTip(tr("If checked, you will get alerts about case "
|
||||||
|
"announcements if a juror spot is open."));
|
||||||
|
|
||||||
|
ui_casing_layout->setWidget(5, QFormLayout::LabelRole, ui_casing_jur_lbl);
|
||||||
|
|
||||||
|
ui_casing_jur_cb = new QCheckBox(ui_casing_widget);
|
||||||
|
ui_casing_jur_cb->setChecked(ao_app->get_casing_juror_enabled());
|
||||||
|
|
||||||
|
ui_casing_layout->setWidget(5, QFormLayout::FieldRole, ui_casing_jur_cb);
|
||||||
|
|
||||||
|
// -- STENO ANNOUNCEMENTS
|
||||||
|
|
||||||
|
ui_casing_steno_lbl = new QLabel(ui_casing_widget);
|
||||||
|
ui_casing_steno_lbl->setText(tr("Stenographer:"));
|
||||||
|
ui_casing_steno_lbl->setToolTip(tr("If checked, you will get alerts about case "
|
||||||
|
"announcements if a stenographer spot is open."));
|
||||||
|
|
||||||
|
ui_casing_layout->setWidget(6, QFormLayout::LabelRole, ui_casing_steno_lbl);
|
||||||
|
|
||||||
|
ui_casing_steno_cb = new QCheckBox(ui_casing_widget);
|
||||||
|
ui_casing_steno_cb->setChecked(ao_app->get_casing_steno_enabled());
|
||||||
|
|
||||||
|
ui_casing_layout->setWidget(6, QFormLayout::FieldRole, ui_casing_steno_cb);
|
||||||
|
|
||||||
|
// -- CM ANNOUNCEMENTS
|
||||||
|
|
||||||
|
ui_casing_cm_lbl = new QLabel(ui_casing_widget);
|
||||||
|
ui_casing_cm_lbl->setText(tr("CM:"));
|
||||||
|
ui_casing_cm_lbl->setToolTip(tr("If checked, you will appear amongst the potential "
|
||||||
|
"CMs on the server."));
|
||||||
|
|
||||||
|
ui_casing_layout->setWidget(7, QFormLayout::LabelRole, ui_casing_cm_lbl);
|
||||||
|
|
||||||
|
ui_casing_cm_cb = new QCheckBox(ui_casing_widget);
|
||||||
|
ui_casing_cm_cb->setChecked(ao_app->get_casing_cm_enabled());
|
||||||
|
|
||||||
|
ui_casing_layout->setWidget(7, QFormLayout::FieldRole, ui_casing_cm_cb);
|
||||||
|
|
||||||
|
// -- CM CASES ANNOUNCEMENTS
|
||||||
|
|
||||||
|
ui_casing_cm_cases_lbl = new QLabel(ui_casing_widget);
|
||||||
|
ui_casing_cm_cases_lbl->setText(tr("Hosting cases:"));
|
||||||
|
ui_casing_cm_cases_lbl->setToolTip(tr("If you're a CM, enter what cases you are "
|
||||||
|
"willing to host."));
|
||||||
|
|
||||||
|
ui_casing_layout->setWidget(8, QFormLayout::LabelRole, ui_casing_cm_cases_lbl);
|
||||||
|
|
||||||
|
ui_casing_cm_cases_textbox = new QLineEdit(ui_casing_widget);
|
||||||
|
ui_casing_cm_cases_textbox->setText(ao_app->get_casing_can_host_cases());
|
||||||
|
|
||||||
|
ui_casing_layout->setWidget(8, QFormLayout::FieldRole, ui_casing_cm_cases_textbox);
|
||||||
|
|
||||||
|
// When we're done, we should continue the updates!
|
||||||
|
setUpdatesEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AOOptionsDialog::save_pressed()
|
||||||
|
{
|
||||||
|
// Save everything into the config.ini.
|
||||||
|
QSettings* configini = ao_app->configini;
|
||||||
|
|
||||||
|
configini->setValue("theme", ui_theme_combobox->currentText());
|
||||||
|
configini->setValue("log_goes_downwards", ui_downwards_cb->isChecked());
|
||||||
|
configini->setValue("log_maximum", ui_length_spinbox->value());
|
||||||
|
configini->setValue("default_username", ui_username_textbox->text());
|
||||||
|
configini->setValue("show_custom_shownames", ui_showname_cb->isChecked());
|
||||||
|
configini->setValue("master", ui_ms_textbox->text());
|
||||||
|
configini->setValue("discord", ui_discord_cb->isChecked());
|
||||||
|
|
||||||
|
QFile* callwordsini = new QFile(ao_app->get_base_path() + "callwords.ini");
|
||||||
|
|
||||||
|
if (!callwordsini->open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text))
|
||||||
|
{
|
||||||
|
// Nevermind!
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QTextStream out(callwordsini);
|
||||||
|
out << ui_callwords_textbox->toPlainText();
|
||||||
|
callwordsini->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
configini->setValue("default_audio_device", ui_audio_device_combobox->currentText());
|
||||||
|
configini->setValue("default_music", ui_music_volume_spinbox->value());
|
||||||
|
configini->setValue("default_sfx", ui_sfx_volume_spinbox->value());
|
||||||
|
configini->setValue("default_blip", ui_blips_volume_spinbox->value());
|
||||||
|
configini->setValue("blip_rate", ui_bliprate_spinbox->value());
|
||||||
|
configini->setValue("blank_blip", ui_blank_blips_cb->isChecked());
|
||||||
|
|
||||||
|
configini->setValue("casing_enabled", ui_casing_enabled_cb->isChecked());
|
||||||
|
configini->setValue("casing_defence_enabled", ui_casing_def_cb->isChecked());
|
||||||
|
configini->setValue("casing_prosecution_enabled", ui_casing_pro_cb->isChecked());
|
||||||
|
configini->setValue("casing_judge_enabled", ui_casing_jud_cb->isChecked());
|
||||||
|
configini->setValue("casing_juror_enabled", ui_casing_jur_cb->isChecked());
|
||||||
|
configini->setValue("casing_steno_enabled", ui_casing_steno_cb->isChecked());
|
||||||
|
configini->setValue("casing_cm_enabled", ui_casing_cm_cb->isChecked());
|
||||||
|
configini->setValue("casing_can_host_cases", ui_casing_cm_cases_textbox->text());
|
||||||
|
|
||||||
|
callwordsini->close();
|
||||||
|
done(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AOOptionsDialog::discard_pressed()
|
||||||
|
{
|
||||||
|
done(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if (defined (_WIN32) || defined (_WIN64))
|
||||||
|
bool AOOptionsDialog::needs_default_audiodev()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#elif (defined (LINUX) || defined (__linux__))
|
||||||
|
bool AOOptionsDialog::needs_default_audiodev()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#error This operating system is not supported.
|
||||||
|
#endif
|
115
aooptionsdialog.h
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
#ifndef AOOPTIONSDIALOG_H
|
||||||
|
#define AOOPTIONSDIALOG_H
|
||||||
|
|
||||||
|
#include "aoapplication.h"
|
||||||
|
#include "bass.h"
|
||||||
|
|
||||||
|
#include <QtCore/QVariant>
|
||||||
|
#include <QtWidgets/QApplication>
|
||||||
|
#include <QtWidgets/QCheckBox>
|
||||||
|
#include <QtWidgets/QComboBox>
|
||||||
|
#include <QtWidgets/QDialog>
|
||||||
|
#include <QtWidgets/QDialogButtonBox>
|
||||||
|
#include <QtWidgets/QFormLayout>
|
||||||
|
#include <QtWidgets/QFrame>
|
||||||
|
#include <QtWidgets/QLabel>
|
||||||
|
#include <QtWidgets/QLineEdit>
|
||||||
|
#include <QtWidgets/QPlainTextEdit>
|
||||||
|
#include <QtWidgets/QSpinBox>
|
||||||
|
#include <QtWidgets/QTabWidget>
|
||||||
|
#include <QtWidgets/QVBoxLayout>
|
||||||
|
#include <QtWidgets/QWidget>
|
||||||
|
|
||||||
|
#include <QDirIterator>
|
||||||
|
#include <QTextStream>
|
||||||
|
|
||||||
|
class AOOptionsDialog: public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit AOOptionsDialog(QWidget *parent = nullptr, AOApplication *p_ao_app = nullptr);
|
||||||
|
|
||||||
|
private:
|
||||||
|
AOApplication *ao_app;
|
||||||
|
|
||||||
|
QVBoxLayout *ui_vertical_layout;
|
||||||
|
QTabWidget *ui_settings_tabs;
|
||||||
|
|
||||||
|
QWidget *ui_gameplay_tab;
|
||||||
|
QWidget *ui_form_layout_widget;
|
||||||
|
QFormLayout *ui_gameplay_form;
|
||||||
|
QLabel *ui_theme_label;
|
||||||
|
QComboBox *ui_theme_combobox;
|
||||||
|
QFrame *ui_theme_log_divider;
|
||||||
|
QLabel *ui_downwards_lbl;
|
||||||
|
QCheckBox *ui_downwards_cb;
|
||||||
|
QLabel *ui_length_lbl;
|
||||||
|
QSpinBox *ui_length_spinbox;
|
||||||
|
QFrame *ui_log_names_divider;
|
||||||
|
QLineEdit *ui_username_textbox;
|
||||||
|
QLabel *ui_username_lbl;
|
||||||
|
QLabel *ui_showname_lbl;
|
||||||
|
QCheckBox *ui_showname_cb;
|
||||||
|
QFrame *ui_net_divider;
|
||||||
|
QLabel *ui_ms_lbl;
|
||||||
|
QLineEdit *ui_ms_textbox;
|
||||||
|
QLabel *ui_discord_lbl;
|
||||||
|
QCheckBox *ui_discord_cb;
|
||||||
|
|
||||||
|
QWidget *ui_callwords_tab;
|
||||||
|
QWidget *ui_callwords_widget;
|
||||||
|
QVBoxLayout *ui_callwords_layout;
|
||||||
|
QPlainTextEdit *ui_callwords_textbox;
|
||||||
|
QLabel *ui_callwords_explain_lbl;
|
||||||
|
QCheckBox *ui_callwords_char_textbox;
|
||||||
|
|
||||||
|
QWidget *ui_audio_tab;
|
||||||
|
QWidget *ui_audio_widget;
|
||||||
|
QFormLayout *ui_audio_layout;
|
||||||
|
QLabel *ui_audio_device_lbl;
|
||||||
|
QComboBox *ui_audio_device_combobox;
|
||||||
|
QFrame *ui_audio_volume_divider;
|
||||||
|
QSpinBox *ui_music_volume_spinbox;
|
||||||
|
QLabel *ui_music_volume_lbl;
|
||||||
|
QSpinBox *ui_sfx_volume_spinbox;
|
||||||
|
QSpinBox *ui_blips_volume_spinbox;
|
||||||
|
QLabel *ui_sfx_volume_lbl;
|
||||||
|
QLabel *ui_blips_volume_lbl;
|
||||||
|
QFrame *ui_volume_blip_divider;
|
||||||
|
QSpinBox *ui_bliprate_spinbox;
|
||||||
|
QLabel *ui_bliprate_lbl;
|
||||||
|
QCheckBox *ui_blank_blips_cb;
|
||||||
|
QLabel *ui_blank_blips_lbl;
|
||||||
|
QDialogButtonBox *ui_settings_buttons;
|
||||||
|
|
||||||
|
QWidget *ui_casing_tab;
|
||||||
|
QWidget *ui_casing_widget;
|
||||||
|
QFormLayout *ui_casing_layout;
|
||||||
|
QLabel *ui_casing_supported_lbl;
|
||||||
|
QLabel *ui_casing_enabled_lbl;
|
||||||
|
QCheckBox *ui_casing_enabled_cb;
|
||||||
|
QLabel *ui_casing_def_lbl;
|
||||||
|
QCheckBox *ui_casing_def_cb;
|
||||||
|
QLabel *ui_casing_pro_lbl;
|
||||||
|
QCheckBox *ui_casing_pro_cb;
|
||||||
|
QLabel *ui_casing_jud_lbl;
|
||||||
|
QCheckBox *ui_casing_jud_cb;
|
||||||
|
QLabel *ui_casing_jur_lbl;
|
||||||
|
QCheckBox *ui_casing_jur_cb;
|
||||||
|
QLabel *ui_casing_steno_lbl;
|
||||||
|
QCheckBox *ui_casing_steno_cb;
|
||||||
|
QLabel *ui_casing_cm_lbl;
|
||||||
|
QCheckBox *ui_casing_cm_cb;
|
||||||
|
QLabel *ui_casing_cm_cases_lbl;
|
||||||
|
QLineEdit *ui_casing_cm_cases_textbox;
|
||||||
|
|
||||||
|
bool needs_default_audiodev();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void save_pressed();
|
||||||
|
void discard_pressed();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // AOOPTIONSDIALOG_H
|
32
aoscene.cpp
@ -6,27 +6,41 @@ AOScene::AOScene(QWidget *parent, AOApplication *p_ao_app) : QLabel(parent)
|
|||||||
{
|
{
|
||||||
m_parent = parent;
|
m_parent = parent;
|
||||||
ao_app = p_ao_app;
|
ao_app = p_ao_app;
|
||||||
|
m_movie = new QMovie(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AOScene::set_image(QString p_image)
|
void AOScene::set_image(QString p_image)
|
||||||
{
|
{
|
||||||
QString background_path = ao_app->get_background_path() + p_image + ".png";
|
QString background_path = ao_app->get_background_path(p_image + ".png");
|
||||||
QString animated_background_path = ao_app->get_background_path() + p_image + ".gif";
|
QString animated_background_path = ao_app->get_background_path(p_image + ".gif");
|
||||||
QString default_path = ao_app->get_default_background_path() + p_image;
|
QString default_path = ao_app->get_default_background_path(p_image + ".png");
|
||||||
|
|
||||||
QPixmap background(background_path);
|
QPixmap background(background_path);
|
||||||
QPixmap animated_background(animated_background_path);
|
|
||||||
QPixmap default_bg(default_path);
|
QPixmap default_bg(default_path);
|
||||||
|
|
||||||
int w = this->width();
|
int w = this->width();
|
||||||
int h = this->height();
|
int h = this->height();
|
||||||
|
|
||||||
if (file_exists(animated_background_path))
|
this->clear();
|
||||||
this->setPixmap(animated_background.scaled(w, h));
|
this->setMovie(nullptr);
|
||||||
|
|
||||||
|
m_movie->stop();
|
||||||
|
m_movie->setFileName(animated_background_path);
|
||||||
|
m_movie->setScaledSize(QSize(w, h));
|
||||||
|
|
||||||
|
if (m_movie->isValid())
|
||||||
|
{
|
||||||
|
this->setMovie(m_movie);
|
||||||
|
m_movie->start();
|
||||||
|
}
|
||||||
else if (file_exists(background_path))
|
else if (file_exists(background_path))
|
||||||
|
{
|
||||||
this->setPixmap(background.scaled(w, h));
|
this->setPixmap(background.scaled(w, h));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
this->setPixmap(default_bg.scaled(w, h));
|
this->setPixmap(default_bg.scaled(w, h));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AOScene::set_legacy_desk(QString p_image)
|
void AOScene::set_legacy_desk(QString p_image)
|
||||||
@ -34,8 +48,8 @@ void AOScene::set_legacy_desk(QString p_image)
|
|||||||
//vanilla desks vary in both width and height. in order to make that work with viewport rescaling,
|
//vanilla desks vary in both width and height. in order to make that work with viewport rescaling,
|
||||||
//some INTENSE math is needed.
|
//some INTENSE math is needed.
|
||||||
|
|
||||||
QString desk_path = ao_app->get_background_path() + p_image;
|
QString desk_path = ao_app->get_background_path(p_image);
|
||||||
QString default_path = ao_app->get_default_background_path() + p_image;
|
QString default_path = ao_app->get_default_background_path(p_image);
|
||||||
|
|
||||||
QPixmap f_desk;
|
QPixmap f_desk;
|
||||||
|
|
||||||
@ -53,7 +67,7 @@ void AOScene::set_legacy_desk(QString p_image)
|
|||||||
|
|
||||||
//int final_y = y_modifier * vp_height;
|
//int final_y = y_modifier * vp_height;
|
||||||
//int final_w = w_modifier * f_desk.width();
|
//int final_w = w_modifier * f_desk.width();
|
||||||
int final_h = h_modifier * f_desk.height();
|
int final_h = static_cast<int>(h_modifier * f_desk.height());
|
||||||
|
|
||||||
//this->resize(final_w, final_h);
|
//this->resize(final_w, final_h);
|
||||||
//this->setPixmap(f_desk.scaled(final_w, final_h));
|
//this->setPixmap(f_desk.scaled(final_w, final_h));
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QMovie>
|
||||||
|
|
||||||
class Courtroom;
|
class Courtroom;
|
||||||
class AOApplication;
|
class AOApplication;
|
||||||
@ -18,6 +19,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QWidget *m_parent;
|
QWidget *m_parent;
|
||||||
|
QMovie *m_movie;
|
||||||
AOApplication *ao_app;
|
AOApplication *ao_app;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -1,41 +1,49 @@
|
|||||||
#include "aosfxplayer.h"
|
#include "aosfxplayer.h"
|
||||||
|
#include "file_functions.h"
|
||||||
|
|
||||||
AOSfxPlayer::AOSfxPlayer(QWidget *parent, AOApplication *p_ao_app)
|
AOSfxPlayer::AOSfxPlayer(QWidget *parent, AOApplication *p_ao_app)
|
||||||
{
|
{
|
||||||
m_sfxplayer = new QSoundEffect;
|
|
||||||
m_parent = parent;
|
m_parent = parent;
|
||||||
ao_app = p_ao_app;
|
ao_app = p_ao_app;
|
||||||
}
|
}
|
||||||
|
|
||||||
AOSfxPlayer::~AOSfxPlayer()
|
void AOSfxPlayer::play(QString p_sfx, QString p_char, QString shout)
|
||||||
{
|
{
|
||||||
m_sfxplayer->stop();
|
QString misc_path = "";
|
||||||
m_sfxplayer->deleteLater();
|
QString char_path = "";
|
||||||
}
|
QString sound_path = ao_app->get_sounds_path(p_sfx);
|
||||||
|
|
||||||
void AOSfxPlayer::play(QString p_sfx, QString p_char)
|
if (shout != "")
|
||||||
{
|
misc_path = ao_app->get_base_path() + "misc/" + shout + "/" + p_sfx;
|
||||||
m_sfxplayer->stop();
|
|
||||||
p_sfx = p_sfx.toLower();
|
|
||||||
QString f_path;
|
|
||||||
if (p_char != "")
|
if (p_char != "")
|
||||||
f_path = ao_app->get_character_path(p_char) + p_sfx;
|
char_path = ao_app->get_character_path(p_char, p_sfx);
|
||||||
else
|
|
||||||
f_path = ao_app->get_sounds_path() + p_sfx;
|
QString f_path;
|
||||||
|
|
||||||
|
if (file_exists(char_path))
|
||||||
|
f_path = char_path;
|
||||||
|
else if (file_exists(misc_path))
|
||||||
|
f_path = misc_path;
|
||||||
|
else
|
||||||
|
f_path = sound_path;
|
||||||
|
|
||||||
|
m_stream = BASS_StreamCreateFile(FALSE, f_path.utf16(), 0, 0, BASS_STREAM_AUTOFREE | BASS_UNICODE | BASS_ASYNCFILE);
|
||||||
|
|
||||||
m_sfxplayer->setSource(QUrl::fromLocalFile(f_path));
|
|
||||||
set_volume(m_volume);
|
set_volume(m_volume);
|
||||||
|
|
||||||
m_sfxplayer->play();
|
if (ao_app->get_audio_output_device() != "default")
|
||||||
|
BASS_ChannelSetDevice(m_stream, BASS_GetDevice());
|
||||||
|
BASS_ChannelPlay(m_stream, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AOSfxPlayer::stop()
|
void AOSfxPlayer::stop()
|
||||||
{
|
{
|
||||||
m_sfxplayer->stop();
|
BASS_ChannelStop(m_stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AOSfxPlayer::set_volume(int p_value)
|
void AOSfxPlayer::set_volume(int p_value)
|
||||||
{
|
{
|
||||||
m_volume = p_value;
|
m_volume = p_value;
|
||||||
m_sfxplayer->setVolume(p_value / 100.0);
|
float volume = p_value / 100.0f;
|
||||||
|
BASS_ChannelSetAttribute(m_stream, BASS_ATTRIB_VOL, volume);
|
||||||
}
|
}
|
||||||
|
@ -1,29 +1,28 @@
|
|||||||
#ifndef AOSFXPLAYER_H
|
#ifndef AOSFXPLAYER_H
|
||||||
#define AOSFXPLAYER_H
|
#define AOSFXPLAYER_H
|
||||||
|
|
||||||
|
#include "bass.h"
|
||||||
#include "aoapplication.h"
|
#include "aoapplication.h"
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QSoundEffect>
|
|
||||||
|
|
||||||
class AOSfxPlayer
|
class AOSfxPlayer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AOSfxPlayer(QWidget *parent, AOApplication *p_ao_app);
|
AOSfxPlayer(QWidget *parent, AOApplication *p_ao_app);
|
||||||
~AOSfxPlayer();
|
|
||||||
|
|
||||||
void play(QString p_sfx, QString p_char = "");
|
void play(QString p_sfx, QString p_char = "", QString shout = "");
|
||||||
void stop();
|
void stop();
|
||||||
void set_volume(int p_volume);
|
void set_volume(int p_volume);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QWidget *m_parent;
|
QWidget *m_parent;
|
||||||
AOApplication *ao_app;
|
AOApplication *ao_app;
|
||||||
QSoundEffect *m_sfxplayer;
|
|
||||||
|
|
||||||
int m_volume = 0;
|
int m_volume = 0;
|
||||||
|
HSTREAM m_stream;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // AOSFXPLAYER_H
|
#endif // AOSFXPLAYER_H
|
||||||
|
@ -5,7 +5,7 @@ AOTextArea::AOTextArea(QWidget *p_parent) : QTextBrowser(p_parent)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AOTextArea::append_chatmessage(QString p_name, QString p_message)
|
void AOTextArea::append_chatmessage(QString p_name, QString p_message, QString p_colour)
|
||||||
{
|
{
|
||||||
const QTextCursor old_cursor = this->textCursor();
|
const QTextCursor old_cursor = this->textCursor();
|
||||||
const int old_scrollbar_value = this->verticalScrollBar()->value();
|
const int old_scrollbar_value = this->verticalScrollBar()->value();
|
||||||
@ -14,7 +14,7 @@ void AOTextArea::append_chatmessage(QString p_name, QString p_message)
|
|||||||
this->moveCursor(QTextCursor::End);
|
this->moveCursor(QTextCursor::End);
|
||||||
|
|
||||||
this->append("");
|
this->append("");
|
||||||
this->insertHtml("<b>" + p_name.toHtmlEscaped() + "</b>: ");
|
this->insertHtml("<b><font color=" + p_colour + ">" + p_name.toHtmlEscaped() + "</font></b>: ");
|
||||||
|
|
||||||
//cheap workarounds ahoy
|
//cheap workarounds ahoy
|
||||||
p_message += " ";
|
p_message += " ";
|
||||||
|
@ -12,7 +12,7 @@ class AOTextArea : public QTextBrowser
|
|||||||
public:
|
public:
|
||||||
AOTextArea(QWidget *p_parent = nullptr);
|
AOTextArea(QWidget *p_parent = nullptr);
|
||||||
|
|
||||||
void append_chatmessage(QString p_name, QString p_message);
|
void append_chatmessage(QString p_name, QString p_message, QString p_colour);
|
||||||
void append_error(QString p_message);
|
void append_error(QString p_message);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -1,4 +1 @@
|
|||||||
10.0.0.1:27071:the shit server
|
127.0.0.1:27016:Default local 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)
|
|
||||||
|
BIN
base/themes/default/addevidence.png
Normal file
After Width: | Height: | Size: 403 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 742 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 730 B |
Before Width: | Height: | Size: 344 B After Width: | Height: | Size: 285 B |
Before Width: | Height: | Size: 291 B After Width: | Height: | Size: 215 B |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
@ -1,52 +1,236 @@
|
|||||||
|
; Client size. Changing it to something other than 714, 668 will stretch or
|
||||||
|
; compress courtroombackground.png accordingly.
|
||||||
courtroom = 0, 0, 714, 668
|
courtroom = 0, 0, 714, 668
|
||||||
|
|
||||||
|
; IC Area. Changing 256, 192 will stretch or compress character gifs and the
|
||||||
|
; /bgs being used accordingly
|
||||||
viewport = 0, 0, 256, 192
|
viewport = 0, 0, 256, 192
|
||||||
chatbox = 0, 96, 256, 78
|
|
||||||
ao2_chatbox = 0, 114, 256, 78
|
; IC chatbox
|
||||||
showname = 6, 113, 80, 15
|
chatbox = 0, 174, 256, 108
|
||||||
message = 3, 132, 250, 60
|
|
||||||
|
; IC chatbox if the current background's folder contains stand.png,
|
||||||
|
; defensedesk.png and prosecutiondesk.png
|
||||||
|
ao2_chatbox = 0, 174, 256, 108
|
||||||
|
|
||||||
|
; Textbox for custom IC name (the "showname")
|
||||||
|
showname = 6, 1, 256, 15
|
||||||
|
|
||||||
|
; IC message, positioned within the chatbox. Changing 250 affects how
|
||||||
|
; long text goes on before going onto the next line. Changing 89 affects
|
||||||
|
; how many lines you can see before the message starts scrolling, based on
|
||||||
|
; the formula of n = 25+(n-1)*16, where n is the number of lines to be
|
||||||
|
; displayed. (ie, set it to 25 for 1 line, 41 for 2, 57 for 3, 73 for 4,
|
||||||
|
; 89 for 5, 105 for 6... Less than 25 displays nothing)
|
||||||
|
message = 3, 18, 250, 89
|
||||||
|
|
||||||
|
; Where you type to make an IC chat message
|
||||||
|
ic_chat_message = 2, 283, 250, 23
|
||||||
|
|
||||||
|
; IC chat message if the current background's folder contains stand.png,
|
||||||
|
; defensedesk.png and prosecutiondesk.png
|
||||||
|
ao2_ic_chat_message = 2, 283, 250, 23
|
||||||
|
|
||||||
|
; IC chatlog
|
||||||
ic_chatlog = 260, 0, 231, 319
|
ic_chatlog = 260, 0, 231, 319
|
||||||
|
|
||||||
|
; Master server chatlog
|
||||||
ms_chatlog = 490, 1, 224, 277
|
ms_chatlog = 490, 1, 224, 277
|
||||||
|
|
||||||
|
; OOC Chatlog
|
||||||
server_chatlog = 490, 1, 224, 277
|
server_chatlog = 490, 1, 224, 277
|
||||||
mute_list = 260, 160, 231, 159
|
|
||||||
area_list = 266, 494, 224, 174
|
; Where you type to make an OOC chat message
|
||||||
music_list = 490, 342, 224, 326
|
; NOTE: THIS DOES NOT HAVE ANY VISUAL APPEARANCE
|
||||||
ic_chat_message = 0, 174, 256, 23
|
|
||||||
ao2_ic_chat_message = 0, 192, 256, 23
|
|
||||||
ooc_chat_message = 492, 281, 222, 19
|
ooc_chat_message = 492, 281, 222, 19
|
||||||
|
|
||||||
|
; Where you enter your OOC name, and also where it shows up
|
||||||
ooc_chat_name = 492, 300, 85, 19
|
ooc_chat_name = 492, 300, 85, 19
|
||||||
area_password = 266, 471, 224, 23
|
|
||||||
music_search = 490, 319, 226, 23
|
; Toggle between Server and Master OOC chats
|
||||||
emote_left = 0, 253, 20, 20
|
|
||||||
emote_right = 236, 253, 20, 20
|
|
||||||
defense_bar = 393, 323, 84, 14
|
|
||||||
prosecution_bar = 393, 340, 84, 14
|
|
||||||
music_label = 260, 390, 41, 16
|
|
||||||
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
|
ooc_toggle = 580, 300, 133, 19
|
||||||
witness_testimony = 5, 345, 85, 42
|
|
||||||
cross_examination = 95, 345, 85, 42
|
; Where the jukebox is
|
||||||
change_character = 5, 390, 121, 23
|
music_list = 490, 342, 224, 326
|
||||||
reload_theme = 5, 415, 101, 23
|
|
||||||
call_mod = 5, 440, 71, 23
|
; Jukebox search bar
|
||||||
pre = 187, 345, 51, 21
|
music_search = 490, 319, 100, 23
|
||||||
flip = 187, 362, 51, 21
|
|
||||||
guard = 187, 379, 61, 21
|
found_song_color = 100, 255, 100
|
||||||
custom_objection = 250, 325, 40, 40
|
missing_song_color = 255, 100, 100
|
||||||
realization = 295, 325, 40, 40
|
|
||||||
mute_button = 340, 325, 40, 40
|
; Labels and sliders for music/sfx/blips
|
||||||
defense_plus = 477, 325, 9, 9
|
music_label = 282, 607, 41, 16
|
||||||
defense_minus = 385, 325, 9, 9
|
sfx_label = 282, 627, 41, 16
|
||||||
prosecution_plus = 477, 342, 9, 9
|
blip_label = 282, 647, 41, 16
|
||||||
prosecution_minus = 385, 342, 9, 9
|
music_slider = 326, 608, 140, 16
|
||||||
text_color = 390, 360, 79, 23
|
sfx_slider = 326, 628, 140, 16
|
||||||
music_slider = 310, 392, 160, 16
|
blip_slider = 326, 648, 140, 16
|
||||||
sfx_slider = 310, 412, 160, 16
|
|
||||||
blip_slider = 310, 432, 160, 16
|
; Emote buttons - [490, 98] determines how many columns and rows of buttons are
|
||||||
|
; displayed per page. 49, 49 is the ABSOLUTE MINIMUM, and displays 1 button per
|
||||||
|
; page. Having either number lower than 49 crashes the client when you try to
|
||||||
|
; pick a character. If you want X columns and Y rows, you would change it to
|
||||||
|
; 49X, 49Y (ie. 490, 147 if you want 10 columns and 3 rows)
|
||||||
|
emotes = 10, 342, 490, 147
|
||||||
|
emote_button_spacing = 9, 9
|
||||||
|
|
||||||
|
; Page togglers for emotes
|
||||||
|
emote_left = 373, 475, 17, 17
|
||||||
|
emote_right = 392, 475, 17, 17
|
||||||
|
|
||||||
|
; Emote dropdown/emote names - Change '125' to make it longer/shorter and
|
||||||
|
; display the full emote name or truncate it based on length
|
||||||
|
emote_dropdown = 5, 470, 105, 20
|
||||||
|
|
||||||
|
; Hold it/Take That/Objection and the "BLING!" buttons
|
||||||
|
hold_it = 10, 310, 76, 28
|
||||||
|
objection = 90, 310, 76, 28
|
||||||
|
take_that = 170, 310, 76, 28
|
||||||
|
realization = 5, 515, 42, 42
|
||||||
|
|
||||||
|
; If the server supports it (AOV does not currently) - if a character has a
|
||||||
|
; custom.gif and custom.wav in their folder, this button acts as another
|
||||||
|
; Objection/Take That/Hold It for that character that uses the custom animation
|
||||||
|
; and sfx. (Think Satorah! Such Insolence!, Gotcha!)
|
||||||
|
custom_objection = 340, 565, 76, 28
|
||||||
|
|
||||||
|
; Text color dropdown menu
|
||||||
|
text_color = 115, 470, 80, 20
|
||||||
|
|
||||||
|
pos_dropdown = 200, 470, 80, 20
|
||||||
|
|
||||||
|
; Preanimation toggle
|
||||||
|
pre = 5, 490, 80, 21
|
||||||
|
|
||||||
|
; Flip button
|
||||||
|
flip = 104, 490, 51, 21
|
||||||
|
|
||||||
|
; Guard button
|
||||||
|
guard = 200, 560, 61, 21
|
||||||
|
|
||||||
|
pre_no_interrupt = 200, 490, 80, 21
|
||||||
|
|
||||||
|
; Penalty bars and judge's buttons for penalizing. Other than the bars, these
|
||||||
|
; ONLY show up on a character with /pos jud
|
||||||
|
defense_bar = 15, 566, 170, 9
|
||||||
|
prosecution_bar = 15, 582, 170, 9
|
||||||
|
defense_plus = 183, 566, 9, 9
|
||||||
|
defense_minus = 6, 566, 9, 9
|
||||||
|
prosecution_plus = 183, 582, 9, 9
|
||||||
|
prosecution_minus = 6, 582, 9, 9
|
||||||
|
|
||||||
|
; Judge's buttons for WT and CE. /pos jud
|
||||||
|
witness_testimony = 290, 470, 85, 42
|
||||||
|
cross_examination = 290, 515, 85, 42
|
||||||
|
|
||||||
|
; Buttons to change character/Reload theme/Call Mod
|
||||||
|
change_character = 5, 610, 120, 23
|
||||||
|
reload_theme = 5, 637, 94, 23
|
||||||
|
call_mod = 104, 637, 64, 23
|
||||||
|
|
||||||
|
; Mute button
|
||||||
|
mute_button = 150, 515, 42, 42
|
||||||
|
|
||||||
|
; Where the Mute list pops up when you click Mute
|
||||||
|
mute_list = 280, 469, 210, 198
|
||||||
|
|
||||||
|
; ???? - if there was an Area button, where the area list would show up?
|
||||||
|
; area_list = 270, 494, 224, 174
|
||||||
|
|
||||||
|
; ???? - where a password box appears if an area is password locked?
|
||||||
|
; area_password = 266, 471, 224, 23
|
||||||
|
|
||||||
|
; >Evidence meme
|
||||||
|
evidence_button = 627, 322, 85, 18
|
||||||
|
evidence_background = 0, 385, 490, 284
|
||||||
|
evidence_name = 112, 4, 264, 19
|
||||||
|
evidence_buttons = 28, 27, 430, 216
|
||||||
|
evidence_button_spacing = 2, 3
|
||||||
|
evidence_overlay = 24, 24, 439, 222
|
||||||
|
evidence_delete = 78, 8, 70, 20
|
||||||
|
evidence_image_name = 150, 8, 130, 20
|
||||||
|
evidence_image_button = 280, 8, 60, 20
|
||||||
|
evidence_x = 341, 8, 20, 20
|
||||||
|
evidence_description = 78, 28, 281, 166
|
||||||
|
evidence_left = 2, 124, 20, 20
|
||||||
|
evidence_right = 465, 124, 20, 20
|
||||||
|
evidence_present = 165, 247, 158, 41
|
||||||
|
|
||||||
|
; Character select widgets
|
||||||
char_select = 0, 0, 714, 668
|
char_select = 0, 0, 714, 668
|
||||||
back_to_lobby = 5, 5, 91, 23
|
back_to_lobby = 5, 5, 91, 23
|
||||||
char_password = 297, 7, 120, 22
|
char_password = 297, 7, 120, 22
|
||||||
|
char_buttons = 25, 36, 663, 596
|
||||||
|
char_button_spacing = 7, 7
|
||||||
|
char_select_left = 2, 325, 20, 20
|
||||||
|
char_select_right = 691, 325, 20, 20
|
||||||
spectator = 317, 640, 80, 23
|
spectator = 317, 640, 80, 23
|
||||||
|
|
||||||
|
; -------------------------
|
||||||
|
; New in 2.6.0
|
||||||
|
; -------------------------
|
||||||
|
|
||||||
|
; The log limiter explaining label. This is simply a piece of text that
|
||||||
|
; explains what the spin box is for.
|
||||||
|
; log_limit_label = 190, 612, 50, 30
|
||||||
|
|
||||||
|
; The spinbox allows you to set the log limit ingame inbetween 1 and 10000,
|
||||||
|
; with the option to set it to 0 as well (which is considered 'infinite' by
|
||||||
|
; the log limiter).
|
||||||
|
; log_limit_spinbox = 168, 636, 70, 25
|
||||||
|
|
||||||
|
; This is an input field that allows you to change your in-character showname.
|
||||||
|
ic_chat_name = 200, 534, 78, 23
|
||||||
|
|
||||||
|
; I am sure there are some differences between the 'ao2_' versions and the
|
||||||
|
; 'ao2_'-less versions of the IC text display and input, but I do not know
|
||||||
|
; what. Still, here you go!
|
||||||
|
ao2_ic_chat_name = 200, 534, 78, 23
|
||||||
|
|
||||||
|
; An in-game tickbox that allows you to set whether your client should show
|
||||||
|
; custom shownames where possible, or always keep to character names.
|
||||||
|
; This is useful if you suspect someone is impersonating others, for example,
|
||||||
|
; and they are using this in combination with ini-swapping to 'duplicate' a
|
||||||
|
; character.
|
||||||
|
showname_enable = 200, 510, 80, 21
|
||||||
|
|
||||||
|
; A simple button that opens up the settings menu.
|
||||||
|
; Equivalent to typing /settings in the OOC chat.
|
||||||
|
settings = 130, 610, 60, 23
|
||||||
|
|
||||||
|
; The character search text input in the character selecton screen.
|
||||||
|
; The moment you enter some text, it immediately starts filtering.
|
||||||
|
char_search = 420, 7, 120, 22
|
||||||
|
|
||||||
|
; A tickbox that filters based on if a character requires password to access or not.
|
||||||
|
; Note that this is actually only partially implemented in AO.
|
||||||
|
; The interface exists for it, but no way to actually password the characters.
|
||||||
|
char_passworded = 545, 7, 100, 22
|
||||||
|
|
||||||
|
; A tickbox that filters characters based on if they are taken.
|
||||||
|
char_taken = 635, 7, 80, 22
|
||||||
|
|
||||||
|
; These buttons are similar to the CE / WT buttons, except they show a
|
||||||
|
; Not Guilty or Guilty animation instead.
|
||||||
|
not_guilty = 380, 470, 85, 42
|
||||||
|
guilty = 380, 515, 85, 42
|
||||||
|
|
||||||
|
; These are responsible for the pairing stuff.
|
||||||
|
; These work much like muting, actually.
|
||||||
|
pair_button = 104, 515, 42, 42
|
||||||
|
pair_list = 280, 490, 210, 177
|
||||||
|
pair_offset_spinbox = 280, 470, 210, 20
|
||||||
|
|
||||||
|
; This button allows switching between music and areas.
|
||||||
|
switch_area_music = 590, 319, 35, 23
|
||||||
|
|
||||||
|
; These are colours for the various statuses an area can be in.
|
||||||
|
area_free_color = 54, 198, 68
|
||||||
|
area_lfp_color = 255, 255 0
|
||||||
|
area_casing_color = 255, 166, 0
|
||||||
|
area_recess_color = 255, 190, 30
|
||||||
|
area_rp_color = 200, 52, 252
|
||||||
|
area_gaming_color = 55, 255, 255
|
||||||
|
area_locked_color = 165, 43, 43
|
||||||
|
|
||||||
|
11
base/themes/default/courtroom_fonts.ini
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
showname = 8
|
||||||
|
message = 10
|
||||||
|
ic_chatlog = 10
|
||||||
|
ms_chatlog = 10
|
||||||
|
server_chatlog = 9
|
||||||
|
music_list = 8
|
||||||
|
|
||||||
|
ic_chatlog_color = 255, 255, 255
|
||||||
|
|
||||||
|
; Color for all labels and checkboxes
|
||||||
|
label_color = 255, 255, 255
|
8
base/themes/default/courtroom_sounds.ini
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
realization = sfx-realization.wav
|
||||||
|
witness_testimony = sfx-testimony2.wav
|
||||||
|
cross_examination = sfx-testimony.wav
|
||||||
|
evidence_present = sfx-evidenceshoop.wav
|
||||||
|
word_call = sfx-gaspen-yeah!.wav
|
||||||
|
mod_call = sfx-gallery.wav
|
||||||
|
not_guilty = sfx-notguilty.wav
|
||||||
|
guilty = sfx-guilty.wav
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 286 B After Width: | Height: | Size: 171 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 188 B |
Before Width: | Height: | Size: 315 B After Width: | Height: | Size: 184 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 187 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 187 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 188 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 188 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 188 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 187 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 188 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 188 B |
BIN
base/themes/default/deleteevidence.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
base/themes/default/evidence_appear_left.gif
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
base/themes/default/evidence_appear_right.gif
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
base/themes/default/evidence_selected.png
Normal file
After Width: | Height: | Size: 291 B |
BIN
base/themes/default/evidence_selector.png
Normal file
After Width: | Height: | Size: 931 B |
BIN
base/themes/default/evidencebackground.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
base/themes/default/evidencebutton.png
Normal file
After Width: | Height: | Size: 577 B |
BIN
base/themes/default/evidenceoverlay.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
base/themes/default/evidencex.png
Normal file
After Width: | Height: | Size: 637 B |
BIN
base/themes/default/guilty.gif
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
base/themes/default/guilty.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.8 KiB |
@ -1,9 +1,10 @@
|
|||||||
lobby = 0, 0, 517, 666
|
lobby = 0, 0, 517, 666
|
||||||
publi_servers = 46, 88, 114, 30
|
public_servers = 46, 88, 114, 30
|
||||||
favorites = 164, 88, 114, 30
|
favorites = 164, 88, 114, 30
|
||||||
refresh = 56, 381, 132, 28
|
refresh = 56, 381, 132, 28
|
||||||
add_to_fav = 194, 381, 132, 28
|
add_to_fav = 194, 381, 132, 28
|
||||||
connect = 332, 381, 132, 28
|
connect = 332, 381, 132, 28
|
||||||
|
version = 170, 1, 300, 21
|
||||||
about = 428, 1, 88, 21
|
about = 428, 1, 88, 21
|
||||||
server_list = 20, 125, 286, 240
|
server_list = 20, 125, 286, 240
|
||||||
player_count = 336, 91, 173, 16
|
player_count = 336, 91, 173, 16
|
||||||
|
Before Width: | Height: | Size: 652 B After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 608 B After Width: | Height: | Size: 4.9 KiB |
BIN
base/themes/default/notguilty.gif
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
base/themes/default/notguilty.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.9 KiB |
BIN
base/themes/default/pair_button.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
base/themes/default/pair_button_pressed.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 286 B After Width: | Height: | Size: 175 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 182 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 173 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 181 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 182 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 183 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 183 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 184 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 183 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 185 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 186 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.9 KiB |
BIN
base/themes/default/testimony.png
Normal file
After Width: | Height: | Size: 579 B |
216
charselect.cpp
@ -1,11 +1,10 @@
|
|||||||
#include "courtroom.h"
|
#include "courtroom.h"
|
||||||
|
#include "lobby.h"
|
||||||
|
|
||||||
#include "file_functions.h"
|
#include "file_functions.h"
|
||||||
#include "debug_functions.h"
|
#include "debug_functions.h"
|
||||||
#include "hardware_functions.h"
|
#include "hardware_functions.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
void Courtroom::construct_char_select()
|
void Courtroom::construct_char_select()
|
||||||
{
|
{
|
||||||
ui_char_select_background = new AOImage(this, ao_app);
|
ui_char_select_background = new AOImage(this, ao_app);
|
||||||
@ -19,49 +18,32 @@ void Courtroom::construct_char_select()
|
|||||||
ui_back_to_lobby = new AOButton(ui_char_select_background, ao_app);
|
ui_back_to_lobby = new AOButton(ui_char_select_background, ao_app);
|
||||||
|
|
||||||
ui_char_password = new QLineEdit(ui_char_select_background);
|
ui_char_password = new QLineEdit(ui_char_select_background);
|
||||||
|
ui_char_password->setPlaceholderText(tr("Password"));
|
||||||
|
|
||||||
ui_char_select_left = new AOButton(ui_char_select_background, ao_app);
|
ui_char_select_left = new AOButton(ui_char_select_background, ao_app);
|
||||||
ui_char_select_right = new AOButton(ui_char_select_background, ao_app);
|
ui_char_select_right = new AOButton(ui_char_select_background, ao_app);
|
||||||
|
|
||||||
ui_spectator = new AOButton(ui_char_select_background, ao_app);
|
ui_spectator = new AOButton(ui_char_select_background, ao_app);
|
||||||
ui_spectator->setText("Spectator");
|
ui_spectator->setText(tr("Spectator"));
|
||||||
|
|
||||||
QPoint f_spacing = ao_app->get_button_spacing("char_button_spacing", "courtroom_design.ini");
|
ui_char_search = new QLineEdit(ui_char_select_background);
|
||||||
|
ui_char_search->setPlaceholderText(tr("Search"));
|
||||||
|
ui_char_search->setFocus();
|
||||||
|
set_size_and_pos(ui_char_search, "char_search");
|
||||||
|
|
||||||
const int button_width = 60;
|
ui_char_passworded = new QCheckBox(ui_char_select_background);
|
||||||
int x_spacing = f_spacing.x();
|
ui_char_passworded->setText(tr("Passworded"));
|
||||||
int x_mod_count = 0;
|
set_size_and_pos(ui_char_passworded, "char_passworded");
|
||||||
|
|
||||||
const int button_height = 60;
|
ui_char_taken = new QCheckBox(ui_char_select_background);
|
||||||
int y_spacing = f_spacing.y();
|
ui_char_taken->setText(tr("Taken"));
|
||||||
int y_mod_count = 0;
|
set_size_and_pos(ui_char_taken, "char_taken");
|
||||||
|
|
||||||
|
ui_char_taken->setChecked(true);
|
||||||
|
ui_char_passworded->setChecked(true);
|
||||||
|
|
||||||
set_size_and_pos(ui_char_buttons, "char_buttons");
|
set_size_and_pos(ui_char_buttons, "char_buttons");
|
||||||
|
|
||||||
char_columns = ((ui_char_buttons->width() - button_width) / (x_spacing + button_width)) + 1;
|
|
||||||
char_rows = ((ui_char_buttons->height() - button_height) / (y_spacing + button_height)) + 1;
|
|
||||||
|
|
||||||
max_chars_on_page = char_columns * char_rows;
|
|
||||||
|
|
||||||
for (int n = 0 ; n < max_chars_on_page ; ++n)
|
|
||||||
{
|
|
||||||
int x_pos = (button_width + x_spacing) * x_mod_count;
|
|
||||||
int y_pos = (button_height + y_spacing) * y_mod_count;
|
|
||||||
|
|
||||||
ui_char_button_list.append(new AOCharButton(ui_char_buttons, ao_app, x_pos, y_pos));
|
|
||||||
|
|
||||||
connect(ui_char_button_list.at(n), SIGNAL(clicked()), char_button_mapper, SLOT(map())) ;
|
|
||||||
char_button_mapper->setMapping (ui_char_button_list.at(n), n) ;
|
|
||||||
|
|
||||||
++x_mod_count;
|
|
||||||
|
|
||||||
if (x_mod_count == char_columns)
|
|
||||||
{
|
|
||||||
++y_mod_count;
|
|
||||||
x_mod_count = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
connect (char_button_mapper, SIGNAL(mapped(int)), this, SLOT(char_clicked(int)));
|
connect (char_button_mapper, SIGNAL(mapped(int)), this, SLOT(char_clicked(int)));
|
||||||
connect(ui_back_to_lobby, SIGNAL(clicked()), this, SLOT(on_back_to_lobby_clicked()));
|
connect(ui_back_to_lobby, SIGNAL(clicked()), this, SLOT(on_back_to_lobby_clicked()));
|
||||||
|
|
||||||
@ -69,6 +51,10 @@ void Courtroom::construct_char_select()
|
|||||||
connect(ui_char_select_right, SIGNAL(clicked()), this, SLOT(on_char_select_right_clicked()));
|
connect(ui_char_select_right, SIGNAL(clicked()), this, SLOT(on_char_select_right_clicked()));
|
||||||
|
|
||||||
connect(ui_spectator, SIGNAL(clicked()), this, SLOT(on_spectator_clicked()));
|
connect(ui_spectator, SIGNAL(clicked()), this, SLOT(on_spectator_clicked()));
|
||||||
|
|
||||||
|
connect(ui_char_search, SIGNAL(textEdited(const QString&)), this, SLOT(on_char_search_changed(const QString&)));
|
||||||
|
connect(ui_char_passworded, SIGNAL(stateChanged(int)), this, SLOT(on_char_passworded_clicked(int)));
|
||||||
|
connect(ui_char_taken, SIGNAL(stateChanged(int)), this, SLOT(on_char_taken_clicked(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Courtroom::set_char_select()
|
void Courtroom::set_char_select()
|
||||||
@ -87,6 +73,10 @@ void Courtroom::set_char_select()
|
|||||||
|
|
||||||
ui_char_select_background->resize(f_charselect.width, f_charselect.height);
|
ui_char_select_background->resize(f_charselect.width, f_charselect.height);
|
||||||
ui_char_select_background->set_image("charselect_background.png");
|
ui_char_select_background->set_image("charselect_background.png");
|
||||||
|
|
||||||
|
filter_character_list();
|
||||||
|
|
||||||
|
ui_char_search->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Courtroom::set_char_select_page()
|
void Courtroom::set_char_select_page()
|
||||||
@ -97,19 +87,23 @@ void Courtroom::set_char_select_page()
|
|||||||
ui_char_select_right->hide();
|
ui_char_select_right->hide();
|
||||||
|
|
||||||
for (AOCharButton *i_button : ui_char_button_list)
|
for (AOCharButton *i_button : ui_char_button_list)
|
||||||
|
{
|
||||||
|
i_button->reset();
|
||||||
i_button->hide();
|
i_button->hide();
|
||||||
|
i_button->move(0,0);
|
||||||
|
}
|
||||||
|
|
||||||
int total_pages = char_list.size() / max_chars_on_page;
|
int total_pages = ui_char_button_list_filtered.size() / max_chars_on_page;
|
||||||
int chars_on_page = 0;
|
int chars_on_page = 0;
|
||||||
|
|
||||||
if (char_list.size() % max_chars_on_page != 0)
|
if (ui_char_button_list_filtered.size() % max_chars_on_page != 0)
|
||||||
{
|
{
|
||||||
++total_pages;
|
++total_pages;
|
||||||
//i. e. not on the last page
|
//i. e. not on the last page
|
||||||
if (total_pages > current_char_page + 1)
|
if (total_pages > current_char_page + 1)
|
||||||
chars_on_page = max_chars_on_page;
|
chars_on_page = max_chars_on_page;
|
||||||
else
|
else
|
||||||
chars_on_page = char_list.size() % max_chars_on_page;
|
chars_on_page = ui_char_button_list_filtered.size() % max_chars_on_page;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -121,42 +115,154 @@ void Courtroom::set_char_select_page()
|
|||||||
if (current_char_page > 0)
|
if (current_char_page > 0)
|
||||||
ui_char_select_left->show();
|
ui_char_select_left->show();
|
||||||
|
|
||||||
for (int n_button = 0 ; n_button < chars_on_page ; ++n_button)
|
put_button_in_place(current_char_page * max_chars_on_page, chars_on_page);
|
||||||
{
|
|
||||||
int n_real_char = n_button + current_char_page * max_chars_on_page;
|
|
||||||
AOCharButton *f_button = ui_char_button_list.at(n_button);
|
|
||||||
|
|
||||||
f_button->reset();
|
|
||||||
f_button->set_image(char_list.at(n_real_char).name);
|
|
||||||
f_button->show();
|
|
||||||
|
|
||||||
if (char_list.at(n_real_char).taken)
|
|
||||||
f_button->set_taken();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Courtroom::char_clicked(int n_char)
|
void Courtroom::char_clicked(int n_char)
|
||||||
{
|
{
|
||||||
int n_real_char = n_char + current_char_page * max_chars_on_page;
|
QString char_ini_path = ao_app->get_character_path(char_list.at(n_char).name, "char.ini");
|
||||||
|
|
||||||
QString char_ini_path = ao_app->get_character_path(char_list.at(n_real_char).name) + "char.ini";
|
|
||||||
qDebug() << "char_ini_path" << char_ini_path;
|
qDebug() << "char_ini_path" << char_ini_path;
|
||||||
|
|
||||||
if (!file_exists(char_ini_path))
|
if (!file_exists(char_ini_path))
|
||||||
{
|
{
|
||||||
qDebug() << "did not find " << char_ini_path;
|
|
||||||
call_notice("Could not find " + char_ini_path);
|
call_notice("Could not find " + char_ini_path);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n_real_char == m_cid)
|
if (n_char == m_cid)
|
||||||
{
|
{
|
||||||
enter_courtroom(m_cid);
|
enter_courtroom(m_cid);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ao_app->send_server_packet(new AOPacket("CC#" + QString::number(ao_app->s_pv) + "#" + QString::number(n_real_char) + "#" + get_hdid() + "#%"));
|
ao_app->send_server_packet(new AOPacket("CC#" + QString::number(ao_app->s_pv) + "#" + QString::number(n_char) + "#" + get_hdid() + "#%"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui_ic_chat_name->setPlaceholderText(char_list.at(n_char).name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Courtroom::put_button_in_place(int starting, int chars_on_this_page)
|
||||||
|
{
|
||||||
|
if (ui_char_button_list_filtered.size() == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
QPoint f_spacing = ao_app->get_button_spacing("char_button_spacing", "courtroom_design.ini");
|
||||||
|
|
||||||
|
int x_spacing = f_spacing.x();
|
||||||
|
int x_mod_count = 0;
|
||||||
|
|
||||||
|
int y_spacing = f_spacing.y();
|
||||||
|
int y_mod_count = 0;
|
||||||
|
|
||||||
|
char_columns = ((ui_char_buttons->width() - button_width) / (x_spacing + button_width)) + 1;
|
||||||
|
char_rows = ((ui_char_buttons->height() - button_height) / (y_spacing + button_height)) + 1;
|
||||||
|
|
||||||
|
max_chars_on_page = char_columns * char_rows;
|
||||||
|
|
||||||
|
int startout = starting;
|
||||||
|
for (int n = starting ; n < startout+chars_on_this_page ; ++n)
|
||||||
|
{
|
||||||
|
int x_pos = (button_width + x_spacing) * x_mod_count;
|
||||||
|
int y_pos = (button_height + y_spacing) * y_mod_count;
|
||||||
|
|
||||||
|
ui_char_button_list_filtered.at(n)->move(x_pos, y_pos);
|
||||||
|
ui_char_button_list_filtered.at(n)->show();
|
||||||
|
ui_char_button_list_filtered.at(n)->apply_taken_image();
|
||||||
|
|
||||||
|
++x_mod_count;
|
||||||
|
|
||||||
|
if (x_mod_count == char_columns)
|
||||||
|
{
|
||||||
|
++y_mod_count;
|
||||||
|
x_mod_count = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Courtroom::character_loading_finished()
|
||||||
|
{
|
||||||
|
// Zeroeth, we'll clear any leftover characters from previous server visits.
|
||||||
|
ao_app->generated_chars = 0;
|
||||||
|
if (ui_char_button_list.size() > 0)
|
||||||
|
{
|
||||||
|
foreach (AOCharButton* item, ui_char_button_list) {
|
||||||
|
delete item;
|
||||||
|
}
|
||||||
|
ui_char_button_list.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// First, we'll make all the character buttons in the very beginning.
|
||||||
|
// We also hide them all, so they can't be accidentally clicked.
|
||||||
|
// Later on, we'll be revealing buttons as we need them.
|
||||||
|
for (int n = 0; n < char_list.size(); n++)
|
||||||
|
{
|
||||||
|
AOCharButton* character = new AOCharButton(ui_char_buttons, ao_app, 0, 0, char_list.at(n).taken);
|
||||||
|
character->reset();
|
||||||
|
character->hide();
|
||||||
|
character->set_image(char_list.at(n).name);
|
||||||
|
ui_char_button_list.append(character);
|
||||||
|
|
||||||
|
connect(character, SIGNAL(clicked()), char_button_mapper, SLOT(map()));
|
||||||
|
char_button_mapper->setMapping(character, ui_char_button_list.size() - 1);
|
||||||
|
|
||||||
|
// This part here serves as a way of showing to the player that the game is still running, it is
|
||||||
|
// just loading the pictures of the characters.
|
||||||
|
if (ao_app->lobby_constructed)
|
||||||
|
{
|
||||||
|
ao_app->generated_chars++;
|
||||||
|
int total_loading_size = ao_app->char_list_size * 2 + ao_app->evidence_list_size + ao_app->music_list_size;
|
||||||
|
int loading_value = int(((ao_app->loaded_chars + ao_app->generated_chars + ao_app->loaded_music + ao_app->loaded_evidence) / static_cast<double>(total_loading_size)) * 100);
|
||||||
|
ao_app->w_lobby->set_loading_value(loading_value);
|
||||||
|
ao_app->w_lobby->set_loading_text("Generating chars:\n" + QString::number(ao_app->generated_chars) + "/" + QString::number(ao_app->char_list_size));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
filter_character_list();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Courtroom::filter_character_list()
|
||||||
|
{
|
||||||
|
ui_char_button_list_filtered.clear();
|
||||||
|
for (int i = 0; i < char_list.size(); i++)
|
||||||
|
{
|
||||||
|
AOCharButton* current_char = ui_char_button_list.at(i);
|
||||||
|
|
||||||
|
// It seems passwording characters is unimplemented yet?
|
||||||
|
// Until then, this will stay here, I suppose.
|
||||||
|
//if (ui_char_passworded->isChecked() && character_is_passworded??)
|
||||||
|
// continue;
|
||||||
|
|
||||||
|
if (!ui_char_taken->isChecked() && char_list.at(i).taken)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!char_list.at(i).name.contains(ui_char_search->text(), Qt::CaseInsensitive))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// We only really need to update the fact that a character is taken
|
||||||
|
// for the buttons that actually appear.
|
||||||
|
// You'd also update the passwordedness and etc. here later.
|
||||||
|
current_char->reset();
|
||||||
|
current_char->set_taken(char_list.at(i).taken);
|
||||||
|
|
||||||
|
ui_char_button_list_filtered.append(current_char);
|
||||||
|
}
|
||||||
|
|
||||||
|
current_char_page = 0;
|
||||||
|
set_char_select_page();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Courtroom::on_char_search_changed(const QString& newtext)
|
||||||
|
{
|
||||||
|
filter_character_list();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Courtroom::on_char_passworded_clicked(int newstate)
|
||||||
|
{
|
||||||
|
filter_character_list();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Courtroom::on_char_taken_clicked(int newstate)
|
||||||
|
{
|
||||||
|
filter_character_list();
|
||||||
|
}
|
||||||
|
76
chatlogpiece.cpp
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
#include "chatlogpiece.h"
|
||||||
|
|
||||||
|
chatlogpiece::chatlogpiece()
|
||||||
|
{
|
||||||
|
name = "UNKNOWN";
|
||||||
|
showname = "UNKNOWN";
|
||||||
|
message = "UNKNOWN";
|
||||||
|
is_song = false;
|
||||||
|
datetime = QDateTime::currentDateTime().toUTC();
|
||||||
|
}
|
||||||
|
|
||||||
|
chatlogpiece::chatlogpiece(QString p_name, QString p_showname, QString p_message, bool p_song)
|
||||||
|
{
|
||||||
|
name = p_name;
|
||||||
|
showname = p_showname;
|
||||||
|
message = p_message;
|
||||||
|
is_song = p_song;
|
||||||
|
datetime = QDateTime::currentDateTime().toUTC();
|
||||||
|
}
|
||||||
|
|
||||||
|
chatlogpiece::chatlogpiece(QString p_name, QString p_showname, QString p_message, bool p_song, QDateTime p_datetime)
|
||||||
|
{
|
||||||
|
name = p_name;
|
||||||
|
showname = p_showname;
|
||||||
|
message = p_message;
|
||||||
|
is_song = p_song;
|
||||||
|
datetime = p_datetime.toUTC();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString chatlogpiece::get_name()
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString chatlogpiece::get_showname()
|
||||||
|
{
|
||||||
|
return showname;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString chatlogpiece::get_message()
|
||||||
|
{
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDateTime chatlogpiece::get_datetime()
|
||||||
|
{
|
||||||
|
return datetime;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool chatlogpiece::get_is_song()
|
||||||
|
{
|
||||||
|
return is_song;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString chatlogpiece::get_datetime_as_string()
|
||||||
|
{
|
||||||
|
return datetime.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString chatlogpiece::get_full()
|
||||||
|
{
|
||||||
|
QString full = "[";
|
||||||
|
|
||||||
|
full.append(get_datetime_as_string());
|
||||||
|
full.append(" UTC] ");
|
||||||
|
full.append(get_showname());
|
||||||
|
full.append(" (");
|
||||||
|
full.append(get_name());
|
||||||
|
full.append(")");
|
||||||
|
if (is_song)
|
||||||
|
full.append(" has played a song: ");
|
||||||
|
full.append(get_message());
|
||||||
|
|
||||||
|
return full;
|
||||||
|
}
|
31
chatlogpiece.h
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#ifndef CHATLOGPIECE_H
|
||||||
|
#define CHATLOGPIECE_H
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
#include <QDateTime>
|
||||||
|
|
||||||
|
class chatlogpiece
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
chatlogpiece();
|
||||||
|
chatlogpiece(QString p_name, QString p_showname, QString p_message, bool p_song);
|
||||||
|
chatlogpiece(QString p_name, QString p_showname, QString p_message, bool p_song, QDateTime p_datetime);
|
||||||
|
|
||||||
|
QString get_name();
|
||||||
|
QString get_showname();
|
||||||
|
QString get_message();
|
||||||
|
bool get_is_song();
|
||||||
|
QDateTime get_datetime();
|
||||||
|
QString get_datetime_as_string();
|
||||||
|
|
||||||
|
QString get_full();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString name;
|
||||||
|
QString showname;
|
||||||
|
QString message;
|
||||||
|
QDateTime datetime;
|
||||||
|
bool is_song;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CHATLOGPIECE_H
|
1749
courtroom.cpp
202
courtroom.h
@ -24,13 +24,8 @@
|
|||||||
#include "file_functions.h"
|
#include "file_functions.h"
|
||||||
#include "datatypes.h"
|
#include "datatypes.h"
|
||||||
#include "debug_functions.h"
|
#include "debug_functions.h"
|
||||||
|
#include "chatlogpiece.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QScrollBar>
|
|
||||||
#include <QRegExp>
|
|
||||||
#include <QBrush>
|
|
||||||
#include <QTextCharFormat>
|
|
||||||
#include <QFont>
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QPlainTextEdit>
|
#include <QPlainTextEdit>
|
||||||
@ -43,6 +38,18 @@
|
|||||||
#include <QSignalMapper>
|
#include <QSignalMapper>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QTextBrowser>
|
#include <QTextBrowser>
|
||||||
|
#include <QSpinBox>
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QScrollBar>
|
||||||
|
#include <QRegExp>
|
||||||
|
#include <QBrush>
|
||||||
|
#include <QTextCharFormat>
|
||||||
|
#include <QFont>
|
||||||
|
#include <QInputDialog>
|
||||||
|
#include <QFileDialog>
|
||||||
|
|
||||||
|
#include <stack>
|
||||||
|
|
||||||
class AOApplication;
|
class AOApplication;
|
||||||
|
|
||||||
@ -55,6 +62,49 @@ public:
|
|||||||
void append_char(char_type p_char){char_list.append(p_char);}
|
void append_char(char_type p_char){char_list.append(p_char);}
|
||||||
void append_evidence(evi_type p_evi){evidence_list.append(p_evi);}
|
void append_evidence(evi_type p_evi){evidence_list.append(p_evi);}
|
||||||
void append_music(QString f_music){music_list.append(f_music);}
|
void append_music(QString f_music){music_list.append(f_music);}
|
||||||
|
void append_area(QString f_area){area_list.append(f_area);}
|
||||||
|
|
||||||
|
void fix_last_area()
|
||||||
|
{
|
||||||
|
QString malplaced = area_list.last();
|
||||||
|
area_list.removeLast();
|
||||||
|
append_music(malplaced);
|
||||||
|
}
|
||||||
|
|
||||||
|
void arup_append(int players, QString status, QString cm, QString locked)
|
||||||
|
{
|
||||||
|
arup_players.append(players);
|
||||||
|
arup_statuses.append(status);
|
||||||
|
arup_cms.append(cm);
|
||||||
|
arup_locks.append(locked);
|
||||||
|
}
|
||||||
|
|
||||||
|
void arup_modify(int type, int place, QString value)
|
||||||
|
{
|
||||||
|
if (type == 0)
|
||||||
|
{
|
||||||
|
if (arup_players.size() > place)
|
||||||
|
arup_players[place] = value.toInt();
|
||||||
|
}
|
||||||
|
else if (type == 1)
|
||||||
|
{
|
||||||
|
if (arup_statuses.size() > place)
|
||||||
|
arup_statuses[place] = value;
|
||||||
|
}
|
||||||
|
else if (type == 2)
|
||||||
|
{
|
||||||
|
if (arup_cms.size() > place)
|
||||||
|
arup_cms[place] = value;
|
||||||
|
}
|
||||||
|
else if (type == 3)
|
||||||
|
{
|
||||||
|
if (arup_locks.size() > place)
|
||||||
|
arup_locks[place] = value;
|
||||||
|
}
|
||||||
|
list_areas();
|
||||||
|
}
|
||||||
|
|
||||||
|
void character_loading_finished();
|
||||||
|
|
||||||
//sets position of widgets based on theme ini files
|
//sets position of widgets based on theme ini files
|
||||||
void set_widgets();
|
void set_widgets();
|
||||||
@ -83,12 +133,18 @@ public:
|
|||||||
//sets the local mute list based on characters available on the server
|
//sets the local mute list based on characters available on the server
|
||||||
void set_mute_list();
|
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
|
//sets desk and bg based on pos in chatmessage
|
||||||
void set_scene();
|
void set_scene();
|
||||||
|
|
||||||
//sets text color based on text color in chatmessage
|
//sets text color based on text color in chatmessage
|
||||||
void set_text_color();
|
void set_text_color();
|
||||||
|
|
||||||
|
// And gets the colour, too!
|
||||||
|
QColor get_text_color(QString color);
|
||||||
|
|
||||||
//takes in serverD-formatted IP list as prints a converted version to server OOC
|
//takes in serverD-formatted IP list as prints a converted version to server OOC
|
||||||
//admittedly poorly named
|
//admittedly poorly named
|
||||||
void set_ip_list(QString p_list);
|
void set_ip_list(QString p_list);
|
||||||
@ -100,23 +156,21 @@ public:
|
|||||||
//send a message that the player is banned and quits the server
|
//send a message that the player is banned and quits the server
|
||||||
void set_ban(int p_cid);
|
void set_ban(int p_cid);
|
||||||
|
|
||||||
//implementations in path_functions.cpp
|
|
||||||
QString get_background_path();
|
|
||||||
QString get_default_background_path();
|
|
||||||
|
|
||||||
//cid = character id, returns the cid of the currently selected character
|
//cid = character id, returns the cid of the currently selected character
|
||||||
int get_cid() {return m_cid;}
|
int get_cid() {return m_cid;}
|
||||||
QString get_current_char() {return current_char;}
|
QString get_current_char() {return current_char;}
|
||||||
|
QString get_current_background() {return current_background;}
|
||||||
|
|
||||||
//properly sets up some varibles: resets user state
|
//properly sets up some varibles: resets user state
|
||||||
void enter_courtroom(int p_cid);
|
void enter_courtroom(int p_cid);
|
||||||
|
|
||||||
//helper function that populates ui_music_list with the contents of music_list
|
//helper function that populates ui_music_list with the contents of music_list
|
||||||
void list_music();
|
void list_music();
|
||||||
|
void list_areas();
|
||||||
|
|
||||||
//these are for OOC chat
|
//these are for OOC chat
|
||||||
void append_ms_chatmessage(QString f_name, QString f_message);
|
void append_ms_chatmessage(QString f_name, QString f_message);
|
||||||
void append_server_chatmessage(QString p_name, QString p_message);
|
void append_server_chatmessage(QString p_name, QString p_message, QString p_colour);
|
||||||
|
|
||||||
//these functions handle chatmessages sequentially.
|
//these functions handle chatmessages sequentially.
|
||||||
//The process itself is very convoluted and merits separate documentation
|
//The process itself is very convoluted and merits separate documentation
|
||||||
@ -125,24 +179,30 @@ public:
|
|||||||
void handle_chatmessage_2();
|
void handle_chatmessage_2();
|
||||||
void handle_chatmessage_3();
|
void handle_chatmessage_3();
|
||||||
|
|
||||||
|
//This function filters out the common CC inline text trickery, for appending to
|
||||||
|
//the IC chatlog.
|
||||||
|
QString filter_ic_text(QString p_text);
|
||||||
|
|
||||||
//adds text to the IC chatlog. p_name first as bold then p_text then a newlin
|
//adds text to the IC chatlog. p_name first as bold then p_text then a newlin
|
||||||
//this function keeps the chatlog scrolled to the top unless there's text selected
|
//this function keeps the chatlog scrolled to the top unless there's text selected
|
||||||
// or the user isn't already scrolled to the top
|
// or the user isn't already scrolled to the top
|
||||||
void append_ic_text(QString p_text, QString p_name = "");
|
void append_ic_text(QString p_text, QString p_name = "", bool is_songchange = false);
|
||||||
|
|
||||||
//prints who played the song to IC chat and plays said song(if found on local filesystem)
|
//prints who played the song to IC chat and plays said song(if found on local filesystem)
|
||||||
//takes in a list where the first element is the song name and the second is the char id of who played it
|
//takes in a list where the first element is the song name and the second is the char id of who played it
|
||||||
void handle_song(QStringList *p_contents);
|
void handle_song(QStringList *p_contents);
|
||||||
|
|
||||||
void play_preanim();
|
void play_preanim(bool noninterrupting);
|
||||||
|
|
||||||
//plays the witness testimony or cross examination animation based on argument
|
//plays the witness testimony or cross examination animation based on argument
|
||||||
void handle_wtce(QString p_wtce);
|
void handle_wtce(QString p_wtce, int variant);
|
||||||
|
|
||||||
//sets the hp bar of defense(p_bar 1) or pro(p_bar 2)
|
//sets the hp bar of defense(p_bar 1) or pro(p_bar 2)
|
||||||
//state is an number between 0 and 10 inclusive
|
//state is an number between 0 and 10 inclusive
|
||||||
void set_hp_bar(int p_bar, int p_state);
|
void set_hp_bar(int p_bar, int p_state);
|
||||||
|
|
||||||
|
void announce_case(QString title, bool def, bool pro, bool jud, bool jur, bool steno);
|
||||||
|
|
||||||
void check_connection_received();
|
void check_connection_received();
|
||||||
|
|
||||||
~Courtroom();
|
~Courtroom();
|
||||||
@ -159,18 +219,67 @@ private:
|
|||||||
int m_viewport_width = 256;
|
int m_viewport_width = 256;
|
||||||
int m_viewport_height = 192;
|
int m_viewport_height = 192;
|
||||||
|
|
||||||
|
bool first_message_sent = false;
|
||||||
|
int maximumMessages = 0;
|
||||||
|
|
||||||
|
// This is for inline message-colouring.
|
||||||
|
|
||||||
|
enum INLINE_COLOURS {
|
||||||
|
INLINE_BLUE,
|
||||||
|
INLINE_GREEN,
|
||||||
|
INLINE_ORANGE,
|
||||||
|
INLINE_GREY
|
||||||
|
};
|
||||||
|
|
||||||
|
// A stack of inline colours.
|
||||||
|
std::stack<INLINE_COLOURS> inline_colour_stack;
|
||||||
|
|
||||||
|
bool next_character_is_not_special = false; // If true, write the
|
||||||
|
// next character as it is.
|
||||||
|
|
||||||
|
bool message_is_centered = false;
|
||||||
|
|
||||||
|
int current_display_speed = 3;
|
||||||
|
int message_display_speed[7] = {30, 40, 50, 60, 75, 100, 120};
|
||||||
|
|
||||||
|
// This is for checking if the character should start talking again
|
||||||
|
// when an inline blue text ends.
|
||||||
|
bool entire_message_is_blue = false;
|
||||||
|
|
||||||
|
// And this is the inline 'talking checker'. Counts how 'deep' we are
|
||||||
|
// in inline blues.
|
||||||
|
int inline_blue_depth = 0;
|
||||||
|
|
||||||
|
// The character ID of the character this user wants to appear alongside with.
|
||||||
|
int other_charid = -1;
|
||||||
|
|
||||||
|
// The offset this user has given if they want to appear alongside someone.
|
||||||
|
int offset_with_pair = 0;
|
||||||
|
|
||||||
QVector<char_type> char_list;
|
QVector<char_type> char_list;
|
||||||
QVector<evi_type> evidence_list;
|
QVector<evi_type> evidence_list;
|
||||||
QVector<QString> music_list;
|
QVector<QString> music_list;
|
||||||
|
QVector<QString> area_list;
|
||||||
|
|
||||||
|
QVector<int> arup_players;
|
||||||
|
QVector<QString> arup_statuses;
|
||||||
|
QVector<QString> arup_cms;
|
||||||
|
QVector<QString> arup_locks;
|
||||||
|
|
||||||
QSignalMapper *char_button_mapper;
|
QSignalMapper *char_button_mapper;
|
||||||
|
|
||||||
|
QVector<chatlogpiece> ic_chatlog_history;
|
||||||
|
|
||||||
|
// These map music row items and area row items to their actual IDs.
|
||||||
|
QVector<int> music_row_to_number;
|
||||||
|
QVector<int> area_row_to_number;
|
||||||
|
|
||||||
//triggers ping_server() every 60 seconds
|
//triggers ping_server() every 60 seconds
|
||||||
QTimer *keepalive_timer;
|
QTimer *keepalive_timer;
|
||||||
|
|
||||||
//determines how fast messages tick onto screen
|
//determines how fast messages tick onto screen
|
||||||
QTimer *chat_tick_timer;
|
QTimer *chat_tick_timer;
|
||||||
int chat_tick_interval = 60;
|
//int chat_tick_interval = 60;
|
||||||
//which tick position(character in chat message) we are at
|
//which tick position(character in chat message) we are at
|
||||||
int tick_pos = 0;
|
int tick_pos = 0;
|
||||||
//used to determine how often blips sound
|
//used to determine how often blips sound
|
||||||
@ -180,6 +289,12 @@ private:
|
|||||||
bool rainbow_appended = false;
|
bool rainbow_appended = false;
|
||||||
bool blank_blip = false;
|
bool blank_blip = false;
|
||||||
|
|
||||||
|
// Used for getting the current maximum blocks allowed in the IC chatlog.
|
||||||
|
int log_maximum_blocks = 0;
|
||||||
|
|
||||||
|
// True, if the log should go downwards.
|
||||||
|
bool log_goes_downwards = false;
|
||||||
|
|
||||||
//delay before chat messages starts ticking
|
//delay before chat messages starts ticking
|
||||||
QTimer *text_delay_timer;
|
QTimer *text_delay_timer;
|
||||||
|
|
||||||
@ -197,7 +312,7 @@ private:
|
|||||||
//every time point in char.inis times this equals the final time
|
//every time point in char.inis times this equals the final time
|
||||||
const int time_mod = 40;
|
const int time_mod = 40;
|
||||||
|
|
||||||
static const int chatmessage_size = 15;
|
static const int chatmessage_size = 23;
|
||||||
QString m_chatmessage[chatmessage_size];
|
QString m_chatmessage[chatmessage_size];
|
||||||
bool chatmessage_is_empty = false;
|
bool chatmessage_is_empty = false;
|
||||||
|
|
||||||
@ -218,7 +333,7 @@ private:
|
|||||||
|
|
||||||
bool is_muted = false;
|
bool is_muted = false;
|
||||||
|
|
||||||
//state of animation, 0 = objecting, 1 = preanim, 2 = talking, 3 = idle
|
//state of animation, 0 = objecting, 1 = preanim, 2 = talking, 3 = idle, 4 = noniterrupting preanim
|
||||||
int anim_state = 3;
|
int anim_state = 3;
|
||||||
|
|
||||||
//state of text ticking, 0 = not yet ticking, 1 = ticking in progress, 2 = ticking done
|
//state of text ticking, 0 = not yet ticking, 1 = ticking in progress, 2 = ticking done
|
||||||
@ -242,6 +357,9 @@ private:
|
|||||||
int char_rows = 9;
|
int char_rows = 9;
|
||||||
int max_chars_on_page = 90;
|
int max_chars_on_page = 90;
|
||||||
|
|
||||||
|
const int button_width = 60;
|
||||||
|
const int button_height = 60;
|
||||||
|
|
||||||
int current_emote_page = 0;
|
int current_emote_page = 0;
|
||||||
int current_emote = 0;
|
int current_emote = 0;
|
||||||
int emote_columns = 5;
|
int emote_columns = 5;
|
||||||
@ -277,6 +395,7 @@ private:
|
|||||||
AOScene *ui_vp_background;
|
AOScene *ui_vp_background;
|
||||||
AOMovie *ui_vp_speedlines;
|
AOMovie *ui_vp_speedlines;
|
||||||
AOCharMovie *ui_vp_player_char;
|
AOCharMovie *ui_vp_player_char;
|
||||||
|
AOCharMovie *ui_vp_sideplayer_char;
|
||||||
AOScene *ui_vp_desk;
|
AOScene *ui_vp_desk;
|
||||||
AOScene *ui_vp_legacy_desk;
|
AOScene *ui_vp_legacy_desk;
|
||||||
AOEvidenceDisplay *ui_vp_evidence_display;
|
AOEvidenceDisplay *ui_vp_evidence_display;
|
||||||
@ -297,7 +416,12 @@ private:
|
|||||||
QListWidget *ui_area_list;
|
QListWidget *ui_area_list;
|
||||||
QListWidget *ui_music_list;
|
QListWidget *ui_music_list;
|
||||||
|
|
||||||
|
AOButton *ui_pair_button;
|
||||||
|
QListWidget *ui_pair_list;
|
||||||
|
QSpinBox *ui_pair_offset_spinbox;
|
||||||
|
|
||||||
QLineEdit *ui_ic_chat_message;
|
QLineEdit *ui_ic_chat_message;
|
||||||
|
QLineEdit *ui_ic_chat_name;
|
||||||
|
|
||||||
QLineEdit *ui_ooc_chat_message;
|
QLineEdit *ui_ooc_chat_message;
|
||||||
QLineEdit *ui_ooc_chat_name;
|
QLineEdit *ui_ooc_chat_name;
|
||||||
@ -328,14 +452,23 @@ private:
|
|||||||
|
|
||||||
AOButton *ui_witness_testimony;
|
AOButton *ui_witness_testimony;
|
||||||
AOButton *ui_cross_examination;
|
AOButton *ui_cross_examination;
|
||||||
|
AOButton *ui_guilty;
|
||||||
|
AOButton *ui_not_guilty;
|
||||||
|
|
||||||
AOButton *ui_change_character;
|
AOButton *ui_change_character;
|
||||||
AOButton *ui_reload_theme;
|
AOButton *ui_reload_theme;
|
||||||
AOButton *ui_call_mod;
|
AOButton *ui_call_mod;
|
||||||
|
AOButton *ui_settings;
|
||||||
|
AOButton *ui_announce_casing;
|
||||||
|
AOButton *ui_switch_area_music;
|
||||||
|
|
||||||
QCheckBox *ui_pre;
|
QCheckBox *ui_pre;
|
||||||
QCheckBox *ui_flip;
|
QCheckBox *ui_flip;
|
||||||
QCheckBox *ui_guard;
|
QCheckBox *ui_guard;
|
||||||
|
QCheckBox *ui_casing;
|
||||||
|
|
||||||
|
QCheckBox *ui_pre_non_interrupt;
|
||||||
|
QCheckBox *ui_showname_enable;
|
||||||
|
|
||||||
AOButton *ui_custom_objection;
|
AOButton *ui_custom_objection;
|
||||||
AOButton *ui_realization;
|
AOButton *ui_realization;
|
||||||
@ -355,6 +488,9 @@ private:
|
|||||||
|
|
||||||
AOImage *ui_muted;
|
AOImage *ui_muted;
|
||||||
|
|
||||||
|
QSpinBox *ui_log_limit_spinbox;
|
||||||
|
QLabel *ui_log_limit_label;
|
||||||
|
|
||||||
AOButton *ui_evidence_button;
|
AOButton *ui_evidence_button;
|
||||||
AOImage *ui_evidence;
|
AOImage *ui_evidence;
|
||||||
AOLineEdit *ui_evidence_name;
|
AOLineEdit *ui_evidence_name;
|
||||||
@ -376,6 +512,7 @@ private:
|
|||||||
QWidget *ui_char_buttons;
|
QWidget *ui_char_buttons;
|
||||||
|
|
||||||
QVector<AOCharButton*> ui_char_button_list;
|
QVector<AOCharButton*> ui_char_button_list;
|
||||||
|
QVector<AOCharButton*> ui_char_button_list_filtered;
|
||||||
AOImage *ui_selector;
|
AOImage *ui_selector;
|
||||||
|
|
||||||
AOButton *ui_back_to_lobby;
|
AOButton *ui_back_to_lobby;
|
||||||
@ -387,9 +524,15 @@ private:
|
|||||||
|
|
||||||
AOButton *ui_spectator;
|
AOButton *ui_spectator;
|
||||||
|
|
||||||
|
QLineEdit *ui_char_search;
|
||||||
|
QCheckBox *ui_char_passworded;
|
||||||
|
QCheckBox *ui_char_taken;
|
||||||
|
|
||||||
void construct_char_select();
|
void construct_char_select();
|
||||||
void set_char_select();
|
void set_char_select();
|
||||||
void set_char_select_page();
|
void set_char_select_page();
|
||||||
|
void put_button_in_place(int starting, int chars_on_this_page);
|
||||||
|
void filter_character_list();
|
||||||
|
|
||||||
void construct_emotes();
|
void construct_emotes();
|
||||||
void set_emote_page();
|
void set_emote_page();
|
||||||
@ -398,8 +541,6 @@ private:
|
|||||||
void construct_evidence();
|
void construct_evidence();
|
||||||
void set_evidence_page();
|
void set_evidence_page();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void objection_done();
|
void objection_done();
|
||||||
void preanim_done();
|
void preanim_done();
|
||||||
@ -411,6 +552,8 @@ public slots:
|
|||||||
|
|
||||||
void mod_called(QString p_ip);
|
void mod_called(QString p_ip);
|
||||||
|
|
||||||
|
void case_called(QString msg, bool def, bool pro, bool jud, bool jur, bool steno);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void start_chat_ticking();
|
void start_chat_ticking();
|
||||||
void play_sfx();
|
void play_sfx();
|
||||||
@ -418,6 +561,7 @@ private slots:
|
|||||||
void chat_tick();
|
void chat_tick();
|
||||||
|
|
||||||
void on_mute_list_clicked(QModelIndex p_index);
|
void on_mute_list_clicked(QModelIndex p_index);
|
||||||
|
void on_pair_list_clicked(QModelIndex p_index);
|
||||||
|
|
||||||
void on_chat_return_pressed();
|
void on_chat_return_pressed();
|
||||||
|
|
||||||
@ -425,6 +569,7 @@ private slots:
|
|||||||
|
|
||||||
void on_music_search_edited(QString p_text);
|
void on_music_search_edited(QString p_text);
|
||||||
void on_music_list_double_clicked(QModelIndex p_model);
|
void on_music_list_double_clicked(QModelIndex p_model);
|
||||||
|
void on_area_list_double_clicked(QModelIndex p_model);
|
||||||
|
|
||||||
void select_emote(int p_id);
|
void select_emote(int p_id);
|
||||||
|
|
||||||
@ -456,6 +601,7 @@ private slots:
|
|||||||
void on_realization_clicked();
|
void on_realization_clicked();
|
||||||
|
|
||||||
void on_mute_clicked();
|
void on_mute_clicked();
|
||||||
|
void on_pair_clicked();
|
||||||
|
|
||||||
void on_defense_minus_clicked();
|
void on_defense_minus_clicked();
|
||||||
void on_defense_plus_clicked();
|
void on_defense_plus_clicked();
|
||||||
@ -468,19 +614,28 @@ private slots:
|
|||||||
void on_sfx_slider_moved(int p_value);
|
void on_sfx_slider_moved(int p_value);
|
||||||
void on_blip_slider_moved(int p_value);
|
void on_blip_slider_moved(int p_value);
|
||||||
|
|
||||||
|
void on_log_limit_changed(int value);
|
||||||
|
void on_pair_offset_changed(int value);
|
||||||
|
|
||||||
void on_ooc_toggle_clicked();
|
void on_ooc_toggle_clicked();
|
||||||
|
|
||||||
void on_witness_testimony_clicked();
|
void on_witness_testimony_clicked();
|
||||||
void on_cross_examination_clicked();
|
void on_cross_examination_clicked();
|
||||||
|
void on_not_guilty_clicked();
|
||||||
|
void on_guilty_clicked();
|
||||||
|
|
||||||
void on_change_character_clicked();
|
void on_change_character_clicked();
|
||||||
void on_reload_theme_clicked();
|
void on_reload_theme_clicked();
|
||||||
void on_call_mod_clicked();
|
void on_call_mod_clicked();
|
||||||
|
void on_settings_clicked();
|
||||||
|
void on_announce_casing_clicked();
|
||||||
|
|
||||||
void on_pre_clicked();
|
void on_pre_clicked();
|
||||||
void on_flip_clicked();
|
void on_flip_clicked();
|
||||||
void on_guard_clicked();
|
void on_guard_clicked();
|
||||||
|
|
||||||
|
void on_showname_enable_clicked();
|
||||||
|
|
||||||
void on_evidence_button_clicked();
|
void on_evidence_button_clicked();
|
||||||
|
|
||||||
void on_evidence_delete_clicked();
|
void on_evidence_delete_clicked();
|
||||||
@ -490,12 +645,21 @@ private slots:
|
|||||||
|
|
||||||
void on_char_select_left_clicked();
|
void on_char_select_left_clicked();
|
||||||
void on_char_select_right_clicked();
|
void on_char_select_right_clicked();
|
||||||
|
void on_char_search_changed(const QString& newtext);
|
||||||
|
void on_char_taken_clicked(int newstate);
|
||||||
|
void on_char_passworded_clicked(int newstate);
|
||||||
|
|
||||||
void on_spectator_clicked();
|
void on_spectator_clicked();
|
||||||
|
|
||||||
void char_clicked(int n_char);
|
void char_clicked(int n_char);
|
||||||
|
|
||||||
|
void on_switch_area_music_clicked();
|
||||||
|
|
||||||
|
void on_casing_clicked();
|
||||||
|
|
||||||
void ping_server();
|
void ping_server();
|
||||||
|
|
||||||
|
void load_bass_opus_plugin();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // COURTROOM_H
|
#endif // COURTROOM_H
|
||||||
|
14
datatypes.h
@ -92,7 +92,15 @@ enum CHAT_MESSAGE
|
|||||||
EVIDENCE_ID,
|
EVIDENCE_ID,
|
||||||
FLIP,
|
FLIP,
|
||||||
REALIZATION,
|
REALIZATION,
|
||||||
TEXT_COLOR
|
TEXT_COLOR,
|
||||||
|
SHOWNAME,
|
||||||
|
OTHER_CHARID,
|
||||||
|
OTHER_NAME,
|
||||||
|
OTHER_EMOTE,
|
||||||
|
SELF_OFFSET,
|
||||||
|
OTHER_OFFSET,
|
||||||
|
OTHER_FLIP,
|
||||||
|
NONINTERRUPTING_PRE
|
||||||
};
|
};
|
||||||
|
|
||||||
enum COLOR
|
enum COLOR
|
||||||
@ -103,7 +111,9 @@ enum COLOR
|
|||||||
ORANGE,
|
ORANGE,
|
||||||
BLUE,
|
BLUE,
|
||||||
YELLOW,
|
YELLOW,
|
||||||
RAINBOW
|
RAINBOW,
|
||||||
|
PINK,
|
||||||
|
CYAN
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DATATYPES_H
|
#endif // DATATYPES_H
|
||||||
|