Define info_panel_y multiple times.

Bug #1166100 reported by Kyran Jackson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Stratagus
Fix Released
Wishlist
Unassigned

Bug Description

In scripts/ui.lua there is a line:

local info_panel_y = 160

I'd like to do something like the following:

if ((Video.Width == 800) and (Video.Height == 480)) then
 local info_panel_y = 160
else
 local info_panel_y = Video.Height - 136 - 24 - 16
end

However, this results in a crash. Is there a way to get this to work?

Kyran Jackson (erstmap)
Changed in stratagus:
importance: Undecided → Wishlist
Revision history for this message
Joris Dauphin (joris-dauphin) wrote :

local and block in lua: http://www.lua.org/pil/4.2.html

You should try (untested).
-- 8< --
local info_panel_y
if ((Video.Width == 800) and (Video.Height == 480)) then
  info_panel_y = 160
else
  info_panel_y = Video.Height - 136 - 24 - 16
end
-- >8 --

Revision history for this message
Kyran Jackson (erstmap) wrote :

Fantastic, that did the trick!

Changed in stratagus:
status: New → Fix Released
Revision history for this message
Travis (dinky-dye-aussie) wrote :

I was thinking about this code you're on about Kyran. Made me wonder if in fact I could make interface for the higher resolutions that are a bit chunkier and fill up a bit more space on screen, so we could have higher resolution interface pieces.

When you think about it, the wargus interface at anything above say, 1280 wide, could do with a bit of beefing up, to support bigger set pieces and bigger buttons ... it would be great to have higher resolution fonts. I have seen that Warwind game on the forums, and all of the interfaces look amazing, and they use a bit higher resolution fonts.

It's something to think about, but if that was the case, would I be able to use the same sort of code you have used here, to make it so the higher resolutions use the higher resolution set pieces?

Revision history for this message
Kyran Jackson (erstmap) wrote :

Yes.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.