Truffle Posted June 19, 2005 Share Posted June 19, 2005 Okay first let me explain what the purpose of this program is and how it works.First of all it is a "database", if you will, of levels created by various authors for an old FPS game called Outlaws. When I release it it will come with an INI file with a list of maps. It will contain the levels name, filesize, author, etc as pictured above. The user can click on the Check for Updates button and it phones home to my webserver and downloads an updated INI file and adds to the list. That all works fine and dandy, but I would like that Search function to work because (as of right now there are 48 maps in the list) when it starts getting into the 100s and more it will be very hard to find the level you are looking for.I do however have the sort columns thing going, so its better than nothing, but a search would be really cool!And another thing is how do I check for which item is clicked on? Say they click on Map No. 6. Which is The Alamo. My idea is for them to click on Map Info and it brings up a summary of the level. (written in the ini file and corresponds to the map number) Then when they click download and it pulls the correct zip file from the webserver.Here is a sample of the INI file to give you better idea how it works[version]numMaps=48[zips]1=demoranch.zip2=spacewar.zip3=oltown.zip4=olcity.zip[filesize]1=14KB2=1.4MB3=53KB4=40KB[mapnames]1=Demolition Ranch2=Space War3=OL Town4=OL City[author]1=Truffle2=Molycoat3=Truffle4=Truffle[screenshots]1=demoranch.jpg2=spacewar.jpg3=oltown.jpg4=olcity.jpg[mapinfo]1=Small DM arena map designed for Sanchez/Dynamite matches only2=Transforms OL into a sci-fi space shooter!3=First map created by Truffle. A sanc mod featuring the "Cuncussion Rifle"4=Another map in the "OL" series also containing the Cuncussion Rifle Link to comment Share on other sites More sharing options...
HardCopy Posted June 20, 2005 Share Posted June 20, 2005 And another thing is how do I check for which item is clicked on? Say they click on Map No. 6. Which is The Alamo. My idea is for them to click on Map Info and it brings up a summary of the level. (written in the ini file and corresponds to the map number) Then when they click download and it pulls the correct zip file from the webserver.Nice Clean Gui btw...Reference the above question: this should answer that part.case $msg = $Listview $filename= $myarray[_GUICtrlListViewGetCurSel($listview)+1] ;;;;- dont know if u will need the +1 bit in your array. try with and without it.this returns the index# of the currently selected item in your listview.....hopefully if you have stored these listview items in parallel to an array u can extract the filename stored in it.hth HardCopy Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad Link to comment Share on other sites More sharing options...
Truffle Posted June 20, 2005 Author Share Posted June 20, 2005 No Im not using an array. But the GetSurSel does do the job, just differently than the way you used it. case $msg = $btnInfo $a = _GUICtrlListViewGetCurSel($lstMaps)+1 $selMapName = IniRead($mainDir&"\maplist.ini","mapnames",$a,"Error") $selZip = IniRead($mainDir&"\maplist.ini","zips",$a,"Error") $selSize = IniRead($mainDir&"\maplist.ini","filesize",$a,"Error") $selAuthor = IniRead($mainDir&"\maplist.ini","author",$a,"Error") $selScreen = IniRead($mainDir&"\maplist.ini","screenshots",$a,"Error") $selInfo = IniRead($mainDir&"\maplist.ini","mapinfo",$a,"Error") MsgBox(0,"",$selMapName&" "&$selZip&" "&$selSize&" "&$selAuthor&" "&$selScreen&" "&$selInfo)Works great. Thanks for pointing me in the right direction. Now I just gotta read up on child windows so I can put all that information in a new window instead of that message box. Link to comment Share on other sites More sharing options...
buzz44 Posted June 20, 2005 Share Posted June 20, 2005 (edited) For the search function you will want to use something like... For $I = 0 To _GUICtrlListViewGetItemCount(listview) - 1 $Search = _GUICtrlListViewGetItemText($listview, $I, 1) If $Search = "What you want to search for" Then ; Do something EndIf Next Will search the map column (1) of each list view item to check if thats what you wanted to search for. To change if you want to search for, map, author, filename etc. Change the "1" to the appropriate number, remembers its zero based. All that should work... in theory . Edited June 20, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now