Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add transfer box customization #1955

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
botder merged 5 commits into multitheftauto:master from botder:feature/transferbox
Jan 4, 2021

Conversation

@botder
Copy link
Member

@botder botder commented Dec 29, 2020
edited
Loading

Transfer box customization

This work is based on the work by @CrosRoad95 in pull request #171

grafik
You are able to hide and show the transfer box on clients.
You can hide the transfer box from server-side before the client starts resources to not show the download window at all.
You are supposed to use a resource with higher download priority to show a custom transfer box.
You will only receive events for the resource download transfer box.
The map download transfer box does not emit these events and can not be hidden with the scripting functions.
Players can force the download window to always appear regardless of the script provided setting through settings.

New server functions

These functions are global. That means they apply for every player.

bool setTransferBoxVisible(bool visible)
bool isTransferBoxVisible() -- returns false only if the server wants the transfer box hidden for players

New client functions

bool setTransferBoxVisible(bool visible)
bool isTransferBoxVisible() -- returns true if transfer box should be visible (if a download is running), it does not represent the value set by setTransferBoxVisible
bool isTransferBoxAlwaysVisible() -- returns true if the user enabled the main menu setting to always display it (cvar)

New client events

onClientResourceFileDownload(resource-pointer resource, string fileName, number fileSize, string state)
-- state can be "queued" or "finished" or "failed"
onClientTransferBoxProgressChange(number downloadedBytes, number downloadTotalBytes)
onClientTransferBoxVisibilityChange(bool isVisible)

patrikjuvonen, PlatinMTA, Vadya963, XeNikk, JDM170, jayceon123, qualiti, Unde-R, Lpsd, xLive, and 5 more reacted with thumbs up emoji CrosRoad95, PlatinMTA, Vadya963, and jayceon123 reacted with laugh emoji stoneage-mta and jey-banned reacted with heart emoji PlatinMTA, Vadya963, XeNikk, and jayceon123 reacted with rocket emoji XeNikk and jayceon123 reacted with eyes emoji
Based on pull request multitheftauto#171 by CrosRoad95
@botder botder added the enhancement New feature or request label Dec 29, 2020
@patrikjuvonen patrikjuvonen added this to the 1.6 milestone Dec 29, 2020
Copy link
Member

@Lpsd Lpsd left a comment

Choose a reason for hiding this comment

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

Good stuff. I've created a basic resource to test (and show off) these features.

It disables the default transfer box and replaces it with a basic dx progress bar, as well as the file name and progress percentage displayed above it.

lgtm :shipit:

CrosRoad95 reacted with rocket emoji
Copy link
Contributor

@patrikjuvonen patrikjuvonen left a comment

Choose a reason for hiding this comment

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

Did light testing and works well. Looks good!

Copy link
Member Author

botder commented Jan 4, 2021

Individual resource file download progress can't be displayed because the network module returns false in a GetDownloadStatus lookup through the HTTP server interface.

@botder botder merged commit 650fed6 into multitheftauto:master Jan 4, 2021
@botder botder deleted the feature/transferbox branch January 4, 2021 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sbx320 sbx320 sbx320 requested changes

@Lpsd Lpsd Lpsd approved these changes

+1 more reviewer

@patrikjuvonen patrikjuvonen patrikjuvonen approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

enhancement New feature or request

Projects

None yet

Milestone

1.5.9

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /