GCI2012: Improve Game Configuration Widget
- Refactored mapmodel+datamanager to have two separate map models for static and mission maps, and then three static MapInfos in MapModel for the three special maps (random, maze, drawn).
- Created theme selector dialog.
- Created seed view/edit dialog.
- Enlarged start icon on pagemultiplayer and pagenetgame, and added Start.png.
- Moved "Settings" button on pagemultiplayer and pagenetgame from middle of page to page footer.
- Added "load drawing" button to mapcontainer widget.
- Map preview is no longer the randomize button; The randomize functionality is now in a button of its own.
- Map preview no longer grays out (isn't disabled) when in slave mode.
- Seed is now viewable and copyable when in slave mode -- but not editable.
- You should now use the property master (isMaster() and setMaster()) on gamecfgwidget and mapcontainer instead of the enabled property. This is because some widgets (e.g. "view/edit seed" button and map preview) shouldn't be disabled, when all other widgets should be.
- Added mission map descriptions w/ locale support in INI format in mapname/desc.txt if applicable. Use '|' for line break.
-- Library for miscellaneous utilitiy functions
-- Check if a gear is inside a box
function gearIsInBox(gear, x, y, w, h)
gx, gy = GetGearPosition(gear)
if gx >= x and gy >= y and gx <= x + w and gy <= y + h then
return true
end
return false
end
-- Check if a gear is inside a circle
function gearIsInCircle(gear, x, y, r, useRadius)
gx, gy = GetGearPosition(gear)
if useRadius then
r = r + GetGearRadius(gear)
end
if r ^ 2 >= (x - gx) ^ 2 + (y - gy) ^ 2 then
return true
end
return false
end