FlatUI

by Psyhe

This mod replaces all graphics of the user interface. The mod also changes the health bar, indicators, underground lines and more. This can be configured in the settings. Now transparent!

Tweaks
4 days ago
2.0
561

g Crash on newest experimental

a month ago

Failed to load mods: The given sprite rectangle (left_top=578x861, right_bottom=594x877) is outside the actual sprite size (left_top=0x0, right_bottom=593x1222). See the log file for more information.: __FlatUI__/graphics/gui-new.png
Maybe it's some undocumented change in 2.0.68?

a month ago
(updated a month ago)

same thing

a month ago
(updated 30 days ago)

Temporary Solution with help from chat gpt: (If you are not using transparent ui then you need to edit FlatUI__/graphics/gui-new.png instead, you might also not want the extra pixels to be transparent, but thats something you can ask the chat bot about)
Step-by-step in GIMP

Open the file

Start GIMP.

Go to File → Open and select gui-new_tr.png from your FlatUI/graphics/ folder.

Check the current size

In GIMP’s title bar or in Image → Canvas Size…, you should see the dimensions: 593 × 1222.

Increase the canvas width

Go to Image → Canvas Size…

In the Width box, change 593 to 595.

Leave Height at 1222.

Click the Center dropdown next to “Offset” and set it so the image stays anchored to the left. This makes the extra pixel appear on the right side.

Add the transparent pixel

In the Canvas Size dialog, make sure Resize layers: All layers is selected.

Press Resize.

Now the image is 595×1222, with a 2-pixel wide empty strip on the right.

Because your image already has transparency, that new column will automatically be transparent.

Export the file

Go to File → Export As…

Choose gui-new_tr.png and overwrite the original in:

FlatUI/graphics/gui-new_tr.png

In the export dialog, keep defaults and click Export.

Test in Factorio

Restart Factorio.

The error outside the actual sprite size (… right_bottom=594x877) should be gone.

30 days ago
(updated 30 days ago)

Worse. It is now crashing on newest stable 2.0.69 too:

Failed to load mods: The given sprite rectangle (left_top=578x861, right_bottom=594x877) is outside the actual sprite size (left_top=0x0, right_bottom=593x1222).
See the log file for more information.: FlatUI/graphics/gui-new.png

29 days ago

Our beloved 'little' mod :(

25 days ago

same thing

21 days ago

Same here :(

21 days ago

People. We need to talk to Factorio devs. Maybe its on their side and its a bug. If it is some new feature, we shit out of luck. :(

14 days ago

This module is really useful, but the new version of the game has compatibility issues with this module, when can the author fix it? - from Baidu Translation

13 days ago

I threw together a PowerShell script anyone should be able to run, just start PowerShell and copy-paste into it (or create a .ps1 file and run that if you prefer). It uses only standard system libraries available by default on any modern Windows edition, and is hopefully straightforward enough that anyone can also read and check that it doesn't contain any malicious code. If you've modified your mod install folder path, you should also be capable of modifying the first few lines of the script. If the original mod is updated in the future, simply delete the FlatUI folder in your mods folder and it should revert to using the downloaded version.

$ErrorActionPreference = 'Stop'

cd $Env:APPDATA\Factorio\mods

if (-not (Test-Path FlatUI)) {
    Expand-Archive .\FlatUI_1.1.2.zip .
}

$folder = Convert-Path .\FlatUI\graphics

function patch([string]$file) {
    if (-not (Test-Path "$folder\$file.original")) {
        Move-Item "$folder\$file" "$folder\$file.original"
    }

    $image = [System.Drawing.Image]::FromFile("$folder\$file.original")

    $resizedImage = New-Object System.Drawing.Bitmap(($image.Width + 2), $image.Height)

    $graphics = [System.Drawing.Graphics]::FromImage($resizedImage)
    $graphics.DrawImage($image, 0, 0, $image.Width, $image.Height)
    $resizedImage.Save("$folder\$file", [System.Drawing.Imaging.ImageFormat]::Png)

    $graphics.Dispose()
    $image.Dispose()
    $resizedImage.Dispose()
}

patch("gui-new.png")
patch("gui-new_tr.png")
12 days ago

I threw together a PowerShell script anyone should be able to run, just start PowerShell and copy-paste into it (or create a .ps1 file and run that if you prefer). It uses only standard system libraries available by default on any modern Windows edition, and is hopefully straightforward enough that anyone can also read and check that it doesn't contain any malicious code. If you've modified your mod install folder path, you should also be capable of modifying the first few lines of the script. If the original mod is updated in the future, simply delete the FlatUI folder in your mods folder and it should revert to using the downloaded version.

```powershell
$ErrorActionPreference = 'Stop'

cd $Env:APPDATA\Factorio\mods

if (-not (Test-Path FlatUI)) {
Expand-Archive .\FlatUI_1.1.2.zip .
}

$folder = Convert-Path .\FlatUI\graphics

function patch([string]$file) {
if (-not (Test-Path "$folder\$file.original")) {
Move-Item "$folder\$file" "$folder\$file.original"
}

$image = [System.Drawing.Image]::FromFile("$folder\$file.original")

$resizedImage = New-Object System.Drawing.Bitmap(($image.Width + 2), $image.Height)

$graphics = [System.Drawing.Graphics]::FromImage($resizedImage)
$graphics.DrawImage($image, 0, 0, $image.Width, $image.Height)
$resizedImage.Save("$folder\$file", [System.Drawing.Imaging.ImageFormat]::Png)

$graphics.Dispose()
$image.Dispose()
$resizedImage.Dispose()

}

patch("gui-new.png")
patch("gui-new_tr.png")
```
No effect

12 days ago

No effect

from what the script looks like, just open gui-new.png and gui-new_tr.png, make them 2 pixels longer on the right and it should work

12 days ago

No effect

aw_dangit.mp3

No errors? Did it extract the zip to a FlatUI folder? Is there a ui-new.png.original file in the graphics subfolder? Can you open and check the dimensions of ui-new.png?

11 days ago

No effect

aw_dangit.mp3

No errors? Did it extract the zip to a FlatUI folder? Is there a ui-new.png.original file in the graphics subfolder? Can you open and check the dimensions of ui-new.png?

There is a gui-new.png.original file, but I don't know how to open it. I repackaged the unzipped file and then launched the game, but the game reported an error again - from Baidu Translation

11 days ago

There is a gui-new.png.original file, but I don't know how to open it. I repackaged the unzipped file and then launched the game, but the game reported an error again - from Baidu Translation

That's a backup of the original file. There should also have been an updated gui-new.png and gui-new_tr.png. I guess the script isn't bulletproof... 😕 you'll have to follow the manual guide Aurora94 posted above.

4 days ago

I sincerely apologize for the issues.

I haven't played Factorio and visited the mod portal in a long time.

For some reason, the developers reduced the height of "gui-new.png" by 2 pixels and increased its width by 4 pixels.

I've fixed everything, and the mod is working again.

4 days ago

Praise our savior!

I sincerely apologize for the issues.

I haven't played Factorio and visited the mod portal in a long time.

For some reason, the developers reduced the height of "gui-new.png" by 2 pixels and increased its width by 4 pixels.

I've fixed everything, and the mod is working again.

hell yeah welcome back!

a day ago

I sincerely apologize for the issues.

I haven't played Factorio and visited the mod portal in a long time.

For some reason, the developers reduced the height of "gui-new.png" by 2 pixels and increased its width by 4 pixels.

I've fixed everything, and the mod is working again.

Praise be!

New response