Skip to content

UI/settings/feature/topbarsettings/Topbar settings drag & drop improvements#1587

Open
JannePaaso71 wants to merge 52 commits into
mainfrom
UI/Settings/Feature/Topbarsettings
Open

UI/settings/feature/topbarsettings/Topbar settings drag & drop improvements#1587
JannePaaso71 wants to merge 52 commits into
mainfrom
UI/Settings/Feature/Topbarsettings

Conversation

@JannePaaso71
Copy link
Copy Markdown

  • Added topbar drag & drop ordering
  • Added clan tile restrictions
  • Fixed layout resizing issues
  • Fixed clan tile hierarchy behavior

KimKiva and others added 30 commits October 1, 2025 11:32
…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.
…mp Area to ensurethat the drag affects what is inside the TopBarTogglle area.
JannePaaso71 and others added 21 commits April 28, 2026 14:38
… The new function has been initialized with variables.
…in use. Now only one is in use and the others are disabled, not removed.
…(), MoveUnderClanPanel(), MoveToTopBar() and IsVisble(). Unity/UIOverlay/TopPanel Alt 1/TopBarTargets has been added new row: Coins.
Copy link
Copy Markdown

Copilot AI left a comment

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 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 from PlayerPrefs as 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.

Comment on lines +216 to +218

Debug.Log($"[TopBarDebug] Bridge target = {owner.name}, style={owner.style}, rows={owner.RowCount()}");

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.

Korjaa tämä.

Comment on lines +246 to +247
bool clanTileOn = PlayerPrefs.GetInt(
TopBarDefs.Key(TopBarDefs.TopBarItem.ClanTile) + "_" + SettingsCarrier.Instance.TopBarStyleSetting,
Copy link
Copy Markdown
Contributor

@BillTheBeast BillTheBeast May 27, 2026

Choose a reason for hiding this comment

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

Tätä ei tarvitse tosiasiassa muuttaa, koska jos tuota SettingsCarrieriä ei löydy meillä rupeaa olemaan jo muitakin ongelmia.

Comment on lines +109 to +118
public void OnDrag(PointerEventData e)
{
if (DebugOn) Debug.Log($"[TopBarDebug] TopBarToggleDrag : OnDrag()");

if (!DragAllowed())
return;

FollowPointer(e);
UpdatePlaceholderIndex(e);
}
Comment on lines +68 to 76
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);
}
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.

Sama kuin aikaisemmin, jos SettingCarrieriä ei löydy on meillä muitakin ongelmia. Joten tätä ei tarvitse muuttaa.

Comment on lines +55 to +59
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()");
Comment on lines +77 to +84
public void ApplyFromSettings()
{
if (DebugOn) Debug.Log($"[TopBarDebug] TopBarTargets : ApplyFromSettings()");

Debug.Log($"[TB] APPLY style={style} " +
$"active={gameObject.activeInHierarchy} " +
$"name={name}");

Comment on lines +98 to +100
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)
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.

Mikäs tämä on on? Jäänyt kopio tuosta aikaisemmasta metodista tähän?

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.

Mikä tämän koodin virka on?

Copy link
Copy Markdown
Contributor

@BillTheBeast BillTheBeast left a comment

Choose a reason for hiding this comment

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

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.

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.

4 participants