Reversing look and walk GUI icons

Started by meowy, Mon 01/03/2004 07:41:01

Previous topic - Next topic

meowy

With that new lesson up on making a custom Quit Gui, I now have a lovely purple quit screen.  Thank you!  I've got a problem with my normal UI now though.  I've got everything working again after I crapped it up the other day.  Except for the look and walk part.  I reversed the buttons from the standard layout.

Look first, then Walk.  Is that just impossible to make work or am I missing the obvious in my scripting?  If I click the eye on my ui thingy, it makes the walk cursor.  If I click the walk icon it makes the eye cursor.  The resulting icons from the UI click work like what the cursor is.  They're not reversed in action though.  The resulting cursors work fine, but they're not what I want from the clicks.


On the GUI edit part, the eye icon is 0, the walk icon is 1.  (The rest are hand-2, talk-3, inventory bag-8, save game 4, restore 5, quit 6, about screen 7)  I added the inventory bag after the rest so it's out of order.

The GUI lists this one as 0 ICONBAR (Others are 1 INVENTORY, 2 QUITGUI)


Then the script section has this

 if (interface == ICONBAR) {
   if (button == 8) {  // show inventory
     show_inventory_window();
   }
   else if (button == 8) {   // use selected inventory
     if (character[ GetPlayerCharacter() ].activeinv >= 0)
       SetCursorMode(4);
   }
   else if (button == 4)    // save game
     SaveGameDialog();
   else if (button == 5)   // load game
     RestoreGameDialog();
   else if (button == 6)   // quit
     GUIOn(QUITGUI);
   else if (button == 7)    // about
     Display("JammieGirl and Cat (Version: 1)[[February 2004[[[[Adventure Game Studio v2 run-time engine[[Copyright (c) 1999-2003 Chris Jones");
 }  // end if interface ICONBAR

 if (interface == INVENTORY) {
   // They clicked a button on the Inventory GUI
   
   if (button == 1) {
     // They pressed SELECT, so switch to the Get cursor
     SetCursorMode (MODE_USE);
     // But, override the appearance to look like the arrow
     SetMouseCursor (6);
   }
   
   if (button == 2) {
     // They pressed LOOK, so switch to that mode
     SetActiveInventory(-1);
     SetCursorMode(MODE_LOOK);  
   }
   if (button == 2) {
     // They pressed the OK button, close the GUI
     GUIOff (INVENTORY);
     SetDefaultCursor();
   }


I went through all the available scripts but I don't see any that show where to switch the two so they're reversed in my game.  Can I write something up to make it go?

I tried putting this in.. but it didn't make a difference


   else if (button == 0)    // looking mode
     SetCursorMode(MODE_LOOK);  
   else if (button == 1)   // walk mode
     SetDefaultCursor();

With putting that in the ICONBAR section with the other else if bits.  But.. bleh.. no difference.  I copied bits from the other else if's and bits from the INVENTORY script part that's there at the bottom.  Kind of making them match a bit like the others.

It's quite possible that I've been working on this part for much too long today to see the answer if it's obvious haha.  How do I make it do what I want?
- meowy

Gilbert

You probably set the "Left click" action of teh "look" and "walk" buttons to "Set cursor mode" (actually I think this is the default action for the default GUI), if you want more control over these two buttons, just change their left click action to "run script..." and you can script whatever you want for them.

meowy

Ooooh...   Yeah they were both to the set cursor mode.

I'll give that a shot too.. to scripting them, just to be sure I can do it in case I need it later on for some reason haha!  Thank you!

I ended up changing the New Mode Number on the eye button and walk button on the ICONBAR ui thingy.. reversing the 1 and 0 between the two and it works okay so far.  I don't understand why that works, but I can worry about that after I get some sleep hehe
- meowy

SMF spam blocked by CleanTalk