Skip to content

Conversation

@tomipir
Copy link
Contributor

@tomipir tomipir commented Dec 19, 2025

Replaced the current page/book style categorization with a sideways scrolling bar

  • Bar has items in two rows
  • Selected item is highligted
  • Owned pieces are sorted to the left side of the scroll

Replaced category selection with a vertical scroll that shows 3 items at a time

  • Scrolling is infinite
  • After letting go of the scroll, the category closest to the middle is selected
  • Category image is the first image of the category, default images for categories should propably be added later

Added color selection visually

  • Functionality not implemented yet

Added a speech bubble that shows a random phrase listed in the GDD when opening AvatarEditor

Added a confirmation popup window for saving

Left old scripts in the files if needed for reference in the near future

Known Issues

  • Opening AvatarEditor with the confluent/symbiosis class gives an error. Editor still works as expected
  • Opening AvatarEditor gives a warning about a color that could not be parsed, and uses the default white color
  • Popup window buttons don't scale properly with aspect ratio
  • Changing aspect ratio while the game is running doesn't update cell sizes
  • Sometimes when clicking different features really fast the input doesn't register until you click somewhere else
  • Text for the speech bubbles in popup and AvatarEditor windows is not localized
  • Some features look really small. This will likely be fixed automatically when each featureimage has a correct iconimage set
  • When opening AvatarEditor for the first time after launching the game, the default character image is shown for a few frames

- Hardcoded to hair atm
attached script to HorizontalScrollView-Grid instead of BottomMenu
- Added VerticalScrollViewGrid for category selection
- renamed ScrollBarContentLoader script to ScrollBarFeatureLoader
- Also removed placeholder images from verticalscroll
VerticalScrollView-Grid => CategoryGrid
HorizontalScrollView-Grid => FeatureGrid
- Clicking features on FeatureGrid now updates the character
- Made SetFeature function from FeaturePicker public to bypass old logic
- Feature slot that's being changed hardcoded to hair for now
- Made BookImage transparent in editor to see more easily
- Now changing the category works
- Feature category Id:s being hardcoded is not optimal, returning to it later
- Added LayoutElement component to prefab
- Replaced many CategoryGrid components
- Added UpdateCellSize function

Category selection now shows 3 categories regardless of screen size/aspect ratio. It does not update when changing screen size while the app is running for now.
Not sure if OnEndDrag is the right event yet
- It now clicks the button on the cell after clamping
- Clicking the cells still works too, planning on changing this later
- Now there are cells now both top and bottom when loading the grid items
- Renamed wrongly named variable
- Made CategoryGrid create 3 of each category for future purposes
@tomipir tomipir self-assigned this Dec 19, 2025
@BillTheBeast BillTheBeast moved this to Tarkistuksessa in KÄYTTÖLIITTYMÄ Dec 22, 2025

float t = 0f;

while (t < 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Vähän epäselvä toteutus, vaikka onkin tarpeellinen. Ymmärrän että tämän on tarkoitus tapahtua 0,2 sekunnissa ja sen takia toi kertominen 5:llä, mut kannattaa varmaankin kirjoittaa kommentti tähän siitä.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Kirjoitin selkeämmäksi


private void OnClamp(float targetYPos)
{
float totalCellSize = _categoryLoader.cellHeight + _categoryLoader.spacing;
Copy link
Contributor

Choose a reason for hiding this comment

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

Tämä sama laskuhan tehdään tossa ClampToCenterissä, voisiko tuon indeksin antaa sieltä.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tehty. Lisäsin myös sen että dragin aloittaminen lopettaa jo käynnissä olevan clamppauksen

GameObject colorGridCell = Instantiate(_gridCellPrefab, _colorGridContent);
GridCellHandler handler = colorGridCell.GetComponent<GridCellHandler>();

Vector2 colorImageMinAnchors = new(0.05f, 0.05f);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nimeämis säännöt. Toinen on kirjoitettu isolla, toinen pienellä.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Korjattu

}
}

