So, I created a function that cab parse attract.cfg and window.am. To have it update upon resizing the window, a tick function would have to be created. Am I going about this the correct way? Should I do something differently? Does it even matter? Here is what I have so far.
// Preliminary Support for isWindowWidescreen
fe.load_module("file-format");
function isWindowWidescreen() {
local windowMode = "";
local attractConfigFile = txt.loadFile(FeConfigDirectory + "/attract.cfg");
foreach(line in attractConfigFile.lines){
local isLine = line.find("window_mode");
if (isLine != null) windowMode = strip(line.slice(12));
}
if (windowMode == "window" || "window_no_border") {
local windowSize = "";
local attractWindowFile = txt.loadFile(FeConfigDirectory + "/window.am");
foreach(line in attractWindowFile.lines){
local isLine = line.find("size");
if (isLine != null) windowSize = strip(line.slice(4));
}
return splitRes(windowSize, "width", ",").tofloat() / splitRes(windowSize, "height", ",").tofloat() > 4.0 / 3.0;
}
else {
return fe.layout.width.tofloat() / fe.layout.height.tofloat() > 4.0 / 3.0;
}
}