meltedgun 0 Posted January 31, 2019 Dear XVM Community, Here is a small tweak to the carousel code in XVM that allows sorting of the carousel by battles played (battlecount). Would it be worth adding this as an XVM capability? Nothing is lost and the code is right here. Thanks, MG _________________________________________________________________________________________________ This mod allows the addition of “battlesCount” to sort criteria: \World_of_Tanks\res_mods\mods\xfw_packages\xvm_tankcarousel\python\tankcarousel.py In the section: if sort_criterion in ['winRate', 'markOfMastery']: (down to just before elif statement) Make this change if sort_criterion in ['winRate', 'markOfMastery', 'battlesCount']: itemsCache = dependency.instance(IItemsCache) vehicles_stats = itemsCache.items.getAccountDossier().getRandomStats().getVehicles() # battlesCount, wins, markOfMastery, xp stats = vehicles_stats.get(vehicle.intCD) comparisonKey.append(factor if stats else 0) if stats: if sort_criterion == 'winRate': comparisonKey.append(float(stats.wins) / stats.battlesCount * factor) elif sort_criterion == 'markOfMastery': comparisonKey.append(stats.markOfMastery * factor) elif sort_criterion == 'battlesCount': comparisonKey.append(stats.battlesCount * factor) This mod sorts the carousel by winrate or battles played D:\World_of_Tanks\res_mods\configs\xvm\Aslain\carousel.xc Set the sort order from: "sorting_criteria": ["nation", "type", "level"], To one of the following: Games played low to high "sorting_criteria": ["battlesCount", "level"], Games played high to low "sorting_criteria": ["-battlesCount", "level"], Winrate High to Low "sorting_criteria": ["-winRate"], Winrate Low to High "sorting_criteria": ["winRate"], Quote Share this post Link to post Short link Share on other sites
night_dragon_on 5,601 #449237 Posted January 31, 2019 Added. Quote Share this post Link to post Short link Share on other sites
meltedgun 0 #449269 Posted January 31, 2019 5 hours ago, night_dragon_on said: Added. Thank you very much! MG Quote Share this post Link to post Short link Share on other sites