This repository has been archived by the owner on Mar 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Custom bg names #120
Open
stonedDiscord
wants to merge
6
commits into
master
Choose a base branch
from
custom_bg
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Custom bg names #120
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
81d1ec2
set defaults for bg
stonedDiscord 96d7a3b
add custom bg to constructor and make it work
stonedDiscord c690e20
add options to the yaml loader
stonedDiscord 1ad4727
_allowed
stonedDiscord 2a55396
logik ist das sonderbarste bonbon von allen
stonedDiscord 3684ec5
Merge branch 'master' into custom_bg
stonedDiscord File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,8 +37,9 @@ def __init__(self, | |
area_id, | ||
server, | ||
name, | ||
background, | ||
bg_lock, | ||
background='gs4', | ||
bg_lock=False, | ||
custom_bg=True, | ||
evidence_mod='FFA', | ||
locking_allowed=False, | ||
iniswap_allowed=True, | ||
|
@@ -54,6 +55,7 @@ def __init__(self, | |
self.name = name | ||
self.background = background | ||
self.bg_lock = bg_lock | ||
self.custom_bg = custom_bg | ||
self.server = server | ||
self.music_looper = None | ||
self.next_message_time = 0 | ||
|
@@ -410,8 +412,7 @@ def change_background(self, bg: str): | |
Raises: | ||
AreaError: if `bg` is not in background list | ||
""" | ||
|
||
if bg.lower() not in (name.lower() | ||
if self.custom_bg == False or bg.lower() not in (name.lower() | ||
for name in self.server.backgrounds): | ||
raise AreaError('Invalid background name.') | ||
self.background = bg | ||
|
@@ -738,6 +739,12 @@ def load_areas(self): | |
item['locking_allowed'] = False | ||
if 'iniswap_allowed' not in item: | ||
item['iniswap_allowed'] = True | ||
if 'background' not in item: | ||
item['background'] = 'gs4' | ||
if 'bglock' not in item: | ||
item['bglock'] = False | ||
if 'custom_bg_allowed' not in item: | ||
item['custom_bg_allowed'] = True | ||
if 'showname_changes_allowed' not in item: | ||
item['showname_changes_allowed'] = True | ||
if 'shouts_allowed' not in item: | ||
|
@@ -751,7 +758,7 @@ def load_areas(self): | |
item['area']) | ||
self.areas.append( | ||
self.Area(self.cur_id, self.server, item['area'], | ||
item['background'], item['bglock'], | ||
item['background'], item['bglock'], item['custom_bg_allowed'], | ||
item['evidence_mod'], item['locking_allowed'], | ||
item['iniswap_allowed'], | ||
item['showname_changes_allowed'], | ||
Comment on lines
+761
to
764
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually now that this was changed, I think you can actually get away with doing self.Area(self.cur_id, self.server, **item) and then the default parameters set in |
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Will always say "invalid background name" if custom backgrounds is set to false.