Adding thumnails to GLMVS mapvote (or other mapvote addons)?
12 replies, posted
I'm using this mapvote addon: [url=https://facepunch.com/showthread.php?t=1289931]GLMVS[/url]. Which works great, except for the [thumbnails:
[img]http://i.imgur.com/7tbi4pr.png[/img]
I've seen no mention of them in the addmaps.lua or maplibrary.lua
How would I go about adding some thumbnails? Or, if there's a different mapvote addon that you're more familiar with, feel free to suggest it (and how I'd add thumbnails, if possible).
From my understanding, you just need to have a .png of the image you want to use named the same as the map, and put it in the maps directory.
[QUOTE=Nookyava;48880508]From my understanding, you just need to have a .png of the image you want to use named the same as the map, and put it in the maps directory.[/QUOTE]
Okay, going to try out:
ttt_lttp_kakariko_a4.png in /garrysmod/maps
[editline]11th October 2015[/editline]
Didn't work.
:snip: nevermind
Bumb-erino.
It tries to search for the map images on the clients computer, but if they exist on the server it will include them and make the client download them upon joining it
[CODE]
for _, info in ipairs( MapList ) do
if file.Exists( "maps/" ..info.Map.. ".png", "MOD" ) then
resource.AddFile( "maps/" ..info.Map.. ".png" )
end
end
[/CODE]
This code forces the player to download the image from the server, located in the maps folder like so: "maps/MAPNAME.png"
Of course the images would have to be valid in FastDL as well otherwise your users won't be able to download them properly
It searches for the image the following places in the users Garry's Mod installation
download/maps/MAPNAME.png
maps/MAPNAME.png
Typically if FastDL is set up correctly the image will be downloaded to
download/maps/MAPNAME.png
If you do not have FastDL and would just like the images to appear for yourself you can test this by putting the image both in the maps folder on your server, with the same name as the map and as a .png, and the same on your client
[QUOTE=Flamingsword;48902898]It tries to search for the map images on the clients computer, but if they exist on the server it will include them and make the client download them upon joining it
[CODE]
for _, info in ipairs( MapList ) do
if file.Exists( "maps/" ..info.Map.. ".png", "MOD" ) then
resource.AddFile( "maps/" ..info.Map.. ".png" )
end
end
[/CODE]
This code forces the player to download the image from the server, located in the maps folder like so: "maps/MAPNAME.png"
Of course the images would have to be valid in FastDL as well otherwise your users won't be able to download them properly
It searches for the image the following places in the users Garry's Mod installation
download/maps/MAPNAME.png
maps/MAPNAME.png
Typically if FastDL is set up correctly the image will be downloaded to
download/maps/MAPNAME.png
If you do not have FastDL and would just like the images to appear for yourself you can test this by putting the image both in the maps folder on your server, with the same name as the map and as a .png, and the same on your client[/QUOTE]
Where is this code located? Or, if it's not already in GLMVS, which file do I add it to?
[QUOTE=paladynne;48903291]Where is this code located? Or, if it's not already in GLMVS, which file do I add it to?[/QUOTE]
It's a serverside file.
[QUOTE=Nookyava;48903323]It's a serverside file.[/QUOTE]
lol, which one. I've been digging through them.
[QUOTE=paladynne;48903378]lol, which one. I've been digging through them.[/QUOTE]
Meaning it's serverside code... You need to place it yourself obviously, because the images have NOT been downloading.
[QUOTE=Nookyava;48903385]Meaning it's serverside code... You need to place it yourself obviously, because the images have NOT been downloading.[/QUOTE]
B-but, where do I place the code QQ
[QUOTE=paladynne;48903477]B-but, where do I place the code QQ[/QUOTE]
You were already spoonfed some code, do some work and figure out where serverside could possibly go.
GLMVS already contains the code [URL="https://github.com/ptown2/GLMVS/blob/cacabcac7735622c89a12e0bbca0abf03ddc7d10/lua/modules/glmvs/sv_load.lua#L18"]here[/URL] for the serverside code and [URL="https://github.com/ptown2/GLMVS/blob/cacabcac7735622c89a12e0bbca0abf03ddc7d10/lua/modules/util/cl_init.lua#L26"]here[/URL] for the clientside code, the map image is written to a table [URL="https://github.com/ptown2/GLMVS/blob/cacabcac7735622c89a12e0bbca0abf03ddc7d10/lua/modules/glmvs/shared.lua#L60"]here[/URL] then the table is written to the authors function for setting the map data [URL="https://github.com/ptown2/GLMVS/blob/cacabcac7735622c89a12e0bbca0abf03ddc7d10/lua/vgui/pack_default/panel_default.lua#L42"]here[/URL] and [URL="https://github.com/ptown2/GLMVS/blob/cacabcac7735622c89a12e0bbca0abf03ddc7d10/lua/vgui/derma_mapbutton.lua#L77"]here[/URL] is the actual function
Provided you have the latest version of the addon everything should already work provided you have set up FastDL, etc correctly, there are tons of tutorials on this and I suggest you read up on how FastDL works before asking anymore questions
And to search for functions and code etc, Github is really useful
Sorry, you need to Log In to post a reply to this thread.