Garry's Mod

Garry's Mod

40 ratings
Добавление всех подписок в коллекцию
By Get-6aget
Данный способ поможет вам добавить до 1000 подписок в коллекцию сразу! (Тестировалось на Edge, всё работает как надо)
   
Award
Favorite
Favorited
Unfavorite
Инструкция
1. Преступите создавать новую коллекцию.

2. Сохраните название и детали коллекции.

3. На экране «Добавить / изменить связанные предметы» откройте консоль разработчика (Ctrl + Shift + I), затем откройте вкладку «Console».

** 4. Вставьте следующий скрипт в консоль и нажмите Enter:

ВАЖНО! В строке url убрать пробелы с ссылки


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: 'ht tps:// steamcommunity. com/sharedfiles/addchild',
data: data,
success: function(response){
if(object && response.success == 1){
object.addClass('inCollection');
}
}
});
}
}, 0);



5. Это создаст 2 новые кнопки над таблицей с элементами подписки. Нажмите зеленую кнопку, чтобы добавить все подписанные элементы в эту коллекцию, и красную кнопку, чтобы удалить все подписанные элементы из этой коллекции.

6. После нажатия зеленой кнопки откройте вкладку «Network» в консоли разработчика и дождитесь, пока последний запрос не получит ответ «200».

7. Обновите страницу, ваша коллекция будет обновлена!


Чтобы увидеть, как это выглядит на странице, смотрите скриншот: imgur. com/ a/w8qZ3VM


Идея и реализация не моя, взято отсюда: reddit. com/r/CitiesSkylines/comments/8hrdsd /add_all_subscribed_items_to_steam_collections_at/

12 Comments
Foorgone 14 Jun, 2023 @ 9:18am 
а как друга в создатели коллекции добавить
M8estro 3 May, 2022 @ 8:45am 
Спасибо огромное:slimehappy:
🌸Дед Хаггис ® ⁴² 30 Aug, 2021 @ 1:00am 
:steamthumbsdown:
🌸Дед Хаггис ® ⁴² 30 Aug, 2021 @ 12:59am 
Не работает
Wolf Koirt 23 Jun, 2021 @ 11:52am 
Кнопка "-" работает, "+" нет
vl 15 Mar, 2021 @ 10:20am 
поттомучто будет пожар
Get-6aget  [author] 14 Mar, 2021 @ 7:43am 
Ладно
Leg1oner 14 Mar, 2021 @ 7:37am 
как сломать пк за 10 сек
Get-6aget  [author] 14 Mar, 2021 @ 7:04am 
Почему?
vl 14 Mar, 2021 @ 6:30am 
как сломать пк за 10 сек