Garry's Mod

Garry's Mod

31 ratings
Adding all subscribed addons to a collection
By kootranova1
This guide is for those who need to fully restart Garry's Mod but don't want to lose all their addons.
2
   
Award
Favorite
Favorited
Unfavorite
Adding addons to a collection
1. Make a collection
2. Open a browser that has a developer console
3. On the "Add / Edit Child Items" screen, open the developer console (Ctrl+Shift+I), then open tab "Console"
4. paste the following in the console's text box;
setTimeout(function(){
// Create "Add" button
var btn_add = document.createElement("BUTTON");
var collection_window = document.querySelector('div.collectionAddItemsSection')
collection_window.insertBefore(btn_add,collection_window.firstChild);
btn_add.setAttribute('id','ASCM_addall');
jQuery('button#ASCM_addall').html('+')
btn_add.style.position = 'absolute';
btn_add.style.top = '110px';
btn_add.style.right = '50px';
btn_add.style['border-radius'] = '10px';
btn_add.style.color = 'white';
btn_add.style['font-size'] = '40px';
btn_add.style.background = '#00c417';
btn_add.style.width = '60px';
btn_add.style.height = '60px';
btn_add.style['text-decoration'] = 'none';
// Create "Remove" button
var btn_rem = document.createElement("BUTTON");
var collection_window = document.querySelector('div.collectionAddItemsSection')
collection_window.insertBefore(btn_rem ,collection_window.firstChild);
btn_rem .setAttribute('id','ASCM_removeall');
jQuery('button#ASCM_removeall').html('-')
btn_rem.style.position = 'absolute';
btn_rem.style.top = '110px';
btn_rem.style.right = '120px';
btn_rem.style['border-radius'] = '10px';
btn_rem.style.color = 'white';
btn_rem.style['font-size'] = '40px';
btn_rem.style.background = '#c20000';
btn_rem.style.width = '60px';
btn_rem.style.height = '60px';
btn_rem.style['text-decoration'] = 'none';
// Bind "Add" button
jQuery('button#ASCM_addall').click(function(){
var items = [];
var collection_name = jQuery('div.manageCollectionHeader div.breadcrumbs a').eq(2).text().trim();
var url = new URL(document.location.href);
var collection_id = url.searchParams.get('id');
jQuery('div#MySubscribedItems div.itemChoice:not(.inCollection)').each(function(){
var data = {
id: collection_id,
sessionid: window.g_sessionID,
childid: jQuery(this).attr('id').replace('choice_MySubscribedItems_',''),
activeSection: collection_name
};
addToCollection(data, jQuery(this));
});
});
// Bind "Remove" button
jQuery('button#ASCM_removeall').click(function(){
jQuery('div#MySubscribedItems div.itemChoice.inCollection').each(function(){
window.RemoveChildFromCollection(jQuery(this).attr('id').replace('choice_MySubscribedItems_',''))
});
});
// Function to send a request to add item to a collection
function addToCollection(data, object){
jQuery.ajax({
type: "POST",
url: 'https://steamcommunity.com/sharedfiles/addchild',
data: data,
success: function(response){
if(object && response.success == 1){
object.addClass('inCollection');
}
}
});
}
}, 0);

5. Press the green + Button
6. Click the Directory link to your collection
7. Now just publish your collection.
Credit
All of this was done by Kluvo2 on reddit;
https://www.reddit.com/user/kluvo2/

i have permission to post this.
11 Comments
Joemate The Australasian Figbird Oct 12, 2023 @ 1:43am 
░░█▐▓▓░████▄▄▄█▀▄▓▓▓▌█ Help
░░░░░▄█▌▀▄▓▓▄▄▄▄▀▀▀▄▓▓▓▓▓▌█ Doge
░░░▄█▀▀▄▓█▓▓▓▓▓▓▓▓▓▓▓▓▀░▓▌█ Take
░░█▀▄▓▓▓███▓▓▓███▓▓▓▄░░▄▓▐█▌ Over
░█▌▓▓▓▀▀▓▓▓▓███▓▓▓▓▓▓▓▄▀▓▓▐█ Steam
▐█▐██▐░▄▓▓▓▓▓▀▄░▀▓▓▓▓▓▓▓▓▓▌█▌ Copy
█▌███▓▓▓▓▓▓▓▓▐░░▄▓▓███▓▓▓▄▀▐█ And
█▐█▓▀░░▀▓▓▓▓▓▓▓▓▓██████▓▓▓▓▐█ Paste
▌▓▄▌▀░▀░▐▀█▄▓▓██████████▓▓▓▌█▌
▌▓▓▓▄▄▀▀▓▓▓▀▓▓▓▓▓▓▓▓█▓█▓█▓▓▌█▌DO IT.
█▐▓▓▓▓▓▓▄▄▄▓▓▓▓▓▓█▓█▓█▓█▓▓▓▐
Sir.HolyWalkingBread Apr 12, 2022 @ 8:41pm 
beginers* whaa? i dont get it *veterans* i already know you dont need to say it *between beginers and veterns* thx helpfull guide
ketch10 Apr 12, 2022 @ 5:07am 
my leg is slightly itchy
mono Apr 7, 2022 @ 8:48pm 
@Tmac86 Not Like a solution But Link the Mods in the Desc of the Collection Its will work until we figure out how to fix it.


Also Sorry for being late
Tmac86 Jan 12, 2022 @ 7:15pm 
@-b6-3ntar
I have been researching and trying to fix exactly that for a long time. IF anyone has a solution please let us know, it's very inconvenient and annoying.
twke Jan 12, 2022 @ 4:29pm 
thanks it helped a lot but for some reason the box shows only limited number of assets but not all of them, how do i fix that?
Tmac86 Dec 30, 2021 @ 3:14pm 
I figured it out right click on the Scroll Bar in the window, then click inspect. Next scroll down to the bottom of the code you will see a box and change the second number in the middle. That makes it so the box is a lot bigger so you can read your subscribed items easier. However it does not add more subscribed items to list if they are not all in there. Which is the problem I'm trying to fix.
kootranova1  [author] Dec 30, 2021 @ 2:45am 
@Tmac86
Sorry man, no idea. I don't think i've experienced/noticed that problem. I didn't write the code, so try reaching out to the author for help;
https://www.reddit.com/user/kluvo2/