| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #include "UIMLCraftingProgress.h"
- #include "Globals.h"
- #include "UIMLProgressAndStateView.h"
- #include "UIMLUtils.h"
- UIMLCraftingProgressElement::UIMLCraftingProgressElement()
- : UIMLElement()
- {}
- bool UIMLCraftingProgressElement::isApplicableFor(
- Framework::XML::Element& element)
- {
- return element.getName().istGleich("craftingProgress");
- }
- Framework::Zeichnung* UIMLCraftingProgressElement::parseElement(
- Framework::XML::Element& element, Framework::UIMLContainer& generalFactory)
- {
- int addressLength = 0;
- int* address = getUIMLTargetAddress(
- element.getAttributeValue("target"), addressLength);
- UIMLProgressAndStateView* view
- = new UIMLProgressAndStateView(element.getAttributeValue("id"),
- element.getAttributeValue("backgroundImagePath"),
- element.getAttributeValue("foregroundImagePath"),
- address,
- addressLength,
- 1,
- 3,
- "Progress: ",
- " ticks");
- Framework::Text direction = element.getAttributeValue("direction");
- view->setStyle(UIMLProgressAndStateView::Style::Sichtbar
- | UIMLProgressAndStateView::Style::Erlaubt);
- if (direction.istGleich("TOP") || direction.istGleich("BOTTOM"))
- {
- view->addStyle(UIMLProgressAndStateView::Style::Vertical);
- }
- if (direction.istGleich("TOP") || direction.istGleich("LEFT"))
- {
- view->addStyle(UIMLProgressAndStateView::Style::Reversed);
- }
- return view;
- }
- bool UIMLCraftingProgressElement::updateElement(
- Framework::XML::Element& element,
- Framework::Zeichnung& z,
- Framework::UIMLContainer& generalFactory)
- {
- return false; // No update needed for this element
- }
|