Welcome, Guest. Please login or register.
Did you miss your activation email?
November 22, 2024, 08:24:33 AM
Home Help Login Register
News: Zombie Master 2 discussion

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Changing Votemap list assortment
Pages: [1]
Author Topic: Changing Votemap list assortment  (Read 3523 times)
SwftOne
Poster

Posts: 28


« on: November 17, 2010, 06:25:07 PM »

Topic says it all pretty sure the maps the show up in the fretta Votemap menu are random. Is there anyway I can put them in alphabetical order?
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #1 on: November 17, 2010, 06:47:19 PM »

Nope, fretta always randomizes the list, there's no convar for it.
SwftOne
Poster

Posts: 28


« Reply #2 on: November 17, 2010, 07:10:57 PM »

Nope, fretta always randomizes the list, there's no convar for it.


Can I disable the randomize and make it call for a txt file I have  manually typed the maps in? That may be the wrong direction but i know this isn't impossible  :p

Think i found it this is it right?

function PANEL:ChooseMap( gamemode )

self.lblActionName:SetText( "Which Map?" )
self:ResetPeeps()
self.ctrlList:Clear()

local gm = g_PlayableGamemodes[ gamemode ]
if ( !gm ) then MsgN( "GAMEMODE MISSING, COULDN'T VOTE FOR MAP ", gamemode ) return end

for id, mapname in RandomPairs( gm.maps ) do

local lbl = vgui.Create( "DButton", self.ctrlList )
lbl:SetText( mapname )

Derma_Hook( lbl, "Paint", "Paint", "GamemodeButton" )
Derma_Hook( lbl, "ApplySchemeSettings", "Scheme", "GamemodeButton" )
Derma_Hook( lbl, "PerformLayout", "Layout", "GamemodeButton" )

lbl:SetTall( 24 )
lbl:SetWide( 240 )

lbl.WantName = mapname
lbl.NumVotes = 0
lbl.DoClick = function() if GetGlobalFloat( "VoteEndTime", 0 ) - CurTime() <= 0 then return end RunConsoleCommand( "votemap", mapname ) end

self.ctrlList:AddItem( lbl )

end

end
« Last Edit: November 17, 2010, 07:16:05 PM by SwftOne »
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #3 on: November 17, 2010, 08:10:56 PM »

If you're going to mod things, I would suggest just changing where it says "RandomPairs" into "pairs". This will always keep them in the same order, with minimal effort.
SwftOne
Poster

Posts: 28


« Reply #4 on: November 17, 2010, 11:06:40 PM »

awesome ty :p
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Changing Votemap list assortment « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.008 seconds with 17 queries.