mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-27 05:11:34 +00:00
QLineEdit for setting base animation files
This commit is contained in:
parent
95272e0f14
commit
06fda4c5a1
3 changed files with 16 additions and 35 deletions
|
@ -423,33 +423,14 @@ void CSMPrefs::State::declare()
|
||||||
declareShortcut ("script-editor-uncomment", "Uncomment Selection", QKeySequence());
|
declareShortcut ("script-editor-uncomment", "Uncomment Selection", QKeySequence());
|
||||||
|
|
||||||
declareCategory ("Models");
|
declareCategory ("Models");
|
||||||
declareString ("baseanim", "3rd person base model with textkeys-data", "meshes/openmwdude.dae").
|
declareString ("baseanim", "base animations", "meshes/base_anim.nif").
|
||||||
setTooltip("3rd person base model with textkeys-data");
|
setTooltip("3rd person base model with textkeys-data");
|
||||||
|
declareString ("baseanimkna", "base animations, kna", "meshes/base_animkna.nif").
|
||||||
/*# 3rd person base model with textkeys-data
|
setTooltip("3rd person beast race base model with textkeys-data");
|
||||||
baseanim = meshes/base_anim.nif
|
declareString ("baseanimfemale", "base animations, female", "meshes/base_anim_female.nif").
|
||||||
|
setTooltip("3rd person female base model with textkeys-data");
|
||||||
# 1st person base animation model that looks also for corresponding kf-file
|
declareString ("wolfskin", "base animations, wolf", "meshes/wolf/skin.nif").
|
||||||
xbaseanim1st = meshes/xbase_anim.1st.nif
|
setTooltip("3rd person werewolf skin");
|
||||||
|
|
||||||
# 3rd person beast race base model with textkeys-data
|
|
||||||
baseanimkna = meshes/base_animkna.nif
|
|
||||||
|
|
||||||
# 1st person beast race base animation model
|
|
||||||
baseanimkna1st = meshes/base_animkna.1st.nif
|
|
||||||
|
|
||||||
# 3rd person female base model with textkeys-data
|
|
||||||
baseanimfemale = meshes/base_anim_female.nif
|
|
||||||
|
|
||||||
# 1st person female base model with textkeys-data
|
|
||||||
baseanimfemale1st = meshes/base_anim_female.1st.nif
|
|
||||||
|
|
||||||
# 3rd person werewolf skin
|
|
||||||
wolfskin = meshes/wolf/skin.nif
|
|
||||||
|
|
||||||
# 1st person werewolf skin
|
|
||||||
wolfskin1st = meshes/wolf/skin.1st.nif*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSMPrefs::State::declareCategory (const std::string& key)
|
void CSMPrefs::State::declareCategory (const std::string& key)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
#include "stringsetting.hpp"
|
#include "stringsetting.hpp"
|
||||||
|
|
||||||
#include <QTextEdit>
|
#include <QLineEdit>
|
||||||
#include <QMutexLocker>
|
#include <QMutexLocker>
|
||||||
|
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/settings.hpp>
|
||||||
|
@ -22,7 +22,7 @@ CSMPrefs::StringSetting& CSMPrefs::StringSetting::setTooltip (const std::string&
|
||||||
|
|
||||||
std::pair<QWidget *, QWidget *> CSMPrefs::StringSetting::makeWidgets (QWidget *parent)
|
std::pair<QWidget *, QWidget *> CSMPrefs::StringSetting::makeWidgets (QWidget *parent)
|
||||||
{
|
{
|
||||||
mWidget = new QTextEdit (QString::fromUtf8 (mDefault.c_str()), parent);
|
mWidget = new QLineEdit (QString::fromUtf8 (mDefault.c_str()), parent);
|
||||||
|
|
||||||
if (!mTooltip.empty())
|
if (!mTooltip.empty())
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,7 @@ std::pair<QWidget *, QWidget *> CSMPrefs::StringSetting::makeWidgets (QWidget *p
|
||||||
mWidget->setToolTip (tooltip);
|
mWidget->setToolTip (tooltip);
|
||||||
}
|
}
|
||||||
|
|
||||||
connect (mWidget, SIGNAL (textChanged (std::string)), this, SLOT (textChanged (std::string)));
|
connect (mWidget, SIGNAL (textChanged (QString)), this, SLOT (textChanged (QString)));
|
||||||
|
|
||||||
return std::make_pair (static_cast<QWidget *> (nullptr), mWidget);
|
return std::make_pair (static_cast<QWidget *> (nullptr), mWidget);
|
||||||
}
|
}
|
||||||
|
@ -39,15 +39,15 @@ void CSMPrefs::StringSetting::updateWidget()
|
||||||
{
|
{
|
||||||
if (mWidget)
|
if (mWidget)
|
||||||
{
|
{
|
||||||
//mWidget->setValue(getValues().getString(getKey(), getParent()->getKey()));
|
mWidget->setText(QString::fromStdString(getValues().getString(getKey(), getParent()->getKey())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSMPrefs::StringSetting::textChanged (std::string text)
|
void CSMPrefs::StringSetting::textChanged (const QString& text)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
QMutexLocker lock (getMutex());
|
QMutexLocker lock (getMutex());
|
||||||
getValues().setString (getKey(), getParent()->getKey(), text);
|
getValues().setString (getKey(), getParent()->getKey(), text.toStdString());
|
||||||
}
|
}
|
||||||
|
|
||||||
getParent()->getState()->update (*this);
|
getParent()->getState()->update (*this);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include "setting.hpp"
|
#include "setting.hpp"
|
||||||
|
|
||||||
class QTextEdit;
|
class QLineEdit;
|
||||||
|
|
||||||
namespace CSMPrefs
|
namespace CSMPrefs
|
||||||
{
|
{
|
||||||
|
@ -13,7 +13,7 @@ namespace CSMPrefs
|
||||||
|
|
||||||
std::string mTooltip;
|
std::string mTooltip;
|
||||||
std::string mDefault;
|
std::string mDefault;
|
||||||
QTextEdit* mWidget;
|
QLineEdit* mWidget;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ namespace CSMPrefs
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void textChanged (std::string text);
|
void textChanged (const QString& text);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue