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

Modding: allow custom ResourcePortraits #8330

Merged
merged 5 commits into from
Jan 9, 2023

Conversation

vegeta1k95
Copy link
Collaborator

Allow for mods to add optional ResourcePortraits with un-tinted background.
Example:
image

@github-actions
Copy link

github-actions bot commented Jan 8, 2023

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@vegeta1k95
Copy link
Collaborator Author

Okay, so I did generification of almost all entities icons to account for moddable optional portraits with custom backgrounds. This includes:

  • Units
  • Buildings
  • Techs
  • Resources
  • Improvements
  • Promotions
  • UnitActions
  • Religions
  • Nations
  • Uniques

Each of these instances now can have optional untinted portraits with custom background.
If portrait is absent it resorts to icons.

This doesn't influence base game, so for modding convenience only.

@AdityaMH
Copy link
Contributor

AdityaMH commented Jan 9, 2023

if player using resources portait mods, they can't know what resources type. luxury or bonus resources each item.

fun getReligionPortrait(iconName: String, size: Float): Portrait {
if (religionIconExists(iconName)) {
return PortraitReligion(iconName, size)
} else {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of 'else', since if the previous if was true it returns

@yairm210
Copy link
Owner

yairm210 commented Jan 9, 2023

Code looks ok, but I'll want some pics

One screenshot, with a promoted unit selected and a city button visible, can probably contain almost all of these:

Units
Buildings
Techs
Resources
Improvements
Promotions
UnitActions
Religions
Nations

Only for Uniques do we need a screenshot of the tech table

@vegeta1k95
Copy link
Collaborator Author

vegeta1k95 commented Jan 9, 2023

Here is everything except religions and uniques (Mod is "Civ 5 Icons")
image

Here is techs (building, units, res, improvements, uniques):
image
image

Here is religion:
image
image
image

@vegeta1k95
Copy link
Collaborator Author

City View:
image

@vegeta1k95
Copy link
Collaborator Author

if player using resources portait mods, they can't know what resources type. luxury or bonus resources each item.

That's a modder's problem. He can make different portraits/add indicators to them to distinguish types. or as a last measure resort to using icons.

@yairm210
Copy link
Owner

yairm210 commented Jan 9, 2023

That's good, but I was pretty sure that works since that's what you set out to do :)
What I want is to ensure that the regular, non-portrait view still looks the same

@vegeta1k95
Copy link
Collaborator Author

vegeta1k95 commented Jan 9, 2023

Here same without mods:
image
image
image
image
image
image
image

Nothing changed, except for Improvement Dimming, I don't know why they were dimmed in the first place, I could hardly see them even in default (they were half-transparent for some reason)

@vegeta1k95
Copy link
Collaborator Author

vegeta1k95 commented Jan 9, 2023

Idk how to resolve conflict tho. I pushed this at the same time with PromotionScreen rework and now it conflicts

@github-actions
Copy link

github-actions bot commented Jan 9, 2023

Conflicts have been resolved.

@github-actions github-actions bot removed the Conflicts label Jan 9, 2023
@yairm210 yairm210 merged commit 0006aae into yairm210:master Jan 9, 2023
@vegeta1k95 vegeta1k95 deleted the resportraits branch January 9, 2023 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants