Disable VerbCoin on title screen

Started by MikeDraven, Sun 16/05/2021 19:31:57

Previous topic - Next topic

MikeDraven

Hi,
I'm using the default VerbCoin.
I want to disable the verbcoin GUI on the title screen.

There's 3 hotspots - start game, load game, quit game.

I've tried something like this:

Code: ags

function room_Load()
{
gBottomBar.Visible = false;
mouse.Mode = eModePointer;
VerbCoin.Disable();
}

function hStart_AnyClick()
{
  player.ChangeRoom(1);
}

function hLoad_AnyClick()
{
  lstRestoreGamesList.FillSaveGameList();
  gRestoreGame.Visible = true;
}

function hQuit_AnyClick()
{
  QuitGame(0);
}


But it doesn't work.
I mean - when I use VerbCoin.Disable(); - the cursor remains in pointer mode, but clicking on hotspots don't do anything.

How to disable the VerbCoin and make AnyClick events work?

MikeDraven

I found the solution, thanks to a similar topic on this forum (and modified it a bit).

Maybe it'll help someone too.

Code: ags

function room_Load()
{
gBottomBar.Visible = false;
mouse.Mode = eModePointer;
}

function on_mouse_click(MouseButton button) // called when a mouse button is clicked
{
 if (button == eMouseLeft) 
  {
    if (mouse.Mode == eModePointer)
    {
      // if there's a hotspot under mouse cursor
      if (GetLocationType(mouse.x, mouse.y) == eLocationHotspot)
      {
        // then fire "anyclick" event
        Room.ProcessClick(mouse.x, mouse.y, eModePointer);
        return; // do not do anything else
      }
    }
    // in all other cases - just do default action
    Room.ProcessClick(mouse.x,mouse.y, mouse.Mode);
  }
}

SMF spam blocked by CleanTalk