Skip to content

Instantly share code, notes, and snippets.

@Boboss74
Created September 25, 2023 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Boboss74/e1301261338f543a4ba21403af552108 to your computer and use it in GitHub Desktop.
Save Boboss74/e1301261338f543a4ba21403af552108 to your computer and use it in GitHub Desktop.
CyberPunk 2077 Mod: Reset Attributes always available (Redscript)
// CyberPunk 2077 Mod: Reset Attributes always available
// https://www.nexusmods.com/cyberpunk2077/mods/9240
// Authors: snogthemo, Boboss74, yakuzadeso
@wrapMethod(NewPerksCategoriesGameController)
private final func ResolveResetAttributesButtonVisibility() -> Void {
if (IsDefined(this.m_questSystem) && this.m_questSystem.GetFact(n"ResetAttributeDisabled") == 1) {
this.m_questSystem.SetFact(n"ResetAttributeDisabled", 0);
}
wrappedMethod();
}
@wrapMethod(NewPerksCategoriesGameController)
protected cb func OnResetConfirmed(data: ref<inkGameNotificationData>) -> Bool {
wrappedMethod(data);
// On reset confirmation, keep button visible and reset "ResetAttributeDisabled" state.
this.ResolveResetAttributesButtonVisibility();
}
@Boboss74
Copy link
Author

In order to get color syntax, I set the extension to .swift instead of .reds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment