There are some widgets that display the unit model as an icon (e.g. idle builders, selection buttons, group buttons). However, this is the base pose of the model used for the unit. For some units this is not desirable since e.g. the unit shares its model with others by hiding parts, contains effect objects (e.g. construction frames or the hourglass on the window in Kernel Panic Corruption) that aren't shown on the model normally or the unit is just posed in an unappealing or unrepresentative way (e.g. KPC Security Hole or Kernel) for better scripting.
It would be helpful if modders could define a separate model to be used for these widgets that have the hidden parts removed and possibly stand in a position that's more representative of the unit, perhaps even with additions for easier differentiation of the selection icons.
Request to widget makers: Iconmodel
Moderator: Moderators
Said model should also be used for the ghost building you see when placing it, if I may add.
However, personnaly I'd just like a Cob Function, MakesModelPretty(), that contains all the move/turn to make the model presentable. Because I hate any kind of duplicate, makes maintenace hellish.
Ex: You touch up a model, with your method you have to touch up the icon model as well. While with mine, no.
However, personnaly I'd just like a Cob Function, MakesModelPretty(), that contains all the move/turn to make the model presentable. Because I hate any kind of duplicate, makes maintenace hellish.
Ex: You touch up a model, with your method you have to touch up the icon model as well. While with mine, no.
I used this luafunction to draw the buildpic of a unit some time ago.
(needs the variables iconSizeX, iconSizeY)
Code: Select all
local function drawbuildPic(coord,unitDefID,Color)
gl.Color(Color)
gl.Texture("#" .. unitDefID)
gl.Shape(GL_QUADS, {
{ v = { coord.x + 1, coord.y + 1 }, t = { 0, 1 } },
{ v = { coord.x+iconSizeX - 0, coord.y + 1 }, t = { 1, 1 } },
{ v = { coord.x+iconSizeX - 0, coord.y+iconSizeY - 0 }, t = { 1, 0 } },
{ v = { coord.x + 1, coord.y+iconSizeY - 0 }, t = { 0, 0 } },
})
gl.Texture(false)
end