a few questions about modding the UI

Information and discussion for custom maps and mods.
Post Reply
fernoe
Posts: 33
Joined: Sat Sep 24, 2005 10:21 pm

a few questions about modding the UI

Post by fernoe »

I'm trying to edit the UI and everything I try just seems to crash the game

1. in the red alert mod, i've edited this tag in chrome.yaml

order-icons: chrome2.png

i've also added a .png image called chrome2.png to the uibits folder. this doesn't seem to work, the game crashes. Am I doing something wrong? is there a correct way to do this? my exception log for this;


Red Alert Mod at Version release-20150614
Operating System: Windows (Microsoft Windows NT 6.1.7601 Service Pack 1)
Runtime Version: .NET CLR 4.0.30319.18444
Exception of type `System.IO.InvalidDataException`: Non-power-of-two array 764x463
at OpenRA.Renderer.Sdl2.Texture.SetData(Byte[] colors, Int32 width, Int32 height)
at OpenRA.Graphics.Sheet.GetTexture()
at OpenRA.Graphics.SpriteRenderer.Flush()
at OpenRA.Graphics.SpriteRenderer.SetRenderStateForSprite(Sprite s)
at OpenRA.Graphics.SpriteRenderer.DrawSprite(Sprite s, float2 location, Single paletteTextureIndex, float2 size)
at OpenRA.Widgets.WidgetUtils.FillRectWithSprite(Rectangle r, Sprite s)
at OpenRA.Widgets.WidgetUtils.DrawPanelPartial(Rectangle bounds, PanelSides ps, Sprite borderTop, Sprite borderBottom, Sprite borderLeft, Sprite borderRight, Sprite cornerTopLeft, Sprite cornerTopRight, Sprite cornerBottomLeft, Sprite cornerBottomRight, Sprite background)
at OpenRA.Widgets.WidgetUtils.DrawPanelPartial(String collection, Rectangle bounds, PanelSides ps)
at OpenRA.Mods.Common.Widgets.ButtonWidget.DrawBackground(String baseName, Rectangle rect, Boolean disabled, Boolean pressed, Boolean hover, Boolean highlighted)
at OpenRA.Mods.Common.Widgets.ButtonWidget.DrawBackground(Rectangle rect, Boolean disabled, Boolean pressed, Boolean hover, Boolean highlighted)
at OpenRA.Mods.Common.Widgets.ButtonWidget.Draw()
at OpenRA.Widgets.Widget.DrawOuter()
at OpenRA.Widgets.Widget.DrawOuter()
at OpenRA.Widgets.Widget.DrawOuter()
at OpenRA.Widgets.Widget.DrawOuter()
at OpenRA.Widgets.Widget.DrawOuter()
at OpenRA.Widgets.Widget.DrawOuter()
at OpenRA.Widgets.Widget.DrawOuter()
at OpenRA.Widgets.Widget.DrawOuter()
at OpenRA.Game.RenderTick()
at OpenRA.Game.Loop()
at OpenRA.Game.Run()
at OpenRA.Program.Run(String[] args)
at OpenRA.Program.Main(String[] args)



2. is there a way to add a new font to the game?

3.in the CnC mod, there are numbered buttons for producing items from multiple productive structures at the same time, i'm not sure what they're called. What do I need to do to add those into the RA mod?

Scott_NZ
Posts: 94
Joined: Thu Sep 13, 2012 9:09 am

Post by Scott_NZ »

1. The width and height of your chrome2.png both need to be powers of 2. Try resizing it to 1024x512.

2. Yes. Have a look at mod.yaml.

3. In C&C production is handled differently. Production traits are defined on the building (ProductionQueue, rules/structures.yaml) instead of the player (ClassicProductionQueue, rules/player.yaml). You'll also have to change the UI yaml to use the C&C widget logic instead. Compare cnc's ingame.yaml and ra's ingame-player.yaml. Probably some other things that I've forgotten about.

Post Reply