tools/MissionsEditor/hedgehogedit.cpp
author nemo
Fri, 02 Apr 2010 15:58:45 +0000
changeset 3259 a29ccf4aed82
parent 2596 41b46f83d088
permissions -rw-r--r--
This attempts to distribute crates based on their probabilities, while preserving 35% for health crates since that has no probability GUI yet

#include "hedgehogedit.h"
#include "ui_hedgehogedit.h"

HedgehogEdit::HedgehogEdit(QWidget *parent) :
    QFrame(parent),
    m_ui(new Ui::HedgehogEdit)
{
    m_ui->setupUi(this);
}

HedgehogEdit::~HedgehogEdit()
{
    delete m_ui;
}

void HedgehogEdit::changeEvent(QEvent *e)
{
    QWidget::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        m_ui->retranslateUi(this);
        break;
    default:
        break;
    }
}

void HedgehogEdit::setHedgehog(quint32 level, quint32 health, const QString & name)
{
    m_ui->cbLevel->setCurrentIndex(level);
    m_ui->sbHealth->setValue(health);
    m_ui->leName->setText(name);
}

void HedgehogEdit::setHat(const QString & name)
{
    m_ui->leHat->setText(name);
}

void HedgehogEdit::setCoordinates(int x, int y)
{
    m_ui->pbCoordinates->setText(QString("%1x%2").arg(x).arg(y));
}