private void AddListener()
Copy link
Contributor

Choose a reason for hiding this comment

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

Kannattaa kirjoittaa kommentti, jos koodi on keskeneräinen. (Erottaa onko jotain mitä on tulossa myöhemmin vai että onko vahingossa lisätty/jäänyt.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tehty. Pidetään mielessä jatkossa.

public string GetSelectedFeature(int index) =>
index >= 0 && index < _selectedFeatures.Count ? _selectedFeatures[index] : null;

public void SetSelectedFeature(int index, string value)
Copy link
Contributor

Choose a reason for hiding this comment

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

Muuttaisin nämä metodit niin, että ne on yksityisiä ja sit vain lisäisin uudet julkiset, joille annetaan suoraan toi AvatarPiece enum, joka kertoo mikä pala pitäisi olla käytössä.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Laitoin yksityiseksi. En tehnyt uusia julkisia kun niitä ei tällä hetkellä käytetä missään muualla

_selectedFeatures[index] = value;
}

public List<AvatarPartInfo> GetCurrentCategoryFeatures() => _currentCategoryFeatures;
Copy link
Contributor

Choose a reason for hiding this comment

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

Tarvitseeko näitä metodeita (ja samoin että onko toi _currentCategoryFeatures tarpeellinen)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ei tarvitse, poistin paljon muutakin käyttämätöntä mitä oli jäänyt vanhasta koodista

[SerializeField] private AvatarPartsReference _avatarPartsReference;
private List<string> _selectedFeatures = new List<string>(new string[7]);
private List<AvatarPartInfo> _currentCategoryFeatures = new();
private CharacterClassType _characterClassType;
Copy link
Contributor

Choose a reason for hiding this comment

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

Tarvitseeko hahmon luokan tietoja olla tässä metodissa? Nehän saa muualta jos tarvitsee.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ei tarvitse, oli jäänyt vahingossa

[SerializeField] private Image _featureImage;
[SerializeField] private Button _button;

public void SetValues(Sprite cellImage = null,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suosittlen uudelleen järjestämään nämä muuttujat sillä, esim. toi cellImagen värin oleminen viimeisenä kun taas toi cellImage on ensimmäinen haittaa hieman luettavuutta.

Lisäksi kannattaa kysyä pitäisikö, joku tieto pistää pakolliseksi ettei päädy käyttämään metodia ilman muuttujia.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Järjestin uudelleen. Mitään tiettyä tietoa en laittanut pakolliseksi koska ei ole yhtä tiettyä mitä käytän aina, mutta antaa nyt varoituksen eikä tee mitään jos metodi kutsutaan ilman muuttujia.

{
if (_selectedCellHandler != null)
{
_selectedCellHandler.SetValues(backgroundColor: _backgroundColor);
Copy link
Contributor

Choose a reason for hiding this comment

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

Voisiko nämä arvot antaa Handlerille tuossa kun se luodaan ja sitten vain käskeä sitä vaihtaa niitä edestakaisin tarpeen mukaan.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tehty

tomipir added 12 commits January 7, 2026 14:35
-Removed double index calculation
-Made while loop more clear to read
-Coroutine now stops if you click again before it has finished
Made anchors not exceed value 1 or be less than 0
-Clicking the category cells now selects them in addition to dragging
-Bugs out if you go in same direction a few times, need to rethink infinitescroll
-Buttons now disabled until the animation finishes
-Now loops correctly when only clicking buttons
-Now no longer goes beyond the given screen space
-Now shows a warning and does nothing if called without no arguments
-Set functions not needed elsewhere private
-Made own scrips for featurecell, categorycell and colorcell that inherift from gridcellhandler
-Made each its own prefab
-Adjusted scripts to work with these changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Tarkistuksessa

Development

Successfully merging this pull request may close these issues.

3 participants