yairm210 / Unciv

Open-source Android/Desktop remake of Civ V
Mozilla Public License 2.0
8.32k stars 1.56k forks source link

Inviting testers for spruced-up Mod manager screen #3912

Closed SomeTroglodyte closed 3 years ago

SomeTroglodyte commented 3 years ago

I got side-tracked and improved the mod manager screen. Too big for a single PR - and before splitting it into digestible chunks I'd like to sound the waters - likes, dislikes, bug reports, facepalms.

If you have Android Studio set up and would like to help, please take a moment to pull the branch and playtest it. jarplayers - sorry I forgot how to build one.

Instructions - you have cloned a fork and set up everything according to this - this should work:

Otherwise - Android Studio but no Unciv as ready project - you should be able to just Get from Version Control and use my git URL above, no credentials necessary as all Unciv forks are public, and follow the wiki to get a 'desktop' run configuration (and maybe refer to my notes for some details like having to wait for the gradle indexer before the 'classpath' dropdown knows enough about the project.... Then switch branch as above and go?

Screenshots: ModManager-1 ModManager-2

The little eye icon is old, the little arrow I borrowed from the 'Resume' main menu button indicates mods used in any current savegame including autosaves (helps not deleting them - but does not lock the delete button - yet?), and there's an indicator for outdated mods needing an update too (mirrors the " - Updated" added to mods in the middle column, and is cleared - along with the button addition - when you update it.

As for the colourful decoration in the right-hand column - take a guess. I'll have to take down my splashscreen.jpg and replace it, as I forgot to update credits.md for it and lost the attribution. There's an improvement for that not yet coded, will just feel faster with a little better queue prioritization.

Other ideas on the todo list: Column sorting, syncing an installed mod to scroll its online button into view, deleting a ImagesToNotAddToGame if it exists, and fixing a tiny problem 5Hex may soon show: Updating an already installed mod which has removed files will not clear them locally, so your downloaded mod may in time behave differently than what the author intended.

Another request for comments: No existing mod but mine uses the existing feature that contained zips are unpacked recursively. Current master will unzip these into the mod root no matter in which subfolder they were found, and then leave them. My branch here will unzip relative to the sub-zip's container folder, and I have on my list to delete them afterwards. Which do you think is the best approach? As far as I can see, this is not documented yet.

Lastly, the Mods wiki entry would need updating - for mod splash screens if we merge this, for sub-zips, and possibly for the atlas issue (I'm 95% positive a mod must include and maintain its atlas + corresponding png on its repo, as these are used by mobile devices, not the Images folder, right? One could even drop the Images and the mod would work if I'm not mistaken. I think the wiki could be a little clearer on that).

lishaoxia1985 commented 3 years ago

At first, the mod should contain md5 check information, it can be used to check whether the mod downloaded is the whole one and needs to update.

SomeTroglodyte commented 3 years ago

Not a bad idea per se, but ... how to get from github without too much overhead?

Example search response ->

json ```json { "total_count": 1, "incomplete_results": false, "items": [ { "id": 365534465, "node_id": "MDEwOlJlcG9zaXRvcnkzNjU1MzQ0NjU=", "name": "Aliens-have-crashed-on-Earth", "full_name": "SomeTroglodyte/Aliens-have-crashed-on-Earth", "private": false, "owner": { "login": "SomeTroglodyte", "id": 63000004, "node_id": "MDQ6VXNlcjYzMDAwMDA0", "avatar_url": "https://avatars.githubusercontent.com/u/63000004?v=4", "gravatar_id": "", "url": "https://api.github.com/users/SomeTroglodyte", "html_url": "https://github.com/SomeTroglodyte", "followers_url": "https://api.github.com/users/SomeTroglodyte/followers", "following_url": "https://api.github.com/users/SomeTroglodyte/following{/other_user}", "gists_url": "https://api.github.com/users/SomeTroglodyte/gists{/gist_id}", "starred_url": "https://api.github.com/users/SomeTroglodyte/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SomeTroglodyte/subscriptions", "organizations_url": "https://api.github.com/users/SomeTroglodyte/orgs", "repos_url": "https://api.github.com/users/SomeTroglodyte/repos", "events_url": "https://api.github.com/users/SomeTroglodyte/events{/privacy}", "received_events_url": "https://api.github.com/users/SomeTroglodyte/received_events", "type": "User", "site_admin": false }, "html_url": "https://github.com/SomeTroglodyte/Aliens-have-crashed-on-Earth", "description": "A 'we come in peace'-themed joke mod.", "fork": false, "url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth", "forks_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/forks", "keys_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/keys{/key_id}", "collaborators_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/collaborators{/collaborator}", "teams_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/teams", "hooks_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/hooks", "issue_events_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/issues/events{/number}", "events_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/events", "assignees_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/assignees{/user}", "branches_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/branches{/branch}", "tags_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/tags", "blobs_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/git/blobs{/sha}", "git_tags_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/git/tags{/sha}", "git_refs_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/git/refs{/sha}", "trees_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/git/trees{/sha}", "statuses_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/statuses/{sha}", "languages_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/languages", "stargazers_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/stargazers", "contributors_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/contributors", "subscribers_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/subscribers", "subscription_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/subscription", "commits_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/commits{/sha}", "git_commits_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/git/commits{/sha}", "comments_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/comments{/number}", "issue_comment_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/issues/comments{/number}", "contents_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/contents/{+path}", "compare_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/compare/{base}...{head}", "merges_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/merges", "archive_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/{archive_format}{/ref}", "downloads_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/downloads", "issues_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/issues{/number}", "pulls_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/pulls{/number}", "milestones_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/milestones{/number}", "notifications_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/notifications{?since,all,participating}", "labels_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/labels{/name}", "releases_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/releases{/id}", "deployments_url": "https://api.github.com/repos/SomeTroglodyte/Aliens-have-crashed-on-Earth/deployments", "created_at": "2021-05-08T14:26:23Z", "updated_at": "2021-05-10T19:15:17Z", "pushed_at": "2021-05-10T19:15:15Z", "git_url": "git://github.com/SomeTroglodyte/Aliens-have-crashed-on-Earth.git", "ssh_url": "git@github.com:SomeTroglodyte/Aliens-have-crashed-on-Earth.git", "clone_url": "https://github.com/SomeTroglodyte/Aliens-have-crashed-on-Earth.git", "svn_url": "https://github.com/SomeTroglodyte/Aliens-have-crashed-on-Earth", "homepage": "", "size": 1060, "stargazers_count": 1, "watchers_count": 1, "language": null, "has_issues": true, "has_projects": true, "has_downloads": true, "has_wiki": true, "has_pages": false, "forks_count": 0, "mirror_url": null, "archived": false, "disabled": false, "open_issues_count": 1, "license": null, "forks": 0, "open_issues": 1, "watchers": 1, "default_branch": "master", "score": 1.0 } ] } ```

As you can see, tons of redundant info but no checksum-type data. id and node_id will not change on update. The /repos API also does not have more info. And I wouldn't download each and every zip in its entirety to hash it... Update: You do get sha hashes - for commits and files through the branches api. Not for the entire repo, so we wouldn't be checking local integrity...

No, updated_at is the best change detector whe have. (?)

ajustsomebody commented 3 years ago

i havent tested the mod but those images over mod size should really be scaled up/down to one size, it is really unpleasant to have those in different dimensions

SomeTroglodyte commented 3 years ago

They are. I chose user avatars to be smaller than splash screens, though.