mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-29 02:23:22 +08:00
Bit more tidying
This commit is contained in:
parent
83e7388d49
commit
1c0e4896fa
@ -4132,16 +4132,16 @@
|
||||
"assets/build/windows/x64/python.exe": "https://files.ballistica.net/cache/ba1/25/a7/dc87c1be41605eb6fefd0145144c",
|
||||
"assets/build/windows/x64/python37.dll": "https://files.ballistica.net/cache/ba1/b9/e4/d912f56e42e9991bcbb4c804cfcb",
|
||||
"assets/build/windows/x64/pythonw.exe": "https://files.ballistica.net/cache/ba1/6c/bb/b6f52c306aa4e88061510e96cefe",
|
||||
"build/prefab/linux-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/f0/6c/17cfdbdfeac96070b5134251a451",
|
||||
"build/prefab/linux-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/52/25/297b9a00058301b85ddb02f6ee09",
|
||||
"build/prefab/linux/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/94/a8/e1477ff611c1e1a5a625bffff60c",
|
||||
"build/prefab/linux/release/ballisticacore": "https://files.ballistica.net/cache/ba1/c6/d8/20917734baac0fdec68f72c41ed7",
|
||||
"build/prefab/mac-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/ed/2b/0f91bf6faf8efd08890a687d48d7",
|
||||
"build/prefab/mac-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/1b/cc/88ba8eb1dbd3cc30181d75b4d16e",
|
||||
"build/prefab/mac/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/9e/df/8560a3f6a5394d6e1e4eff3c4225",
|
||||
"build/prefab/mac/release/ballisticacore": "https://files.ballistica.net/cache/ba1/73/e2/8d816aa46639e1200a63c387ad5a",
|
||||
"build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/85/9a/d64a09c882fe8ddd061d37547ea3",
|
||||
"build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/d9/f8/ede540a4757ea9c246b4818abc93",
|
||||
"build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/33/00/49adaf80c83df4d6d806691676c0",
|
||||
"build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/5e/e3/4a2fd651c619449b0ac47580b442"
|
||||
"build/prefab/linux-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/36/5a/025457e87759c13a5067617816cd",
|
||||
"build/prefab/linux-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/66/49/fb5663472ab1f4bd32f5748ba4d7",
|
||||
"build/prefab/linux/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/44/3e/6eb652f11d24c22f87ae8aab399b",
|
||||
"build/prefab/linux/release/ballisticacore": "https://files.ballistica.net/cache/ba1/f4/57/7e48692454b644a7111902f12b58",
|
||||
"build/prefab/mac-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/18/55/246021de09b021993e8bdbdb19a6",
|
||||
"build/prefab/mac-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/3f/ea/079aa2649359d2024b7c20dd19d0",
|
||||
"build/prefab/mac/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/05/5d/2608f732d75799cfe09c6947736a",
|
||||
"build/prefab/mac/release/ballisticacore": "https://files.ballistica.net/cache/ba1/ef/20/4f2abb279d24dced1f11f83fbe78",
|
||||
"build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/f9/36/28081d9962d3f91c286663357e80",
|
||||
"build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/51/55/83ceb6ffb806c75815e5f9e88008",
|
||||
"build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/46/ea/461f76e113d3a02da3c61ea04bdb",
|
||||
"build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/83/af/a8ce32760e4dc300ac861f745615"
|
||||
}
|
||||
@ -34,7 +34,7 @@ NOTE: This file was autogenerated by gendummymodule; do not edit by hand.
|
||||
"""
|
||||
|
||||
# (hash we can use to see if this file is out of date)
|
||||
# SOURCES_HASH=34814525496434113316994893689868607574
|
||||
# SOURCES_HASH=33373537027192610824913965080968605548
|
||||
|
||||
# I'm sorry Pylint. I know this file saddens you. Be strong.
|
||||
# pylint: disable=useless-suppression
|
||||
@ -727,13 +727,6 @@ class Node:
|
||||
"""
|
||||
return bool()
|
||||
|
||||
def get_name(self) -> str:
|
||||
"""get_name() -> str
|
||||
|
||||
Return the name assigned to a Node; used mainly for debugging
|
||||
"""
|
||||
return str()
|
||||
|
||||
# Show that ur return type varies based on "doraise" value:
|
||||
@overload
|
||||
def getdelegate(self,
|
||||
@ -756,6 +749,13 @@ class Node:
|
||||
"""
|
||||
return None
|
||||
|
||||
def getname(self) -> str:
|
||||
"""getname() -> str
|
||||
|
||||
Return the name assigned to a Node; used mainly for debugging
|
||||
"""
|
||||
return str()
|
||||
|
||||
def getnodetype(self) -> str:
|
||||
"""getnodetype() -> str
|
||||
|
||||
@ -915,8 +915,8 @@ class SessionPlayer:
|
||||
"""
|
||||
return {'foo': 'bar'}
|
||||
|
||||
def get_name(self, full: bool = False, icon: bool = True) -> str:
|
||||
"""get_name(full: bool = False, icon: bool = True) -> str
|
||||
def getname(self, full: bool = False, icon: bool = True) -> str:
|
||||
"""getname(full: bool = False, icon: bool = True) -> str
|
||||
|
||||
Returns the player's name. If icon is True, the long version of the
|
||||
name may include an icon.
|
||||
|
||||
@ -282,20 +282,6 @@ class Activity(DependencyComponent, Generic[PlayerType, TeamType]):
|
||||
"""(internal)"""
|
||||
self._has_ended = val
|
||||
|
||||
# def set_immediate_end(self, results: ba.TeamGameResults, delay: float,
|
||||
# force: bool) -> None:
|
||||
# """Set the activity to die immediately after beginning.
|
||||
|
||||
# (internal)
|
||||
# """
|
||||
# if self.has_begun():
|
||||
# raise RuntimeError('This should only be called for Activities'
|
||||
# 'that have not yet begun.')
|
||||
# if not self._should_end_immediately or force:
|
||||
# self._should_end_immediately = True
|
||||
# self._should_end_immediately_results = results
|
||||
# self._should_end_immediately_delay = delay
|
||||
|
||||
def destroy(self) -> None:
|
||||
"""Begin the process of tearing down the activity.
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ def game_begin_analytics() -> None:
|
||||
_ba.increment_analytics_count('Co-op round start 4+ human players')
|
||||
|
||||
elif isinstance(session, DualTeamSession):
|
||||
_ba.set_analytics_screen('Teams Game: ' + activity.get_name())
|
||||
_ba.set_analytics_screen('Teams Game: ' + activity.getname())
|
||||
_ba.increment_analytics_count('Teams round start')
|
||||
if len(activity.players) == 1:
|
||||
_ba.increment_analytics_count('Teams round start 1 human player')
|
||||
@ -74,7 +74,7 @@ def game_begin_analytics() -> None:
|
||||
_ba.increment_analytics_count('Teams round start 8+ human players')
|
||||
|
||||
elif isinstance(session, FreeForAllSession):
|
||||
_ba.set_analytics_screen('FreeForAll Game: ' + activity.get_name())
|
||||
_ba.set_analytics_screen('FreeForAll Game: ' + activity.getname())
|
||||
_ba.increment_analytics_count('Free-for-all round start')
|
||||
if len(activity.players) == 1:
|
||||
_ba.increment_analytics_count(
|
||||
|
||||
@ -56,7 +56,7 @@ class GameActivity(Activity[PlayerType, TeamType]):
|
||||
|
||||
tips: List[Union[str, Dict[str, Any]]] = []
|
||||
|
||||
# Default get_name() will return this if not None.
|
||||
# Default getname() will return this if not None.
|
||||
name: Optional[str] = None
|
||||
|
||||
# Default get_description() will return this if not None.
|
||||
@ -112,7 +112,7 @@ class GameActivity(Activity[PlayerType, TeamType]):
|
||||
return cls.score_info if cls.score_info is not None else ScoreInfo()
|
||||
|
||||
@classmethod
|
||||
def get_name(cls) -> str:
|
||||
def getname(cls) -> str:
|
||||
"""Return a str name for this game type.
|
||||
|
||||
This default implementation simply returns the 'name' class attr.
|
||||
@ -123,9 +123,9 @@ class GameActivity(Activity[PlayerType, TeamType]):
|
||||
def get_display_string(cls, settings: Optional[Dict] = None) -> ba.Lstr:
|
||||
"""Return a descriptive name for this game/settings combo.
|
||||
|
||||
Subclasses should override get_name(); not this.
|
||||
Subclasses should override getname(); not this.
|
||||
"""
|
||||
name = Lstr(translate=('gameNames', cls.get_name()))
|
||||
name = Lstr(translate=('gameNames', cls.getname()))
|
||||
|
||||
# A few substitutions for 'Epic', 'Solo' etc. modes.
|
||||
# FIXME: Should provide a way for game types to define filters of
|
||||
@ -512,7 +512,7 @@ class GameActivity(Activity[PlayerType, TeamType]):
|
||||
|
||||
# Store some basic info about players present at start time.
|
||||
self.initial_player_info = [
|
||||
PlayerInfo(name=p.get_name(full=True), character=p.character)
|
||||
PlayerInfo(name=p.getname(full=True), character=p.character)
|
||||
for p in self.players
|
||||
]
|
||||
|
||||
@ -924,7 +924,7 @@ class GameActivity(Activity[PlayerType, TeamType]):
|
||||
from ba._gameutils import animate
|
||||
from ba._coopsession import CoopSession
|
||||
from bastd.actor.playerspaz import PlayerSpaz
|
||||
name = player.get_name()
|
||||
name = player.getname()
|
||||
color = player.color
|
||||
highlight = player.highlight
|
||||
|
||||
@ -941,7 +941,7 @@ class GameActivity(Activity[PlayerType, TeamType]):
|
||||
# If this is co-op and we're on Courtyard or Runaround, add the
|
||||
# material that allows us to collide with the player-walls.
|
||||
# FIXME: Need to generalize this.
|
||||
if isinstance(self.session, CoopSession) and self.map.get_name() in [
|
||||
if isinstance(self.session, CoopSession) and self.map.getname() in [
|
||||
'Courtyard', 'Tower D'
|
||||
]:
|
||||
mat = self.map.preloaddata['collide_with_wall_material']
|
||||
|
||||
@ -45,11 +45,11 @@ def get_device_value(device: ba.InputDevice, name: str) -> Any:
|
||||
useragentstring = app.user_agent_string
|
||||
platform = app.platform
|
||||
subplatform = app.subplatform
|
||||
bs_config = _ba.app.config
|
||||
appconfig = _ba.app.config
|
||||
|
||||
# If there's an entry in our config for this controller, use it.
|
||||
if 'Controllers' in bs_config:
|
||||
ccfgs = bs_config['Controllers']
|
||||
if 'Controllers' in appconfig:
|
||||
ccfgs = appconfig['Controllers']
|
||||
if devicename in ccfgs:
|
||||
mapping = None
|
||||
if unique_id in ccfgs[devicename]:
|
||||
@ -621,15 +621,15 @@ def get_last_player_name_from_input_device(device: ba.InputDevice) -> str:
|
||||
|
||||
(generally the last one used there)
|
||||
"""
|
||||
bs_config = _ba.app.config
|
||||
appconfig = _ba.app.config
|
||||
|
||||
# Look for a default player profile name for them;
|
||||
# otherwise default to their current random name.
|
||||
profilename = '_random'
|
||||
key_name = device.name + ' ' + device.unique_identifier
|
||||
if ('Default Player Profiles' in bs_config
|
||||
and key_name in bs_config['Default Player Profiles']):
|
||||
profilename = bs_config['Default Player Profiles'][key_name]
|
||||
if ('Default Player Profiles' in appconfig
|
||||
and key_name in appconfig['Default Player Profiles']):
|
||||
profilename = appconfig['Default Player Profiles'][key_name]
|
||||
if profilename == '_random':
|
||||
profilename = device.get_default_player_name()
|
||||
if profilename == '__account__':
|
||||
|
||||
@ -455,7 +455,7 @@ class Chooser:
|
||||
def _do_nothing(self) -> None:
|
||||
"""Does nothing! (hacky way to disable callbacks)"""
|
||||
|
||||
def _get_name(self, full: bool = False) -> str:
|
||||
def _getname(self, full: bool = False) -> str:
|
||||
name_raw = name = self._profilenames[self._profileindex]
|
||||
clamp = False
|
||||
if name == '_random':
|
||||
@ -569,8 +569,8 @@ class Chooser:
|
||||
_ba.app.config.commit()
|
||||
|
||||
# Set this player's short and full name.
|
||||
self._player.set_name(self._get_name(),
|
||||
self._get_name(full=True),
|
||||
self._player.set_name(self._getname(),
|
||||
self._getname(full=True),
|
||||
real=True)
|
||||
self._ready = True
|
||||
self._update_text()
|
||||
@ -685,12 +685,12 @@ class Chooser:
|
||||
|
||||
# Once we're ready, we've saved the name, so lets ask the system
|
||||
# for it so we get appended numbers and stuff.
|
||||
text = Lstr(value=self._player.get_name(full=True))
|
||||
text = Lstr(value=self._player.getname(full=True))
|
||||
text = Lstr(value='${A} (${B})',
|
||||
subs=[('${A}', text),
|
||||
('${B}', Lstr(resource='readyText'))])
|
||||
else:
|
||||
text = Lstr(value=self._get_name(full=True))
|
||||
text = Lstr(value=self._getname(full=True))
|
||||
|
||||
can_switch_teams = len(self.lobby.teams) > 1
|
||||
|
||||
|
||||
@ -192,7 +192,7 @@ class Map(Actor):
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
def get_name(cls) -> str:
|
||||
def getname(cls) -> str:
|
||||
"""Return the unique name of this map, in English."""
|
||||
return cls.name
|
||||
|
||||
@ -231,14 +231,14 @@ class Map(Actor):
|
||||
# Set area-of-interest bounds.
|
||||
aoi_bounds = self.get_def_bound_box('area_of_interest_bounds')
|
||||
if aoi_bounds is None:
|
||||
print('WARNING: no "aoi_bounds" found for map:', self.get_name())
|
||||
print('WARNING: no "aoi_bounds" found for map:', self.getname())
|
||||
aoi_bounds = (-1, -1, -1, 1, 1, 1)
|
||||
gnode.area_of_interest_bounds = aoi_bounds
|
||||
|
||||
# Set map bounds.
|
||||
map_bounds = self.get_def_bound_box('map_bounds')
|
||||
if map_bounds is None:
|
||||
print('WARNING: no "map_bounds" found for map:', self.get_name())
|
||||
print('WARNING: no "map_bounds" found for map:', self.getname())
|
||||
map_bounds = (-30, -10, -30, 30, 100, 30)
|
||||
_ba.set_map_bounds(map_bounds)
|
||||
|
||||
|
||||
@ -167,13 +167,13 @@ class Player(Generic[TeamType]):
|
||||
"""
|
||||
return self._sessionplayer.exists()
|
||||
|
||||
def get_name(self, full: bool = False, icon: bool = True) -> str:
|
||||
"""get_name(full: bool = False, icon: bool = True) -> str
|
||||
def getname(self, full: bool = False, icon: bool = True) -> str:
|
||||
"""getname(full: bool = False, icon: bool = True) -> str
|
||||
|
||||
Returns the player's name. If icon is True, the long version of the
|
||||
name may include an icon.
|
||||
"""
|
||||
return self._sessionplayer.get_name(full=full, icon=icon)
|
||||
return self._sessionplayer.getname(full=full, icon=icon)
|
||||
|
||||
def is_alive(self) -> bool:
|
||||
"""is_alive() -> bool
|
||||
|
||||
@ -50,15 +50,15 @@ def get_player_profile_icon(profilename: str) -> str:
|
||||
"""
|
||||
from ba._enums import SpecialChar
|
||||
|
||||
bs_config = _ba.app.config
|
||||
appconfig = _ba.app.config
|
||||
icon: str
|
||||
try:
|
||||
is_global = bs_config['Player Profiles'][profilename]['global']
|
||||
is_global = appconfig['Player Profiles'][profilename]['global']
|
||||
except KeyError:
|
||||
is_global = False
|
||||
if is_global:
|
||||
try:
|
||||
icon = bs_config['Player Profiles'][profilename]['icon']
|
||||
icon = appconfig['Player Profiles'][profilename]['icon']
|
||||
except KeyError:
|
||||
icon = _ba.charstr(SpecialChar.LOGO)
|
||||
else:
|
||||
@ -71,9 +71,9 @@ def get_player_profile_colors(
|
||||
profiles: Dict[str, Dict[str, Any]] = None
|
||||
) -> Tuple[Tuple[float, float, float], Tuple[float, float, float]]:
|
||||
"""Given a profile, return colors for them."""
|
||||
bs_config = _ba.app.config
|
||||
appconfig = _ba.app.config
|
||||
if profiles is None:
|
||||
profiles = bs_config['Player Profiles']
|
||||
profiles = appconfig['Player Profiles']
|
||||
|
||||
# Special case: when being asked for a random color in kiosk mode,
|
||||
# always return default purple.
|
||||
|
||||
@ -238,7 +238,6 @@ class Session:
|
||||
|
||||
def on_player_leave(self, sessionplayer: ba.SessionPlayer) -> None:
|
||||
"""Called when a previously-accepted ba.SessionPlayer leaves."""
|
||||
# pylint: disable=too-many-branches
|
||||
|
||||
if sessionplayer not in self.players:
|
||||
print('ERROR: Session.on_player_leave called'
|
||||
@ -250,7 +249,8 @@ class Session:
|
||||
activity = self._activity_weak()
|
||||
|
||||
if not sessionplayer.in_game:
|
||||
# Ok, the player's still in the lobby. Simply remove them from it.
|
||||
|
||||
# Ok, the player is still in the lobby; simply remove them.
|
||||
with _ba.Context(self):
|
||||
try:
|
||||
self.lobby.remove_chooser(sessionplayer)
|
||||
@ -261,11 +261,10 @@ class Session:
|
||||
# teams/activities/etc.
|
||||
sessionteam = sessionplayer.team
|
||||
assert sessionteam is not None
|
||||
assert sessionplayer in sessionteam.players
|
||||
|
||||
_ba.screenmessage(
|
||||
Lstr(resource='playerLeftText',
|
||||
subs=[('${PLAYER}', sessionplayer.get_name(full=True))]))
|
||||
subs=[('${PLAYER}', sessionplayer.getname(full=True))]))
|
||||
|
||||
# Remove them from their SessionTeam.
|
||||
if sessionplayer in sessionteam.players:
|
||||
@ -287,38 +286,42 @@ class Session:
|
||||
|
||||
# If we're a non-team session, remove their team too.
|
||||
if not self.use_teams:
|
||||
|
||||
# They should have been the only one on their team.
|
||||
assert not sessionteam.players
|
||||
|
||||
# Remove their Team from the Activity.
|
||||
if activity is not None:
|
||||
if sessionteam.gameteam in activity.teams:
|
||||
activity.remove_team(sessionteam)
|
||||
else:
|
||||
print('Team not found in Activity in on_player_leave.')
|
||||
|
||||
# And then from the Session.
|
||||
with _ba.Context(self):
|
||||
if sessionteam in self.teams:
|
||||
try:
|
||||
self.teams.remove(sessionteam)
|
||||
self.on_team_leave(sessionteam)
|
||||
except Exception:
|
||||
print_exception(
|
||||
f'Error in on_team_leave for Session {self}.')
|
||||
else:
|
||||
print('Team no in Session teams in on_player_leave.')
|
||||
try:
|
||||
sessionteam.reset_sessiondata()
|
||||
except Exception:
|
||||
print_exception(
|
||||
f'Error clearing sessiondata'
|
||||
f' for team {sessionteam} in session {self}.')
|
||||
self._remove_player_team(sessionteam, activity)
|
||||
|
||||
# Now remove them from the session list.
|
||||
self.players.remove(sessionplayer)
|
||||
|
||||
def _remove_player_team(self, sessionteam: ba.SessionTeam,
|
||||
activity: Optional[ba.Activity]) -> None:
|
||||
"""Remove the player-specific team in non-teams mode."""
|
||||
|
||||
# They should have been the only one on their team.
|
||||
assert not sessionteam.players
|
||||
|
||||
# Remove their Team from the Activity.
|
||||
if activity is not None:
|
||||
if sessionteam.gameteam in activity.teams:
|
||||
activity.remove_team(sessionteam)
|
||||
else:
|
||||
print('Team not found in Activity in on_player_leave.')
|
||||
|
||||
# And then from the Session.
|
||||
with _ba.Context(self):
|
||||
if sessionteam in self.teams:
|
||||
try:
|
||||
self.teams.remove(sessionteam)
|
||||
self.on_team_leave(sessionteam)
|
||||
except Exception:
|
||||
print_exception(
|
||||
f'Error in on_team_leave for Session {self}.')
|
||||
else:
|
||||
print('Team no in Session teams in on_player_leave.')
|
||||
try:
|
||||
sessionteam.reset_sessiondata()
|
||||
except Exception:
|
||||
print_exception(f'Error clearing sessiondata'
|
||||
f' for team {sessionteam} in session {self}.')
|
||||
|
||||
def end(self) -> None:
|
||||
"""Initiates an end to the session and a return to the main menu.
|
||||
|
||||
@ -408,6 +411,15 @@ class Session:
|
||||
|
||||
return UNHANDLED
|
||||
|
||||
class _SetActivityLock:
|
||||
|
||||
def __init__(self, session: ba.Session) -> None:
|
||||
self._session = session
|
||||
self._session._in_set_activity = True
|
||||
|
||||
def __del__(self) -> None:
|
||||
self._session._in_set_activity = False
|
||||
|
||||
def set_activity(self, activity: ba.Activity) -> None:
|
||||
"""Assign a new current ba.Activity for the session.
|
||||
|
||||
@ -420,8 +432,7 @@ class Session:
|
||||
|
||||
# Sanity test: make sure this doesn't get called recursively.
|
||||
if self._in_set_activity:
|
||||
raise RuntimeError(
|
||||
'Session.set_activity() cannot be called recursively.')
|
||||
raise RuntimeError('Session.set_activity() called recursively.')
|
||||
self._in_set_activity = True
|
||||
|
||||
if activity.session is not _ba.getsession():
|
||||
@ -432,7 +443,7 @@ class Session:
|
||||
return
|
||||
|
||||
if activity is self._activity_retained:
|
||||
print_error('activity set to already-current activity')
|
||||
print_error('Activity set to already-current activity.')
|
||||
return
|
||||
|
||||
if self._next_activity is not None:
|
||||
@ -640,7 +651,7 @@ class Session:
|
||||
_ba.screenmessage(
|
||||
Lstr(resource='playerDelayedJoinText',
|
||||
subs=[('${PLAYER}',
|
||||
sessionplayer.get_name(full=True))]),
|
||||
sessionplayer.getname(full=True))]),
|
||||
color=(0, 1, 0),
|
||||
)
|
||||
|
||||
@ -654,7 +665,7 @@ class Session:
|
||||
sessionteam = SessionTeam(
|
||||
team_id=our_team_id,
|
||||
color=chooser.get_color(),
|
||||
name=chooser.getplayer().get_name(full=True, icon=False),
|
||||
name=chooser.getplayer().getname(full=True, icon=False),
|
||||
)
|
||||
|
||||
# Add player's team to the Session.
|
||||
|
||||
@ -104,7 +104,7 @@ class PlayerRecord:
|
||||
raise SessionPlayerNotFoundError()
|
||||
return self._player
|
||||
|
||||
def get_name(self, full: bool = False) -> str:
|
||||
def getname(self, full: bool = False) -> str:
|
||||
"""Return the player entry's name."""
|
||||
return self.name_full if full else self.name
|
||||
|
||||
@ -307,8 +307,8 @@ class Stats:
|
||||
|
||||
def register_player(self, player: ba.SessionPlayer) -> None:
|
||||
"""Register a player with this score-set."""
|
||||
name = player.get_name()
|
||||
name_full = player.get_name(full=True)
|
||||
name = player.getname()
|
||||
name_full = player.getname(full=True)
|
||||
try:
|
||||
# If the player already exists, update his character and such as
|
||||
# it may have changed.
|
||||
@ -327,13 +327,13 @@ class Stats:
|
||||
# corresponds to a player with that name.
|
||||
for record_id, record in self._player_records.items():
|
||||
lastplayer = record.get_last_player()
|
||||
if lastplayer and lastplayer.get_name() == record_id:
|
||||
if lastplayer and lastplayer.getname() == record_id:
|
||||
records[record_id] = record
|
||||
return records
|
||||
|
||||
def player_got_hit(self, player: ba.SessionPlayer) -> None:
|
||||
"""Call this when a player got hit."""
|
||||
s_player = self._player_records[player.get_name()]
|
||||
s_player = self._player_records[player.getname()]
|
||||
s_player.streak = 0
|
||||
|
||||
def player_scored(self,
|
||||
@ -364,7 +364,7 @@ class Stats:
|
||||
from ba._gameactivity import GameActivity
|
||||
from ba._lang import Lstr
|
||||
del victim_player # Currently unused.
|
||||
name = player.get_name()
|
||||
name = player.getname()
|
||||
s_player = self._player_records[name]
|
||||
|
||||
if kill:
|
||||
@ -384,7 +384,7 @@ class Stats:
|
||||
assert self._activity is not None
|
||||
activity = self._activity()
|
||||
if isinstance(activity, GameActivity):
|
||||
name_full = player.get_name(full=True, icon=False)
|
||||
name_full = player.getname(full=True, icon=False)
|
||||
activity.show_zoom_message(
|
||||
Lstr(resource='nameScoresText',
|
||||
subs=[('${NAME}', name_full)]),
|
||||
@ -450,7 +450,7 @@ class Stats:
|
||||
killer: ba.Player = None) -> None:
|
||||
"""Should be called when a player is killed."""
|
||||
from ba._lang import Lstr
|
||||
name = player.get_name()
|
||||
name = player.getname()
|
||||
prec = self._player_records[name]
|
||||
prec.streak = 0
|
||||
if killed:
|
||||
@ -468,7 +468,7 @@ class Stats:
|
||||
if killer.team is player.team:
|
||||
_ba.screenmessage(Lstr(resource='nameBetrayedText',
|
||||
subs=[('${NAME}',
|
||||
killer.get_name()),
|
||||
killer.getname()),
|
||||
('${VICTIM}', name)]),
|
||||
top=True,
|
||||
color=killer.color,
|
||||
@ -476,7 +476,7 @@ class Stats:
|
||||
else:
|
||||
_ba.screenmessage(Lstr(resource='nameKilledText',
|
||||
subs=[('${NAME}',
|
||||
killer.get_name()),
|
||||
killer.getname()),
|
||||
('${VICTIM}', name)]),
|
||||
top=True,
|
||||
color=killer.color,
|
||||
|
||||
@ -61,12 +61,12 @@ class FreeForAllVictoryScoreScreenActivity(MultiTeamScoreScreenActivity):
|
||||
player_order_prev.sort(
|
||||
reverse=True,
|
||||
key=lambda p:
|
||||
(p.team.sessiondata['previous_score'], p.get_name(full=True)))
|
||||
(p.team.sessiondata['previous_score'], p.getname(full=True)))
|
||||
player_order = list(self.players)
|
||||
player_order.sort(reverse=True,
|
||||
key=lambda p:
|
||||
(p.team.sessiondata['score'], p.team.sessiondata[
|
||||
'score'], p.get_name(full=True)))
|
||||
'score'], p.getname(full=True)))
|
||||
|
||||
v_offs = -74.0 + spacing * len(player_order_prev) * 0.5
|
||||
delay1 = 1.3 + 0.1
|
||||
@ -161,7 +161,7 @@ class FreeForAllVictoryScoreScreenActivity(MultiTeamScoreScreenActivity):
|
||||
0: ts_h_offs - 72.0 * scale,
|
||||
transtime2: ts_h_offs - (72.0 + slide_amt) * scale
|
||||
}))
|
||||
txt = Text(ba.Lstr(value=player.get_name(full=True)),
|
||||
txt = Text(ba.Lstr(value=player.getname(full=True)),
|
||||
maxwidth=130.0,
|
||||
scale=0.75 * scale,
|
||||
position=(ts_h_offs - 50.0 * scale,
|
||||
|
||||
@ -212,7 +212,7 @@ class MultiTeamScoreScreenActivity(ScoreScreenActivity):
|
||||
scale=(30.0 * scale, 30.0 * scale),
|
||||
transition=Image.Transition.IN_LEFT,
|
||||
transition_delay=tdelay).autoretain()
|
||||
Text(ba.Lstr(value=playerrec.get_name(full=True)),
|
||||
Text(ba.Lstr(value=playerrec.getname(full=True)),
|
||||
maxwidth=160,
|
||||
scale=0.75 * scale,
|
||||
position=(ts_h_offs + 10.0 * scale,
|
||||
|
||||
@ -80,7 +80,7 @@ class TeamSeriesVictoryScoreScreenActivity(MultiTeamScoreScreenActivity):
|
||||
if prec.player.in_game:
|
||||
player_entries.append(
|
||||
(prec.player.team.sessiondata['score'],
|
||||
prec.get_name(full=True), prec))
|
||||
prec.getname(full=True), prec))
|
||||
player_entries.sort(reverse=True, key=lambda x: x[0])
|
||||
else:
|
||||
for _pkey, prec in self.stats.get_records().items():
|
||||
@ -364,7 +364,7 @@ class TeamSeriesVictoryScoreScreenActivity(MultiTeamScoreScreenActivity):
|
||||
assert i.node
|
||||
ba.animate(i.node, 'opacity', {0.0: 0.0, 0.25: 1.0})
|
||||
ZoomText(ba.Lstr(
|
||||
value=team.players[0].get_name(full=True, icon=False)),
|
||||
value=team.players[0].getname(full=True, icon=False)),
|
||||
position=(0, 97 + offs_v),
|
||||
color=team.color,
|
||||
scale=1.15,
|
||||
|
||||
@ -88,7 +88,7 @@ class RespawnIcon:
|
||||
attrs={
|
||||
'v_attach': 'top',
|
||||
'h_attach': 'right' if on_right else 'left',
|
||||
'text': ba.Lstr(value=player.get_name()),
|
||||
'text': ba.Lstr(value=player.getname()),
|
||||
'maxwidth': 100,
|
||||
'h_align': 'center',
|
||||
'v_align': 'center',
|
||||
|
||||
@ -75,7 +75,7 @@ class Icon(ba.Actor):
|
||||
'text',
|
||||
owner=self.node,
|
||||
attrs={
|
||||
'text': ba.Lstr(value=player.get_name()),
|
||||
'text': ba.Lstr(value=player.getname()),
|
||||
'color': ba.safecolor(player.team.color),
|
||||
'h_align': 'center',
|
||||
'v_align': 'center',
|
||||
@ -276,7 +276,7 @@ class EliminationGame(ba.TeamGameActivity[Player, Team]):
|
||||
player.team.survival_seconds = 0
|
||||
ba.screenmessage(
|
||||
ba.Lstr(resource='playerDelayedJoinText',
|
||||
subs=[('${PLAYER}', player.get_name(full=True))]),
|
||||
subs=[('${PLAYER}', player.getname(full=True))]),
|
||||
color=(0, 1, 0),
|
||||
)
|
||||
return
|
||||
|
||||
@ -117,7 +117,7 @@ class MeteorShowerGame(ba.TeamGameActivity[Player, Team]):
|
||||
if self.has_begun():
|
||||
ba.screenmessage(
|
||||
ba.Lstr(resource='playerDelayedJoinText',
|
||||
subs=[('${PLAYER}', player.get_name(full=True))]),
|
||||
subs=[('${PLAYER}', player.getname(full=True))]),
|
||||
color=(0, 1, 0),
|
||||
)
|
||||
# For score purposes, mark them as having died right as the
|
||||
|
||||
@ -901,7 +901,7 @@ class OnslaughtGame(ba.CoopGameActivity[Player, Team]):
|
||||
in [Preset.ENDLESS, Preset.ENDLESS_TOURNAMENT] or
|
||||
(player.respawn_wave <= len(self._waves)))):
|
||||
rtxt = ba.Lstr(resource='onslaughtRespawnText',
|
||||
subs=[('${PLAYER}', player.get_name()),
|
||||
subs=[('${PLAYER}', player.getname()),
|
||||
('${WAVE}', str(player.respawn_wave))
|
||||
])
|
||||
text = ba.Lstr(value='${A}${B}\n',
|
||||
|
||||
@ -253,7 +253,7 @@ class RaceGame(ba.TeamGameActivity[Player, Team]):
|
||||
ba.screenmessage(ba.Lstr(
|
||||
translate=('statements', 'Killing ${NAME} for'
|
||||
' skipping part of the track!'),
|
||||
subs=[('${NAME}', player.get_name(full=True))]),
|
||||
subs=[('${NAME}', player.getname(full=True))]),
|
||||
color=(1, 0, 0))
|
||||
else:
|
||||
# If this player is in first, note that this is the
|
||||
@ -368,7 +368,7 @@ class RaceGame(ba.TeamGameActivity[Player, Team]):
|
||||
translate=('statements',
|
||||
'${TEAM} is disqualified because ${PLAYER} left'),
|
||||
subs=[('${TEAM}', player.team.name),
|
||||
('${PLAYER}', player.get_name(full=True))]),
|
||||
('${PLAYER}', player.getname(full=True))]),
|
||||
color=(1, 1, 0))
|
||||
player.team.finished = True
|
||||
player.team.time = None
|
||||
|
||||
@ -354,7 +354,7 @@ class Target(ba.Actor):
|
||||
# names and colors so they know who got the hit.
|
||||
if len(activity.players) > 1:
|
||||
popupcolor = ba.safecolor(player.color, target_intensity=0.75)
|
||||
popupstr += ' ' + player.get_name()
|
||||
popupstr += ' ' + player.getname()
|
||||
PopupText(popupstr,
|
||||
position=self._position,
|
||||
color=popupcolor,
|
||||
|
||||
@ -935,7 +935,7 @@ class CoopBrowserWindow(ba.Window):
|
||||
|
||||
# add all custom user levels here..
|
||||
# items += [
|
||||
# 'User:' + l.get_name()
|
||||
# 'User:' + l.getname()
|
||||
# for l in get_campaign('User').get_levels()
|
||||
# ]
|
||||
|
||||
|
||||
@ -389,20 +389,20 @@ class KioskWindow(ba.Window):
|
||||
pass
|
||||
else:
|
||||
# Also make sure there's no player profiles.
|
||||
bs_config = ba.app.config
|
||||
bs_config['Player Profiles'] = {}
|
||||
appconfig = ba.app.config
|
||||
appconfig['Player Profiles'] = {}
|
||||
|
||||
def _do_game(self, mode: str) -> None:
|
||||
self._save_state()
|
||||
if mode in ['epic', 'ctf', 'hockey']:
|
||||
bs_config = ba.app.config
|
||||
if 'Team Tournament Playlists' not in bs_config:
|
||||
bs_config['Team Tournament Playlists'] = {}
|
||||
if 'Free-for-All Playlists' not in bs_config:
|
||||
bs_config['Free-for-All Playlists'] = {}
|
||||
bs_config['Show Tutorial'] = False
|
||||
appconfig = ba.app.config
|
||||
if 'Team Tournament Playlists' not in appconfig:
|
||||
appconfig['Team Tournament Playlists'] = {}
|
||||
if 'Free-for-All Playlists' not in appconfig:
|
||||
appconfig['Free-for-All Playlists'] = {}
|
||||
appconfig['Show Tutorial'] = False
|
||||
if mode == 'epic':
|
||||
bs_config['Free-for-All Playlists']['Just Epic Elim'] = [{
|
||||
appconfig['Free-for-All Playlists']['Just Epic Elim'] = [{
|
||||
'settings': {
|
||||
'Epic Mode': 1,
|
||||
'Lives Per Player': 1,
|
||||
@ -412,7 +412,7 @@ class KioskWindow(ba.Window):
|
||||
},
|
||||
'type': 'bs_elimination.EliminationGame'
|
||||
}]
|
||||
bs_config['Free-for-All Playlist Selection'] = 'Just Epic Elim'
|
||||
appconfig['Free-for-All Playlist Selection'] = 'Just Epic Elim'
|
||||
_ba.fade_screen(False,
|
||||
endcall=ba.Call(
|
||||
ba.pushcall,
|
||||
@ -420,7 +420,7 @@ class KioskWindow(ba.Window):
|
||||
ba.FreeForAllSession)))
|
||||
else:
|
||||
if mode == 'ctf':
|
||||
bs_config['Team Tournament Playlists']['Just CTF'] = [{
|
||||
appconfig['Team Tournament Playlists']['Just CTF'] = [{
|
||||
'settings': {
|
||||
'Epic Mode': False,
|
||||
'Flag Idle Return Time': 30,
|
||||
@ -432,10 +432,10 @@ class KioskWindow(ba.Window):
|
||||
},
|
||||
'type': 'bs_capture_the_flag.CTFGame'
|
||||
}]
|
||||
bs_config[
|
||||
appconfig[
|
||||
'Team Tournament Playlist Selection'] = 'Just CTF'
|
||||
else:
|
||||
bs_config['Team Tournament Playlists']['Just Hockey'] = [{
|
||||
appconfig['Team Tournament Playlists']['Just Hockey'] = [{
|
||||
'settings': {
|
||||
'Respawn Times': 1.0,
|
||||
'Score to Win': 1,
|
||||
@ -444,8 +444,8 @@ class KioskWindow(ba.Window):
|
||||
},
|
||||
'type': 'bs_hockey.HockeyGame'
|
||||
}]
|
||||
bs_config['Team Tournament Playlist Selection'] = \
|
||||
'Just Hockey'
|
||||
appconfig['Team Tournament Playlist Selection'] = (
|
||||
'Just Hockey')
|
||||
_ba.fade_screen(False,
|
||||
endcall=ba.Call(
|
||||
ba.pushcall,
|
||||
|
||||
@ -708,7 +708,7 @@ class MainMenuWindow(ba.Window):
|
||||
|
||||
# Player name if applicable.
|
||||
if self._input_player:
|
||||
player_name = self._input_player.get_name()
|
||||
player_name = self._input_player.getname()
|
||||
h, v, scale = positions[self._p_index]
|
||||
v += 35
|
||||
ba.textwidget(parent=self._root_widget,
|
||||
|
||||
@ -338,7 +338,7 @@ class PlaylistBrowserWindow(ba.Window):
|
||||
v_align='center')
|
||||
|
||||
index = 0
|
||||
bs_config = ba.app.config
|
||||
appconfig = ba.app.config
|
||||
|
||||
model_opaque = ba.getmodel('level_select_button_opaque')
|
||||
model_transparent = ba.getmodel('level_select_button_transparent')
|
||||
@ -418,13 +418,13 @@ class PlaylistBrowserWindow(ba.Window):
|
||||
raise Exception('unrecognized session-type: ' +
|
||||
str(self._sessiontype))
|
||||
else:
|
||||
if name not in bs_config[self._pvars.config_name +
|
||||
if name not in appconfig[self._pvars.config_name +
|
||||
' Playlists']:
|
||||
print(
|
||||
'NOT FOUND ERR',
|
||||
bs_config[self._pvars.config_name +
|
||||
appconfig[self._pvars.config_name +
|
||||
' Playlists'])
|
||||
playlist = bs_config[self._pvars.config_name +
|
||||
playlist = appconfig[self._pvars.config_name +
|
||||
' Playlists'][name]
|
||||
playlist = filter_playlist(playlist,
|
||||
self._sessiontype,
|
||||
|
||||
@ -110,7 +110,7 @@ class PlaylistEditWindow(ba.Window):
|
||||
parent=self._root_widget,
|
||||
position=(210 + x_inset, v + 7),
|
||||
size=(self._scroll_width - 53, 43),
|
||||
text=self._editcontroller.get_name(),
|
||||
text=self._editcontroller.getname(),
|
||||
h_align='left',
|
||||
v_align='center',
|
||||
max_chars=40,
|
||||
|
||||
@ -44,7 +44,7 @@ class PlaylistEditController:
|
||||
from bastd.ui import playlist as playlistui
|
||||
from bastd.ui.playlist import edit as peditui
|
||||
|
||||
bs_config = ba.app.config
|
||||
appconfig = ba.app.config
|
||||
|
||||
# Since we may be showing our map list momentarily,
|
||||
# lets go ahead and preload all map preview textures.
|
||||
@ -58,8 +58,8 @@ class PlaylistEditController:
|
||||
self._config_name_full = self._pvars.config_name + ' Playlists'
|
||||
|
||||
# Make sure config exists.
|
||||
if self._config_name_full not in bs_config:
|
||||
bs_config[self._config_name_full] = {}
|
||||
if self._config_name_full not in appconfig:
|
||||
appconfig[self._config_name_full] = {}
|
||||
|
||||
self._selected_index = 0
|
||||
if existing_playlist_name:
|
||||
@ -67,7 +67,7 @@ class PlaylistEditController:
|
||||
|
||||
# Filter out invalid games.
|
||||
self._playlist = filter_playlist(
|
||||
bs_config[self._pvars.config_name +
|
||||
appconfig[self._pvars.config_name +
|
||||
' Playlists'][existing_playlist_name],
|
||||
sessiontype=sessiontype,
|
||||
remove_unowned=False)
|
||||
@ -87,7 +87,7 @@ class PlaylistEditController:
|
||||
self._name = (
|
||||
self._pvars.default_new_list_name.evaluate() +
|
||||
((' ' + str(i)) if i > 1 else ''))
|
||||
if self._name not in bs_config[self._pvars.config_name +
|
||||
if self._name not in appconfig[self._pvars.config_name +
|
||||
' Playlists']:
|
||||
break
|
||||
i += 1
|
||||
@ -115,7 +115,7 @@ class PlaylistEditController:
|
||||
"""(internal)"""
|
||||
self._edit_ui_selection = selection
|
||||
|
||||
def get_name(self) -> str:
|
||||
def getname(self) -> str:
|
||||
"""(internal)"""
|
||||
return self._name
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ class EditProfileWindow(ba.Window):
|
||||
"""Transitions out and recreates ourself."""
|
||||
ba.containerwidget(edit=self._root_widget, transition='out_left')
|
||||
ba.app.main_menu_window = EditProfileWindow(
|
||||
self.get_name(), self._in_main_menu).get_root_widget()
|
||||
self.getname(), self._in_main_menu).get_root_widget()
|
||||
|
||||
def __init__(self,
|
||||
existing_profile: Optional[str],
|
||||
@ -605,7 +605,7 @@ class EditProfileWindow(ba.Window):
|
||||
def _update_clipped_name(self) -> None:
|
||||
if not self._clipped_name_text:
|
||||
return
|
||||
name = self.get_name()
|
||||
name = self.getname()
|
||||
if name == '__account__':
|
||||
name = (_ba.get_account_name()
|
||||
if _ba.get_account_state() == 'signed_in' else '???')
|
||||
@ -630,7 +630,7 @@ class EditProfileWindow(ba.Window):
|
||||
if self._icon_button_label:
|
||||
ba.textwidget(edit=self._icon_button_label, text=self._icon)
|
||||
|
||||
def get_name(self) -> str:
|
||||
def getname(self) -> str:
|
||||
"""Return the current profile name value."""
|
||||
if self._is_account_profile:
|
||||
new_name = '__account__'
|
||||
@ -643,7 +643,7 @@ class EditProfileWindow(ba.Window):
|
||||
def save(self, transition_out: bool = True) -> bool:
|
||||
"""Save has been selected."""
|
||||
from bastd.ui.profile import browser as pbrowser
|
||||
new_name = self.get_name().strip()
|
||||
new_name = self.getname().strip()
|
||||
|
||||
if not new_name:
|
||||
ba.screenmessage(ba.Lstr(resource='nameNotEmptyText'))
|
||||
|
||||
@ -48,7 +48,7 @@ class ProfileUpgradeWindow(ba.Window):
|
||||
self._base_scale = (2.05 if ba.app.small_ui else
|
||||
1.5 if ba.app.med_ui else 1.2)
|
||||
self._upgrade_start_time: Optional[float] = None
|
||||
self._name = edit_profile_window.get_name()
|
||||
self._name = edit_profile_window.getname()
|
||||
self._edit_profile_window = weakref.ref(edit_profile_window)
|
||||
|
||||
top_extra = 15 if ba.app.small_ui else 15
|
||||
|
||||
@ -55,7 +55,6 @@ class ConfigKeyboardWindow(ba.Window):
|
||||
stack_offset=(0, -10) if ba.app.small_ui else (0, 0),
|
||||
transition=transition))
|
||||
|
||||
# don't ask to config joysticks while we're in here..
|
||||
self._rebuild_ui()
|
||||
|
||||
def _rebuild_ui(self) -> None:
|
||||
@ -63,7 +62,7 @@ class ConfigKeyboardWindow(ba.Window):
|
||||
for widget in self._root_widget.get_children():
|
||||
widget.delete()
|
||||
|
||||
# fill our temp config with present values
|
||||
# Fill our temp config with present values.
|
||||
self._settings: Dict[str, int] = {}
|
||||
for button in [
|
||||
'buttonJump', 'buttonPunch', 'buttonBomb', 'buttonPickUp',
|
||||
@ -197,8 +196,10 @@ class ConfigKeyboardWindow(ba.Window):
|
||||
label='',
|
||||
color=color)
|
||||
|
||||
# do this deferred so it shows up on top of other buttons
|
||||
# Do this deferred so it shows up on top of other buttons. (ew.)
|
||||
def doit() -> None:
|
||||
if not self._root_widget:
|
||||
return
|
||||
uiscale = 0.66 * scale * 2.0
|
||||
maxwidth = 76.0 * scale
|
||||
txt = ba.textwidget(parent=self._root_widget,
|
||||
@ -288,17 +289,14 @@ class AwaitKeyboardInputWindow(ba.Window):
|
||||
color=(1, 1, 1, 0.3),
|
||||
text=str(self._counter))
|
||||
self._decrement_timer: Optional[ba.Timer] = ba.Timer(
|
||||
1.0,
|
||||
ba.Call(self._decrement),
|
||||
repeat=True,
|
||||
timetype=ba.TimeType.REAL)
|
||||
1.0, self._decrement, repeat=True, timetype=ba.TimeType.REAL)
|
||||
_ba.capture_keyboard_input(ba.WeakCall(self._button_callback))
|
||||
|
||||
def __del__(self) -> None:
|
||||
_ba.release_keyboard_input()
|
||||
|
||||
def _die(self) -> None:
|
||||
# this strong-refs us; killing it allow us to die now
|
||||
# This strong-refs us; killing it allows us to die now.
|
||||
self._decrement_timer = None
|
||||
if self._root_widget:
|
||||
ba.containerwidget(edit=self._root_widget, transition='out_left')
|
||||
|
||||
@ -39,7 +39,7 @@ class SoundtrackEditWindow(ba.Window):
|
||||
existing_soundtrack: Optional[Union[str, Dict[str, Any]]],
|
||||
transition: str = 'in_right'):
|
||||
# pylint: disable=too-many-statements
|
||||
bs_config = ba.app.config
|
||||
appconfig = ba.app.config
|
||||
self._r = 'editSoundtrackWindow'
|
||||
self._folder_tex = ba.gettexture('folder')
|
||||
self._file_tex = ba.gettexture('file')
|
||||
@ -81,8 +81,8 @@ class SoundtrackEditWindow(ba.Window):
|
||||
v_align='center',
|
||||
maxwidth=280)
|
||||
v = self._height - 110
|
||||
if 'Soundtracks' not in bs_config:
|
||||
bs_config['Soundtracks'] = {}
|
||||
if 'Soundtracks' not in appconfig:
|
||||
appconfig['Soundtracks'] = {}
|
||||
|
||||
self._soundtrack_name: Optional[str]
|
||||
self._existing_soundtrack_name: Optional[str]
|
||||
@ -90,7 +90,7 @@ class SoundtrackEditWindow(ba.Window):
|
||||
# if they passed just a name, pull info from that soundtrack
|
||||
if isinstance(existing_soundtrack, str):
|
||||
self._soundtrack = copy.deepcopy(
|
||||
bs_config['Soundtracks'][existing_soundtrack])
|
||||
appconfig['Soundtracks'][existing_soundtrack])
|
||||
self._soundtrack_name = existing_soundtrack
|
||||
self._existing_soundtrack_name = existing_soundtrack
|
||||
self._last_edited_song_type = None
|
||||
@ -129,7 +129,7 @@ class SoundtrackEditWindow(ba.Window):
|
||||
while True:
|
||||
self._soundtrack_name = st_name_text.replace(
|
||||
'${COUNT}', str(i))
|
||||
if self._soundtrack_name not in bs_config['Soundtracks']:
|
||||
if self._soundtrack_name not in appconfig['Soundtracks']:
|
||||
break
|
||||
i += 1
|
||||
|
||||
|
||||
@ -48,16 +48,16 @@ class TeamNamesColorsWindow(popup.PopupWindow):
|
||||
size=(self._width, self._height),
|
||||
scale=scale)
|
||||
|
||||
bs_config = ba.app.config
|
||||
appconfig = ba.app.config
|
||||
self._names = list(
|
||||
bs_config.get('Custom Team Names', DEFAULT_TEAM_NAMES))
|
||||
appconfig.get('Custom Team Names', DEFAULT_TEAM_NAMES))
|
||||
# We need to flatten the translation since it will be an
|
||||
# editable string.
|
||||
self._names = [
|
||||
ba.Lstr(translate=('teamNames', n)).evaluate() for n in self._names
|
||||
]
|
||||
self._colors = list(
|
||||
bs_config.get('Custom Team Colors', DEFAULT_TEAM_COLORS))
|
||||
appconfig.get('Custom Team Colors', DEFAULT_TEAM_COLORS))
|
||||
|
||||
self._color_buttons: List[ba.Widget] = []
|
||||
self._color_text_fields: List[ba.Widget] = []
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<!-- THIS FILE IS AUTO GENERATED; DO NOT EDIT BY HAND -->
|
||||
<h4><em>last updated on 2020-05-30 for Ballistica version 1.5.0 build 20035</em></h4>
|
||||
<h4><em>last updated on 2020-05-30 for Ballistica version 1.5.0 build 20036</em></h4>
|
||||
<p>This page documents the Python classes and functions in the 'ba' module,
|
||||
which are the ones most relevant to modding in Ballistica. If you come across something you feel should be included here or could be better explained, please <a href="mailto:support@froemling.net">let me know</a>. Happy modding!</p>
|
||||
<hr>
|
||||
@ -1595,7 +1595,7 @@ start_long_action(callback_when_done=<a href="#class_ba_ContextCall">ba.ContextC
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Methods Inherited:</h3>
|
||||
<h5><a href="#method_ba_GameActivity__add_actor_weak_ref">add_actor_weak_ref()</a>, <a href="#method_ba_GameActivity__add_player">add_player()</a>, <a href="#method_ba_GameActivity__add_team">add_team()</a>, <a href="#method_ba_GameActivity__begin">begin()</a>, <a href="#method_ba_GameActivity__continue_or_end_game">continue_or_end_game()</a>, <a href="#method_ba_GameActivity__create_player">create_player()</a>, <a href="#method_ba_GameActivity__create_settings_ui">create_settings_ui()</a>, <a href="#method_ba_GameActivity__create_team">create_team()</a>, <a href="#method_ba_GameActivity__dep_is_present">dep_is_present()</a>, <a href="#method_ba_GameActivity__destroy">destroy()</a>, <a href="#method_ba_GameActivity__end">end()</a>, <a href="#method_ba_GameActivity__end_game">end_game()</a>, <a href="#method_ba_GameActivity__get_description">get_description()</a>, <a href="#method_ba_GameActivity__get_description_display_string">get_description_display_string()</a>, <a href="#method_ba_GameActivity__get_display_string">get_display_string()</a>, <a href="#method_ba_GameActivity__get_dynamic_deps">get_dynamic_deps()</a>, <a href="#method_ba_GameActivity__get_game_settings">get_game_settings()</a>, <a href="#method_ba_GameActivity__get_instance_description">get_instance_description()</a>, <a href="#method_ba_GameActivity__get_instance_description_short">get_instance_description_short()</a>, <a href="#method_ba_GameActivity__get_instance_display_string">get_instance_display_string()</a>, <a href="#method_ba_GameActivity__get_instance_scoreboard_display_string">get_instance_scoreboard_display_string()</a>, <a href="#method_ba_GameActivity__get_name">get_name()</a>, <a href="#method_ba_GameActivity__get_score_info">get_score_info()</a>, <a href="#method_ba_GameActivity__get_settings_display_string">get_settings_display_string()</a>, <a href="#method_ba_GameActivity__get_supported_maps">get_supported_maps()</a>, <a href="#method_ba_GameActivity__get_team_display_string">get_team_display_string()</a>, <a href="#method_ba_GameActivity__handlemessage">handlemessage()</a>, <a href="#method_ba_GameActivity__has_begun">has_begun()</a>, <a href="#method_ba_GameActivity__has_ended">has_ended()</a>, <a href="#method_ba_GameActivity__has_transitioned_in">has_transitioned_in()</a>, <a href="#method_ba_GameActivity__is_transitioning_out">is_transitioning_out()</a>, <a href="#method_ba_GameActivity__is_waiting_for_continue">is_waiting_for_continue()</a>, <a href="#method_ba_GameActivity__on_continue">on_continue()</a>, <a href="#method_ba_GameActivity__on_expire">on_expire()</a>, <a href="#method_ba_GameActivity__on_player_join">on_player_join()</a>, <a href="#method_ba_GameActivity__on_player_leave">on_player_leave()</a>, <a href="#method_ba_GameActivity__on_team_join">on_team_join()</a>, <a href="#method_ba_GameActivity__on_team_leave">on_team_leave()</a>, <a href="#method_ba_GameActivity__on_transition_in">on_transition_in()</a>, <a href="#method_ba_GameActivity__on_transition_out">on_transition_out()</a>, <a href="#method_ba_GameActivity__remove_player">remove_player()</a>, <a href="#method_ba_GameActivity__remove_team">remove_team()</a>, <a href="#method_ba_GameActivity__respawn_player">respawn_player()</a>, <a href="#method_ba_GameActivity__retain_actor">retain_actor()</a>, <a href="#method_ba_GameActivity__set_has_ended">set_has_ended()</a>, <a href="#method_ba_GameActivity__setup_standard_powerup_drops">setup_standard_powerup_drops()</a>, <a href="#method_ba_GameActivity__setup_standard_time_limit">setup_standard_time_limit()</a>, <a href="#method_ba_GameActivity__show_zoom_message">show_zoom_message()</a>, <a href="#method_ba_GameActivity__spawn_player">spawn_player()</a>, <a href="#method_ba_GameActivity__spawn_player_if_exists">spawn_player_if_exists()</a>, <a href="#method_ba_GameActivity__transition_in">transition_in()</a>, <a href="#method_ba_GameActivity__transition_out">transition_out()</a></h5>
|
||||
<h5><a href="#method_ba_GameActivity__add_actor_weak_ref">add_actor_weak_ref()</a>, <a href="#method_ba_GameActivity__add_player">add_player()</a>, <a href="#method_ba_GameActivity__add_team">add_team()</a>, <a href="#method_ba_GameActivity__begin">begin()</a>, <a href="#method_ba_GameActivity__continue_or_end_game">continue_or_end_game()</a>, <a href="#method_ba_GameActivity__create_player">create_player()</a>, <a href="#method_ba_GameActivity__create_settings_ui">create_settings_ui()</a>, <a href="#method_ba_GameActivity__create_team">create_team()</a>, <a href="#method_ba_GameActivity__dep_is_present">dep_is_present()</a>, <a href="#method_ba_GameActivity__destroy">destroy()</a>, <a href="#method_ba_GameActivity__end">end()</a>, <a href="#method_ba_GameActivity__end_game">end_game()</a>, <a href="#method_ba_GameActivity__get_description">get_description()</a>, <a href="#method_ba_GameActivity__get_description_display_string">get_description_display_string()</a>, <a href="#method_ba_GameActivity__get_display_string">get_display_string()</a>, <a href="#method_ba_GameActivity__get_dynamic_deps">get_dynamic_deps()</a>, <a href="#method_ba_GameActivity__get_game_settings">get_game_settings()</a>, <a href="#method_ba_GameActivity__get_instance_description">get_instance_description()</a>, <a href="#method_ba_GameActivity__get_instance_description_short">get_instance_description_short()</a>, <a href="#method_ba_GameActivity__get_instance_display_string">get_instance_display_string()</a>, <a href="#method_ba_GameActivity__get_instance_scoreboard_display_string">get_instance_scoreboard_display_string()</a>, <a href="#method_ba_GameActivity__get_score_info">get_score_info()</a>, <a href="#method_ba_GameActivity__get_settings_display_string">get_settings_display_string()</a>, <a href="#method_ba_GameActivity__get_supported_maps">get_supported_maps()</a>, <a href="#method_ba_GameActivity__get_team_display_string">get_team_display_string()</a>, <a href="#method_ba_GameActivity__getname">getname()</a>, <a href="#method_ba_GameActivity__handlemessage">handlemessage()</a>, <a href="#method_ba_GameActivity__has_begun">has_begun()</a>, <a href="#method_ba_GameActivity__has_ended">has_ended()</a>, <a href="#method_ba_GameActivity__has_transitioned_in">has_transitioned_in()</a>, <a href="#method_ba_GameActivity__is_transitioning_out">is_transitioning_out()</a>, <a href="#method_ba_GameActivity__is_waiting_for_continue">is_waiting_for_continue()</a>, <a href="#method_ba_GameActivity__on_continue">on_continue()</a>, <a href="#method_ba_GameActivity__on_expire">on_expire()</a>, <a href="#method_ba_GameActivity__on_player_join">on_player_join()</a>, <a href="#method_ba_GameActivity__on_player_leave">on_player_leave()</a>, <a href="#method_ba_GameActivity__on_team_join">on_team_join()</a>, <a href="#method_ba_GameActivity__on_team_leave">on_team_leave()</a>, <a href="#method_ba_GameActivity__on_transition_in">on_transition_in()</a>, <a href="#method_ba_GameActivity__on_transition_out">on_transition_out()</a>, <a href="#method_ba_GameActivity__remove_player">remove_player()</a>, <a href="#method_ba_GameActivity__remove_team">remove_team()</a>, <a href="#method_ba_GameActivity__respawn_player">respawn_player()</a>, <a href="#method_ba_GameActivity__retain_actor">retain_actor()</a>, <a href="#method_ba_GameActivity__set_has_ended">set_has_ended()</a>, <a href="#method_ba_GameActivity__setup_standard_powerup_drops">setup_standard_powerup_drops()</a>, <a href="#method_ba_GameActivity__setup_standard_time_limit">setup_standard_time_limit()</a>, <a href="#method_ba_GameActivity__show_zoom_message">show_zoom_message()</a>, <a href="#method_ba_GameActivity__spawn_player">spawn_player()</a>, <a href="#method_ba_GameActivity__spawn_player_if_exists">spawn_player_if_exists()</a>, <a href="#method_ba_GameActivity__transition_in">transition_in()</a>, <a href="#method_ba_GameActivity__transition_out">transition_out()</a></h5>
|
||||
<h3>Methods Defined or Overridden:</h3>
|
||||
<h5><a href="#method_ba_CoopGameActivity____init__"><constructor></a>, <a href="#method_ba_CoopGameActivity__celebrate">celebrate()</a>, <a href="#method_ba_CoopGameActivity__fade_to_red">fade_to_red()</a>, <a href="#method_ba_CoopGameActivity__get_score_type">get_score_type()</a>, <a href="#method_ba_CoopGameActivity__on_begin">on_begin()</a>, <a href="#method_ba_CoopGameActivity__setup_low_life_warning_sound">setup_low_life_warning_sound()</a>, <a href="#method_ba_CoopGameActivity__spawn_player_spaz">spawn_player_spaz()</a>, <a href="#method_ba_CoopGameActivity__supports_session_type">supports_session_type()</a></h5>
|
||||
<dl>
|
||||
@ -2182,7 +2182,7 @@ its time with lingering corpses, sound effects, etc.</p>
|
||||
<h3>Methods Inherited:</h3>
|
||||
<h5><a href="#method_ba_Activity__add_actor_weak_ref">add_actor_weak_ref()</a>, <a href="#method_ba_Activity__add_player">add_player()</a>, <a href="#method_ba_Activity__add_team">add_team()</a>, <a href="#method_ba_Activity__begin">begin()</a>, <a href="#method_ba_Activity__create_player">create_player()</a>, <a href="#method_ba_Activity__create_team">create_team()</a>, <a href="#method_ba_Activity__dep_is_present">dep_is_present()</a>, <a href="#method_ba_Activity__destroy">destroy()</a>, <a href="#method_ba_Activity__get_dynamic_deps">get_dynamic_deps()</a>, <a href="#method_ba_Activity__has_begun">has_begun()</a>, <a href="#method_ba_Activity__has_ended">has_ended()</a>, <a href="#method_ba_Activity__has_transitioned_in">has_transitioned_in()</a>, <a href="#method_ba_Activity__is_transitioning_out">is_transitioning_out()</a>, <a href="#method_ba_Activity__on_expire">on_expire()</a>, <a href="#method_ba_Activity__on_player_leave">on_player_leave()</a>, <a href="#method_ba_Activity__on_team_join">on_team_join()</a>, <a href="#method_ba_Activity__on_team_leave">on_team_leave()</a>, <a href="#method_ba_Activity__on_transition_out">on_transition_out()</a>, <a href="#method_ba_Activity__remove_player">remove_player()</a>, <a href="#method_ba_Activity__remove_team">remove_team()</a>, <a href="#method_ba_Activity__retain_actor">retain_actor()</a>, <a href="#method_ba_Activity__set_has_ended">set_has_ended()</a>, <a href="#method_ba_Activity__transition_in">transition_in()</a>, <a href="#method_ba_Activity__transition_out">transition_out()</a></h5>
|
||||
<h3>Methods Defined or Overridden:</h3>
|
||||
<h5><a href="#method_ba_GameActivity____init__"><constructor></a>, <a href="#method_ba_GameActivity__continue_or_end_game">continue_or_end_game()</a>, <a href="#method_ba_GameActivity__create_settings_ui">create_settings_ui()</a>, <a href="#method_ba_GameActivity__end">end()</a>, <a href="#method_ba_GameActivity__end_game">end_game()</a>, <a href="#method_ba_GameActivity__get_description">get_description()</a>, <a href="#method_ba_GameActivity__get_description_display_string">get_description_display_string()</a>, <a href="#method_ba_GameActivity__get_display_string">get_display_string()</a>, <a href="#method_ba_GameActivity__get_game_settings">get_game_settings()</a>, <a href="#method_ba_GameActivity__get_instance_description">get_instance_description()</a>, <a href="#method_ba_GameActivity__get_instance_description_short">get_instance_description_short()</a>, <a href="#method_ba_GameActivity__get_instance_display_string">get_instance_display_string()</a>, <a href="#method_ba_GameActivity__get_instance_scoreboard_display_string">get_instance_scoreboard_display_string()</a>, <a href="#method_ba_GameActivity__get_name">get_name()</a>, <a href="#method_ba_GameActivity__get_score_info">get_score_info()</a>, <a href="#method_ba_GameActivity__get_settings_display_string">get_settings_display_string()</a>, <a href="#method_ba_GameActivity__get_supported_maps">get_supported_maps()</a>, <a href="#method_ba_GameActivity__get_team_display_string">get_team_display_string()</a>, <a href="#method_ba_GameActivity__handlemessage">handlemessage()</a>, <a href="#method_ba_GameActivity__is_waiting_for_continue">is_waiting_for_continue()</a>, <a href="#method_ba_GameActivity__on_begin">on_begin()</a>, <a href="#method_ba_GameActivity__on_continue">on_continue()</a>, <a href="#method_ba_GameActivity__on_player_join">on_player_join()</a>, <a href="#method_ba_GameActivity__on_transition_in">on_transition_in()</a>, <a href="#method_ba_GameActivity__respawn_player">respawn_player()</a>, <a href="#method_ba_GameActivity__setup_standard_powerup_drops">setup_standard_powerup_drops()</a>, <a href="#method_ba_GameActivity__setup_standard_time_limit">setup_standard_time_limit()</a>, <a href="#method_ba_GameActivity__show_zoom_message">show_zoom_message()</a>, <a href="#method_ba_GameActivity__spawn_player">spawn_player()</a>, <a href="#method_ba_GameActivity__spawn_player_if_exists">spawn_player_if_exists()</a>, <a href="#method_ba_GameActivity__spawn_player_spaz">spawn_player_spaz()</a>, <a href="#method_ba_GameActivity__supports_session_type">supports_session_type()</a></h5>
|
||||
<h5><a href="#method_ba_GameActivity____init__"><constructor></a>, <a href="#method_ba_GameActivity__continue_or_end_game">continue_or_end_game()</a>, <a href="#method_ba_GameActivity__create_settings_ui">create_settings_ui()</a>, <a href="#method_ba_GameActivity__end">end()</a>, <a href="#method_ba_GameActivity__end_game">end_game()</a>, <a href="#method_ba_GameActivity__get_description">get_description()</a>, <a href="#method_ba_GameActivity__get_description_display_string">get_description_display_string()</a>, <a href="#method_ba_GameActivity__get_display_string">get_display_string()</a>, <a href="#method_ba_GameActivity__get_game_settings">get_game_settings()</a>, <a href="#method_ba_GameActivity__get_instance_description">get_instance_description()</a>, <a href="#method_ba_GameActivity__get_instance_description_short">get_instance_description_short()</a>, <a href="#method_ba_GameActivity__get_instance_display_string">get_instance_display_string()</a>, <a href="#method_ba_GameActivity__get_instance_scoreboard_display_string">get_instance_scoreboard_display_string()</a>, <a href="#method_ba_GameActivity__get_score_info">get_score_info()</a>, <a href="#method_ba_GameActivity__get_settings_display_string">get_settings_display_string()</a>, <a href="#method_ba_GameActivity__get_supported_maps">get_supported_maps()</a>, <a href="#method_ba_GameActivity__get_team_display_string">get_team_display_string()</a>, <a href="#method_ba_GameActivity__getname">getname()</a>, <a href="#method_ba_GameActivity__handlemessage">handlemessage()</a>, <a href="#method_ba_GameActivity__is_waiting_for_continue">is_waiting_for_continue()</a>, <a href="#method_ba_GameActivity__on_begin">on_begin()</a>, <a href="#method_ba_GameActivity__on_continue">on_continue()</a>, <a href="#method_ba_GameActivity__on_player_join">on_player_join()</a>, <a href="#method_ba_GameActivity__on_transition_in">on_transition_in()</a>, <a href="#method_ba_GameActivity__respawn_player">respawn_player()</a>, <a href="#method_ba_GameActivity__setup_standard_powerup_drops">setup_standard_powerup_drops()</a>, <a href="#method_ba_GameActivity__setup_standard_time_limit">setup_standard_time_limit()</a>, <a href="#method_ba_GameActivity__show_zoom_message">show_zoom_message()</a>, <a href="#method_ba_GameActivity__spawn_player">spawn_player()</a>, <a href="#method_ba_GameActivity__spawn_player_if_exists">spawn_player_if_exists()</a>, <a href="#method_ba_GameActivity__spawn_player_spaz">spawn_player_spaz()</a>, <a href="#method_ba_GameActivity__supports_session_type">supports_session_type()</a></h5>
|
||||
<dl>
|
||||
<dt><h4><a name="method_ba_GameActivity____init__"><constructor></a></dt></h4><dd>
|
||||
<p><span>ba.GameActivity(settings: Dict[str, Any])</span></p>
|
||||
@ -2265,7 +2265,7 @@ can override this method.</p>
|
||||
|
||||
<p>Return a descriptive name for this game/settings combo.</p>
|
||||
|
||||
<p>Subclasses should override get_name(); not this.</p>
|
||||
<p>Subclasses should override getname(); not this.</p>
|
||||
|
||||
</dd>
|
||||
<dt><h4><a name="method_ba_GameActivity__get_game_settings">get_game_settings()</a></dt></h4><dd>
|
||||
@ -2397,15 +2397,6 @@ with the first value, ${ARG2} with the second, etc.</p>
|
||||
<p>This name is used above the game scoreboard in the corner
|
||||
of the screen, so it should be as concise as possible.</p>
|
||||
|
||||
</dd>
|
||||
<dt><h4><a name="method_ba_GameActivity__get_name">get_name()</a></dt></h4><dd>
|
||||
<h5><span><em><class method></span></em></h5>
|
||||
<p><span>get_name() -> str </span></p>
|
||||
|
||||
<p>Return a str name for this game type.</p>
|
||||
|
||||
<p>This default implementation simply returns the 'name' class attr.</p>
|
||||
|
||||
</dd>
|
||||
<dt><h4><a name="method_ba_GameActivity__get_score_info">get_score_info()</a></dt></h4><dd>
|
||||
<h5><span><em><class method></span></em></h5>
|
||||
@ -2439,6 +2430,15 @@ for this game-type for the given <a href="#class_ba_Session">ba.Session</a> type
|
||||
|
||||
<p>Given a team name, returns a localized version of it.</p>
|
||||
|
||||
</dd>
|
||||
<dt><h4><a name="method_ba_GameActivity__getname">getname()</a></dt></h4><dd>
|
||||
<h5><span><em><class method></span></em></h5>
|
||||
<p><span>getname() -> str </span></p>
|
||||
|
||||
<p>Return a str name for this game type.</p>
|
||||
|
||||
<p>This default implementation simply returns the 'name' class attr.</p>
|
||||
|
||||
</dd>
|
||||
<dt><h4><a name="method_ba_GameActivity__handlemessage">handlemessage()</a></dt></h4><dd>
|
||||
<p><span>handlemessage(self, msg: Any) -> Any</span></p>
|
||||
@ -3021,7 +3021,7 @@ etc.</p>
|
||||
<h3>Methods Inherited:</h3>
|
||||
<h5><a href="#method_ba_Actor__autoretain">autoretain()</a>, <a href="#method_ba_Actor__getactivity">getactivity()</a>, <a href="#method_ba_Actor__is_alive">is_alive()</a>, <a href="#method_ba_Actor__on_expire">on_expire()</a></h5>
|
||||
<h3>Methods Defined or Overridden:</h3>
|
||||
<h5><a href="#method_ba_Map____init__"><constructor></a>, <a href="#method_ba_Map__exists">exists()</a>, <a href="#method_ba_Map__get_def_bound_box">get_def_bound_box()</a>, <a href="#method_ba_Map__get_def_point">get_def_point()</a>, <a href="#method_ba_Map__get_def_points">get_def_points()</a>, <a href="#method_ba_Map__get_ffa_start_position">get_ffa_start_position()</a>, <a href="#method_ba_Map__get_flag_position">get_flag_position()</a>, <a href="#method_ba_Map__get_music_type">get_music_type()</a>, <a href="#method_ba_Map__get_name">get_name()</a>, <a href="#method_ba_Map__get_play_types">get_play_types()</a>, <a href="#method_ba_Map__get_preview_texture_name">get_preview_texture_name()</a>, <a href="#method_ba_Map__get_start_position">get_start_position()</a>, <a href="#method_ba_Map__handlemessage">handlemessage()</a>, <a href="#method_ba_Map__is_point_near_edge">is_point_near_edge()</a>, <a href="#method_ba_Map__on_preload">on_preload()</a>, <a href="#method_ba_Map__preload">preload()</a></h5>
|
||||
<h5><a href="#method_ba_Map____init__"><constructor></a>, <a href="#method_ba_Map__exists">exists()</a>, <a href="#method_ba_Map__get_def_bound_box">get_def_bound_box()</a>, <a href="#method_ba_Map__get_def_point">get_def_point()</a>, <a href="#method_ba_Map__get_def_points">get_def_points()</a>, <a href="#method_ba_Map__get_ffa_start_position">get_ffa_start_position()</a>, <a href="#method_ba_Map__get_flag_position">get_flag_position()</a>, <a href="#method_ba_Map__get_music_type">get_music_type()</a>, <a href="#method_ba_Map__get_play_types">get_play_types()</a>, <a href="#method_ba_Map__get_preview_texture_name">get_preview_texture_name()</a>, <a href="#method_ba_Map__get_start_position">get_start_position()</a>, <a href="#method_ba_Map__getname">getname()</a>, <a href="#method_ba_Map__handlemessage">handlemessage()</a>, <a href="#method_ba_Map__is_point_near_edge">is_point_near_edge()</a>, <a href="#method_ba_Map__on_preload">on_preload()</a>, <a href="#method_ba_Map__preload">preload()</a></h5>
|
||||
<dl>
|
||||
<dt><h4><a name="method_ba_Map____init__"><constructor></a></dt></h4><dd>
|
||||
<p><span>ba.Map(vr_overlay_offset: Optional[Sequence[float]] = None)</span></p>
|
||||
@ -3096,13 +3096,6 @@ as far from these players as possible.</p>
|
||||
|
||||
<p>If None is returned, default music will be used.</p>
|
||||
|
||||
</dd>
|
||||
<dt><h4><a name="method_ba_Map__get_name">get_name()</a></dt></h4><dd>
|
||||
<h5><span><em><class method></span></em></h5>
|
||||
<p><span>get_name() -> str </span></p>
|
||||
|
||||
<p>Return the unique name of this map, in English.</p>
|
||||
|
||||
</dd>
|
||||
<dt><h4><a name="method_ba_Map__get_play_types">get_play_types()</a></dt></h4><dd>
|
||||
<h5><span><em><class method></span></em></h5>
|
||||
@ -3123,6 +3116,13 @@ as far from these players as possible.</p>
|
||||
|
||||
<p>Return a random starting position for the given team index.</p>
|
||||
|
||||
</dd>
|
||||
<dt><h4><a name="method_ba_Map__getname">getname()</a></dt></h4><dd>
|
||||
<h5><span><em><class method></span></em></h5>
|
||||
<p><span>getname() -> str </span></p>
|
||||
|
||||
<p>Return the unique name of this map, in English.</p>
|
||||
|
||||
</dd>
|
||||
<dt><h4><a name="method_ba_Map__handlemessage">handlemessage()</a></dt></h4><dd>
|
||||
<p><span>handlemessage(self, msg: Any) -> Any</span></p>
|
||||
@ -3590,7 +3590,7 @@ a live node in the game.</p>
|
||||
Node reference (sometimes used as attr values/etc).</p>
|
||||
|
||||
<h3>Methods:</h3>
|
||||
<h5><a href="#method_ba_Node__add_death_action">add_death_action()</a>, <a href="#method_ba_Node__connectattr">connectattr()</a>, <a href="#method_ba_Node__delete">delete()</a>, <a href="#method_ba_Node__exists">exists()</a>, <a href="#method_ba_Node__get_name">get_name()</a>, <a href="#method_ba_Node__getdelegate">getdelegate()</a>, <a href="#method_ba_Node__getnodetype">getnodetype()</a>, <a href="#method_ba_Node__handlemessage">handlemessage()</a></h5>
|
||||
<h5><a href="#method_ba_Node__add_death_action">add_death_action()</a>, <a href="#method_ba_Node__connectattr">connectattr()</a>, <a href="#method_ba_Node__delete">delete()</a>, <a href="#method_ba_Node__exists">exists()</a>, <a href="#method_ba_Node__getdelegate">getdelegate()</a>, <a href="#method_ba_Node__getname">getname()</a>, <a href="#method_ba_Node__getnodetype">getnodetype()</a>, <a href="#method_ba_Node__handlemessage">handlemessage()</a></h5>
|
||||
<dl>
|
||||
<dt><h4><a name="method_ba_Node__add_death_action">add_death_action()</a></dt></h4><dd>
|
||||
<p><span>add_death_action(action: Callable[[], None]) -> None</span></p>
|
||||
@ -3633,12 +3633,6 @@ idea to check this.</p>
|
||||
functionality, so a statement such as "if mynode" will do
|
||||
the right thing both for Node objects and values of None.</p>
|
||||
|
||||
</dd>
|
||||
<dt><h4><a name="method_ba_Node__get_name">get_name()</a></dt></h4><dd>
|
||||
<p><span>get_name() -> str</span></p>
|
||||
|
||||
<p>Return the name assigned to a Node; used mainly for debugging</p>
|
||||
|
||||
</dd>
|
||||
<dt><h4><a name="method_ba_Node__getdelegate">getdelegate()</a></dt></h4><dd>
|
||||
<p><span>getdelegate(type: Type, doraise: bool = False) -> <varies></span></p>
|
||||
@ -3649,6 +3643,12 @@ the right thing both for Node objects and values of None.</p>
|
||||
type, then None will be returned. If 'doraise' is True, then an
|
||||
<a href="#class_ba_DelegateNotFoundError">ba.DelegateNotFoundError</a> will be raised instead.</p>
|
||||
|
||||
</dd>
|
||||
<dt><h4><a name="method_ba_Node__getname">getname()</a></dt></h4><dd>
|
||||
<p><span>getname() -> str</span></p>
|
||||
|
||||
<p>Return the name assigned to a Node; used mainly for debugging</p>
|
||||
|
||||
</dd>
|
||||
<dt><h4><a name="method_ba_Node__getnodetype">getnodetype()</a></dt></h4><dd>
|
||||
<p><span>getnodetype() -> str</span></p>
|
||||
@ -3874,7 +3874,7 @@ even if myactor is set to None.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Methods:</h3>
|
||||
<h5><a href="#method_ba_Player__assign_input_call">assign_input_call()</a>, <a href="#method_ba_Player__exists">exists()</a>, <a href="#method_ba_Player__get_icon">get_icon()</a>, <a href="#method_ba_Player__get_name">get_name()</a>, <a href="#method_ba_Player__is_alive">is_alive()</a>, <a href="#method_ba_Player__reset_input">reset_input()</a></h5>
|
||||
<h5><a href="#method_ba_Player__assign_input_call">assign_input_call()</a>, <a href="#method_ba_Player__exists">exists()</a>, <a href="#method_ba_Player__get_icon">get_icon()</a>, <a href="#method_ba_Player__getname">getname()</a>, <a href="#method_ba_Player__is_alive">is_alive()</a>, <a href="#method_ba_Player__reset_input">reset_input()</a></h5>
|
||||
<dl>
|
||||
<dt><h4><a name="method_ba_Player__assign_input_call">assign_input_call()</a></dt></h4><dd>
|
||||
<p><span>assign_input_call(self, inputtype: Union[str, Tuple[str, ...]], call: Callable) -> None</span></p>
|
||||
@ -3910,10 +3910,10 @@ the right thing both for Player objects and values of None.</p>
|
||||
<p>Returns the character's icon (images, colors, etc contained in a dict)</p>
|
||||
|
||||
</dd>
|
||||
<dt><h4><a name="method_ba_Player__get_name">get_name()</a></dt></h4><dd>
|
||||
<p><span>get_name(self, full: bool = False, icon: bool = True) -> str</span></p>
|
||||
<dt><h4><a name="method_ba_Player__getname">getname()</a></dt></h4><dd>
|
||||
<p><span>getname(self, full: bool = False, icon: bool = True) -> str</span></p>
|
||||
|
||||
<p>get_name(full: bool = False, icon: bool = True) -> str</p>
|
||||
<p>getname(full: bool = False, icon: bool = True) -> str</p>
|
||||
|
||||
<p>Returns the player's name. If icon is True, the long version of the
|
||||
name may include an icon.</p>
|
||||
@ -4047,7 +4047,7 @@ the type-checker properly identifies the returned value as one.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Methods:</h3>
|
||||
<h5><a href="#method_ba_PlayerRecord____init__"><constructor></a>, <a href="#method_ba_PlayerRecord__associate_with_player">associate_with_player()</a>, <a href="#method_ba_PlayerRecord__cancel_multi_kill_timer">cancel_multi_kill_timer()</a>, <a href="#method_ba_PlayerRecord__get_icon">get_icon()</a>, <a href="#method_ba_PlayerRecord__get_last_player">get_last_player()</a>, <a href="#method_ba_PlayerRecord__get_name">get_name()</a>, <a href="#method_ba_PlayerRecord__getactivity">getactivity()</a>, <a href="#method_ba_PlayerRecord__submit_kill">submit_kill()</a></h5>
|
||||
<h5><a href="#method_ba_PlayerRecord____init__"><constructor></a>, <a href="#method_ba_PlayerRecord__associate_with_player">associate_with_player()</a>, <a href="#method_ba_PlayerRecord__cancel_multi_kill_timer">cancel_multi_kill_timer()</a>, <a href="#method_ba_PlayerRecord__get_icon">get_icon()</a>, <a href="#method_ba_PlayerRecord__get_last_player">get_last_player()</a>, <a href="#method_ba_PlayerRecord__getactivity">getactivity()</a>, <a href="#method_ba_PlayerRecord__getname">getname()</a>, <a href="#method_ba_PlayerRecord__submit_kill">submit_kill()</a></h5>
|
||||
<dl>
|
||||
<dt><h4><a name="method_ba_PlayerRecord____init__"><constructor></a></dt></h4><dd>
|
||||
<p><span>ba.PlayerRecord(name: str, name_full: str, player: <a href="#class_ba_SessionPlayer">ba.SessionPlayer</a>, stats: <a href="#class_ba_Stats">ba.Stats</a>)</span></p>
|
||||
@ -4076,12 +4076,6 @@ the type-checker properly identifies the returned value as one.</p>
|
||||
|
||||
<p>Return the last <a href="#class_ba_Player">ba.Player</a> we were associated with.</p>
|
||||
|
||||
</dd>
|
||||
<dt><h4><a name="method_ba_PlayerRecord__get_name">get_name()</a></dt></h4><dd>
|
||||
<p><span>get_name(self, full: bool = False) -> str</span></p>
|
||||
|
||||
<p>Return the player entry's name.</p>
|
||||
|
||||
</dd>
|
||||
<dt><h4><a name="method_ba_PlayerRecord__getactivity">getactivity()</a></dt></h4><dd>
|
||||
<p><span>getactivity(self) -> Optional[<a href="#class_ba_Activity">ba.Activity</a>]</span></p>
|
||||
@ -4090,6 +4084,12 @@ the type-checker properly identifies the returned value as one.</p>
|
||||
|
||||
<p>Returns None if the activity no longer exists.</p>
|
||||
|
||||
</dd>
|
||||
<dt><h4><a name="method_ba_PlayerRecord__getname">getname()</a></dt></h4><dd>
|
||||
<p><span>getname(self, full: bool = False) -> str</span></p>
|
||||
|
||||
<p>Return the player entry's name.</p>
|
||||
|
||||
</dd>
|
||||
<dt><h4><a name="method_ba_PlayerRecord__submit_kill">submit_kill()</a></dt></h4><dd>
|
||||
<p><span>submit_kill(self, showpoints: bool = True) -> None</span></p>
|
||||
@ -4568,7 +4568,7 @@ is still in its lobby selecting a team/etc. then a
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Methods:</h3>
|
||||
<h5><a href="#method_ba_SessionPlayer__assign_input_call">assign_input_call()</a>, <a href="#method_ba_SessionPlayer__exists">exists()</a>, <a href="#method_ba_SessionPlayer__get_account_id">get_account_id()</a>, <a href="#method_ba_SessionPlayer__get_icon">get_icon()</a>, <a href="#method_ba_SessionPlayer__get_name">get_name()</a>, <a href="#method_ba_SessionPlayer__remove_from_game">remove_from_game()</a>, <a href="#method_ba_SessionPlayer__reset_input">reset_input()</a>, <a href="#method_ba_SessionPlayer__set_name">set_name()</a></h5>
|
||||
<h5><a href="#method_ba_SessionPlayer__assign_input_call">assign_input_call()</a>, <a href="#method_ba_SessionPlayer__exists">exists()</a>, <a href="#method_ba_SessionPlayer__get_account_id">get_account_id()</a>, <a href="#method_ba_SessionPlayer__get_icon">get_icon()</a>, <a href="#method_ba_SessionPlayer__getname">getname()</a>, <a href="#method_ba_SessionPlayer__remove_from_game">remove_from_game()</a>, <a href="#method_ba_SessionPlayer__reset_input">reset_input()</a>, <a href="#method_ba_SessionPlayer__set_name">set_name()</a></h5>
|
||||
<dl>
|
||||
<dt><h4><a name="method_ba_SessionPlayer__assign_input_call">assign_input_call()</a></dt></h4><dd>
|
||||
<p><span>assign_input_call(type: Union[str, Tuple[str, ...]],
|
||||
@ -4606,8 +4606,8 @@ joins (while verification occurs).</p>
|
||||
<p>Returns the character's icon (images, colors, etc contained in a dict)</p>
|
||||
|
||||
</dd>
|
||||
<dt><h4><a name="method_ba_SessionPlayer__get_name">get_name()</a></dt></h4><dd>
|
||||
<p><span>get_name(full: bool = False, icon: bool = True) -> str</span></p>
|
||||
<dt><h4><a name="method_ba_SessionPlayer__getname">getname()</a></dt></h4><dd>
|
||||
<p><span>getname(full: bool = False, icon: bool = True) -> str</span></p>
|
||||
|
||||
<p>Returns the player's name. If icon is True, the long version of the
|
||||
name may include an icon.</p>
|
||||
@ -5061,7 +5061,7 @@ of the session.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
<h3>Methods Inherited:</h3>
|
||||
<h5><a href="#method_ba_GameActivity__add_actor_weak_ref">add_actor_weak_ref()</a>, <a href="#method_ba_GameActivity__add_player">add_player()</a>, <a href="#method_ba_GameActivity__add_team">add_team()</a>, <a href="#method_ba_GameActivity__begin">begin()</a>, <a href="#method_ba_GameActivity__continue_or_end_game">continue_or_end_game()</a>, <a href="#method_ba_GameActivity__create_player">create_player()</a>, <a href="#method_ba_GameActivity__create_settings_ui">create_settings_ui()</a>, <a href="#method_ba_GameActivity__create_team">create_team()</a>, <a href="#method_ba_GameActivity__dep_is_present">dep_is_present()</a>, <a href="#method_ba_GameActivity__destroy">destroy()</a>, <a href="#method_ba_GameActivity__end_game">end_game()</a>, <a href="#method_ba_GameActivity__get_description">get_description()</a>, <a href="#method_ba_GameActivity__get_description_display_string">get_description_display_string()</a>, <a href="#method_ba_GameActivity__get_display_string">get_display_string()</a>, <a href="#method_ba_GameActivity__get_dynamic_deps">get_dynamic_deps()</a>, <a href="#method_ba_GameActivity__get_game_settings">get_game_settings()</a>, <a href="#method_ba_GameActivity__get_instance_description">get_instance_description()</a>, <a href="#method_ba_GameActivity__get_instance_description_short">get_instance_description_short()</a>, <a href="#method_ba_GameActivity__get_instance_display_string">get_instance_display_string()</a>, <a href="#method_ba_GameActivity__get_instance_scoreboard_display_string">get_instance_scoreboard_display_string()</a>, <a href="#method_ba_GameActivity__get_name">get_name()</a>, <a href="#method_ba_GameActivity__get_score_info">get_score_info()</a>, <a href="#method_ba_GameActivity__get_settings_display_string">get_settings_display_string()</a>, <a href="#method_ba_GameActivity__get_supported_maps">get_supported_maps()</a>, <a href="#method_ba_GameActivity__get_team_display_string">get_team_display_string()</a>, <a href="#method_ba_GameActivity__handlemessage">handlemessage()</a>, <a href="#method_ba_GameActivity__has_begun">has_begun()</a>, <a href="#method_ba_GameActivity__has_ended">has_ended()</a>, <a href="#method_ba_GameActivity__has_transitioned_in">has_transitioned_in()</a>, <a href="#method_ba_GameActivity__is_transitioning_out">is_transitioning_out()</a>, <a href="#method_ba_GameActivity__is_waiting_for_continue">is_waiting_for_continue()</a>, <a href="#method_ba_GameActivity__on_continue">on_continue()</a>, <a href="#method_ba_GameActivity__on_expire">on_expire()</a>, <a href="#method_ba_GameActivity__on_player_join">on_player_join()</a>, <a href="#method_ba_GameActivity__on_player_leave">on_player_leave()</a>, <a href="#method_ba_GameActivity__on_team_join">on_team_join()</a>, <a href="#method_ba_GameActivity__on_team_leave">on_team_leave()</a>, <a href="#method_ba_GameActivity__on_transition_out">on_transition_out()</a>, <a href="#method_ba_GameActivity__remove_player">remove_player()</a>, <a href="#method_ba_GameActivity__remove_team">remove_team()</a>, <a href="#method_ba_GameActivity__respawn_player">respawn_player()</a>, <a href="#method_ba_GameActivity__retain_actor">retain_actor()</a>, <a href="#method_ba_GameActivity__set_has_ended">set_has_ended()</a>, <a href="#method_ba_GameActivity__setup_standard_powerup_drops">setup_standard_powerup_drops()</a>, <a href="#method_ba_GameActivity__setup_standard_time_limit">setup_standard_time_limit()</a>, <a href="#method_ba_GameActivity__show_zoom_message">show_zoom_message()</a>, <a href="#method_ba_GameActivity__spawn_player">spawn_player()</a>, <a href="#method_ba_GameActivity__spawn_player_if_exists">spawn_player_if_exists()</a>, <a href="#method_ba_GameActivity__transition_in">transition_in()</a>, <a href="#method_ba_GameActivity__transition_out">transition_out()</a></h5>
|
||||
<h5><a href="#method_ba_GameActivity__add_actor_weak_ref">add_actor_weak_ref()</a>, <a href="#method_ba_GameActivity__add_player">add_player()</a>, <a href="#method_ba_GameActivity__add_team">add_team()</a>, <a href="#method_ba_GameActivity__begin">begin()</a>, <a href="#method_ba_GameActivity__continue_or_end_game">continue_or_end_game()</a>, <a href="#method_ba_GameActivity__create_player">create_player()</a>, <a href="#method_ba_GameActivity__create_settings_ui">create_settings_ui()</a>, <a href="#method_ba_GameActivity__create_team">create_team()</a>, <a href="#method_ba_GameActivity__dep_is_present">dep_is_present()</a>, <a href="#method_ba_GameActivity__destroy">destroy()</a>, <a href="#method_ba_GameActivity__end_game">end_game()</a>, <a href="#method_ba_GameActivity__get_description">get_description()</a>, <a href="#method_ba_GameActivity__get_description_display_string">get_description_display_string()</a>, <a href="#method_ba_GameActivity__get_display_string">get_display_string()</a>, <a href="#method_ba_GameActivity__get_dynamic_deps">get_dynamic_deps()</a>, <a href="#method_ba_GameActivity__get_game_settings">get_game_settings()</a>, <a href="#method_ba_GameActivity__get_instance_description">get_instance_description()</a>, <a href="#method_ba_GameActivity__get_instance_description_short">get_instance_description_short()</a>, <a href="#method_ba_GameActivity__get_instance_display_string">get_instance_display_string()</a>, <a href="#method_ba_GameActivity__get_instance_scoreboard_display_string">get_instance_scoreboard_display_string()</a>, <a href="#method_ba_GameActivity__get_score_info">get_score_info()</a>, <a href="#method_ba_GameActivity__get_settings_display_string">get_settings_display_string()</a>, <a href="#method_ba_GameActivity__get_supported_maps">get_supported_maps()</a>, <a href="#method_ba_GameActivity__get_team_display_string">get_team_display_string()</a>, <a href="#method_ba_GameActivity__getname">getname()</a>, <a href="#method_ba_GameActivity__handlemessage">handlemessage()</a>, <a href="#method_ba_GameActivity__has_begun">has_begun()</a>, <a href="#method_ba_GameActivity__has_ended">has_ended()</a>, <a href="#method_ba_GameActivity__has_transitioned_in">has_transitioned_in()</a>, <a href="#method_ba_GameActivity__is_transitioning_out">is_transitioning_out()</a>, <a href="#method_ba_GameActivity__is_waiting_for_continue">is_waiting_for_continue()</a>, <a href="#method_ba_GameActivity__on_continue">on_continue()</a>, <a href="#method_ba_GameActivity__on_expire">on_expire()</a>, <a href="#method_ba_GameActivity__on_player_join">on_player_join()</a>, <a href="#method_ba_GameActivity__on_player_leave">on_player_leave()</a>, <a href="#method_ba_GameActivity__on_team_join">on_team_join()</a>, <a href="#method_ba_GameActivity__on_team_leave">on_team_leave()</a>, <a href="#method_ba_GameActivity__on_transition_out">on_transition_out()</a>, <a href="#method_ba_GameActivity__remove_player">remove_player()</a>, <a href="#method_ba_GameActivity__remove_team">remove_team()</a>, <a href="#method_ba_GameActivity__respawn_player">respawn_player()</a>, <a href="#method_ba_GameActivity__retain_actor">retain_actor()</a>, <a href="#method_ba_GameActivity__set_has_ended">set_has_ended()</a>, <a href="#method_ba_GameActivity__setup_standard_powerup_drops">setup_standard_powerup_drops()</a>, <a href="#method_ba_GameActivity__setup_standard_time_limit">setup_standard_time_limit()</a>, <a href="#method_ba_GameActivity__show_zoom_message">show_zoom_message()</a>, <a href="#method_ba_GameActivity__spawn_player">spawn_player()</a>, <a href="#method_ba_GameActivity__spawn_player_if_exists">spawn_player_if_exists()</a>, <a href="#method_ba_GameActivity__transition_in">transition_in()</a>, <a href="#method_ba_GameActivity__transition_out">transition_out()</a></h5>
|
||||
<h3>Methods Defined or Overridden:</h3>
|
||||
<h5><a href="#method_ba_TeamGameActivity____init__"><constructor></a>, <a href="#method_ba_TeamGameActivity__end">end()</a>, <a href="#method_ba_TeamGameActivity__on_begin">on_begin()</a>, <a href="#method_ba_TeamGameActivity__on_transition_in">on_transition_in()</a>, <a href="#method_ba_TeamGameActivity__spawn_player_spaz">spawn_player_spaz()</a>, <a href="#method_ba_TeamGameActivity__supports_session_type">supports_session_type()</a></h5>
|
||||
<dl>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user