GUI Help

Author Topic: GUI Help  (Read 920 times)

I'm making a GUI that all it does is play music. I made a web browser so I'm familiar with making things
like this, except the coding.



I aready have the functions for playing music, but now I need to know how to make it so that
when I hit the play button, the typed in song will play. I would normally do the command as
highlited, but then again the coding is different.

What are you even asking?

What are you even asking?
Lol, I'm asking how would I make it play the song (which you would have to type in) and hit
the play button so that you can listen to it? I already have the functions for playing music cliently.

Lol, I'm asking how would I make it play the song (which you would have to type in) and hit
the play button so that you can listen to it? I already have the functions for playing music cliently.
Put this into the command. If the textbox name is called mptb.
Code: [Select]
clientcmdplaymusic(mptb.getvalue());

You can also make a list of all the music files available so that you can actually select music from a list with your add-on. On your GUI you can make a GuiScrollCtrl, and inside that GuiScrollCtrl (as a child object), you can add a GuiTextListCtrl and name it something like "mpList", for example.

I think you can build a list of music files and add them to a list like this, correct me if I made a mistake -

Code: [Select]
function buildMusicTracks()
{
for(%m = findFirstFile("Add-Ons/Music/*.ogg"); %m !$= ""; %m = findNextFile("Add-Ons/Music/*.ogg"))
{
%musicFile = strReplace(fileName(%m), ".ogg", ""); //take out the OGG extension
                %musicFinal = strReplace(%musicFile, "_", " "); //take out any underscores
                mpList.addRow(1, %musicFinal);
   
}
}

You do know that The Black Parrot made a client side add-on that lists your music and the server's music in a GUI and allows you to play/stop the music, right? Unless this is just to learn GUI stuff or for personal use, it is unfortunately obsolete.