Text Parser Multiple search question.

Started by jamesreg, Sun 13/05/2018 07:16:16

Previous topic - Next topic

jamesreg

I am working on a sci-fi game and am using the text parser to add a computer database to the game.
So far this is the way it works. I have it set up if you search a name like say John Smith you can type john, or smith or john Smith etc.
It will pop up a picture and profile of that character the way I want. But say I have a John Williams also and the player typed in John.
Is there anyway to have it show a list of multiple entries matching "John" Then allow you to select which one you want.?
If I could make this work it would add a whole new level to what I am doing.

dayowlron

You would have to use a listbox or a custom gui. if you want more than the name to show up you would need the custom gui.
Pro is the opposite of Con                       Kids of today are so much different
This fact can clearly be seen,                  Don't you know?
If progress means to move forward         Just ask them where they are from
Then what does congress mean?             And they tell you where you can go.  --Nipsey Russell

jamesreg

#2
That was to easy lol. Thanks

I figured out how to get it to list multiple entries but how would I go about getting it to now take a selected entry in the listbox and add that text to the text parser box.

dayowlron

Ideally you would use a List box event to do it, however I don't know if controls have events.
probably in the on_mouse_click function you would set the textbox's text property to be the selected items text is from the listbox.
Not sure how to check if it is the listbox that was clicked on since I have not worked with them much.
Code: ags

if (lstListBox.clicked on)????
    txtTextBox.Text =  lstListBox.Items[lstListBox.SelectedIndex];
Pro is the opposite of Con                       Kids of today are so much different
This fact can clearly be seen,                  Don't you know?
If progress means to move forward         Just ask them where they are from
Then what does congress mean?             And they tell you where you can go.  --Nipsey Russell

SMF spam blocked by CleanTalk