timout animation test
This commit is contained in:
+122
-109
@@ -1,27 +1,27 @@
|
||||
# QMake pro-file for PokerTH game
|
||||
|
||||
isEmpty( PREFIX ){
|
||||
PREFIX =/usr
|
||||
}
|
||||
|
||||
isEmpty( PREFIX ):PREFIX = /usr
|
||||
TEMPLATE = app
|
||||
CODECFORSRC = UTF-8
|
||||
|
||||
CONFIG += qt thread embed_manifest_exe exceptions rtti stl warn_on release
|
||||
#CONFIG += qt thread embed_manifest_exe exceptions rtti stl warn_on debug
|
||||
# CONFIG += qt thread embed_manifest_exe exceptions rtti stl warn_on release
|
||||
CONFIG += qt \
|
||||
thread \
|
||||
embed_manifest_exe \
|
||||
exceptions \
|
||||
rtti \
|
||||
stl \
|
||||
warn_on \
|
||||
debug
|
||||
|
||||
# ####Uncomment this for RELEASE on Linux/Unix/BSD (only for static Qt)
|
||||
# QTPLUGIN += qjpeg qgif
|
||||
|
||||
UI_DIR = uics
|
||||
MOC_DIR = mocs
|
||||
OBJECTS_DIR = obj
|
||||
DEFINES += ENABLE_IPV6
|
||||
DEFINES += PREFIX=\"$${PREFIX}\"
|
||||
TARGET = pokerth
|
||||
|
||||
RESOURCES = src/gui/qt/resources/pokerth.qrc
|
||||
|
||||
INCLUDEPATH += . \
|
||||
src \
|
||||
src/engine \
|
||||
@@ -60,7 +60,6 @@ INCLUDEPATH += . \
|
||||
src/gui/qt/gamelobbydialog \
|
||||
src/gui/qt/gamelobbydialog/lobbychat \
|
||||
src/gui/qt/timeoutmsgbox
|
||||
|
||||
DEPENDPATH += . \
|
||||
src \
|
||||
src/config \
|
||||
@@ -103,8 +102,7 @@ DEPENDPATH += . \
|
||||
src/gui/qt/timeoutmsgbox
|
||||
|
||||
# Input
|
||||
HEADERS += \
|
||||
src/game.h \
|
||||
HEADERS += src/game.h \
|
||||
src/session.h \
|
||||
src/playerdata.h \
|
||||
src/gamedata.h \
|
||||
@@ -193,10 +191,10 @@ HEADERS += \
|
||||
src/gui/qt/qttools/qthelper/qthelper.h \
|
||||
src/gui/generic/serverguiwrapper.h \
|
||||
src/gui/qt/gametable/mychancelabel.h \
|
||||
src/gui/qt/serverlistdialog/serverlistdialogimpl.h
|
||||
|
||||
FORMS += \
|
||||
src/gui/qt/gametable.ui \
|
||||
src/gui/qt/serverlistdialog/serverlistdialogimpl.h \
|
||||
src/gui/qt/gametable/mymenubar.h \
|
||||
src/gui/qt/gametable/mytimeoutlabel.h
|
||||
FORMS += src/gui/qt/gametable.ui \
|
||||
src/gui/qt/aboutpokerth.ui \
|
||||
src/gui/qt/connecttoserverdialog.ui \
|
||||
src/gui/qt/createnetworkgamedialog.ui \
|
||||
@@ -213,9 +211,7 @@ FORMS += \
|
||||
src/gui/qt/mymessagedialog.ui \
|
||||
src/gui/qt/manualblindsorderdialog.ui \
|
||||
src/gui/qt/serverlistdialog.ui
|
||||
|
||||
SOURCES += \
|
||||
src/pokerth.cpp \
|
||||
SOURCES += src/pokerth.cpp \
|
||||
src/gui/qt/chattools/chattools.cpp \
|
||||
src/gui/qt/sound/sdlplayer.cpp \
|
||||
src/gui/qt/guiwrapper.cpp \
|
||||
@@ -258,10 +254,10 @@ SOURCES += \
|
||||
src/net/common/net_helper_client.cpp \
|
||||
src/core/common/loghelper_client.cpp \
|
||||
src/gui/qt/gametable/mychancelabel.cpp \
|
||||
src/gui/qt/serverlistdialog/serverlistdialogimpl.cpp
|
||||
|
||||
TRANSLATIONS = \
|
||||
ts/pokerth_bg.ts \
|
||||
src/gui/qt/serverlistdialog/serverlistdialogimpl.cpp \
|
||||
src/gui/qt/gametable/mymenubar.cpp \
|
||||
src/gui/qt/gametable/mytimeoutlabel.cpp
|
||||
TRANSLATIONS = ts/pokerth_bg.ts \
|
||||
ts/pokerth_de.ts \
|
||||
ts/pokerth_dk.ts \
|
||||
ts/pokerth_es.ts \
|
||||
@@ -280,35 +276,47 @@ TRANSLATIONS = \
|
||||
ts/pokerth_zhcn.ts \
|
||||
ts/pokerth_fi.ts \
|
||||
ts/pokerth_START_HERE.ts
|
||||
|
||||
win32 {
|
||||
QTPLUGIN += qjpeg qgif
|
||||
QTPLUGIN += qjpeg \
|
||||
qgif
|
||||
DEFINES += CURL_STATICLIB
|
||||
DEFINES += _WIN32_WINNT=0x0501
|
||||
DEPENDPATH += src/net/win32/ src/core/win32
|
||||
INCLUDEPATH += ../boost/ ../SDL/include ../SDL_mixer
|
||||
INCLUDEPATH += ../SDL/include/SDL ../SDL_mixer/include ../GnuTLS/include ../curl/include ../zlib
|
||||
LIBPATH += ../boost/stage/lib ../GnuTLS/lib ../curl/lib ../zlib
|
||||
|
||||
DEPENDPATH += src/net/win32/ \
|
||||
src/core/win32
|
||||
INCLUDEPATH += ../boost/ \
|
||||
../SDL/include \
|
||||
../SDL_mixer
|
||||
INCLUDEPATH += ../SDL/include/SDL \
|
||||
../SDL_mixer/include \
|
||||
../GnuTLS/include \
|
||||
../curl/include \
|
||||
../zlib
|
||||
LIBPATH += ../boost/stage/lib \
|
||||
../GnuTLS/lib \
|
||||
../curl/lib \
|
||||
../zlib
|
||||
LIBS += -lpokerth_lib
|
||||
|
||||
win32-msvc2005 {
|
||||
LIBPATH += Release/lib ../SDL/VisualC/SDL/Release ../SDL/VisualC/SDLmain/Release ../SDL_mixer/VisualC/Release
|
||||
#LIBPATH += Debug/lib ../SDL/VisualC/SDL/Debug ../SDL/VisualC/SDLmain/Debug ../SDL_mixer/VisualC/Debug
|
||||
LIBPATH += Release/lib \
|
||||
../SDL/VisualC/SDL/Release \
|
||||
../SDL/VisualC/SDLmain/Release \
|
||||
../SDL_mixer/VisualC/Release
|
||||
|
||||
LIBS += -llibgnutls-openssl -llibgcrypt
|
||||
# LIBPATH += Debug/lib ../SDL/VisualC/SDL/Debug ../SDL/VisualC/SDLmain/Debug ../SDL_mixer/VisualC/Debug
|
||||
LIBS += -llibgnutls-openssl \
|
||||
-llibgcrypt
|
||||
LIBS += -llibcurl
|
||||
}
|
||||
|
||||
win32-g++ {
|
||||
debug {
|
||||
LIBPATH += Debug/lib
|
||||
}
|
||||
release {
|
||||
LIBPATH += Release/lib
|
||||
}
|
||||
LIBPATH += ../SDL/lib ../SDL_mixer/lib
|
||||
LIBS += -lgnutls-openssl -lgnutls -lgcrypt -ltasn1 -lgpg-error
|
||||
debug:LIBPATH += Debug/lib
|
||||
release:LIBPATH += Release/lib
|
||||
LIBPATH += ../SDL/lib \
|
||||
../SDL_mixer/lib
|
||||
LIBS += -lgnutls-openssl \
|
||||
-lgnutls \
|
||||
-lgcrypt \
|
||||
-ltasn1 \
|
||||
-lgpg-error
|
||||
LIBS += -lcurl
|
||||
LIBS += -lz
|
||||
LIBS += -llibboost_thread-mgw43-mt-1_38
|
||||
@@ -318,109 +326,101 @@ win32 {
|
||||
LIBS += -llibboost_iostreams-mgw43-mt-1_38
|
||||
LIBS += -llibboost_zlib-mgw43-mt-1_38
|
||||
}
|
||||
|
||||
LIBS += -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lole32 -luuid -luser32 -lmsimg32 -lshell32 -lkernel32 -lws2_32 -ladvapi32 -lsdl -lsdlmain -lsdl_mixer -lwldap32
|
||||
LIBS += -lgdi32 \
|
||||
-lcomdlg32 \
|
||||
-loleaut32 \
|
||||
-limm32 \
|
||||
-lwinmm \
|
||||
-lwinspool \
|
||||
-lole32 \
|
||||
-luuid \
|
||||
-luser32 \
|
||||
-lmsimg32 \
|
||||
-lshell32 \
|
||||
-lkernel32 \
|
||||
-lws2_32 \
|
||||
-ladvapi32 \
|
||||
-lsdl \
|
||||
-lsdlmain \
|
||||
-lsdl_mixer \
|
||||
-lwldap32
|
||||
RC_FILE = pokerth.rc
|
||||
}
|
||||
!win32 {
|
||||
DEPENDPATH += src/net/linux/ src/core/linux
|
||||
}
|
||||
|
||||
unix {
|
||||
# workaround for problems with boost_filesystem exceptions
|
||||
!win32:DEPENDPATH += src/net/linux/ \
|
||||
src/core/linux
|
||||
unix:# workaround for problems with boost_filesystem exceptions
|
||||
QMAKE_LFLAGS += -no_dead_strip_inits_and_terms
|
||||
}
|
||||
|
||||
unix:!mac {
|
||||
|
||||
# #### My release static build options
|
||||
# QMAKE_CXXFLAGS += -ffunction-sections -fdata-sections
|
||||
# QMAKE_LFLAGS += -Wl,--gc-sections
|
||||
|
||||
LIBPATH += lib
|
||||
LIB_DIRS = $${PREFIX}/lib \
|
||||
$${PREFIX}/lib64
|
||||
BOOST_FS = boost_filesystem \
|
||||
boost_filesystem-mt
|
||||
BOOST_THREAD = boost_thread \
|
||||
boost_thread-mt
|
||||
BOOST_IOSTREAMS = boost_iostreams \
|
||||
boost_iostreams-mt
|
||||
BOOST_REGEX = boost_regex \
|
||||
boost_regex-mt
|
||||
|
||||
LIB_DIRS = $${PREFIX}/lib $${PREFIX}/lib64
|
||||
BOOST_FS = boost_filesystem boost_filesystem-mt
|
||||
BOOST_THREAD = boost_thread boost_thread-mt
|
||||
BOOST_IOSTREAMS = boost_iostreams boost_iostreams-mt
|
||||
BOOST_REGEX = boost_regex boost_regex-mt
|
||||
|
||||
#
|
||||
# searching in $PREFIX/lib and $PREFIX/lib64
|
||||
# to override the default '/usr' pass PREFIX
|
||||
# variable to qmake.
|
||||
#
|
||||
for(dir, LIB_DIRS){
|
||||
exists($$dir){
|
||||
for(lib, BOOST_THREAD){
|
||||
exists($${dir}/lib$${lib}.so*){
|
||||
for(dir, LIB_DIRS):exists($$dir) {
|
||||
for(lib, BOOST_THREAD):exists($${dir}/lib$${lib}.so*) {
|
||||
message("Found $$lib")
|
||||
BOOST_THREAD = -l$$lib
|
||||
}
|
||||
}
|
||||
for(lib, BOOST_FS){
|
||||
exists($${dir}/lib$${lib}.so*){
|
||||
for(lib, BOOST_FS):exists($${dir}/lib$${lib}.so*) {
|
||||
message("Found $$lib")
|
||||
BOOST_FS = -l$$lib
|
||||
}
|
||||
}
|
||||
for(lib, BOOST_IOSTREAMS){
|
||||
exists($${dir}/lib$${lib}.so*){
|
||||
for(lib, BOOST_IOSTREAMS):exists($${dir}/lib$${lib}.so*) {
|
||||
message("Found $$lib")
|
||||
BOOST_IOSTREAMS = -l$$lib
|
||||
}
|
||||
}
|
||||
for(lib, BOOST_REGEX){
|
||||
exists($${dir}/lib$${lib}.so*){
|
||||
for(lib, BOOST_REGEX):exists($${dir}/lib$${lib}.so*) {
|
||||
message("Found $$lib")
|
||||
BOOST_REGEX = -l$$lib
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BOOST_LIBS = $$BOOST_THREAD $$BOOST_FS $$BOOST_IOSTREAMS $$BOOST_REGEX
|
||||
!count(BOOST_LIBS, 4){
|
||||
error("Unable to find boost libraries in PREFIX=$${PREFIX}")
|
||||
}
|
||||
|
||||
if($$system(sdl-config --version)){
|
||||
error("sdl-config not found in PATH - libSDL_mixer, libSDL are required!")
|
||||
}
|
||||
|
||||
BOOST_LIBS = $$BOOST_THREAD \
|
||||
$$BOOST_FS \
|
||||
$$BOOST_IOSTREAMS \
|
||||
$$BOOST_REGEX
|
||||
!count(BOOST_LIBS, 4):error("Unable to find boost libraries in PREFIX=$${PREFIX}")
|
||||
if($$system(sdl-config --version)):error("sdl-config not found in PATH - libSDL_mixer, libSDL are required!")
|
||||
UNAME = $$system(uname -s)
|
||||
BSD = $$find(UNAME, "BSD")
|
||||
kFreeBSD = $$find(UNAME, "kFreeBSD")
|
||||
|
||||
LIBS += -lpokerth_lib
|
||||
LIBS += $$BOOST_LIBS
|
||||
LIBS += -lSDL_mixer -lcurl
|
||||
!isEmpty( BSD ) && isEmpty( kFreeBSD ){
|
||||
LIBS += -lcrypto
|
||||
} else {
|
||||
LIBS += -lgnutls-openssl -lgcrypt
|
||||
}
|
||||
LIBS += -lSDL_mixer \
|
||||
-lcurl
|
||||
!isEmpty( BSD ) && isEmpty( kFreeBSD ):LIBS += -lcrypto
|
||||
else:LIBS += -lgnutls-openssl \
|
||||
-lgcrypt
|
||||
TARGETDEPS += ./lib/libpokerth_lib.a
|
||||
|
||||
# #### My release static libs
|
||||
# LIBS += -lgcrypt_static -lgpg-error_static -lgnutls-openssl_static -lgnutls_static -lSDL_mixer_static -lSDL -lmikmod -lcurl
|
||||
|
||||
# ### INSTALL ####
|
||||
|
||||
binary.path += $${PREFIX}/bin/
|
||||
binary.files += pokerth
|
||||
|
||||
data.path += $${PREFIX}/share/pokerth/data/
|
||||
data.files += data/*
|
||||
|
||||
pixmap.path += $${PREFIX}/share/pixmaps/
|
||||
pixmap.files += pokerth.png
|
||||
|
||||
desktop.path += $${PREFIX}/share/applications/
|
||||
desktop.files += pokerth.desktop
|
||||
|
||||
INSTALLS += binary data pixmap desktop
|
||||
INSTALLS += binary \
|
||||
data \
|
||||
pixmap \
|
||||
desktop
|
||||
}
|
||||
|
||||
mac {
|
||||
# make it universal
|
||||
CONFIG += x86
|
||||
@@ -430,18 +430,24 @@ mac {
|
||||
# for universal-compilation on PPC-Mac uncomment the following line
|
||||
# on Intel-Mac you have to comment this line out or build will fail.
|
||||
# QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk/
|
||||
|
||||
LIBPATH += lib
|
||||
LIBS += -lpokerth_lib
|
||||
|
||||
# Qt static (path is standard for self-compiling qt)
|
||||
# LIBS += /usr/local/Trolltech/Qt-4.2.3/lib/libQtCore.a
|
||||
# LIBS += /usr/local/Trolltech/Qt-4.2.3/lib/libQtGui.a
|
||||
# QT dynamic linked framework (see also mac_post_make.sh)
|
||||
LIBS += -framework QtCore
|
||||
LIBS += -framework QtGui
|
||||
LIBS += -framework \
|
||||
QtCore
|
||||
LIBS += -framework \
|
||||
QtGui
|
||||
|
||||
# SDL and SDL_mixer come as frameworks
|
||||
LIBS += -framework SDL
|
||||
LIBS += -framework SDL_mixer
|
||||
LIBS += -framework \
|
||||
SDL
|
||||
LIBS += -framework \
|
||||
SDL_mixer
|
||||
|
||||
# standard path for darwinports
|
||||
# make sure you have a universal version of boost
|
||||
LIBS += /usr/local/lib/libboost_thread-xgcc40-mt.a
|
||||
@@ -449,8 +455,15 @@ mac {
|
||||
LIBS += /usr/local/lib/libboost_regex-xgcc40-mt.a
|
||||
LIBS += /usr/local/lib/libboost_system-xgcc40-mt.a
|
||||
LIBS += /usr/local/lib/libboost_iostreams-xgcc40-mt.a
|
||||
|
||||
# libraries installed on every mac
|
||||
LIBS += -lcrypto -lssl -lz -lcurl -framework Carbon
|
||||
LIBS += -lcrypto \
|
||||
-lssl \
|
||||
-lz \
|
||||
-lcurl \
|
||||
-framework \
|
||||
Carbon
|
||||
|
||||
# set the application icon
|
||||
RC_FILE = pokerth.icns
|
||||
LIBPATH += /Developer/SDKs/MacOSX10.4u.sdk/usr/lib
|
||||
|
||||
+37
-13
@@ -1,3 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>gameTable</class>
|
||||
<widget class="QMainWindow" name="gameTable">
|
||||
@@ -47,7 +48,7 @@
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item rowspan="5" row="0" column="0" >
|
||||
<item row="0" column="0" rowspan="5">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
@@ -1060,7 +1061,7 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item rowspan="5" row="0" column="2" >
|
||||
<item row="0" column="2" rowspan="5">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
@@ -1521,7 +1522,7 @@
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_Board">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -2309,6 +2310,19 @@
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="MyTimeoutLabel" name="label_Timeout0">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>60</y>
|
||||
<width>50</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@@ -2656,7 +2670,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label_voteStarterNick">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Preferred" hsizetype="MinimumExpanding" >
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -2683,7 +2697,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label_kickVoteTimeout">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Preferred" hsizetype="MinimumExpanding" >
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -2700,7 +2714,7 @@
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_kickUser">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -2791,7 +2805,7 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -2891,7 +2905,7 @@
|
||||
<item row="3" column="0">
|
||||
<widget class="MyActionButton" name="pushButton_BetRaise">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -2916,7 +2930,7 @@
|
||||
<item row="4" column="0">
|
||||
<widget class="MyActionButton" name="pushButton_CallCheck">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -2941,7 +2955,7 @@
|
||||
<item row="5" column="0">
|
||||
<widget class="MyActionButton" name="pushButton_Fold">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -3349,7 +3363,7 @@
|
||||
<item>
|
||||
<widget class="QSlider" name="horizontalSlider_speed">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Expanding" hsizetype="MinimumExpanding" >
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -3395,13 +3409,13 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar" >
|
||||
<widget class="MyMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1024</width>
|
||||
<height>23</height>
|
||||
<height>25</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuView">
|
||||
@@ -3598,6 +3612,16 @@
|
||||
<extends>QPushButton</extends>
|
||||
<header>myactionbutton.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>MyMenuBar</class>
|
||||
<extends>QMenuBar</extends>
|
||||
<header>mymenubar.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>MyTimeoutLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
<header>mytimeoutlabel.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="resources/pokerth.qrc"/>
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
#include "myavatarlabel.h"
|
||||
#include "myactionbutton.h"
|
||||
#include "mychancelabel.h"
|
||||
#include "mytimeoutlabel.h"
|
||||
#include "mymenubar.h"
|
||||
#include "log.h"
|
||||
#include "chat.h"
|
||||
|
||||
@@ -265,6 +267,7 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
||||
setLabelArray[8] = textLabel_Set8;
|
||||
setLabelArray[9] = textLabel_Set9;
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { setLabelArray[i]->setMyW(this); }
|
||||
label_Timeout0->setMyW(this);
|
||||
|
||||
// statusLabelArray init
|
||||
actionLabelArray[0] = textLabel_Status0;
|
||||
@@ -1497,6 +1500,7 @@ void gameTableImpl::startTimeoutAnimation(int playerId, int timeoutSec) {
|
||||
//beep for player 0
|
||||
if(playerId) { setLabelArray[playerId]->startTimeOutAnimation(timeoutSec, FALSE); }
|
||||
else { setLabelArray[playerId]->startTimeOutAnimation(timeoutSec, TRUE); }
|
||||
label_Timeout0->startTimeOutAnimation(timeoutSec, FALSE);
|
||||
}
|
||||
|
||||
void gameTableImpl::stopTimeoutAnimation(int playerId) {
|
||||
|
||||
@@ -40,6 +40,7 @@ class BoardInterface;
|
||||
class PlayerInterface;
|
||||
class MyCardsPixmapLabel;
|
||||
class MyAvatarLabel;
|
||||
class MyTimeoutLabel;
|
||||
|
||||
class settingsDialogImpl;
|
||||
class startWindowImpl;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#include "mymenubar.h"
|
||||
|
||||
MyMenuBar::MyMenuBar(QMainWindow* parent)
|
||||
: QMenuBar(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void MyMenuBar::paintEvent(QPaintEvent * event) {
|
||||
|
||||
QMenuBar::paintEvent(event);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef MYMENUBAR_H
|
||||
#define MYMENUBAR_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QtCore>
|
||||
|
||||
class MyMenuBar : public QMenuBar
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MyMenuBar(QMainWindow*);
|
||||
|
||||
void paintEvent(QPaintEvent * event);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,127 @@
|
||||
//
|
||||
// C++ Implementation: mycardspixmaplabel
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
//
|
||||
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
|
||||
//
|
||||
// Copyright: See COPYING file that comes with this distribution
|
||||
//
|
||||
//
|
||||
#include "mytimeoutlabel.h"
|
||||
|
||||
#include "gametableimpl.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
MyTimeoutLabel::MyTimeoutLabel(QGroupBox* parent)
|
||||
: QLabel(parent), timeOutAnimation(FALSE), timeOutValue(0), timeOutFrame(0), waitFrames(0), timerIntervall(0), isBeep(0), isBeepPlayed(0)
|
||||
{
|
||||
|
||||
timeOutAnimationTimer = new QTimer;
|
||||
|
||||
connect(timeOutAnimationTimer, SIGNAL(timeout()), this, SLOT(nextTimeOutAnimationFrame()));
|
||||
}
|
||||
|
||||
|
||||
MyTimeoutLabel::~MyTimeoutLabel()
|
||||
{
|
||||
}
|
||||
|
||||
void MyTimeoutLabel::startTimeOutAnimation(int secs, bool beep) {
|
||||
|
||||
isBeepPlayed = FALSE;
|
||||
isBeep = beep;
|
||||
|
||||
timeOutValue = secs;
|
||||
timeOutFrame = 1;
|
||||
timeOutAnimationWidth = 50;
|
||||
|
||||
int preTimerIntervall = ((timeOutValue-3) * 1000)/timeOutAnimationWidth;
|
||||
|
||||
timerIntervall = preTimerIntervall;
|
||||
|
||||
//save gfx ressources and never play more the 10 pps
|
||||
while(timerIntervall < 100) {
|
||||
if(secs <= 9 && secs >= 6) {
|
||||
//fix inaccuracies caused by integer division
|
||||
timerIntervall = timerIntervall + preTimerIntervall + 5;
|
||||
}
|
||||
else {
|
||||
timerIntervall = timerIntervall + preTimerIntervall;
|
||||
}
|
||||
}
|
||||
|
||||
waitFrames = 3000/timerIntervall;
|
||||
|
||||
//start the real timer
|
||||
realTimer.reset();
|
||||
realTimer.start();
|
||||
|
||||
// std::cout << timerIntervall << endl;
|
||||
timeOutAnimation = TRUE;
|
||||
timeOutAnimationTimer->start(timerIntervall);
|
||||
}
|
||||
|
||||
void MyTimeoutLabel::startTimeOutAnimationNow() {
|
||||
|
||||
timeOutAnimation = TRUE;
|
||||
timeOutAnimationTimer->start(83);
|
||||
|
||||
}
|
||||
|
||||
void MyTimeoutLabel::stopTimeOutAnimation() {
|
||||
|
||||
// timeOutAnimationKickOnTimer->stop();
|
||||
timeOutAnimationTimer->stop();
|
||||
timeOutAnimation = FALSE;
|
||||
update();
|
||||
}
|
||||
|
||||
void MyTimeoutLabel::nextTimeOutAnimationFrame() {
|
||||
|
||||
if(timeOutAnimationWidth >=0) {
|
||||
if(timeOutFrame > waitFrames) {
|
||||
//play beep after waitFrames one time
|
||||
if(isBeep && !isBeepPlayed) {
|
||||
myW->getMySDLPlayer()->playSound("yourturn",0);
|
||||
isBeepPlayed = TRUE;
|
||||
}
|
||||
//save gfx ressources and never play more the 10 pps
|
||||
unsigned int realTimerValue = realTimer.elapsed().total_milliseconds();
|
||||
timeOutAnimationWidth = 50-(((realTimerValue-3000)*50)/((timeOutValue-3)*1000));
|
||||
|
||||
}
|
||||
timeOutFrame++;
|
||||
update();
|
||||
}
|
||||
else {
|
||||
stopTimeOutAnimation();
|
||||
// no callback is called here.
|
||||
// the server initiates any action required.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MyTimeoutLabel::paintEvent(QPaintEvent * event) {
|
||||
|
||||
if(!timeOutAnimation || timeOutFrame <= waitFrames) {
|
||||
QLabel::paintEvent(event);
|
||||
}
|
||||
|
||||
if(timeOutAnimation && timeOutFrame > waitFrames) {
|
||||
|
||||
QPainter painter(this);
|
||||
|
||||
QLinearGradient linearGrad(QPointF(0, 10), QPointF(45, 10));
|
||||
linearGrad.setColorAt(0, Qt::red);
|
||||
linearGrad.setColorAt(0.5, Qt::yellow);
|
||||
linearGrad.setColorAt(1, Qt::green);
|
||||
|
||||
painter.setBrush(linearGrad);
|
||||
|
||||
painter.setPen(QColor(0,0,0));
|
||||
painter.drawRect(0,2,timeOutAnimationWidth-1,8);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// C++ Interface: mycardspixmaplabel
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
//
|
||||
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
|
||||
//
|
||||
// Copyright: See COPYING file that comes with this distribution
|
||||
//
|
||||
//
|
||||
#ifndef MYTIMEOUTLABEL_H
|
||||
#define MYTIMEOUTLABEL_H
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <QtGui>
|
||||
#include <QtCore>
|
||||
#include <third_party/boost/timers.hpp>
|
||||
#include "sdlplayer.h"
|
||||
|
||||
class gameTableImpl;
|
||||
|
||||
class MyTimeoutLabel : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MyTimeoutLabel(QGroupBox*);
|
||||
|
||||
~MyTimeoutLabel();
|
||||
|
||||
|
||||
void setMyW ( gameTableImpl* theValue ) { myW = theValue; }
|
||||
|
||||
void startTimeOutAnimation(int secs, bool beep);
|
||||
void stopTimeOutAnimation();
|
||||
|
||||
void paintEvent(QPaintEvent * event);
|
||||
|
||||
|
||||
public slots:
|
||||
void startTimeOutAnimationNow();
|
||||
void nextTimeOutAnimationFrame();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
gameTableImpl *myW;
|
||||
QTimer *timeOutAnimationTimer;
|
||||
QTimer *timeOutAnimationKickOnTimer;
|
||||
|
||||
// boost::shared_ptr<SDLPlayer> mySDLPlayer;
|
||||
|
||||
boost::timers::portable::microsec_timer realTimer;
|
||||
|
||||
bool timeOutAnimation;
|
||||
|
||||
int timeOutAnimationWidth;
|
||||
int timeOutValue;
|
||||
int timeOutFrame;
|
||||
int waitFrames;
|
||||
int decreaseWidthIntervall;
|
||||
int timerIntervall;
|
||||
bool isBeep;
|
||||
bool isBeepPlayed;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user