8000 [WIP] UI scale by TheCycoONE · Pull Request #3159 · CorsixTH/CorsixTH · GitHub
[go: up one dir, main page]

Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
a4ba86a
Allow specifying a UI scale factor
TheCycoONE Dec 3, 2025
041fbde
Keep fonts crisp with UI scaling
TheCycoONE Dec 3, 2025
237d67b
Add settings window for setting the scale
TheCycoONE Dec 3, 2025
b2c8258
Fix the cursor position when not drawn
TheCycoONE Dec 3, 2025
7f2a1b4
Revert scaling full UI in favour of targetting scaling.
TheCycoONE Dec 4, 2025
f3e6089
Add scale factor to fonts
TheCycoONE Dec 5, 2025
0b039cb
Reset option menu to apply scale change
TheCycoONE Dec 5, 2025
c2eaac3
Apply font scale to confirm dialog
TheCycoONE Dec 5, 2025
c7102d1
UI scaling for tip of the day
TheCycoONE Dec 6, 2025
3da9193
Progress towards bottom panel scaling
TheCycoONE Dec 6, 2025
321a077
Add option to draw scaled sprites
TheCycoONE Dec 6, 2025
92545c1
More bottom panel scaling
TheCycoONE Dec 7, 2025
4a4ead8
scale the information window
TheCycoONE Dec 7, 2025
6fa82e3
scale the jukebox
TheCycoONE Dec 7, 2025
24a5a2b
Use new draw sprites API for map editor
TheCycoONE Dec 9, 2025
2774bcd
Scale pixel coordinates for panels,buttons,windows
TheCycoONE Dec 9, 2025
272e9ec
Fix dragging
TheCycoONE Dec 9, 2025
4e57843
Window positions also use scale coordinates
TheCycoONE Dec 9, 2025
078eb5e
Fix confirm dialog
TheCycoONE Dec 10, 2025
7abf0fb
Fix information dialog
TheCycoONE Dec 10, 2025
e84df68
Fix bottom panel
TheCycoONE Dec 10, 2025
908288c
scale watch and fix information
TheCycoONE Dec 10, 2025
49a2c34
Start of save game compatibility
TheCycoONE Dec 10, 2025
c83212a
Draw tooltips correctly for scale
TheCycoONE Dec 11, 2025
3a9cf23
Add scaling for file/directory dialogs
TheCycoONE Dec 11, 2025
cf933c4
tooltip load fix
TheCycoONE Dec 11, 2025
7ede97b
Patient dialog
TheCycoONE Dec 11, 2025
c4d4968
Scale top menu
TheCycoONE Dec 12, 2025
7752a1d
Fix jukebox scale
TheCycoONE Dec 12, 2025
73e3380
Add broken drag handling from new_ 8000 game
TheCycoONE Dec 12, 2025
99df568
ui scalling for scrollbars and menu list dialogs
TheCycoONE Dec 12, 2025
866ec61
information fix, do not shadow s
TheCycoONE Dec 13, 2025
a560dee
build_room dialog scale
TheCycoONE Dec 13, 2025
81e938a
scale edit room and place objects
TheCycoONE Dec 13, 2025
b05fddb
scale advisor
TheCycoONE Dec 13, 2025
494b2f1
Add ui_scale to busted mock
TheCycoONE Dec 13, 2025
35721bb
Fix bottom panel hit test
TheCycoONE Dec 13, 2025
3311fad
Fix windows config template for ui_scale
TheCycoONE Dec 13, 2025
c909a0f
some comments for parameter changes
TheCycoONE Dec 14, 2025
5d760c1
scale staff profile page
TheCycoONE Dec 15, 2025
8070b2b
Add scale to staff dialog
TheCycoONE Dec 15, 2025
fe602d2
Use DrawFlags instead of support for flag names in binding
TheCycoONE Dec 16, 2025
904c282
update handling for scaled dialogs
TheCycoONE Dec 16, 2025
37cc5c0
Fix missing variable for afterLoad place_objects
TheCycoONE Dec 16, 2025
85c067a
ui_scale town map
TheCycoONE Dec 17, 2025
5c401cf
ui_scale fax
TheCycoONE Dec 17, 2025
db08e42
ui_scale annual reports
TheCycoONE Dec 17, 2025
e6cbcd5
ui_scale bank_manager
TheCycoONE Dec 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Allow specifying a UI scale factor
Currently this is quite blurry, and the pick hospital screen is broken.
  • Loading branch information
TheCycoONE committed Dec 7, 2025
commit a4ba86aeef7729775f1bfec697fef69139f1af10
7 changes: 6 additions & 1 deletion CorsixTH/Lua/config_finder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ local config_defaults = {
fullscreen = false,
width = 800,
height = 600,
ui_scale = 1,
language = [[English]],
audio = true,
free_build_mode = false,
Expand Down Expand Up @@ -206,11 +207,15 @@ local string_01 = [=[
-- Screen size. Must be at least 640x480. Larger sizes will require better
-- hardware in order to maintain a playable framerate. The fullscreen setting
-- can be true or false, and the game will run windowed if not fullscreen.
-- ui_scale can be set to 1, 2, or 3 to scale the user interface for higher
-- resolution displays. For example, at 1920x1080 resolution, setting ui_scale
-- to 2 will make the interface elements twice as large.
--]=] .. '\n' ..
'fullscreen = ' .. tostring(config_values.fullscreen) .. '\n' ..
'\n' ..
'width = ' .. tostring(config_values.width) .. '\n' ..
'height = ' .. tostring(config_values.height) .. '\n' .. [=[
'height = ' .. tostring(config_values.height) .. '\n' ..
'ui_scale = ' .. tostring(config_values.ui_scale) .. '\n' .. [=[

-------------------------------------------------------------------------------
-- Language to use for ingame text. Between the square braces should be one of:
Expand Down
2 changes: 2 additions & 0 deletions CorsixTH/Lua/game_ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,13 @@ function GameUI:draw(canvas)
self:setZoom(1)
app.map:draw(canvas, dx, dy, config.width, config.height, 0, 0)
end
canvas:scale(TheApp.config.ui_scale)
Window.draw(self, canvas, 0, 0) -- NB: not calling UI.draw on purpose
self:drawTooltip(canvas)
if self.simulated_cursor then
self.simulated_cursor.draw(canvas, self.cursor_x, self.cursor_y)
end
canvas:scale(1)
end

function GameUI:onChangeResolution()
Expand Down
2 changes: 2 additions & 0 deletions CorsixTH/Lua/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,13 @@ function UI:draw(canvas)
self.background:draw(canvas, math.floor((screen_w - bg_w) / 2), math.floor((screen_h - bg_h) / 2))
end
end
canvas:scale(TheApp.config.ui_scale)
Window.draw(self, canvas, 0, 0)
self:drawTooltip(canvas)
if self.simulated_cursor then
self.simulated_cursor.draw(canvas, self.cursor_x, self.cursor_y)
end
canvas:scale(1)
end

--! Register a key handler / hotkey for a window.
Expand Down
3 changes: 3 additions & 0 deletions CorsixTH/Lua/window.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ function Window:setPosition(x, y)
self.y_original = y
-- Convert x and y to absolute pixel positions with regard to top/left
local w, h = TheApp.config.width, TheApp.config.height
local scale = TheApp.config.ui_scale
w = w / scale
h = h / scale
if x < 0 then
x = math.ceil(w - self.width + x)
elseif x < 1 then
Expand Down
0