Skip to content
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

Add more settings to steemworlds.sk #38

Merged
merged 6 commits into from Jul 3, 2019

Conversation

Abwasserrohr
Copy link
Owner

@Abwasserrohr Abwasserrohr commented Jun 26, 2019

This pull request aims to add more settings for steemworlds.sk including a first menu which allows to change those settings easily.

Be sure to only allow the owner of the world to change the settings.

Functions (steemworlds.sk):

  • Works as expected
  • Saves to blockchain
  • Loads from blockchain
  • Files load without errors

Menu functions (steemworlds-gui.sk):

  • Works as expected
  • Changes can be done
  • Changes are only possible by the world owner
  • Menu has "back to previous menu" buttons
  • Files load without errors

Video of the working menu: https://youtu.be/lBZD8RanohQ

Close #32 once merged
Close #31 once merged
Close #26 once merged

Added functions:
setSteemWorldWeather(world:world,weather:text)
applySteemWorldSettings(world:world)

Worlds now also get some gamerules, like randomTickSpeed, doWeatherCycle and doDaylightCycle saved to blockchain, also time, weather are now stored to blockchain. They also load if a world is loaded.
@Abwasserrohr Abwasserrohr added enhancement New feature or request steemworlds.sk labels Jun 26, 2019
@Abwasserrohr Abwasserrohr self-assigned this Jun 26, 2019
@Abwasserrohr Abwasserrohr added this to Convenient overview menu in steemworlds.sk Jun 26, 2019
@Abwasserrohr Abwasserrohr changed the title Add moore settings to steemworlds.sk Add more settings to steemworlds.sk Jun 26, 2019
The new getWorldPermission function allows to check if the player is allowed to change settings or build in a world. It is pretty simple right now and only allows the direct owner of the world to do anything, but it can be enhanced later.

Using the function instead of directly checking for permissions, improvements can be made easily later. While the permissiontype parameter of the function does not anything yet, it will be used later to give specific permissions later on. Like giving build rights to specific users or interaction permissions.
Since loading the world edit history can take a while, it is now done within a async process.
To use it, call getSteemWorldHistory(username,worldname) and then wait until getSteemWorldHistoryResult(username,worldname) no longer returns "wait". getSteemWorldHistoryResult(username,worldname) is then going to return the result.
Before, the getSteemWorldHistoryAsync function would have stored the world history for the entire server session, now, it is limited to 5 seconds after the process is done.
This new menu allows the player to open it with /steemworlds, /sw or /sc. There, the player can currently change some settings like gamerules, time and weather.

Later, players can view comments, votes and the history of the world through the menu.
@Abwasserrohr Abwasserrohr merged commit 315507a into master Jul 3, 2019
@Abwasserrohr Abwasserrohr deleted the Abwasserrohr-moresettings branch July 3, 2019 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request steemworlds.sk
Projects
steemworlds.sk
  
Convenient overview menu
1 participant