Right-clicking GUIs in 2.61

Started by DrSlash, Sat 09/07/2011 10:38:11

Previous topic - Next topic

DrSlash

So this is my first question about AGS and I hope the last.
I'm using 2.61 version and as I can see right-clicking GUIs is the same to left-clicking them. I've tried to use
if (IsKeyPressed(RIGHT)==1) SetNextCursorMode();
command to change the script so that it will set the next cursor mode after right-clicking the GUI but it doesn't work (of course, I've placed this command in GUI's script, not in on_mouse_click).
So, here is my question: I want to set the next cursor mode if player right-clicks the GUI. Is is possible?

Dualnames

on mouse click append the following:
Code: ags


if (button==eMouseRight) 
{
  GUI *theGui = GUI.GetAtScreenXY(mouse.x, mouse.y);
  if (theGui!=null) 
  {
    mouse.SelectNextMode();
  }
}




Now whether that's doable in AGS 2.61, well, beats me. But I believe it is.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Khris

No, it isn't. Unless you lose the pointers, oo-code and enums.

DrSlash:
Why on earth would you still use 2.61? I've desperately tried to think of a reason but I can't. Win98 compatibility...?

Re your problem:
Try on_event:

Code: ags
function on_event(int event, int data) {

  if (event == GUI_MUP && data == RIGHT) SetNextCursorMode();
}

monkey0506

I just wanted to point out that even in 2.7+ what Dual said is still incorrect because on_mouse_click is never, ever, ever, ever, ever, ever fired when you click on a GUI or non-InvWindow GUIControl. :P

And wasn't Win98 supported until 2.71 or 2.72 at least? So I too fail to see why you haven't considered upgrading to a higher version of AGS. If you did want to upgrade, 2.7x should be able to import your project. If you wanted to consider upgrading to anything in the 3.x branch you would have to upgrade to the 2.7x branch first, then you can upgrade to a newer version. I mean, if you wanted to.

I can't think of a specific reason why you wouldn't have upgraded from 2.61 to 2.62 at least though. It's been a long time since 2.62 came out, so I don't recall off the top of my head if it would have "broke" anything, but I remember developing with it (vaguely :P). Seriously, the 2.7+ OO-system, pointers, enums, struct member functions..it's really made the script language much more powerful. 3.0 introduced dynamic arrays too which are something I'm rather fond of. :)

DrSlash

I still use 2.61 because old versions of AGS were designed to create games in Sierra style. And that is exactly what I need :)

monkey0506

...there's nothing stopping you from creating a Sierra-style game in newer versions of AGS. The same default GUIs are still being distributed with the default template, and you can still script whatever you'd like. And besides, once you've started a game project, upgrading it doesn't typically alter anything unless something went wrong.

Khris

I must have missed the memo about AGS ditching Sierra functionality just because it became prettier, way more powerful, way more user-friendly, and had tons of new features implemented. Oh wait, there never was such a memo ::)

(Although I can see why one would think that a more user-friendly engine would no longer support creating Sierra games ;))

DrSlash

Well, nothing of these really works. Let's rephrase my question: Is there any way to find out which mouse button player uses?

What about my version of AGS - I surely know that newer versions have all functions of old ones. It's just because I'm very used to 2.61 and I even suppose I'm adept in it :)

SMF spam blocked by CleanTalk