Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
adcae59e
Commit
adcae59e
authored
Mar 18, 2015
by
Zach
Browse files
Merge pull request #846 from poixen/optional_card_scaling
Added optional card scaling setting
parents
fead9f31
441cb444
Changes
5
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/abstractcarditem.cpp
View file @
adcae59e
...
...
@@ -191,7 +191,7 @@ void AbstractCardItem::setHovered(bool _hovered)
processHoverEvent
();
isHovered
=
_hovered
;
setZValue
(
_hovered
?
2000000004
:
realZValue
);
setScale
(
_hovered
?
1.1
:
1
);
setScale
(
_hovered
&&
settingsCache
->
getScaleCards
()
?
1.1
:
1
);
setTransformOriginPoint
(
_hovered
?
CARD_WIDTH
/
2
:
0
,
_hovered
?
CARD_HEIGHT
/
2
:
0
);
update
();
}
...
...
cockatrice/src/dlg_settings.cpp
View file @
adcae59e
...
...
@@ -299,9 +299,13 @@ AppearanceSettingsPage::AppearanceSettingsPage()
displayCardNamesCheckBox
.
setChecked
(
settingsCache
->
getDisplayCardNames
());
connect
(
&
displayCardNamesCheckBox
,
SIGNAL
(
stateChanged
(
int
)),
settingsCache
,
SLOT
(
setDisplayCardNames
(
int
)));
cardScalingCheckBox
.
setChecked
(
settingsCache
->
getScaleCards
());
connect
(
&
cardScalingCheckBox
,
SIGNAL
(
stateChanged
(
int
)),
settingsCache
,
SLOT
(
setCardScaling
(
int
)));
QGridLayout
*
cardsGrid
=
new
QGridLayout
;
cardsGrid
->
addWidget
(
&
displayCardNamesCheckBox
,
0
,
0
,
1
,
2
);
cardsGrid
->
addWidget
(
&
cardScalingCheckBox
,
1
,
0
,
1
,
2
);
cardsGroupBox
=
new
QGroupBox
;
cardsGroupBox
->
setLayout
(
cardsGrid
);
...
...
@@ -351,6 +355,7 @@ void AppearanceSettingsPage::retranslateUi()
cardsGroupBox
->
setTitle
(
tr
(
"Card rendering"
));
displayCardNamesCheckBox
.
setText
(
tr
(
"Display card names on cards having a picture"
));
cardScalingCheckBox
.
setText
(
tr
(
"Scale cards on mouse over"
));
handGroupBox
->
setTitle
(
tr
(
"Hand layout"
));
horizontalHandCheckBox
.
setText
(
tr
(
"Display hand horizontally (wastes space)"
));
...
...
cockatrice/src/dlg_settings.h
View file @
adcae59e
...
...
@@ -98,6 +98,7 @@ private:
QLineEdit
*
playerAreaBgEdit
;
QLineEdit
*
cardBackPicturePathEdit
;
QCheckBox
displayCardNamesCheckBox
;
QCheckBox
cardScalingCheckBox
;
QCheckBox
horizontalHandCheckBox
;
QCheckBox
invertVerticalCoordinateCheckBox
;
QGroupBox
*
zoneBgGroupBox
;
...
...
cockatrice/src/settingscache.cpp
View file @
adcae59e
...
...
@@ -72,7 +72,14 @@ SettingsCache::SettingsCache()
ignoreUnregisteredUsers
=
settings
->
value
(
"chat/ignore_unregistered"
,
false
).
toBool
();
ignoreUnregisteredUserMessages
=
settings
->
value
(
"chat/ignore_unregistered_messages"
,
false
).
toBool
();
attemptAutoConnect
=
settings
->
value
(
"server/auto_connect"
,
0
).
toBool
();
attemptAutoConnect
=
settings
->
value
(
"server/auto_connect"
,
0
).
toBool
();
scaleCards
=
settings
->
value
(
"cards/scaleCards"
,
true
).
toBool
();
}
void
SettingsCache
::
setCardScaling
(
const
int
_scaleCards
)
{
scaleCards
=
_scaleCards
;
settings
->
setValue
(
"cards/scaleCards"
,
scaleCards
);
}
void
SettingsCache
::
setLang
(
const
QString
&
_lang
)
...
...
cockatrice/src/settingscache.h
View file @
adcae59e
...
...
@@ -74,6 +74,7 @@ private:
QString
picUrlHqFallback
;
bool
attemptAutoConnect
;
int
pixmapCacheSize
;
bool
scaleCards
;
public:
SettingsCache
();
const
QByteArray
&
getMainWindowGeometry
()
const
{
return
mainWindowGeometry
;
}
...
...
@@ -125,6 +126,7 @@ public:
void
copyPath
(
const
QString
&
src
,
const
QString
&
dst
);
bool
getAutoConnect
()
const
{
return
attemptAutoConnect
;
}
int
getPixmapCacheSize
()
const
{
return
pixmapCacheSize
;
}
bool
getScaleCards
()
const
{
return
scaleCards
;
}
public
slots
:
void
setMainWindowGeometry
(
const
QByteArray
&
_mainWindowGeometry
);
void
setLang
(
const
QString
&
_lang
);
...
...
@@ -169,6 +171,7 @@ public slots:
void
setPicUrlHqFallback
(
const
QString
&
_picUrlHqFallback
);
void
setAutoConnect
(
const
bool
&
_autoConnect
);
void
setPixmapCacheSize
(
const
int
_pixmapCacheSize
);
void
setCardScaling
(
const
int
_scaleCards
);
};
extern
SettingsCache
*
settingsCache
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment