Skip to content

Publisher SDK improvements#475

Open
kirre-bylund wants to merge 3 commits into
devfrom
feat/publisher-changes
Open

Publisher SDK improvements#475
kirre-bylund wants to merge 3 commits into
devfrom
feat/publisher-changes

Conversation

@kirre-bylund

@kirre-bylund kirre-bylund commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Solves https://github.com/lootlocker/index/issues/1598 for Unity (Unreal implementations to come)

Three related improvements to support white-label / publisher SDK distributions and improve config reliability.


Changes

1. Add enableEditorAdminExtension config setting

A new boolean config field (default true) that controls whether the LootLocker editor tooling is available at all. When set to false:

  • Window → [PackageName] → Manage is greyed out (validate method)
  • The first-time auto-show window is suppressed

Supported via all existing config paths: ScriptableObject inspector, external file config (enable_editor_admin_extension), and command-line override (-enableeditoradminextension).


2. White-label support — editor UI uses PackageName

PackageName was changed from private static readonly string to public const string. All hardcoded "LootLocker" labels in editor tooling now reference this constant, so a publisher only needs to change the one constant to rebrand the entire editor experience:

  • All [MenuItem] paths (Window/LootLocker/...Window/[PackageName]/...)
  • Window titles (Manage window, Log Viewer window)
  • Update checker dialogs and notification window title/body
  • Project Settings path and label

Where the renamed SDK links back to LootLocker resources (GitHub releases page, Project Settings), a contextual notice is shown: "[Name] SDK is powered by LootLocker — ...". This appears in:

  • The update notification window (italic label above action buttons; window height adjusted)
  • The "could not parse release" dialog (appended paragraph)
  • The Project Settings panel (blue info box at the top of the settings)

A sample plain-JSON external config file is included at Resources/SamplePublisherConfig.bytes.


3. External file config as absolute source of truth

Previously the file config (.bytes) was applied once to the ScriptableObject on load, but subsequent mutations to the asset (e.g. via the Inspector) would silently win until the next domain reload.

Now, when a file config is present it is the authoritative source on every Get() call:

  • _activeFileConfig is cached on first load alongside _current
  • The early-return path in Get() re-applies all file config values before returning
  • ApplyFileConfig() extracted as a shared helper (removes duplication)
  • IsFileConfigActive public property added for other systems to query
  • OnEnterPlaymodeInEditor resets _activeFileConfig so the file is re-parsed cleanly on play
  • Project Settings UI: when IsFileConfigActive is true, all fields are wrapped in EditorGUI.BeginDisabledGroup(true) and a warning box is shown: "Settings are controlled by the external config file and cannot be edited here."

Testing

  • Set PackageName to a non-"LootLocker" value and confirm all menu items, window titles, and dialogs reflect the new name
  • Set enableEditorAdminExtension = false and confirm all editor menu items are greyed out / Project Settings entry disappears
  • Drop a valid .bytes file config into the Resources/Config folder, open Project Settings and confirm all fields are greyed out and the warning box is shown; mutate the ScriptableObject in the Inspector and confirm the mutation is overwritten on the next Get() call

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the Unity SDK’s suitability for publisher/white-label distributions by (1) introducing an editor tooling enable/disable switch, (2) centralizing editor UI branding around LootLockerConfig.PackageName, and (3) strengthening external file config behavior to be treated as the governing configuration source.

Changes:

  • Added enableEditorAdminExtension / enable_editor_admin_extension config setting (ScriptableObject, external file config, and command-line override).
  • Replaced hardcoded “LootLocker” labels/paths in editor tooling with LootLockerConfig.PackageName to support rebranding.
  • Refactored external file config application (ApplyFileConfig) and introduced IsFileConfigActive to support “file config controls settings” UX.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Runtime/Game/Resources/LootLockerExternalFileConfig.cs Adds enable_editor_admin_extension to the external config model.
Runtime/Game/Resources/LootLockerConfig.cs Adds enableEditorAdminExtension, caches file config, adds IsFileConfigActive, and refactors file-config application.
Runtime/Game/LootLockerLogger.cs Uses LootLockerConfig.PackageName in version log output for white-label branding.
Runtime/Editor/UpdateChecker/LootLockerUpdateChecker.cs Updates menu path and dialogs/titles to use PackageName; adjusts notification window UI.
Runtime/Editor/ProjectSettings.cs Adds “powered by LootLocker” notice, disables UI under file config, and rebrands settings path/label.
Runtime/Editor/LootLockerEditorData.cs Suppresses first-time auto-show when editor admin extension is disabled.
Runtime/Editor/LogViewer/LootLockerLogViewerWindow.cs Rebrands menu path and window title using PackageName.
Runtime/Editor/Editor UI/LootLockerAdminExtension.cs Rebrands menu paths/window titles using PackageName; adds validation to gray out some menu items when disabled.
Comments suppressed due to low confidence (1)

Runtime/Editor/UpdateChecker/LootLockerUpdateChecker.cs:83

  • The update-checker menu item (and the automatic periodic check) is not gated by enableEditorAdminExtension, so it won't be greyed out / skipped when the editor admin extension is disabled via config.
        [MenuItem("Window/" + LootLockerConfig.PackageName + "/Check for Updates", false, 102)]
        public static void ManualCheck()
        {
            FetchLatestRelease(isManualCheck: true);
        }

Comment on lines +429 to +435
else if (args[i] == "-enableeditoradminextension")
{
if (bool.TryParse(args[i + 1], out bool enableEditorAdminExtension))
{
this.enableEditorAdminExtension = enableEditorAdminExtension;
}
}
Comment on lines +734 to +737
_current.enableEditorAdminExtension = fileConfig.enable_editor_admin_extension;
#if UNITY_EDITOR
_current.adminToken = null;
#endif
Comment on lines +15 to 21
[MenuItem("Window/" + LootLockerConfig.PackageName + "/Log Viewer")]
public static void ShowWindow()
{
var wnd = GetWindow<LootLockerLogViewerWindow>();
wnd.titleContent = new GUIContent("LootLocker Log Viewer");
wnd.titleContent = new GUIContent(LootLockerConfig.PackageName + " Log Viewer");
wnd.Show();
}
Comment on lines 261 to 268
[SettingsProvider]
public static SettingsProvider CreateProvider()
{
return new ProjectSettings("Project/LootLocker SDK", SettingsScope.Project)
return new ProjectSettings("Project/" + LootLockerConfig.PackageName + " SDK", SettingsScope.Project)
{
label = "LootLocker SDK"
label = LootLockerConfig.PackageName + " SDK"
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants