Any way to edit the ServerBrowser UI?
Hello there,
I was just messing around with editing the Server Browser to include the servers' country, and I got it to work fine by editing the server name.
<a href="http://i185.photobucket.com/albums/x101/Chirmaya/ns2_ip_loc.jpg" target="_blank"><img src="http://i185.photobucket.com/albums/x101/Chirmaya/th_ns2_ip_loc.jpg" border="0" class="linked-image" /></a>
Since I want to make little country flags appear, I was trying to find out where all of the images, borders, etc. are setup for the UI, but I have had no luck finding it. Does anyone know if that is hard-coded or is located somewhere else?
Any help would be appreciated.
I was just messing around with editing the Server Browser to include the servers' country, and I got it to work fine by editing the server name.
<a href="http://i185.photobucket.com/albums/x101/Chirmaya/ns2_ip_loc.jpg" target="_blank"><img src="http://i185.photobucket.com/albums/x101/Chirmaya/th_ns2_ip_loc.jpg" border="0" class="linked-image" /></a>
Since I want to make little country flags appear, I was trying to find out where all of the images, borders, etc. are setup for the UI, but I have had no luck finding it. Does anyone know if that is hard-coded or is located somewhere else?
Any help would be appreciated.
Comments
<a href="http://www.unknownworlds.com/ns2/forums/index.php?showtopic=113246" target="_blank">http://www.unknownworlds.com/ns2/forums/in...howtopic=113246</a>
but the places you want to edit are GetServerRecord just do your ip to flag conversion here and and stick the result in the table
you would create your image frame for the flag in ServerListEntry:__init() you could just use password frame for the flag
ServerListEntry:SetData(serverData) This is where you would set the texture for the flag. serverData is the table returned from GetServerRecord for a specific server
<a href="http://i185.photobucket.com/albums/x101/Chirmaya/ns2_ip_loc2.jpg" target="_blank"><img src="http://i185.photobucket.com/albums/x101/Chirmaya/th_ns2_ip_loc2.jpg" border="0" class="linked-image" /></a>
Now I just need to make it so that the flag doesn't cover the locked icons ^_^
EDIT:
Here we go! Woohoo!
<a href="http://i185.photobucket.com/albums/x101/Chirmaya/ns2_ip_loc3.jpg" target="_blank"><img src="http://i185.photobucket.com/albums/x101/Chirmaya/th_ns2_ip_loc3.jpg" border="0" class="linked-image" /></a>
I guess that the final thing is to figure out how to do a tool-tip for a mouse-hover over the flag that will display the country name. Time to think!
Hope you'll release a how to soon
Here are the changes that I made so far. Just look for the <i>//------------------</i> lines to see where I added things.
There may also be a faster way to do the <i>ip-to-country-2010-12-14.lua</i>, but I couldn't think of it. I only know a bit of Lua, so my code is quite ugly =P
Here are the changes that I made so far. Just look for the <i>//------------------</i> lines to see where I added things.
There may also be a faster way to do the <i>ip-to-country-2010-12-14.lua</i>, but I couldn't think of it. I only know a bit of Lua, so my code is quite ugly =P<!--QuoteEnd--></div><!--QuoteEEnd-->
This may help: <a href="https://github.com/agladysh/lua-geoip" target="_blank">https://github.com/agladysh/lua-geoip</a>