mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Added dummy CardEditor, implemented Stylesheet loading
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@50 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -7,8 +7,14 @@
|
||||
// ----------------------------------------------------------------------------- : Includes
|
||||
|
||||
#include <render/card/viewer.hpp>
|
||||
#include <render/value/viewer.hpp>
|
||||
#include <data/set.hpp>
|
||||
#include <data/stylesheet.hpp>
|
||||
#include <data/card.hpp>
|
||||
#include <data/field.hpp>
|
||||
|
||||
DECLARE_TYPEOF_COLLECTION(ValueViewerP);
|
||||
|
||||
// ----------------------------------------------------------------------------- : DataViewer
|
||||
|
||||
|
||||
@@ -28,9 +34,24 @@ Value* DataViewer::focusedValue() const { return nullptr; }
|
||||
|
||||
// ----------------------------------------------------------------------------- : Setting data
|
||||
|
||||
void DataViewer::setCard(Card& card) {
|
||||
assert(set);
|
||||
setStyles(set->stylesheet->card_style);
|
||||
setData(card.data);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Viewers
|
||||
|
||||
void DataViewer::setStyles(IndexMap<FieldP,StyleP>& styles) {
|
||||
}
|
||||
|
||||
void DataViewer::setData(IndexMap<FieldP,ValueP>& values) {
|
||||
FOR_EACH(v, viewers) {
|
||||
v->setValue(values[v->getField()]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ValueViewerP DataViewer::makeViewer(const StyleP& style) {
|
||||
return style->makeViewer(*this, style);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user