diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-07-26 20:14:16 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-07-26 20:14:16 +0000 |
| commit | e260085a116271e49c3d1d835eac1df70424f4c6 (patch) | |
| tree | f08772ebbed902c7e482e8fc58122bebe984dec0 /pokemodr/ScriptWidget.cpp | |
| parent | 96058e330b9a535ec3aecc40cfbd2fa74b791cd8 (diff) | |
| download | sigen-e260085a116271e49c3d1d835eac1df70424f4c6.tar.gz sigen-e260085a116271e49c3d1d835eac1df70424f4c6.tar.xz sigen-e260085a116271e49c3d1d835eac1df70424f4c6.zip | |
[FIX] Fraction won't reduce whenever possible
[FIX] ScriptWidget updates cleaner now
[FIX] Player is now a Containment (Team is for storing the data; Player is an interface for battling)
[FIX] QtConcurrent framework used to parallelize ATB timer and requesting actions
[FIX] ActionQueue now uses a QMutexLocker (slimmer code)
[FIX] Various fixes with arenas
[ADD] pokebattle/Player.cpp
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@229 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemodr/ScriptWidget.cpp')
| -rw-r--r-- | pokemodr/ScriptWidget.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/pokemodr/ScriptWidget.cpp b/pokemodr/ScriptWidget.cpp index 1e3ac794..b6d5753a 100644 --- a/pokemodr/ScriptWidget.cpp +++ b/pokemodr/ScriptWidget.cpp @@ -29,18 +29,18 @@ Pokemodr::ScriptWidget::ScriptWidget(QWidget* parent, const Pokemod::Script& value) : QWidget(parent), - m_value(value), m_document(NULL) { setupUi(this); QMap<QString, QString> languages; - languages["Python"] = "python"; - languages["Ruby"] = "ruby"; - languages["JavaScript"] = "kjs"; - languages["Java"] = "java"; + languages["C#"] = "mono"; languages["Falcon"] = "falcon"; // No highlight rules yet + languages["Java"] = "java"; + languages["JavaScript"] = "kjs"; + languages["Lua"] = "lua"; languages["PHP"] = "php"; - languages["C#"] = "mono"; + languages["Python"] = "python"; + languages["Ruby"] = "ruby"; QList<QString> langs = languages.keys(); foreach (QString language, langs) varInterpreter->addItem(language, languages[language]); @@ -74,6 +74,8 @@ Pokemodr::ScriptWidget::ScriptWidget(QWidget* parent, const Pokemod::Script& val // } layoutScript->addWidget(m_view); connect(m_document, SIGNAL(textChanged(KTextEditor::Document*)), this, SLOT(scriptChanged())); + connect(this, SIGNAL(valueChanged(Pokemod::Fraction)), SLOT(setGui())); + setGui(); } Pokemodr::ScriptWidget::~ScriptWidget() @@ -86,16 +88,20 @@ Pokemod::Script Pokemodr::ScriptWidget::value() const return m_value; } -void Pokemodr::ScriptWidget::setValue(const Pokemod::Script& value) +void Pokemodr::ScriptWidget::setGui() { - if (m_value == value) - return; - m_value = value; varInterpreter->setCurrentIndex(varInterpreter->findData(m_value.interpreter())); m_document->setHighlightingMode(varInterpreter->currentText()); KTextEditor::Cursor cursor = m_view->cursorPosition(); m_document->setText(m_value.script()); m_view->setCursorPosition(cursor); +} + +void Pokemodr::ScriptWidget::setValue(const Pokemod::Script& value) +{ + if (m_value == value) + return; + m_value = value; emit(valueChanged(m_value)); } |
