This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Zecradox's profile picture

How can I make every program that supports any screen resolution work on my OS without changing the code?

Started by Zecradox, 31 March 2018 - 02:10 PM
Zecradox #1
Posted 31 March 2018 - 04:10 PM
There's a bar at the top with the time and close etc, which I don't want the program to draw under/over. I want it to think that the height of the screen is smaller by 1.
InDieTasten #2
Posted 31 March 2018 - 04:20 PM
You can override the term api for the environment the programs are running in. in there you can override behavior to adjust the getSize() height to be decremented by 1, setCursorPos to always go one line below.

Though you maybe want to be able to launch programs in full screen mode as well (which you could call compatibility mode), as there are many programs, that don't support multiple resolutions, and it is pretty much impossible for you to know, whether some anonymous program is supporting some resolution or not.
SquidDev #3
Posted 31 March 2018 - 04:34 PM
It's probably worth having a look at how CraftOS implements this using the multi-shell API. It creates a window which starts at the second line (see launchProcess) and redirects to that.
Bomb Bloke #4
Posted 01 April 2018 - 03:52 AM
Indeed, one should use term.redirect() instead of attempting to override term API functions.

That's the easy bit. The tricky bit is getting your OS's taskbar to actually "do stuff" while the user script is running - you'll need to put some research into coroutines for that to happen.