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

Item.SetNameOverride() behaves very weirdly with Journey Mode duplication menu #4467

Open
mkacct opened this issue Dec 6, 2024 · 0 comments
Labels
NEW ISSUE Flags an Issue as new. To be removed once issue is assessed. Requestor-Modders Issues or PRs adding or fixing TML modder API

Comments

@mkacct
Copy link

mkacct commented Dec 6, 2024

Version

Latest 1.4.4-stable

OS

Windows

Platform

Steam

This bug affects...

Mod capability as a Modder

Description

When a vanilla item's name has been overridden using Item.SetNameOverride(), rolling over that item in the Journey Mode duplication menu causes all other items in the duplication menu to have the same name.

Log File

client.log
Launch.log
Natives.log
environment-client.log

Steps to reproduce

  1. Load a mod with code in it like this:
public class ItemNameOverrider : GlobalItem {
    public override void SetDefaults(Item item) {
        if (item.type == ItemID.CopperBar) {
            item.SetNameOverride("Renamed copper bar");
        }
    }
}
  1. Enter a world in Journey Mode in single-player.
  2. Open the duplication menu and roll over various items with the mouse. Of course, they each show their own names.
  3. Find copper bar and roll over it. It shows its new name "Renamed copper bar".
  4. Now roll over various other items in the duplication menu.

Expected Behavior

The other items still show their vanilla name.

Actual Behavior

After rolling over the copper bar, all items in the duplication menu display their name as "Renamed copper bar", and this persists until you exit the world. (Other attributes like tooltips and rarity are unaffected.) If you put items in your inventory from the duplication menu, they will keep their erroneously modified names.

Reproduction frequency

Consistently, I guess. I disabled all mods other than mine and it still was reproducible.

Additional Information

If my code is actually just wrong, please let me know.

@mkacct mkacct added the NEW ISSUE Flags an Issue as new. To be removed once issue is assessed. label Dec 6, 2024
@github-actions github-actions bot added the Requestor-Modders Issues or PRs adding or fixing TML modder API label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NEW ISSUE Flags an Issue as new. To be removed once issue is assessed. Requestor-Modders Issues or PRs adding or fixing TML modder API
Projects
None yet
Development

No branches or pull requests

1 participant