GUI Suggestions

Started by Joseph DiPerla, Tue 22/04/2003 01:04:34

Previous topic - Next topic

Joseph DiPerla

Well Chris, Its been a while since I made some suggestions like these, so I was making one of my very own games (Notice: ONE OF... Prolly 6), and realised these functions would be useful to me:

1) DisplayButton(int Button, Int GUI), HideButton(Int Button, Int GUI)-- Hide and unhide these buttons from the GUI. I could have swore you had these already implemented, but I cant find them anywhere in the manual.

2) Special Marker for Labels: @MODE_HOTSPOT@-- Would display the mode and the hotspot the mouse is over eG: Look At Door. This brings me to suggestion number 3.

3) DescribeMode(Int Mode, Description)-- Describes the mode. EG: mode 1 would be "Look At:". This is for use the the special marker label above.

4) Can List Boxes have the highlighting feature off? If it can, I dont know how to do it. If not, can it be implemented?

5) A function for a list box to display Inventory Item names, by either odd numbers, or even numbers or all numbers.

6) And Last, a function to be able to scroll up or down on list boxes.

Only 6 suggestions, compared to my average 30 or 40 ;D

If anyone else could find these useful, please speak up now, it would be most appreciated.

Thanks once again for the latest version of AGS Chris.

Joey
Joseph DiPerla--- http://www.adventurestockpile.com
Play my Star Wars MMORPG: http://sw-bfs.com
See my Fiverr page for translation and other services: https://www.fiverr.com/josephdiperla
Google Plus Adventure Community: https://plus.google.com/communities/116504865864458899575

RickJ

JD:  Some of what you ask is already possible.  Let me tell you what I know about each of your suggestions:  

Quote
1) DisplayButton(int Button, Int GUI), HideButton(Int Button, Int GUI)-- Hide and unhide these buttons from the GUI. I could have swore you had these already implemented, but I cant find them anywhere in the manual.
You can use SetButtonPic() to hide or show buttons.  You just need to have a transparent sprite for the hide function and perhaps some simple logic to disable whatever functions are attached to the button.

Quote2) Special Marker for Labels: @MODE_HOTSPOT@-- Would display the mode and the hotspot the mouse is over eG: Look At Door.
Wouldn't it be better to just add an @MODE@  feature.  Then you would have @MODE@ @HOTSPOT@.

Quote3) DescribeMode(Int Mode, Description)-- Describes the mode. EG: mode 1 would be "Look At:". This is for use the the special marker label above.
Couldn't @MODE@ just use the name text  specified when defining the cursors?

Quote4) Can List Boxes have the highlighting feature off? If it can, I dont know how to do it. If not, can it be implemented?
You just need to do a ListBoxSetSelected (gui, object, -1).

Quote5) A function for a list box to display Inventory Item names, by either odd numbers, or even numbers or all numbers.
This can be implemented using a simple while loop and the ListBoxAdd() function.

Quote6) And Last, a function to be able to scroll up or down on list boxes.
The function ListBoxSetTopItem () can be used to scroll a listbox up and down.  

So I guess it boils down to the need for an @MODE@ feature, which seems to be a good idea to me.  The only other question is if there are a few more equally useful @STRINGS@  type things that should be suggested?

Pumaman

#2

Edit: oops, Rick got here first. Sorry, my reply's sort of a duplicate :)


Quote from: Joseph DiPerla on Tue 22/04/2003 01:04:34
1) DisplayButton(int Button, Int GUI), HideButton(Int Button, Int GUI)-- Hide and unhide these buttons from the GUI. I could have swore you had these already implemented, but I cant find them anywhere in the manual.

Strange though, I've never had a request for them. You can always work around it by SetButtonPic'ing to a blank sprite of course.

Quote
2) Special Marker for Labels: @MODE_HOTSPOT@-- Would display the mode and the hotspot the mouse is over eG: Look At Door. This brings me to suggestion number 3.

I don't think this would work because of the peculiarities of some modes, such as Use X On Y and Give X to Y - which would end up being scripted manually anyway.

Quote3) DescribeMode(Int Mode, Description)-- Describes the mode. EG: mode 1 would be "Look At:". This is for use the the special marker label above.

Is this equivalent to adding a GetCursorModeName command?

Quote4) Can List Boxes have the highlighting feature off? If it can, I dont know how to do it. If not, can it be implemented?

Well, you can ListBoxSetSelected to -1 to remove the highlight.

Quote5) A function for a list box to display Inventory Item names, by either odd numbers, or even numbers or all numbers.

