mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-19 04:17:45 +02:00
Changed the Return to a String "left/right" instead.
This commit is contained in:
parent
a4cf27402d
commit
42742ba1f9
5 changed files with 17 additions and 12 deletions
|
@ -20,7 +20,7 @@ Preference {
|
|||
height: control.height + hifi.dimensions.controlInterlineHeight
|
||||
|
||||
Component.onCompleted: {
|
||||
if (preference.value) {
|
||||
if (preference.value == "left") {
|
||||
box1.checked = true;
|
||||
} else {
|
||||
box2.checked = true;
|
||||
|
@ -30,10 +30,10 @@ Preference {
|
|||
function save() {
|
||||
// Box1 = True, Box2 = False (Right Hand for Default)
|
||||
if (box1.checked && !box2.checked) {
|
||||
preference.value = true;
|
||||
preference.value = "left";
|
||||
}
|
||||
if (!box1.checked && box2.checked) {
|
||||
preference.value = false;
|
||||
preference.value = "right";
|
||||
}
|
||||
preference.save();
|
||||
}
|
||||
|
|
|
@ -926,7 +926,7 @@ void MyAvatar::saveData() {
|
|||
Settings settings;
|
||||
settings.beginGroup("Avatar");
|
||||
|
||||
settings.setValue("useAlternativeHand", _useAlternativeHand);
|
||||
settings.setValue("dominantHand", _dominantHand);
|
||||
settings.setValue("headPitch", getHead()->getBasePitch());
|
||||
|
||||
settings.setValue("scale", _targetScale);
|
||||
|
@ -1123,7 +1123,7 @@ void MyAvatar::loadData() {
|
|||
setCollisionSoundURL(settings.value("collisionSoundURL", DEFAULT_AVATAR_COLLISION_SOUND_URL).toString());
|
||||
setSnapTurn(settings.value("useSnapTurn", _useSnapTurn).toBool());
|
||||
setClearOverlayWhenMoving(settings.value("clearOverlayWhenMoving", _clearOverlayWhenMoving).toBool());
|
||||
setUseAlternativeHand(settings.value("useAlternativeHand", _useAlternativeHand).toBool());
|
||||
setDominantHand(settings.value("dominantHand", _dominantHand).toString().toLower());
|
||||
settings.endGroup();
|
||||
|
||||
setEnableMeshVisible(Menu::getInstance()->isOptionChecked(MenuOption::MeshVisible));
|
||||
|
|
|
@ -339,8 +339,13 @@ public:
|
|||
Q_INVOKABLE bool getClearOverlayWhenMoving() const { return _clearOverlayWhenMoving; }
|
||||
Q_INVOKABLE void setClearOverlayWhenMoving(bool on) { _clearOverlayWhenMoving = on; }
|
||||
|
||||
Q_INVOKABLE void setUseAlternativeHand(bool hand) { _useAlternativeHand = hand; }
|
||||
Q_INVOKABLE bool getUseAlternativeHand() const { return _useAlternativeHand; }
|
||||
Q_INVOKABLE void setDominantHand(const QString& hand) {
|
||||
if (hand == "left" || hand == "right") {
|
||||
_dominantHand = hand;
|
||||
}
|
||||
}
|
||||
|
||||
Q_INVOKABLE QString getDominantHand() const { return _dominantHand; }
|
||||
|
||||
Q_INVOKABLE void setHMDLeanRecenterEnabled(bool value) { _hmdLeanRecenterEnabled = value; }
|
||||
Q_INVOKABLE bool getHMDLeanRecenterEnabled() const { return _hmdLeanRecenterEnabled; }
|
||||
|
@ -722,7 +727,7 @@ private:
|
|||
QUrl _fstAnimGraphOverrideUrl;
|
||||
bool _useSnapTurn { true };
|
||||
bool _clearOverlayWhenMoving { true };
|
||||
bool _useAlternativeHand{ false }; // False defaults to right hand, true to left
|
||||
QString _dominantHand{ "right" };
|
||||
|
||||
const float ROLL_CONTROL_DEAD_ZONE_DEFAULT = 8.0f; // deg
|
||||
const float ROLL_CONTROL_RATE_DEFAULT = 2.5f; // deg/sec/deg
|
||||
|
|
|
@ -68,8 +68,8 @@ void setupPreferences() {
|
|||
preferences->addPreference(new CheckPreference(AVATAR_BASICS, "Clear overlays when moving", getter, setter));
|
||||
}
|
||||
{
|
||||
auto getter = [=]()->bool { return myAvatar->getUseAlternativeHand(); };
|
||||
auto setter = [=](bool value) { myAvatar->setUseAlternativeHand(value); };
|
||||
auto getter = [=]()->QString { return myAvatar->getDominantHand(); };
|
||||
auto setter = [=](const QString& value) { myAvatar->setDominantHand(value); };
|
||||
preferences->addPreference(new PrimaryHandPreference(AVATAR_BASICS, "Dominant Hand", getter, setter));
|
||||
}
|
||||
|
||||
|
|
|
@ -340,11 +340,11 @@ public:
|
|||
Type getType() override { return Checkbox; }
|
||||
};
|
||||
|
||||
class PrimaryHandPreference : public BoolPreference {
|
||||
class PrimaryHandPreference : public StringPreference {
|
||||
Q_OBJECT
|
||||
public:
|
||||
PrimaryHandPreference(const QString& category, const QString& name, Getter getter, Setter setter)
|
||||
: BoolPreference(category, name, getter, setter) { }
|
||||
: StringPreference(category, name, getter, setter) { }
|
||||
Type getType() override { return PrimaryHand; }
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue