Skip to content

Unofficial Patch - Tour Revenue Color #2

Description

@ExSlam

Add a condition to make the expected revenue go red if not profitable for consistency when render updates run so that visual glitches do not occur.

[HarmonyPatch(typeof(Tour_New_Popup), "Render")]
public class Tour_New_Popup_Render
{
    public static void Postfix(Tour_New_Popup __instance)
    {
        if (__instance?.Tour == null || __instance.ExpectedRevenue == null)
            return;

        // Profit check (includes saving correctly)
        bool profitable = __instance.Tour.ExpectedRevenue > (__instance.Tour.ProductionCost - __instance.Tour.Saving);

        ExtensionMethods.SetColor(__instance.ExpectedRevenue, profitable ? mainScript.green32 : mainScript.red32);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions