Phobos icon indicating copy to clipboard operation
Phobos copied to clipboard

[Highly Customized] Grey cameo preview and cameo overlays

Open CrimRecya opened this issue 11 months ago • 7 comments

  • A setting that allows you to preview information. This feature can be used as before, playing "new construction options" and clearing the specific production queue when prerequisites loss.
    • Cameo.AlwaysExist controls whether you can see the cameo when the prerequisite have not satisfied (TechnoLevel, Owner & Cameo.RequiredHouses, RequiredHouses, ForbiddenHouses, FactoryOwners, StolenTech, SecretLab and RequiredTheaters, etc should be satisfied, if the Cameo.OverrideTechnos is met, it will override the Owner & Cameo.RequiredHouses conditions). Defaults to [AudioVisual] -> Cameo.AlwaysExist.
      • Cameo.RequiredHouses determines whether to add a condition together with Owner for Cameo.AlwaysExist check when the value is not empty. Suitable for situations where cameo is no need to be modified in games.
      • Cameo.OverrideTechnos determines whether the cameo can also be displayed when you own one of these technos when the value is not empty. Suitable for situations where cameo need to be dynamically modified in games.
    • ShowBuildingStatistics controls whether the number of buildings of this type that you currently own needs to be displayed in the upper left corner of the building cameo (requires the cameo exist).
      • Cameo.ShouldCount controls whether this type of building need to count if ShowBuildingStatistics=true. Default to check if building's own BuildCat is not Combat or BuildLimit is set.
    • Cameo.OverlayShapes controls the drawn image file.
      • Cameo.OverlayFrames controls which frame in Cameo.OverlayShapes to draw in four different situations: currently owned this building type, can automatically build this building, grey cameo and have its prerequisite, grey cameo but have no prerequisite (The second situation requires AutoBuilding to be true, the last situation requires Cameo.AlwaysExist to be true). When set to a negative number, it means that there is no need to draw under the corresponding conditions.
      • Cameo.OverlayPalette the color palette used when drawing Cameo.OverlayShapes.
    • The UIDescription.Unbuildable is like UIDescription, but this only appearing when the techno is truly unbuildable.

In ra2md.ini:

[Phobos]
ShowBuildingStatistics=false     ; boolean

In rulesmd.ini:

[AudioVisual]
Cameo.AlwaysExist=false          ; boolean
Cameo.OverlayShapes=pips.shp     ; filename - including the .shp extension
Cameo.OverlayFrames=             ; integer - owned this building, can automatically build, grey and have its prerequisite, grey but have no prerequisite
Cameo.OverlayPalette=palette.pal ; filename - including the .pal extension

[SOMETECHNO]                     ; TechnoType
Cameo.AlwaysExist=               ; boolean
Cameo.RequiredHouses=            ; list of house types
Cameo.OverrideTechnos=           ; List of TechnoTypes
UIDescription.Unbuildable=       ; CSF entry key

[SOMEBUILDING]                   ; BuildingType
Cameo.ShouldCount=               ; boolean

In artmd.ini:

[SOMETECHNO]                     ; TechnoType
GreyCameoPCX=                    ; PCX filename - including the .pcx extension

CrimRecya avatar Dec 28 '24 09:12 CrimRecya

Splits from #1335 .

CrimRecya avatar Dec 28 '24 09:12 CrimRecya

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

github-actions[bot] avatar Dec 28 '24 09:12 github-actions[bot]

FactoryOwners?

Speederovsky avatar Jan 24 '25 08:01 Speederovsky

FactoryOwners?

Not Supported. You can set Cameo.AuxTechnos to the critical technos.

CrimRecya avatar Jan 24 '25 09:01 CrimRecya

  • Not supporting FactoryOwners might be a bit bold, it's not some obscure feature.
  • Something for stolen tech? One might want to include their special settings.
  • The 'you own this building type' overlay being drawn for defenses is quite a bit weird and it doesn't get drawn for walls, obviously. But visually that will give a weird final effect. It would be useful to let the Statistics only appear for buildings that are related to teching and not defenses.
  • "the upper right corner of the building cameo" You mean left. Right is for queues.

Speederovsky avatar Jan 24 '25 10:01 Speederovsky

  • Not supporting FactoryOwners might be a bit bold, it's not some obscure feature.
  • Something for stolen tech? One might want to include their special settings.
  • The 'you own this building type' overlay being drawn for defenses is quite a bit weird and it doesn't get drawn for walls, obviously. But visually that will give a weird final effect. It would be useful to let the Statistics only appear for buildings that are related to teching and not defenses.
  • "the upper right corner of the building cameo" You mean left. Right is for queues.
  • Okay, I will consider it later.
  • Can you tell me how you would like this to be displayed? In my opinion, not displaying these directly is the best.
  • Great suggestion, I will separate their switches in the future.
  • Thank you for the reminder. I will revise it again in the future.

CrimRecya avatar Jan 24 '25 12:01 CrimRecya

From earlier discussions in Discord, QQ, and #1384: a suggestion on how to implement fixed position cameos (not necessary for this PR but it would complement it nicely).

Design-wise I propose every pickable player country/subfaction to have its own set of static cameos (green on the pic) which would be unique to this specific country/subfaction and that can be greyed out, and if the player has some tech that isn't specific to this faction/subfaction (for example, MCV crate, engineer capture, reverse-engineering) - it would be added as regular dynamic (blue) cameos. Fake cameos (grey) are not visible to the user, they're simply transparent squares with no function.

Because cameo sorting is already controlled by Phobos (courtesy of @Thrifinesma), it should be trivial to add fake cameos and change the sorting function to always place the cameos in the fixed order.

image

Metadorius avatar Mar 24 '25 15:03 Metadorius