UI/settings/feature/topbarsettings/Topbar settings drag & drop improvements#1587
UI/settings/feature/topbarsettings/Topbar settings drag & drop improvements#1587JannePaaso71 wants to merge 52 commits into
Conversation
JannePaaso71
commented
May 27, 2026
- Added topbar drag & drop ordering
- Added clan tile restrictions
- Fixed layout resizing issues
- Fixed clan tile hierarchy behavior
Also added old top bar as a reference.
…en, all childs have been added Layout Element with specific preferred width and height.
…oved. Content-child has been created. BT_AVATAR, BT_AANESTYS,ClanPanelRoot, JukeboxButton and DropDownMneu have been moved to Content child. Content has new child named Spacer to refill empty space in TopbarPanel. All childs have been added Layout Element with specific preferred width and height, except Spacer (flexible width).
…ggle-child has been added. Toggle have been added two components: Image(Color invisible, Raycast Traget off) and Toggle(Target graphic = Image; Graphic = Image).
…ggle have been added two components: Image(Color invisible, Raycast Traget off) and Toggle(Target graphic = Image; Graphic = Image).
…ggle have been added two components: Image(Color invisible, Raycast Traget off) and Toggle(Target graphic = Image; Graphic = Image).
…ave been added to its childs. The structure has been changed.
…kes into account the scalability of the topbar in terms of height and widht).
…been transferred from parents to Toggle-child.TopBarToggleHandler.cs has been updated(Start-function/GetComponent -> GetComponentInChild and checking if _toggle == null. GetToggleValue() has been added checking if _toggle == null.
…rom child to parent.
…ast to TopBarToggleDrag.
…mp Area to ensurethat the drag affects what is inside the TopBarTogglle area.
…ggleHandler.cs have been updated.
… The new function has been initialized with variables.
…in use. Now only one is in use and the others are disabled, not removed.
… Debug have been added to .cs files.
…(), MoveUnderClanPanel(), MoveToTopBar() and IsVisble(). Unity/UIOverlay/TopPanel Alt 1/TopBarTargets has been added new row: Coins.
There was a problem hiding this comment.
Pull request overview
This PR enhances the Settings UI for top bar customization by introducing drag-and-drop ordering, enforcing clan tile ordering restrictions, and adjusting top bar layout behavior. It also adds persistence support for ordered items via SettingsCarrier, plus some prefab/layout updates to support the new hierarchy.
Changes:
- Added new top bar settings runtime components: toggle handling, drag-and-drop reordering, and target application per top bar style.
- Added persisted top bar ordering via
SettingsCarrier(save/load fromPlayerPrefsas JSON). - Updated prefabs/layout and Unity package/project settings to support the new UI structure and behavior.
Reviewed changes
Copilot reviewed 14 out of 27 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| ProjectSettings/ProjectSettings.asset | Changes Unity player input handler setting (project-wide behavior change). |
| Packages/packages-lock.json | Adds Unity sysroot/toolchain packages (Linux toolchain dependencies). |
| Packages/manifest.json | Adds com.unity.toolchain.linux-x86_64 dependency. |
| Assets/MenuUi/Scripts/TopPanel/TopBarToggleHandler.cs.meta | New meta for toggle handler script. |
| Assets/MenuUi/Scripts/TopPanel/TopBarToggleHandler.cs | New toggle persistence + “apply targets” behavior when toggles change. |
| Assets/MenuUi/Scripts/TopPanel/TopBarToggleDrag.cs.meta | New meta for drag handler script. |
| Assets/MenuUi/Scripts/TopPanel/TopBarToggleDrag.cs | New drag-and-drop ordering logic (with clan tile restrictions). |
| Assets/MenuUi/Scripts/TopPanel/TopBarTargets.cs.meta | New meta for style-specific top bar target applier. |
| Assets/MenuUi/Scripts/TopPanel/TopBarTargets.cs | Applies visibility + ordering to actual top bar UI per style, adds spacer handling, clan panel slotting. |
| Assets/MenuUi/Scripts/TopPanel/TopBarOrderBridge.cs.meta | New meta for order bridge script. |
| Assets/MenuUi/Scripts/TopPanel/TopBarOrderBridge.cs | Bridges toggle-list ordering to persisted order + applies indentation/locking for clan sub-items. |
| Assets/MenuUi/Scripts/TopPanel/ScrollOnlyFromScrollbar.cs.meta | New meta for custom scroll rect. |
| Assets/MenuUi/Scripts/TopPanel/ScrollOnlyFromScrollbar.cs | Disables drag scrolling on ScrollRect (scrollbar-only behavior). |
| Assets/MenuUi/Scripts/Settings/SettingEditor.cs | Updates top bar style UI text refresh + style cycling logic. |
| Assets/MenuUi/Prefabs/Windows/Settings/TopBarToggles.prefab.meta | New/updated prefab meta for settings toggles. |
| Assets/MenuUi/Prefabs/Panels/TopPanel Alt1.prefab | Major hierarchy/layout updates + wiring for TopBarTargets and clan panel slot structure. |
| Assets/MenuUi/Prefabs/Panels/TopPanel Alt1 Old.prefab.meta | Adds/updates meta for old prefab asset. |
| Assets/MenuUi/Prefabs/Panels/TopBarModificationPanel.prefab.meta | New meta for top bar modification panel prefab. |
| Assets/MenuUi/Prefabs/Panels/TopBarModificationPanel.prefab | New prefab defining the draggable toggle rows UI. |
| Assets/Altzone/Scripts/Settings/TopBarDefs.cs.meta | New meta for top bar definitions. |
| Assets/Altzone/Scripts/Settings/TopBarDefs.cs | New enum + key helper for stable top bar item IDs/PlayerPrefs keys. |
| Assets/Altzone/Scripts/Settings/SettingsCarrier.cs | Adds top bar order save/load + visibility helpers; fires OnTopBarChanged after loading style. |
Files not reviewed (9)
- Assets/Altzone/Scripts/Settings/TopBarDefs.cs.meta: Language not supported
- Assets/MenuUi/Prefabs/Panels/TopBarModificationPanel.prefab.meta: Language not supported
- Assets/MenuUi/Prefabs/Panels/TopPanel Alt1 Old.prefab.meta: Language not supported
- Assets/MenuUi/Prefabs/Windows/Settings/TopBarToggles.prefab.meta: Language not supported
- Assets/MenuUi/Scripts/TopPanel/ScrollOnlyFromScrollbar.cs.meta: Language not supported
- Assets/MenuUi/Scripts/TopPanel/TopBarOrderBridge.cs.meta: Language not supported
- Assets/MenuUi/Scripts/TopPanel/TopBarTargets.cs.meta: Language not supported
- Assets/MenuUi/Scripts/TopPanel/TopBarToggleDrag.cs.meta: Language not supported
- Assets/MenuUi/Scripts/TopPanel/TopBarToggleHandler.cs.meta: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| Debug.Log($"[TopBarDebug] Bridge target = {owner.name}, style={owner.style}, rows={owner.RowCount()}"); | ||
|
|
| bool clanTileOn = PlayerPrefs.GetInt( | ||
| TopBarDefs.Key(TopBarDefs.TopBarItem.ClanTile) + "_" + SettingsCarrier.Instance.TopBarStyleSetting, |
There was a problem hiding this comment.
Tätä ei tarvitse tosiasiassa muuttaa, koska jos tuota SettingsCarrieriä ei löydy meillä rupeaa olemaan jo muitakin ongelmia.
| public void OnDrag(PointerEventData e) | ||
| { | ||
| if (DebugOn) Debug.Log($"[TopBarDebug] TopBarToggleDrag : OnDrag()"); | ||
|
|
||
| if (!DragAllowed()) | ||
| return; | ||
|
|
||
| FollowPointer(e); | ||
| UpdatePlaceholderIndex(e); | ||
| } |
| private void RefreshTopBarStyleText() | ||
| { | ||
| if (carrier == null) carrier = SettingsCarrier.Instance; | ||
|
|
||
| string styleName = carrier.TopBarStyleSetting.ToString(); | ||
| Debug.Log($"[STYLE TEXT] setting text to {styleName}"); | ||
|
|
||
| _topBarStyleText.SetText(styleName); | ||
| } |
There was a problem hiding this comment.
Sama kuin aikaisemmin, jos SettingCarrieriä ei löydy on meillä muitakin ongelmia. Joten tätä ei tarvitse muuttaa.
| private void OnChanged(bool isOn) | ||
| { | ||
| Debug.Log($"[TopBarDebug] CLICK item={item}, isOn={isOn}, go={gameObject.name}"); | ||
| if (DebugOn) Debug.Log($"[TopBarDebug] TopBarToggleHandler : OnChanged()"); | ||
|
|
|
|
||
| private void OnEnable() | ||
| { | ||
| if (DebugOn) Debug.Log($"[TopBarDebug] TopBarOrderHandler : OnEnable()"); |
|
|
||
| private void OnCarrierChanged(int styleIndex) | ||
| { | ||
| if (DebugOn) Debug.Log($"[TopBarDebug] TopBarTargets : OnCarrieChanged()"); |
| public void ApplyFromSettings() | ||
| { | ||
| if (DebugOn) Debug.Log($"[TopBarDebug] TopBarTargets : ApplyFromSettings()"); | ||
|
|
||
| Debug.Log($"[TB] APPLY style={style} " + | ||
| $"active={gameObject.activeInHierarchy} " + | ||
| $"name={name}"); | ||
|
|
| Debug.Log($"[TopBarDebug] CurrentStyle={CurrentStyle}, " + | ||
| $"owner={(owner ? owner.name : "NULL")}, " + | ||
| $"toggleContainer={(_toggleContainer ? _toggleContainer.name : "NULL")}"); |
| } | ||
|
|
||
| public void PlayMainMenuMusic() { AudioManager.Instance.PlayMusic("MainMenu"); } | ||
| // public void ChangeTopbarStyle(int value) |
There was a problem hiding this comment.
Mikäs tämä on on? Jäänyt kopio tuosta aikaisemmasta metodista tähän?
There was a problem hiding this comment.
Mikä tämän koodin virka on?
There was a problem hiding this comment.
Yläpalkin elementit eivät näy oikein. (Klaanipalkin laatta ei näy missään tyyleissä ja elementit ovat jostain syystä pienemmät kuin on tarkoitus.)
TopPanel Alt 1 ei toimi tällä hetkellä lainkaan.
TopPanel Alt 2:ssä on nyt kaksi klaanipalkkia kun toinen niistä pitäisi olla pelaaja palkki.
Muokkauspanelissa on liian paljon väliä elementtien välissä, mikä johtaa siihen että sitä joutuu skrollaamaan aika huomattavasti jos haluaa nähdä kaikki mitä sen sisällä on.
Pitäisi lisätä jonkin näköinen graaffinen ilmaisu, joka kertoo, että elementit ovat kiinni klaani palkissa. Nyt sitä ei nää juuri mitenkään.