KnossosNET / Knossos.NET

Repository for the Knossos.NET launcher, currently in development.
GNU General Public License v3.0
25 stars 10 forks source link

Some Formatting Adjustments To Download List #44

Closed JohnAFernandez closed 10 months ago

JohnAFernandez commented 10 months ago

I noticed that the formatting and spacing in the download list were a little rough, so I made some changes.

Before: Screen Shot 2023-11-14 at 10 40 53 AM

After: Screen Shot 2023-11-14 at 10 39 04 AM

JohnAFernandez commented 10 months ago

I was also trying to find a way to remove the Downloading <package> lines when the download had succeeded, but I couldn't do that by only altering the .Axaml file. (I couldn't find a way to check for more than one boolean with a binding)

JohnAFernandez commented 10 months ago

Also,I am not trying to make the number of tasks smaller at the top....

Shivansps commented 10 months ago

I was also trying to find a way to remove the Downloading <package> lines when the download had succeeded, but I couldn't do that by only altering the .Axaml file. (I couldn't find a way to check for more than one boolean with a binding)

You arent going to be able to hide from the axml, im sure that what would happen is that an empty space will be displayed instead of what you would want it to do. I dont know how to bind to multiple booleans, it might be possible but i never asked.

But you should be able to make it dissapear from code rather easily Here is were the download task is inserted into the list of tasks the current task has, (the task list works very similar to a tree data structure.) https://github.com/KnossosNET/Knossos.NET/blob/main/Knossos.NET/ViewModels/Templates/TaskItemViewModel.cs#L3206

The only thing you would need to do is to remove it from the list around line 3260 were we can be sure the file has been downloaded and the checksum is ok. await Dispatcher.UIThread.InvokeAsync(() => TaskList.Remove(filetask));

Always with a dispatcher when we are modifiyng a collection that is binded to the UI.

That should do it, altrought it will need some testing.

Also, this is only for mod installs/modify. If you want to do the same for builds you also need to do the same in the InstallBuild method.

JohnAFernandez commented 10 months ago

I added the line and it seemed to work fine. I think I would only add it to the mod install and not build install as mod install is just much busier.

JohnAFernandez commented 10 months ago

My testing seems to show that it works: Screen Shot 2023-11-16 at 12 26 05 AM

JohnAFernandez commented 10 months ago

Btw, the last commit makes the "Complete!" text even with the progress bars. So that is intentionally different from the first set of screenshots.

Shivansps commented 10 months ago

Looks good to me, if this is done we can merge

wookieejedi commented 10 months ago

Cyborg says that's it for this one, so I'll merge in a few minutes unless Shivan beats me to it :D