Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues in create unit dialog #6664

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

lL1l1
Copy link
Contributor

@lL1l1 lL1l1 commented Feb 18, 2025

Issue

1: The create unit dialog does not use the standard way of loading icons, so all modded units do not have a proper icon when hovered over.

2: There are errors when mousing over templates with unloaded modded units.

warning: Error running HandleEvent script in CScriptObject at 279a5800: ...\lua\ui\dialogs\createunit.lua(1425): attempt to perform arithmetic on local `XSkirtO' (a nil value)
         stack traceback:
         	...\lua\ui\dialogs\createunit.lua(1425): in function <...\lua\ui\dialogs\createunit.lua:1420>
         	...\lua\ui\dialogs\createunit.lua(1446): in function `?'
         	...\lua\ui\dialogs\createunit.lua(1577): in function <...\lua\ui\dialogs\createunit.lua:1574>
  1. There are errors when mousing over templates.
warning: Error running HandleEvent script in CScriptObject at 2c0a6100: ...\lua\maui\layouthelpers.lua(79): attempt to call method `SetValue' (a nil value)
         stack traceback:
         	...\lua\maui\layouthelpers.lua(79): in function `SetWidth'
         	...\lua\maui\layouthelpers.lua(104): in function `SetDimensions'
         	...\lua\ui\dialogs\createunit.lua(1479): in function `?'
         	...\lua\ui\dialogs\createunit.lua(1578): in function <...\lua\ui\dialogs\createunit.lua:1575>

Description of the proposed changes

Get the icon the standard way through UI Utils which is what is used for construction.lua.
Fix the errors.

Testing done on the proposed changes

Mousing over a modded unit in the create unit dialog gets the correct icon instead of falling back to the unit's albedo texture.
{DAE74966-43B5-450C-88F2-AE15083C91D1}
This green background is what fixing the mouseover creates by the way:
{4CE86E05-9968-40CF-94FB-745AB788DB1B}

Checklist

- [ ] Changes are annotated, including comments where useful

  • Changes are documented in the changelog for the next game version

@lL1l1 lL1l1 added type: bug area: ui Anything to do with the User Interface of the Game feature: mod compatibility related to FAF compatibility with mods labels Feb 18, 2025
@lL1l1 lL1l1 changed the title Fix create unit dialog not getting modded unit icons properly Fix issues in create unit dialog Feb 18, 2025
@lL1l1 lL1l1 marked this pull request as ready for review February 18, 2025 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ui Anything to do with the User Interface of the Game feature: mod compatibility related to FAF compatibility with mods type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant