-
Notifications
You must be signed in to change notification settings - Fork 41
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 settings to configure features on level editor #139
base: master
Are you sure you want to change the base?
Conversation
2e4c9d4
to
a4a2bef
Compare
0288f5d
to
7030281
Compare
Nice! @YglesEyes maybe you could use this as a starting point for what we've just mentioned in #161 ? |
a89075a
to
be9c675
Compare
Yes thanks, I just wait for Donorhan back (on monday) to discuss with him before doing anything |
be9c675
to
4d06fc6
Compare
@Donorhan Anything we can do to help on that one? |
@@ -1,26 +1,48 @@ | |||
import { moduleType } from '../../../client/helpers'; | |||
import { canUseLevelFeature, moduleType } from '../../../lib/misc'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moduleType
should be imported from '../../../client/helpers'
core/client/ui/radial-menu.js
Outdated
|
||
// If it's an admin, we show the item but if it's disabled for all, the action will be ignored | ||
const isAdmin = user.roles?.admin; | ||
if (!isAdmin && !canUseLevelFeature(user, 'reactions')) mainMenuItems.splice(0, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
splice(0,1)
removes notifications not reactions
moduleType.RADIAL_MENU, | ||
]); | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bracket is misplaced, registerModules
should take 2 params
moduleType.RADIAL_MENU, | ||
); | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too
registerModules([ | ||
{ id: 'send-text', icon: '💬', shortcut: 56, order: 41, label: 'Text', closeMenu: true, scope: 'other' }, | ||
moduleType.RADIAL_MENU, | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too
Maybe we should also add a setting for tasks and inventory? |
4d06fc6
to
528fe80
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me thanks! I left a few comments, it's not blocking but it would make it easier to add permissions later I think 😊
@@ -39,6 +45,30 @@ Template.levelToolbox.events({ | |||
const { x, y } = user.profile; | |||
updateLevel(level.name, { x, y }, level.hide); | |||
}, | |||
'change .js-voice-amplifier-select'(event) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small idea to have less code: add a data-permission="xxx"
then on the JS side do something like:
'change .permission-list select'(event) {
const { permission } = event.target.dataset;
updateFeaturePermissionLevel(permission, event);
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So cool, I searched for something like this but couldn't find, good to know :)
|
||
hotkeys('r', { keyup: true, scope: scopes.player }, event => { | ||
if (event.repeat) return; | ||
|
||
const user = Meteor.user({ fields: { _id: 1, 'profile.levelId': 1, roles: 1 } }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can make it simpler to avoid code repetition:
Have a variable local to the file and update it against the condition line 13. Then in the rest of the functions rely on this variable
@@ -10,7 +10,75 @@ | |||
<label for="level-toolbox-hidden">Hide from the list of levels</label> | |||
</div> | |||
<div> | |||
<button id="level-toolbox-position" type="button" class="js-spawn-position button">Set spawn position (current {{ spawnPosition }})</button> | |||
<div class="feature-dropdown"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be better to loop over a permission array?
528fe80
to
8f9c0fc
Compare
There are features that level admins may want to enable or disable on their level, so here we're giving them the chance to do just that with: * the voice amplifier * the global chat * punches
8f9c0fc
to
b8a8886
Compare
@Donorhan What about this PR ? Is it good for you or need changes ? |
There are features that level admins may want to enable or disable on their level, so here we're giving them the chance to do just that with: