Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mainmenu_play.vts_c] Map Images are not correctly aligned to show the entire image. #3919

Open
DeformedSAS opened this issue Nov 26, 2024 · 1 comment

Comments

@DeformedSAS
Copy link

Panorama issues

Images in the play menu for all maps are way too zoomed in, however there is a simple fix for that. On line 1207 instead of ""mapImage.style.backgroundSize = 'clip_then_cover';"" it should be ""mapImage.style.backgroundSize = 'auto 100%';""

Image

image

The fix i implemented in my CS2 panorama ui port on csgo (nothing to do with this issue!)

image

@DeformedSAS
Copy link
Author

DeformedSAS commented Dec 2, 2024

actually i was wrong that was not the full fix...
this is the actual full fix

function UpdateIconsAndScreenshots(p, numTiles, mapGroupName, mg) {
const keysList = Object.keys(mg.maps);
const iconSize = 200;
const iconPath = mapGroupName === 'random_classic' ? 'file://{images}/icons/ui/random_map.svg' : 'file://{images}/' + mg.icon_image_path + '.svg';
let mapGroupIcon = p.FindChildInLayoutFile('MapSelectionButton').FindChildInLayoutFile('MapGroupCollectionIcon');
if (keysList.length < 2) {
if (mapGroupIcon) {
mapGroupIcon.SetImage(iconPath);
}
else {
mapGroupIcon = $.CreatePanel('Image', p.FindChildInLayoutFile('MapSelectionButton'), 'MapGroupCollectionIcon', {
defaultsrc: 'file://{images}/icons/ui/random_map.svg',
texturewidth: iconSize,
textureheight: iconSize,
src: iconPath,
class: 'map-selection-btn__map-icon'
});
p.FindChildInLayoutFile('MapSelectionButton').MoveChildBefore(mapGroupIcon, p.FindChildInLayoutFile('MapGroupCollectionMultiIcons'));
}
}
let mapImage = null;
let mapIcon = null;
if (mapGroupName === 'random_classic') {
mapImage = p.FindChildInLayoutFile('MapGroupImagesCarousel').FindChildInLayoutFile('MapSelectionScreenshot');
if (!mapImage) {
mapImage = $.CreatePanel('Panel', p.FindChildInLayoutFile('MapGroupImagesCarousel'), 'MapSelectionScreenshot');
mapImage.AddClass('map-selection-btn__screenshot');
}
mapImage.style.backgroundImage = 'url("file://{images}/map_icons/screenshots/360p/random.png")';
mapImage.style.backgroundPosition = '50% 0%';
mapImage.style.backgroundSize = 'auto 100%';
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants