summaryrefslogtreecommitdiff
path: root/apps/opencs/view/world/globalcreator.cpp
blob: 20a5c75cf6258887d2936dd242e58a1f335d41c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "globalcreator.hpp"

#include <components/esm3/variant.hpp>

#include "../../model/world/data.hpp"
#include "../../model/world/commands.hpp"
#include "../../model/world/columns.hpp"
#include "../../model/world/idtable.hpp"

namespace CSVWorld
{
    void GlobalCreator::configureCreateCommand (CSMWorld::CreateCommand& command) const
    {
        CSMWorld::IdTable* table = static_cast<CSMWorld::IdTable*>(getData().getTableModel(getCollectionId()));

        int index = table->findColumnIndex(CSMWorld::Columns::ColumnId_ValueType);
        int type = (int)ESM::VT_Float;

        command.addValue(index, type);
    }

    GlobalCreator::GlobalCreator(CSMWorld::Data& data, QUndoStack& undoStack, const CSMWorld::UniversalId& id)
        : GenericCreator (data, undoStack, id, true)
    {
    }
}