Any way to edit the ServerBrowser UI?

ChirmayaChirmaya Join Date: 2003-01-07 Member: 11976Members
edited May 2011 in Modding
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.

Comments

  • fsfodfsfod uk Join Date: 2004-04-09 Member: 27810Members, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    The main menu and all its sub menu's are just one monolithic compiled flash file "ns2/ui/main_menu.swf" you would have to decompile it and then have to find something to edit the flash file with
  • ChirmayaChirmaya Join Date: 2003-01-07 Member: 11976Members
    Gah >.< Well, I guess text is enough for now. Thanks!
  • shivshiv Join Date: 2010-04-11 Member: 71341Members, Constellation
    edited May 2011
    Check out this post. Someone made a LUA main menu, you could probably just modify that meet your needs. The LUA version is way better IMO.

    <a href="http://www.unknownworlds.com/ns2/forums/index.php?showtopic=113246" target="_blank">http://www.unknownworlds.com/ns2/forums/in...howtopic=113246</a>
  • fsfodfsfod uk Join Date: 2004-04-09 Member: 27810Members, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    I didn't really want to be so blatant and pimp my own work
    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
  • ChirmayaChirmaya Join Date: 2003-01-07 Member: 11976Members
    edited May 2011
    Oh, sweet! Thank you so much! That super rocks! This is what I got so far.

    <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!
  • vlncvlnc Join Date: 2010-09-07 Member: 73921Members, Squad Five Blue
    nice work

    Hope you'll release a how to soon
  • ChirmayaChirmaya Join Date: 2003-01-07 Member: 11976Members
    <a href="http://www.mts.net/~Chirmaya/ns2-serverbrowser-ip-loc.zip" target="_blank">Download files</a>

    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
  • devicenulldevicenull Join Date: 2003-04-30 Member: 15967Members, NS2 Playtester, Squad Five Blue
    <!--quoteo(post=1846239:date=May 14 2011, 12:11 PM:name=Chirmaya)--><div class='quotetop'>QUOTE (Chirmaya @ May 14 2011, 12:11 PM) <a href="index.php?act=findpost&pid=1846239"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec--><a href="http://www.mts.net/~Chirmaya/ns2-serverbrowser-ip-loc.zip" target="_blank">Download files</a>

    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>
Sign In or Register to comment.