Skip to content

Prevent overwriting UI scale property for high DPI displays if alread…#174

Merged
flemming-n-larsen merged 1 commit intorobocode-dev:mainfrom
martinezpenya:master
Oct 20, 2025
Merged

Prevent overwriting UI scale property for high DPI displays if alread…#174
flemming-n-larsen merged 1 commit intorobocode-dev:mainfrom
martinezpenya:master

Conversation

@martinezpenya
Copy link
Contributor

…y set (via command line)

It's a suggestion, I think this don't interfere with your desired way of doing things.
So, I can continue calling my script to launch the robocode jar in my laptop or my desktop:

# Script para lanzar Robocode con diferente escala según el dispositivo

echo "¿Dónde estás ejecutando el programa?"
echo "1) Portátil"
echo "2) Fijo"
echo -n "Selecciona una opción (1 o 2): "

read opcion

case $opcion in
    1)
        echo "Configurando para portátil (uiScale=2)..."
        java -Dsun.java2d.uiScale=2 -jar robocode-tankroyale-gui-0.34.0.jar
        ;;
    2)
        echo "Configurando para equipo fijo (uiScale=1)..."
        java -Dsun.java2d.uiScale=1 -jar robocode-tankroyale-gui-0.34.0.jar
        ;;
    *)
        echo "Opción no válida. Saliendo."
        exit 1
        ;;
esac
``

Copy link
Contributor

@flemming-n-larsen flemming-n-larsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a really good idea! 😊
Sorry I did not think of that. 😞
Actually, I will use this in other situations with other (graphical) properties, so it is always possible to override the properties from the command line. 👍

@flemming-n-larsen flemming-n-larsen merged commit 629b0ec into robocode-dev:main Oct 20, 2025
@martinezpenya
Copy link
Contributor Author

Yes, please, you could do the same with the look and feel.

@flemming-n-larsen
Copy link
Contributor

Yes, please, you could do the same with the look and feel.

✅ Done 😉

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants