Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Button States


Recommended Posts

Hey all, I wanted to add a new button to the frmMenu that makes the picMain visible again (so people can read the news if they already clicked login without exiting and relaunching the client.)

I added it to the index imgButton(5) and added the code on click to the array so it knows what to hide and show.

Problem is I can't find the code to tell it which images to load, like I want it to load btnMain_normal, btnMain_hover and btnMain_click.

Speedy assistance would be appreciated, this feels like a really dumb and small problem to get stuck on.

Cheers-
K
Link to post
Share on other sites
Truthfully, I'd make a new form or something with the news and call that when the button is pushed, but regarding the question, I think you have the forms mixed up, frmMenu is the login and frmMain is the game. Did you pull up the frmMenu and click the buttons and look at their numbers then add those to your code? I'd also, personally, make it so it logged the player out so that they didn't get killed while reading the news. But just a frmMenu.Show() should work.
Link to post
Share on other sites
@'Mohenjo:

> Truthfully, I'd make a new form or something with the news and call that when the button is pushed, but regarding the question, I think you have the forms mixed up, frmMenu is the login and frmMain is the game. Did you pull up the frmMenu and click the buttons and look at their numbers then add those to your code? I'd also, personally, make it so it logged the player out so that they didn't get killed while reading the news. But just a frmMenu.Show() should work.

No, you misunderstood/misread my post.

frmMain has nothing to do with this- I am working solely on frmMenu.

The player doesn't even log in to the game at the point the news is shown in picMain and lblNews on frmMenu.
Link to post
Share on other sites
Oh, I completely misunderstood that, I'm sorry. I did do this on an engine I worked on, not sure I saved it though. So double click on the login button,or find this "If Not picLogin.Visible Then" and add and Else then change all those to false (except make picMain.Visible = True) and do that for each case. Hopefully this helps and makes sense.
Link to post
Share on other sites
@'Mohenjo:

> Oh, I completely misunderstood that, I'm sorry. I did do this on an engine I worked on, not sure I saved it though. So double click on the login button,or find this "If Not picLogin.Visible Then" and add and Else then change all those to false (except make picMain.Visible = True) and do that for each case. Hopefully this helps and makes sense.

Yep, I've done that already.

My request was for the location of the code that directs the imgButton to change to the picture on event.
Link to post
Share on other sites
Oh, I'm sorry, I'm really slow at this XD my code just made clicking the button again hide the stuff and show the main. Sorry for not understanding.

Change MAX_MENUBUTTONS As Long = 4 to 5
Change the index of your button to 5
Give it an image here:
```
' menu - exit

   With MenuButton(4)
       .fileName = "exit"
       .state = 0 ' normal
   End With
```And change it to 5 and name it

Then just find where it's originally rendered, it shouldn't be too hard, just find the load gui sub. Hopefully this actually helps
Link to post
Share on other sites
@'Mohenjo:

> Oh, I'm sorry, I'm really slow at this XD my code just made clicking the button again hide the stuff and show the main. Sorry for not understanding.
>
> Change MAX_MENUBUTTONS As Long = 4 to 5
> Change the index of your button to 5
> Give it an image here:
> ```
> ' menu - exit
>
>    With MenuButton(4)
>        .fileName = "exit"
>        .state = 0 ' normal
>    End With
> ```And change it to 5 and name it
>
> Then just find where it's originally rendered, it shouldn't be too hard, just find the load gui sub. Hopefully this actually helps

You still didn't tell me WHERE the code to change is.
I could've figured out the code itself on my own, lol.

WHERE is the code?
Link to post
Share on other sites
@'Mohenjo:

> Ever heard of Ctrl + F ? Search for it with VB6

… You seriously think I didn't try that? I've used over 20 different search terms, omfg, I tried to keep my last one short so you wouldn't misunderstand and you just come back with that smart-arsery.
Link to post
Share on other sites
Alright, first off, open the client.vbp with VB6\. Next, copy and paste a button that's already there, then go to the properties, index and type 5, next you need to find```
MAX_MENUBUTTONS As Long = 4
```and change the 4 to a 5 (This is in ModConstants).
Next, find ```
' menu - exit

  With MenuButton(4)
      .fileName = "exit"
      .state = 0 ' normal
  End With
```in modGeneral cacheButtons and change the "exit" into "news" or something.
After this, go into the data folder and find graphics\gui and make a copy of the 3 exit buttons and change the exit with news in the file name and in the picture.
And, if you're lazy like me, find Private Sub Form_Load() in the frmMenu and add a render for the new button, otherwise, find the other buttons and add it there. I don't remember where they are.

Hopefully this helped?
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...