aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/user_interface.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2014-03-15 21:33:15 -0400
committerPaul Gilbert2014-03-15 21:33:15 -0400
commit630679a5c8d72242866638b470cd361c0d5c6b0a (patch)
treeee023ed868528e20e5a623ff56c8d64d9c192969 /engines/mads/user_interface.cpp
parentc4ed42e6d5974e635b4241aa110d8ffe2a8c99c7 (diff)
downloadscummvm-rg350-630679a5c8d72242866638b470cd361c0d5c6b0a.tar.gz
scummvm-rg350-630679a5c8d72242866638b470cd361c0d5c6b0a.tar.bz2
scummvm-rg350-630679a5c8d72242866638b470cd361c0d5c6b0a.zip
MADS: Completed UserInterface::loadElements
Diffstat (limited to 'engines/mads/user_interface.cpp')
-rw-r--r--engines/mads/user_interface.cpp53
1 files changed, 50 insertions, 3 deletions
diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp
index e6840ac01a..cbd4573eb4 100644
--- a/engines/mads/user_interface.cpp
+++ b/engines/mads/user_interface.cpp
@@ -130,9 +130,56 @@ void UserInterface::loadElements() {
scene._screenObjects.clear();
if (!scene._screenObjects._v832EC) {
+ // Set up screen objects for the inventory scroller
for (int idx = 1; idx <= 3; ++idx) {
getBounds(CAT_INV_SCROLLER, idx, bounds);
- // TODO
+ moveRect(bounds);
+
+ scene._screenObjects.add(bounds, LAYER_GUI, CAT_INV_SCROLLER, idx);
+ }
+
+ // Set up actions
+ for (int idx = 0; idx < 10; ++idx) {
+ getBounds(CAT_ACTION, idx, bounds);
+ moveRect(bounds);
+
+ scene._screenObjects.add(bounds, LAYER_GUI, CAT_ACTION, idx);
+ }
+
+ // Set up inventory list
+ for (int idx = 0; idx < 5; ++idx) {
+ getBounds(CAT_INV_LIST, idx, bounds);
+ moveRect(bounds);
+
+ scene._screenObjects.add(bounds, LAYER_GUI, CAT_INV_LIST, idx);
+ }
+
+ // Set up the inventory vocab list
+ for (int idx = 0; idx < 5; ++idx) {
+ getBounds(CAT_INV_VOCAB, idx, bounds);
+ moveRect(bounds);
+
+ scene._screenObjects.add(bounds, LAYER_GUI, CAT_INV_VOCAB, idx);
+ }
+
+ // Set up the inventory item picture
+ scene._screenObjects.add(Common::Rect(160, 159, 231, 194), LAYER_GUI,
+ CAT_INV_ANIM, 0);
+ }
+
+ if (!scene._screenObjects._v832EC || scene._screenObjects._v832EC == 2) {
+ for (int hotspotIdx = scene._hotspots.size() - 1; hotspotIdx >= 0; --hotspotIdx) {
+ Hotspot &hs = scene._hotspots[hotspotIdx];
+ scene._screenObjects.add(hs._bounds, LAYER_GUI, CAT_HOTSPOT, hotspotIdx);
+ }
+ }
+
+ if (scene._screenObjects._v832EC == 1) {
+ for (int idx = 0; idx < 5; ++idx) {
+ getBounds(CAT_6, idx, bounds);
+ moveRect(bounds);
+
+ scene._screenObjects.add(bounds, LAYER_GUI, CAT_6, idx);
}
}
}
@@ -222,8 +269,8 @@ bool UserInterface::getBounds(ScrCategory category, int v, Common::Rect &bounds)
return true;
}
-void UserInterface::extendRect(Common::Rect &bounds) {
-
+void UserInterface::moveRect(Common::Rect &bounds) {
+ bounds.translate(0, MADS_SCREEN_HEIGHT - MADS_INTERFACE_HEIGHT);
}
} // End of namespace MADS