mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-12 12:09:15 +00:00
MOHAWK: Don't change current resource when dragging
svn-id: r54607
This commit is contained in:
parent
b4913548d0
commit
8da42b4221
@ -67,6 +67,7 @@ MohawkEngine_Myst::MohawkEngine_Myst(OSystem *syst, const MohawkGameDescription
|
||||
_curCard = 0;
|
||||
_needsUpdate = false;
|
||||
_curResource = -1;
|
||||
_dragResource = 0;
|
||||
|
||||
_gfx = NULL;
|
||||
_console = NULL;
|
||||
@ -294,7 +295,10 @@ Common::Error MohawkEngine_Myst::run() {
|
||||
switch (event.type) {
|
||||
case Common::EVENT_MOUSEMOVE:
|
||||
_needsUpdate = true;
|
||||
checkCurrentResource();
|
||||
// Keep the same resource when dragging
|
||||
if (!_dragResource) {
|
||||
checkCurrentResource();
|
||||
}
|
||||
if (_curResource >= 0 && _mouseClicked) {
|
||||
debug(2, "Sending mouse move event to resource %d\n", _curResource);
|
||||
_resources[_curResource]->handleMouseDrag(&event.mouse);
|
||||
@ -482,6 +486,7 @@ void MohawkEngine_Myst::changeToCard(uint16 card) {
|
||||
// TODO: Handle Script Resources
|
||||
|
||||
// Make sure we have the right cursor showing
|
||||
_dragResource = 0;
|
||||
_curResource = -1;
|
||||
checkCurrentResource();
|
||||
|
||||
|
@ -190,6 +190,7 @@ public:
|
||||
MystSaveLoad *_saveLoad;
|
||||
MystScriptParser *_scriptParser;
|
||||
Common::Array<MystResource*> _resources;
|
||||
MystResource *_dragResource;
|
||||
|
||||
bool _showResourceRects;
|
||||
MystResource *loadResource(Common::SeekableReadStream *rlstStream, MystResource *parent);
|
||||
|
@ -527,6 +527,9 @@ void MystResourceType10::drawDataToScreen() {
|
||||
}
|
||||
|
||||
void MystResourceType10::handleMouseDown(Common::Point *mouse) {
|
||||
// Tell the engine we are dragging a resource
|
||||
_vm->_dragResource = this;
|
||||
|
||||
updatePosition(mouse);
|
||||
|
||||
MystResourceType8::handleMouseDown(mouse);
|
||||
@ -550,6 +553,9 @@ void MystResourceType10::handleMouseUp(Common::Point *mouse) {
|
||||
|
||||
// Draw slider
|
||||
drawConditionalDataToScreen(1);
|
||||
|
||||
// No longer in drag mode
|
||||
_vm->_dragResource = 0;
|
||||
}
|
||||
|
||||
void MystResourceType10::handleMouseDrag(Common::Point *mouse) {
|
||||
|
Loading…
Reference in New Issue
Block a user