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 a setting for randomly rotating boards on file load Issue #960 #961

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/components/drawers/PreferencesDrawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ class GeneralTab extends Component {
h(PreferencesItem, {
id: 'view.winrategraph_invert',
text: t('Invert winrate graph')
}),
h(PreferencesItem, {
id: 'file.loadrandomizedboard',
text: t('Randomized board rotation on load')
})
)
)
Expand Down
7 changes: 7 additions & 0 deletions src/modules/sabaki.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,13 @@ class Sabaki extends EventEmitter {
if (setting.get('game.goto_end_after_loading')) {
this.goToEnd()
}

//This is the rotation setting that Jiaying put in
if (setting.get('file.loadrandomizedboard')) {
const rotations = ['', 'r', 'rr', 'rrr']
let random = Math.floor(Math.random() * rotations.length)
this.pushBoardTransformation(rotations[random])
}
}

this.setBusy(false)
Expand Down
1 change: 1 addition & 0 deletions src/setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ let defaults = {
'view.show_next_moves': true,
'view.show_siblings': true,
'view.show_winrategraph': true,
'file.loadrandomizedboard': false,
'view.sidebar_width': 200,
'view.sidebar_minwidth': 100,
'view.winrategraph_blunderthreshold': 5,
Expand Down