mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 05:07:00 -04:00
Reduce coupling between ValueEditors/Viewers and Set and StyleSheet.
- Adding of actions is done with an addAction function
- Files are read from
- getStylePackage for styling stuff (this is stylesheet)
- getLocalPackage for symbol and image values (this was the set)
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@970 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -110,6 +110,16 @@ Rotation DataViewer::getRotation() const {
|
||||
return Rotation(ss.card_angle(), stylesheet->getCardRect(), ss.card_zoom(), 1.0, ROTATION_ATTACH_TOP_LEFT);
|
||||
}
|
||||
|
||||
Package& DataViewer::getStylePackage() const {
|
||||
return *stylesheet;
|
||||
}
|
||||
Package& DataViewer::getLocalPackage() const {
|
||||
return *set;
|
||||
}
|
||||
Game& DataViewer::getGame() const {
|
||||
return *set->game;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Setting data
|
||||
|
||||
void DataViewer::setCard(const CardP& card, bool refresh) {
|
||||
|
||||
@@ -62,6 +62,13 @@ class DataViewer : public SetView {
|
||||
/// Invalidate and redraw (the area of) a single value viewer
|
||||
virtual void redraw(const ValueViewer&) {}
|
||||
|
||||
/// The package containing style stuff like images
|
||||
virtual Package& getStylePackage() const;
|
||||
/// The local package for loading/saving files
|
||||
Package& getLocalPackage() const;
|
||||
/// Return the game to use for information
|
||||
Game& getGame() const;
|
||||
|
||||
// --------------------------------------------------- : Setting data
|
||||
|
||||
/// Display a card in this viewer
|
||||
@@ -100,7 +107,6 @@ class DataViewer : public SetView {
|
||||
vector<ValueViewerP> viewers; ///< The viewers for the different values in the data
|
||||
CardP card; ///< The card that is currently displayed, if any
|
||||
bool drawing; ///< Are we currently drawing?
|
||||
public:
|
||||
mutable StyleSheetP stylesheet; ///< Stylesheet being used
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user