Filtering DaggerfallExteriorAutomapWindow nameplates
Posted: Wed Dec 23, 2020 12:13 am
I'm attempting to write my first mod and running into some difficulty with protection levels. I want to make a mod very similar to Inventory Filter but for the city map to filter out nameplates. It's a simple mod that adds filter field to the bottom right of the map that will filter out building nameplates as you type.
I'm new to C# and Unity but I believe this can be done by overriding DaggerfallExteriorAutomapWindow's UpdateAutomapView method.
Here's what I have so far:
I'm running into a couple of problems though.
For #2, exteriorAutomap doesn't appear to have been set public and there's no Getter that I can see. Will this also need a patch?
EDIT: Looks like I might be able to do something like this?
I'm new to C# and Unity but I believe this can be done by overriding DaggerfallExteriorAutomapWindow's UpdateAutomapView method.
Here's what I have so far:
Code: Select all
public override void UpdateAutomapView()
{
base.UpdateAutomapView();
for (int i = 0; i < exteriorAutomap.buildingNameplates.Length; i++)
{
if (NameplatePassesFilter(exteriorAutomap.buildingNameplates[i].textLabel.Text))
{
exteriorAutomap.buildingNameplates[i].textLabel.Enabled(false);
}
}
}
- 'FlynsarmyExteriorAutomapWindow.UpdateAutomapView()': cannot override inherited member 'DaggerfallExteriorAutomapWindow.UpdateAutomapView()' because it is not marked virtual, abstract, or override
- 'DaggerfallExteriorAutomapWindow.exteriorAutomap' is inaccessible due to its protection level
Code: Select all
public new void UpdateAutomapView()
{
base.UpdateAutomapView();
...
}
EDIT: Looks like I might be able to do something like this?
Code: Select all
public new void UpdateAutomapView()
{
base.UpdateAutomapView();
for (int i = 0; i < PanelRenderAutomap.Components.Count(); i++)
{
foreach (TextLabel label in PanelRenderAutomap.Components)
{
if (!NameplatePassesFilter(label.Text))
{
PanelRenderAutomap.Components.Remove(label);
}
}
}
}