This seems rather too specialized to add as an AGS feature - just do it by scripting with ListBoxAdd and GetInvName.

Quote
6) And Last, a function to be able to scroll up or down on list boxes.

ListBoxSetTopItem


thanks for your suggestions :)

Joseph DiPerla

Sheesh, I wish I would have seen those functions earlier. Sometimes it doesn't click with me, but Thanks for your help.

I will try to use them, if they dont work, I will certainly be back here asking for help :)

Joey
Joseph DiPerla--- http://www.adventurestockpile.com
Play my Star Wars MMORPG: http://sw-bfs.com
See my Fiverr page for translation and other services: https://www.fiverr.com/josephdiperla
Google Plus Adventure Community: https://plus.google.com/communities/116504865864458899575

Joseph DiPerla

Well, ok, I am having some problems with this thing. I have uploaded a template of what I am trying to accomplish here at this site: http://swunlimited.freeservers.com/index.html

This is the error I got:

An exception occured in ACWin.exe at EIP = 0x00406e9c; program pointer is +6, ACI version 2.55.543,gtags(0,22)

I got this error when pushing button (Object 11) on GUI 0, named ICONBAR. When you push the button, it sets cursor mode to 10. When I play the game and push the button, it crashes and displays that message above.  I believe it does that becouse it is setting the cursor mode above 9.

And when going to cursor mode 11, 12, 13, the mouse cursor was changing to rogers walking down animation view.. I tried to use setdefaultcursor on these with no success. Then I tried to use SetMouseCursor(), and that worked, but was glitchy. Anything else I can do. This is all part of the Template, so you can test this out yourself.

Also is there anyway I can change the color of a buttons text in the script?

I am also trying to create an animated button using this script in repeatedly execute in the global script:

int timer=0;
if (timer==5)
{SetButtonPic(GUI1,0,1,3);
timer++; }
if (timer==10)
{SetButtonPic(GUI1,0,1,5);
timer++;}
if (timer==15)
{SetButtonPic(GUI1,0,1,6);
timer=0;}
else timer++;
 

}

What am I doing wrong with this?
Joseph DiPerla--- http://www.adventurestockpile.com
Play my Star Wars MMORPG: http://sw-bfs.com
See my Fiverr page for translation and other services: https://www.fiverr.com/josephdiperla
Google Plus Adventure Community: https://plus.google.com/communities/116504865864458899575

RickJ

Timer
Try doin this to fix the timer ...


If you declare timer  inside the bounds of a function it will be  dynamicalluy created everytime the function executes

int timer=0;    

function repeatedly_execute() {
  timer++;
  if (timer>=15)  timer=0;
  if (timer==0)    SetButtonPic(GUI1,0,1,6);
  if (timer==5)    SetButtonPic(GUI1,0,1,3);
  if (timer==10)  SetButtonPic(GUI1,0,1,5);
}

Cursor Mode Crash
QuoteWhen you push the button, it sets cursor mode to 10. When I play the game and push the button, it crashes and displays that message above.  I believe it does that becouse it is setting the cursor mode above 9.
I agree.  Don't use a cursor mode that is not defined.


Joseph DiPerla

But I am going to need that cursor mode. Do you suggest that rather than using Cursor mode 10, maybe use 14?

Joey
Joseph DiPerla--- http://www.adventurestockpile.com
Play my Star Wars MMORPG: http://sw-bfs.com
See my Fiverr page for translation and other services: https://www.fiverr.com/josephdiperla
Google Plus Adventure Community: https://plus.google.com/communities/116504865864458899575

RickJ

If it don't exist you can't use it.  If you need more than 0..9 then you will need to do some scripting to make a multiple use cursor mode.

Joseph DiPerla

Hey RickJ, thanks for the animated button suggested. It worked like a charm!

OK, I thought using cursor mode 14 would work, since 11,12,13 dont crash on me.

I will see if scripting what you suggested would work though.

Thanks.

Joey
Joseph DiPerla--- http://www.adventurestockpile.com
Play my Star Wars MMORPG: http://sw-bfs.com
See my Fiverr page for translation and other services: https://www.fiverr.com/josephdiperla
Google Plus Adventure Community: https://plus.google.com/communities/116504865864458899575

RickJ

QuoteOK, I thought using cursor mode 14 would work, since 11,12,13 dont crash on me.
These probably don't crash because there is something else you have defined that has initializes the memory space, corresponding to modes 11..13, to benign values.  

 

Pumaman

Yep thanks for that crash report, I'll fix the next version to check the cursor mode number and exit gracefully if you try and invalid one.

SMF spam blocked by CleanTalk