X2CommunityCore / X2WOTCCommunityHighlander

https://steamcommunity.com/workshop/filedetails/?id=1134256495
MIT License
60 stars 68 forks source link

Proposed fix for the persistent "Low Intel" warning after contacting all regions. #1346

Closed Larryturbo closed 3 days ago

Larryturbo commented 4 months ago

Fixes #1347 The "Low Intel" warning shows up if your total intel is less than the contact cost of the next closest region. But if you've contacted all regions the cost defaults to 9999 and you get the warning despite not having more regions to contact. I've added an additional check to make sure your current resistance contacts aren't equal to the total number of regions that can be contacted (probably 16 but I didn't want to hardcode it) before the warning is displayed.

BlackDog86 commented 1 month ago

Please can you squash all commits into a single commit?

Iridar commented 1 week ago

Good find, but the code needs to be adjusted and actually tested, because right now I believe it will the Low Intel warning to just show never, because class'X2StrategyElement_DefaultMissionSources'.static.GetAllRegions().Length will evaluate to zero.

Highlander is sirius business, please make sure to properly test all submissions.

Don't worry about squashing, it can be done during the merging process.

Iridar commented 3 days ago

I tested, and while this solution works for the Low Intel popup, it doesn't work for the Low Intel warning in the lower left corner, and probably several other UI elements that use the GetMinimumContactCost() function, which is where the problem is. Thus, I suggest fixing the issue in that function instead.

Iridar commented 3 days ago

Closing in favor of alternative implementation in #1388