mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-10-08 14:54:36 +00:00
[ci] auto-format
This commit is contained in:
parent
d2e9830d8c
commit
87b302a50f
20 changed files with 703 additions and 685 deletions
|
|
@ -282,7 +282,8 @@ class RocketLauncher:
|
||||||
direction = [x, 0, z]
|
direction = [x, 0, z]
|
||||||
direction[1] = 0.0
|
direction[1] = 0.0
|
||||||
|
|
||||||
mag = 10.0 / 1 if babase.Vec3(*direction).length() == 0 else babase.Vec3(*direction).length()
|
mag = 10.0 / \
|
||||||
|
1 if babase.Vec3(*direction).length() == 0 else babase.Vec3(*direction).length()
|
||||||
vel = [v * mag for v in direction]
|
vel = [v * mag for v in direction]
|
||||||
Rocket(position=position,
|
Rocket(position=position,
|
||||||
velocity=vel,
|
velocity=vel,
|
||||||
|
|
|
||||||
|
|
@ -791,7 +791,8 @@ class HotPotato(bs.TeamGameActivity[Player, bs.Team]):
|
||||||
self._end_game_timer = bs.Timer(1.25, babase.Call(self.end_game))
|
self._end_game_timer = bs.Timer(1.25, babase.Call(self.end_game))
|
||||||
else:
|
else:
|
||||||
# There's still players remaining, so let's wait a while before marking a new player.
|
# There's still players remaining, so let's wait a while before marking a new player.
|
||||||
self.new_mark_timer = bs.Timer(2.0 if self.slow_motion else 4.0, babase.Call(self.new_mark))
|
self.new_mark_timer = bs.Timer(
|
||||||
|
2.0 if self.slow_motion else 4.0, babase.Call(self.new_mark))
|
||||||
|
|
||||||
# Another extensively used function that returns all alive players.
|
# Another extensively used function that returns all alive players.
|
||||||
def get_alive_players(self) -> Sequence[bs.Player]:
|
def get_alive_players(self) -> Sequence[bs.Player]:
|
||||||
|
|
@ -852,7 +853,8 @@ class HotPotato(bs.TeamGameActivity[Player, bs.Team]):
|
||||||
self._round_end_timer = bs.Timer(0.5, self.end_game)
|
self._round_end_timer = bs.Timer(0.5, self.end_game)
|
||||||
else:
|
else:
|
||||||
# Pick random player(s) to get marked
|
# Pick random player(s) to get marked
|
||||||
self.new_mark_timer = bs.Timer(2.0 if self.slow_motion else 5.2, babase.Call(self.new_mark))
|
self.new_mark_timer = bs.Timer(
|
||||||
|
2.0 if self.slow_motion else 5.2, babase.Call(self.new_mark))
|
||||||
|
|
||||||
self._update_icons() # Create player state icons
|
self._update_icons() # Create player state icons
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -206,7 +206,7 @@ class SimonSays(bs.TeamGameActivity[Player, Team]):
|
||||||
if self.has_begun():
|
if self.has_begun():
|
||||||
bs.broadcastmessage(
|
bs.broadcastmessage(
|
||||||
babase.Lstr(resource='playerDelayedJoinText',
|
babase.Lstr(resource='playerDelayedJoinText',
|
||||||
subs=[('${PLAYER}', player.getname(full=True))]),
|
subs=[('${PLAYER}', player.getname(full=True))]),
|
||||||
color=(0, 1, 0),)
|
color=(0, 1, 0),)
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
|
|
@ -232,7 +232,7 @@ class SimonSays(bs.TeamGameActivity[Player, Team]):
|
||||||
if len(self.players) == 1:
|
if len(self.players) == 1:
|
||||||
bs.timer(4000/1000, lambda: self.check_end())
|
bs.timer(4000/1000, lambda: self.check_end())
|
||||||
else:
|
else:
|
||||||
bs.timer(6000/1000, self.call_round)
|
bs.timer(6000/1000, self.call_round)
|
||||||
|
|
||||||
def spawn_player(self, player: PlayerT) -> bs.Actor:
|
def spawn_player(self, player: PlayerT) -> bs.Actor:
|
||||||
assert player
|
assert player
|
||||||
|
|
@ -310,7 +310,7 @@ class SimonSays(bs.TeamGameActivity[Player, Team]):
|
||||||
if ((self.simon and safe == False) or ((not self.simon) and safe == True)):
|
if ((self.simon and safe == False) or ((not self.simon) and safe == True)):
|
||||||
player.team.score = self.round_num
|
player.team.score = self.round_num
|
||||||
player.actor.handlemessage(bs.DieMessage())
|
player.actor.handlemessage(bs.DieMessage())
|
||||||
bs.timer(1633/1000, self.call_round)
|
bs.timer(1633/1000, self.call_round)
|
||||||
|
|
||||||
def in_circle(self, pos) -> None:
|
def in_circle(self, pos) -> None:
|
||||||
circles = []
|
circles = []
|
||||||
|
|
|
||||||
|
|
@ -340,10 +340,10 @@ class SleepRaceGame(bs.TeamGameActivity[Player, Team]):
|
||||||
player.actor.node.connectattr(
|
player.actor.node.connectattr(
|
||||||
'torso_position', mathnode, 'input2')
|
'torso_position', mathnode, 'input2')
|
||||||
tstr = babase.Lstr(resource='lapNumberText',
|
tstr = babase.Lstr(resource='lapNumberText',
|
||||||
subs=[('${CURRENT}',
|
subs=[('${CURRENT}',
|
||||||
str(player.lap + 1)),
|
str(player.lap + 1)),
|
||||||
('${TOTAL}', str(self._laps))
|
('${TOTAL}', str(self._laps))
|
||||||
])
|
])
|
||||||
txtnode = bs.newnode('text',
|
txtnode = bs.newnode('text',
|
||||||
owner=mathnode,
|
owner=mathnode,
|
||||||
attrs={
|
attrs={
|
||||||
|
|
|
||||||
|
|
@ -349,10 +349,10 @@ class SquidRaceGame(bs.TeamGameActivity[Player, Team]):
|
||||||
player.actor.node.connectattr(
|
player.actor.node.connectattr(
|
||||||
'torso_position', mathnode, 'input2')
|
'torso_position', mathnode, 'input2')
|
||||||
tstr = babase.Lstr(resource='lapNumberText',
|
tstr = babase.Lstr(resource='lapNumberText',
|
||||||
subs=[('${CURRENT}',
|
subs=[('${CURRENT}',
|
||||||
str(player.lap + 1)),
|
str(player.lap + 1)),
|
||||||
('${TOTAL}', str(self._laps))
|
('${TOTAL}', str(self._laps))
|
||||||
])
|
])
|
||||||
txtnode = bs.newnode('text',
|
txtnode = bs.newnode('text',
|
||||||
owner=mathnode,
|
owner=mathnode,
|
||||||
attrs={
|
attrs={
|
||||||
|
|
@ -382,7 +382,7 @@ class SquidRaceGame(bs.TeamGameActivity[Player, Team]):
|
||||||
if self.has_begun():
|
if self.has_begun():
|
||||||
bs.broadcastmessage(
|
bs.broadcastmessage(
|
||||||
babase.Lstr(resource='playerDelayedJoinText',
|
babase.Lstr(resource='playerDelayedJoinText',
|
||||||
subs=[('${PLAYER}', player.getname(full=True))]),
|
subs=[('${PLAYER}', player.getname(full=True))]),
|
||||||
color=(0, 1, 0),
|
color=(0, 1, 0),
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -253,8 +253,8 @@ class UFO(bs.Actor):
|
||||||
1.0 + i,
|
1.0 + i,
|
||||||
lambda: self._bots.spawn_bot(
|
lambda: self._bots.spawn_bot(
|
||||||
RoboBot, pos=(self.node.position[0],
|
RoboBot, pos=(self.node.position[0],
|
||||||
self.node.position[1] - 1,
|
self.node.position[1] - 1,
|
||||||
self.node.position[2]), spawn_time=0.0
|
self.node.position[2]), spawn_time=0.0
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -297,7 +297,6 @@ class UFO(bs.Actor):
|
||||||
node.position[2], 0, 5, 0, 3, 10, 0,
|
node.position[2], 0, 5, 0, 3, 10, 0,
|
||||||
0, 0, 5, 0)
|
0, 0, 5, 0)
|
||||||
|
|
||||||
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
@ -321,7 +320,7 @@ class UFO(bs.Actor):
|
||||||
self.handlemessage(bs.DieMessage())
|
self.handlemessage(bs.DieMessage())
|
||||||
|
|
||||||
def _get_target_player_pt(self) -> tuple[
|
def _get_target_player_pt(self) -> tuple[
|
||||||
bs.Vec3 | None, bs.Vec3 | None]:
|
bs.Vec3 | None, bs.Vec3 | None]:
|
||||||
"""Returns the position and velocity of our target.
|
"""Returns the position and velocity of our target.
|
||||||
|
|
||||||
Both values will be None in the case of no target.
|
Both values will be None in the case of no target.
|
||||||
|
|
@ -514,7 +513,6 @@ class UFO(bs.Actor):
|
||||||
{0: self.shield_deco.color, 0.2: (5, 0.2, 0.2)})
|
{0: self.shield_deco.color, 0.2: (5, 0.2, 0.2)})
|
||||||
self.bot_count = 6
|
self.bot_count = 6
|
||||||
|
|
||||||
|
|
||||||
def update_ai(self) -> None:
|
def update_ai(self) -> None:
|
||||||
"""Should be called periodically to update the spaz' AI."""
|
"""Should be called periodically to update the spaz' AI."""
|
||||||
# pylint: disable=too-many-branches
|
# pylint: disable=too-many-branches
|
||||||
|
|
@ -706,8 +704,8 @@ class UFOSet:
|
||||||
+ str(self._ufo_bot_lists[self._ufo_bot_update_list])
|
+ str(self._ufo_bot_lists[self._ufo_bot_update_list])
|
||||||
)
|
)
|
||||||
self._bot_update_list = (
|
self._bot_update_list = (
|
||||||
self._ufo_bot_update_list + 1
|
self._ufo_bot_update_list + 1
|
||||||
) % self._ufo_bot_list_count
|
) % self._ufo_bot_list_count
|
||||||
|
|
||||||
# Update our list of player points for the bots to use.
|
# Update our list of player points for the bots to use.
|
||||||
player_pts = []
|
player_pts = []
|
||||||
|
|
@ -780,7 +778,7 @@ class UFOSet:
|
||||||
"""Add a bs.SpazBot instance to the set."""
|
"""Add a bs.SpazBot instance to the set."""
|
||||||
self._ufo_bot_lists[self._ufo_bot_add_list].append(bot)
|
self._ufo_bot_lists[self._ufo_bot_add_list].append(bot)
|
||||||
self._ufo_bot_add_list = (
|
self._ufo_bot_add_list = (
|
||||||
self._ufo_bot_add_list + 1) % self._ufo_bot_list_count
|
self._ufo_bot_add_list + 1) % self._ufo_bot_list_count
|
||||||
|
|
||||||
def have_living_bots(self) -> bool:
|
def have_living_bots(self) -> bool:
|
||||||
"""Return whether any bots in the set are alive or spawning."""
|
"""Return whether any bots in the set are alive or spawning."""
|
||||||
|
|
@ -855,18 +853,16 @@ class UFOightGame(bs.TeamGameActivity[Player, Team]):
|
||||||
self._bots = UFOSet()
|
self._bots = UFOSet()
|
||||||
self._preset = str(settings['preset'])
|
self._preset = str(settings['preset'])
|
||||||
self._credit = bs.newnode('text',
|
self._credit = bs.newnode('text',
|
||||||
attrs={
|
attrs={
|
||||||
'v_attach': 'bottom',
|
'v_attach': 'bottom',
|
||||||
'h_align': 'center',
|
'h_align': 'center',
|
||||||
'color': (0.4, 0.4, 0.4),
|
'color': (0.4, 0.4, 0.4),
|
||||||
'flatness': 0.5,
|
'flatness': 0.5,
|
||||||
'shadow': 0.5,
|
'shadow': 0.5,
|
||||||
'position': (0, 20),
|
'position': (0, 20),
|
||||||
'scale': 0.7,
|
'scale': 0.7,
|
||||||
'text': 'By Cross Joy'
|
'text': 'By Cross Joy'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def on_transition_in(self) -> None:
|
def on_transition_in(self) -> None:
|
||||||
super().on_transition_in()
|
super().on_transition_in()
|
||||||
|
|
@ -878,8 +874,6 @@ class UFOightGame(bs.TeamGameActivity[Player, Team]):
|
||||||
super().on_begin()
|
super().on_begin()
|
||||||
self.setup_standard_powerup_drops()
|
self.setup_standard_powerup_drops()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# In pro mode there's no powerups.
|
# In pro mode there's no powerups.
|
||||||
|
|
||||||
# Make our on-screen timer and start it roughly when our bots appear.
|
# Make our on-screen timer and start it roughly when our bots appear.
|
||||||
|
|
@ -987,4 +981,3 @@ class MyUFOFightLevel(babase.Plugin):
|
||||||
preview_texture_name='footballStadiumPreview',
|
preview_texture_name='footballStadiumPreview',
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,11 +43,11 @@ from bascenev1lib.actor.onscreentimer import OnScreenTimer
|
||||||
from bascenev1lib.actor.scoreboard import Scoreboard
|
from bascenev1lib.actor.scoreboard import Scoreboard
|
||||||
from bascenev1lib.actor.spazfactory import SpazFactory
|
from bascenev1lib.actor.spazfactory import SpazFactory
|
||||||
from bascenev1lib.actor.spazbot import (SpazBot, SpazBotSet, BomberBot,
|
from bascenev1lib.actor.spazbot import (SpazBot, SpazBotSet, BomberBot,
|
||||||
BomberBotPro, BomberBotProShielded,
|
BomberBotPro, BomberBotProShielded,
|
||||||
BrawlerBot, BrawlerBotPro,
|
BrawlerBot, BrawlerBotPro,
|
||||||
BrawlerBotProShielded, TriggerBot,
|
BrawlerBotProShielded, TriggerBot,
|
||||||
TriggerBotPro, TriggerBotProShielded,
|
TriggerBotPro, TriggerBotProShielded,
|
||||||
ChargerBot, StickyBot, ExplodeyBot)
|
ChargerBot, StickyBot, ExplodeyBot)
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing import Any, Sequence
|
from typing import Any, Sequence
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ class zBotSet(SpazBotSet):
|
||||||
except Exception:
|
except Exception:
|
||||||
bot_list = []
|
bot_list = []
|
||||||
babase.print_exception('Error updating bot list: ' +
|
babase.print_exception('Error updating bot list: ' +
|
||||||
str(self._bot_lists[self._bot_update_list]))
|
str(self._bot_lists[self._bot_update_list]))
|
||||||
self._bot_update_list = (self._bot_update_list +
|
self._bot_update_list = (self._bot_update_list +
|
||||||
1) % self._bot_list_count
|
1) % self._bot_list_count
|
||||||
|
|
||||||
|
|
@ -286,7 +286,7 @@ class ZombieHorde(bs.TeamGameActivity[Player, Team]):
|
||||||
player.icons = []
|
player.icons = []
|
||||||
bs.broadcastmessage(
|
bs.broadcastmessage(
|
||||||
babase.Lstr(resource='playerDelayedJoinText',
|
babase.Lstr(resource='playerDelayedJoinText',
|
||||||
subs=[('${PLAYER}', player.getname(full=True))]),
|
subs=[('${PLAYER}', player.getname(full=True))]),
|
||||||
color=(0, 1, 0),
|
color=(0, 1, 0),
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -284,7 +284,8 @@ def replay(player, stunt_name):
|
||||||
else:
|
else:
|
||||||
bs.timer(
|
bs.timer(
|
||||||
move["time"],
|
move["time"],
|
||||||
babase.Call(player.actor.move_map[move["move"]["action"]], move["move"]["value"])
|
babase.Call(player.actor.move_map[move["move"]
|
||||||
|
["action"]], move["move"]["value"])
|
||||||
)
|
)
|
||||||
last_move_time = move["time"]
|
last_move_time = move["time"]
|
||||||
time_to_hide_controls = last_move_time + 1
|
time_to_hide_controls = last_move_time + 1
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@ class _cmds:
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def _handle():
|
def _handle():
|
||||||
messages = get_chat_messages()
|
messages = get_chat_messages()
|
||||||
if len(messages) > 1:
|
if len(messages) > 1:
|
||||||
|
|
@ -544,13 +543,16 @@ class _cmds:
|
||||||
cmsg(u'\U0001F95A Nazz are past/present/future \U0001F95A')
|
cmsg(u'\U0001F95A Nazz are past/present/future \U0001F95A')
|
||||||
cmsg(u'\U0001F95A everything is Nazz \U0001F95A')
|
cmsg(u'\U0001F95A everything is Nazz \U0001F95A')
|
||||||
|
|
||||||
|
|
||||||
class NewMainMenuWindow(mainmenu.MainMenuWindow):
|
class NewMainMenuWindow(mainmenu.MainMenuWindow):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
# Display chat icon, but if user open/close gather it may disappear
|
# Display chat icon, but if user open/close gather it may disappear
|
||||||
bui.set_party_icon_always_visible(True)
|
bui.set_party_icon_always_visible(True)
|
||||||
|
|
||||||
# bs.timer(0.05, _update, repeat=True)
|
# bs.timer(0.05, _update, repeat=True)
|
||||||
|
|
||||||
|
|
||||||
def same():
|
def same():
|
||||||
# bs.timer(0.5, _cmds._process_cmd, True)
|
# bs.timer(0.5, _cmds._process_cmd, True)
|
||||||
_cmds._process_cmd()
|
_cmds._process_cmd()
|
||||||
|
|
@ -558,10 +560,7 @@ def same():
|
||||||
|
|
||||||
|
|
||||||
class _enableee(babase.Plugin):
|
class _enableee(babase.Plugin):
|
||||||
timer = bs.AppTimer(0.5, same,repeat=True)
|
timer = bs.AppTimer(0.5, same, repeat=True)
|
||||||
|
|
||||||
def on_app_running(self):
|
def on_app_running(self):
|
||||||
mainmenu.MainMenuWindow = NewMainMenuWindow
|
mainmenu.MainMenuWindow = NewMainMenuWindow
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -55,7 +55,8 @@ def is_game_version_lower_than(version):
|
||||||
version is lower than the passed version. Useful for addressing
|
version is lower than the passed version. Useful for addressing
|
||||||
any breaking changes within game versions.
|
any breaking changes within game versions.
|
||||||
"""
|
"""
|
||||||
game_version = tuple(map(int, babase.app.version if build_number < 21282 else babase.app.env.split(".")))
|
game_version = tuple(map(int, babase.app.version if build_number <
|
||||||
|
21282 else babase.app.env.split(".")))
|
||||||
version = tuple(map(int, version.split(".")))
|
version = tuple(map(int, version.split(".")))
|
||||||
return game_version < version
|
return game_version < version
|
||||||
|
|
||||||
|
|
@ -103,23 +104,23 @@ def partyLight(switch=True):
|
||||||
b = random.choice([0.5, 1])
|
b = random.choice([0.5, 1])
|
||||||
light = NodeActor(
|
light = NodeActor(
|
||||||
bs.newnode('light',
|
bs.newnode('light',
|
||||||
attrs={
|
attrs={
|
||||||
'position': (positions[i][0], 0, positions[i][1]),
|
'position': (positions[i][0], 0, positions[i][1]),
|
||||||
'radius': 1.0,
|
'radius': 1.0,
|
||||||
'lights_volumes': False,
|
'lights_volumes': False,
|
||||||
'height_attenuated': False,
|
'height_attenuated': False,
|
||||||
'color': (r, g, b)
|
'color': (r, g, b)
|
||||||
}))
|
}))
|
||||||
sval = 1.87
|
sval = 1.87
|
||||||
iscale = 1.3
|
iscale = 1.3
|
||||||
tcombine = bs.newnode('combine',
|
tcombine = bs.newnode('combine',
|
||||||
owner=light.node,
|
owner=light.node,
|
||||||
attrs={
|
attrs={
|
||||||
'size': 3,
|
'size': 3,
|
||||||
'input0': positions[i][0],
|
'input0': positions[i][0],
|
||||||
'input1': 0,
|
'input1': 0,
|
||||||
'input2': positions[i][1]
|
'input2': positions[i][1]
|
||||||
})
|
})
|
||||||
assert light.node
|
assert light.node
|
||||||
tcombine.connectattr('output', light.node, 'position')
|
tcombine.connectattr('output', light.node, 'position')
|
||||||
xval = positions[i][0]
|
xval = positions[i][0]
|
||||||
|
|
@ -154,7 +155,7 @@ def partyLight(switch=True):
|
||||||
offset=times[i])
|
offset=times[i])
|
||||||
if not switch:
|
if not switch:
|
||||||
bs.timer(0.1,
|
bs.timer(0.1,
|
||||||
light.node.delete)
|
light.node.delete)
|
||||||
activity.camera_flash_data.append(light) # type: ignore
|
activity.camera_flash_data.append(light) # type: ignore
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -163,12 +164,12 @@ def rainbow(self) -> None:
|
||||||
"""Create RGB tint."""
|
"""Create RGB tint."""
|
||||||
c_existing = self.globalsnode.tint
|
c_existing = self.globalsnode.tint
|
||||||
cnode = bs.newnode('combine',
|
cnode = bs.newnode('combine',
|
||||||
attrs={
|
attrs={
|
||||||
'input0': c_existing[0],
|
'input0': c_existing[0],
|
||||||
'input1': c_existing[1],
|
'input1': c_existing[1],
|
||||||
'input2': c_existing[2],
|
'input2': c_existing[2],
|
||||||
'size': 3
|
'size': 3
|
||||||
})
|
})
|
||||||
|
|
||||||
_gameutils.animate(cnode, 'input0',
|
_gameutils.animate(cnode, 'input0',
|
||||||
{0.0: 1.0, 1.0: 1.0, 2.0: 1.0, 3.0: 1.0,
|
{0.0: 1.0, 1.0: 1.0, 2.0: 1.0, 3.0: 1.0,
|
||||||
|
|
@ -199,12 +200,12 @@ def stop_rainbow(self):
|
||||||
tint = (1, 1, 1)
|
tint = (1, 1, 1)
|
||||||
|
|
||||||
cnode = bs.newnode('combine',
|
cnode = bs.newnode('combine',
|
||||||
attrs={
|
attrs={
|
||||||
'input0': c_existing[0],
|
'input0': c_existing[0],
|
||||||
'input1': c_existing[1],
|
'input1': c_existing[1],
|
||||||
'input2': c_existing[2],
|
'input2': c_existing[2],
|
||||||
'size': 3
|
'size': 3
|
||||||
})
|
})
|
||||||
|
|
||||||
_gameutils.animate(cnode, 'input0', {0: c_existing[0], 1.0: tint[0]})
|
_gameutils.animate(cnode, 'input0', {0: c_existing[0], 1.0: tint[0]})
|
||||||
_gameutils.animate(cnode, 'input1', {0: c_existing[1], 1.0: tint[1]})
|
_gameutils.animate(cnode, 'input1', {0: c_existing[1], 1.0: tint[1]})
|
||||||
|
|
@ -268,12 +269,14 @@ def new_chat_message(msg: Union[str, babase.Lstr], clients: Sequence[int] = None
|
||||||
if msg == '/disco off':
|
if msg == '/disco off':
|
||||||
stop()
|
stop()
|
||||||
|
|
||||||
|
|
||||||
class NewMainMenuWindow(mainmenu.MainMenuWindow):
|
class NewMainMenuWindow(mainmenu.MainMenuWindow):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
# Display chat icon, but if user open/close gather it may disappear
|
# Display chat icon, but if user open/close gather it may disappear
|
||||||
bui.set_party_icon_always_visible(True)
|
bui.set_party_icon_always_visible(True)
|
||||||
|
|
||||||
|
|
||||||
# Replace new chat func to the original game codes.
|
# Replace new chat func to the original game codes.
|
||||||
bs.chatmessage = new_chat_message
|
bs.chatmessage = new_chat_message
|
||||||
|
|
||||||
|
|
@ -282,4 +285,3 @@ bs.chatmessage = new_chat_message
|
||||||
class ByCrossJoy(babase.Plugin):
|
class ByCrossJoy(babase.Plugin):
|
||||||
def on_app_running(self):
|
def on_app_running(self):
|
||||||
mainmenu.MainMenuWindow = NewMainMenuWindow
|
mainmenu.MainMenuWindow = NewMainMenuWindow
|
||||||
|
|
||||||
|
|
@ -370,7 +370,8 @@ def get_event_loop(force_fresh=False):
|
||||||
|
|
||||||
def _generate_join_secret(self):
|
def _generate_join_secret(self):
|
||||||
# resp = requests.get('https://legacy.ballistica.net/bsAccessCheck').text
|
# resp = requests.get('https://legacy.ballistica.net/bsAccessCheck').text
|
||||||
connection_info = bs.get_connection_to_host_info() if build_number < 21697 else bs.get_connection_to_host_info_2()
|
connection_info = bs.get_connection_to_host_info(
|
||||||
|
) if build_number < 21697 else bs.get_connection_to_host_info_2()
|
||||||
if connection_info:
|
if connection_info:
|
||||||
addr = _last_server_addr
|
addr = _last_server_addr
|
||||||
port = _last_server_port
|
port = _last_server_port
|
||||||
|
|
@ -794,7 +795,7 @@ class DiscordRP(babase.Plugin):
|
||||||
def on_app_running(self) -> None:
|
def on_app_running(self) -> None:
|
||||||
if not ANDROID:
|
if not ANDROID:
|
||||||
self.rpc_thread.start()
|
self.rpc_thread.start()
|
||||||
|
|
||||||
self.update_timer = bs.AppTimer(
|
self.update_timer = bs.AppTimer(
|
||||||
1, bs.WeakCall(self.update_status), repeat=True
|
1, bs.WeakCall(self.update_status), repeat=True
|
||||||
)
|
)
|
||||||
|
|
@ -803,7 +804,7 @@ class DiscordRP(babase.Plugin):
|
||||||
self.update_timer = bs.AppTimer(
|
self.update_timer = bs.AppTimer(
|
||||||
4, bs.WeakCall(self.update_status), repeat=True
|
4, bs.WeakCall(self.update_status), repeat=True
|
||||||
)
|
)
|
||||||
|
|
||||||
def has_settings_ui(self):
|
def has_settings_ui(self):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
@ -870,7 +871,8 @@ class DiscordRP(babase.Plugin):
|
||||||
|
|
||||||
def update_status(self) -> None:
|
def update_status(self) -> None:
|
||||||
roster = bs.get_game_roster()
|
roster = bs.get_game_roster()
|
||||||
connection_info = bs.get_connection_to_host_info() if build_number < 21697 else bs.get_connection_to_host_info_2()
|
connection_info = bs.get_connection_to_host_info(
|
||||||
|
) if build_number < 21697 else bs.get_connection_to_host_info_2()
|
||||||
|
|
||||||
self.rpc_thread.large_image_key = "bombsquadicon"
|
self.rpc_thread.large_image_key = "bombsquadicon"
|
||||||
self.rpc_thread.large_image_text = "BombSquad"
|
self.rpc_thread.large_image_text = "BombSquad"
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ class SettingsMaxPlayers(PopupWindow):
|
||||||
icon=bui.gettexture('crossOut'),
|
icon=bui.gettexture('crossOut'),
|
||||||
iconscale=1.2)
|
iconscale=1.2)
|
||||||
bui.containerwidget(edit=self.root_widget,
|
bui.containerwidget(edit=self.root_widget,
|
||||||
cancel_button=self._cancel_button)
|
cancel_button=self._cancel_button)
|
||||||
|
|
||||||
bui.textwidget(
|
bui.textwidget(
|
||||||
parent=self.root_widget,
|
parent=self.root_widget,
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ class SettingWindow(bui.Window):
|
||||||
try:
|
try:
|
||||||
if Udefault >= 29 and self.selected == "upper":
|
if Udefault >= 29 and self.selected == "upper":
|
||||||
bui.textwidget(edit=self.warn_text,
|
bui.textwidget(edit=self.warn_text,
|
||||||
text="Careful!You risk get blind beyond this point")
|
text="Careful!You risk get blind beyond this point")
|
||||||
elif self.selected == "lower" and Ldefault >= -20 or self.selected == "upper" and Udefault <= 30:
|
elif self.selected == "lower" and Ldefault >= -20 or self.selected == "upper" and Udefault <= 30:
|
||||||
bui.textwidget(edit=self.warn_text, text="")
|
bui.textwidget(edit=self.warn_text, text="")
|
||||||
if self.selected == "lower":
|
if self.selected == "lower":
|
||||||
|
|
@ -78,7 +78,7 @@ class SettingWindow(bui.Window):
|
||||||
try:
|
try:
|
||||||
if Ldefault <= -19 and self.selected == "lower":
|
if Ldefault <= -19 and self.selected == "lower":
|
||||||
bui.textwidget(edit=self.warn_text,
|
bui.textwidget(edit=self.warn_text,
|
||||||
text="DON'T BE AFRAID OF DARK,IT'S A PLACE WHERE YOU CAN HIDE")
|
text="DON'T BE AFRAID OF DARK,IT'S A PLACE WHERE YOU CAN HIDE")
|
||||||
elif (self.selected == "upper" and Udefault <= 30) or (self.selected == "lower" and Ldefault >= -20):
|
elif (self.selected == "upper" and Udefault <= 30) or (self.selected == "lower" and Ldefault >= -20):
|
||||||
bui.textwidget(edit=self.warn_text, text="")
|
bui.textwidget(edit=self.warn_text, text="")
|
||||||
if self.selected == "lower":
|
if self.selected == "lower":
|
||||||
|
|
@ -218,23 +218,25 @@ class SettingWindow(bui.Window):
|
||||||
|
|
||||||
# ++++++++++++++++for keyboard navigation++++++++++++++++
|
# ++++++++++++++++for keyboard navigation++++++++++++++++
|
||||||
bui.widget(edit=self.enable_button, up_widget=decrease_button,
|
bui.widget(edit=self.enable_button, up_widget=decrease_button,
|
||||||
down_widget=self.lower_text, left_widget=save_button, right_widget=save_button)
|
down_widget=self.lower_text, left_widget=save_button, right_widget=save_button)
|
||||||
bui.widget(edit=save_button, up_widget=self.close_button, down_widget=self.upper_text,
|
bui.widget(edit=save_button, up_widget=self.close_button, down_widget=self.upper_text,
|
||||||
left_widget=self.enable_button, right_widget=self.enable_button)
|
left_widget=self.enable_button, right_widget=self.enable_button)
|
||||||
bui.widget(edit=self.close_button, up_widget=increase_button, down_widget=save_button,
|
bui.widget(edit=self.close_button, up_widget=increase_button, down_widget=save_button,
|
||||||
left_widget=self.enable_button, right_widget=save_button)
|
left_widget=self.enable_button, right_widget=save_button)
|
||||||
bui.widget(edit=self.lower_text, up_widget=self.enable_button, down_widget=decrease_button,
|
bui.widget(edit=self.lower_text, up_widget=self.enable_button, down_widget=decrease_button,
|
||||||
left_widget=self.upper_text, right_widget=self.upper_text)
|
left_widget=self.upper_text, right_widget=self.upper_text)
|
||||||
bui.widget(edit=self.upper_text, up_widget=save_button, down_widget=increase_button,
|
bui.widget(edit=self.upper_text, up_widget=save_button, down_widget=increase_button,
|
||||||
left_widget=self.lower_text, right_widget=self.lower_text)
|
left_widget=self.lower_text, right_widget=self.lower_text)
|
||||||
bui.widget(edit=decrease_button, up_widget=self.lower_text, down_widget=self.enable_button,
|
bui.widget(edit=decrease_button, up_widget=self.lower_text, down_widget=self.enable_button,
|
||||||
left_widget=increase_button, right_widget=increase_button)
|
left_widget=increase_button, right_widget=increase_button)
|
||||||
bui.widget(edit=increase_button, up_widget=self.upper_text, down_widget=self.close_button,
|
bui.widget(edit=increase_button, up_widget=self.upper_text, down_widget=self.close_button,
|
||||||
left_widget=decrease_button, right_widget=decrease_button)
|
left_widget=decrease_button, right_widget=decrease_button)
|
||||||
# --------------------------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
bui.textwidget(edit=self.upper_text, on_activate_call=babase.Call(self.on_text_click, "upper"))
|
bui.textwidget(edit=self.upper_text, on_activate_call=babase.Call(
|
||||||
bui.textwidget(edit=self.lower_text, on_activate_call=babase.Call(self.on_text_click, "lower"))
|
self.on_text_click, "upper"))
|
||||||
|
bui.textwidget(edit=self.lower_text, on_activate_call=babase.Call(
|
||||||
|
self.on_text_click, "lower"))
|
||||||
|
|
||||||
def on_enableButton_press(self):
|
def on_enableButton_press(self):
|
||||||
global loop
|
global loop
|
||||||
|
|
@ -275,12 +277,14 @@ def new_chat_message(msg: Union[str, babase.Lstr], clients: Sequence[int] = None
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
Print(err, "-from new_chat_message")
|
Print(err, "-from new_chat_message")
|
||||||
|
|
||||||
|
|
||||||
class NewMainMenuWindow(MainMenuWindow):
|
class NewMainMenuWindow(MainMenuWindow):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
# Display chat icon, but if user open/close gather it may disappear
|
# Display chat icon, but if user open/close gather it may disappear
|
||||||
bui.set_party_icon_always_visible(True)
|
bui.set_party_icon_always_visible(True)
|
||||||
|
|
||||||
|
|
||||||
old_fcm = bs.chatmessage
|
old_fcm = bs.chatmessage
|
||||||
bs.chatmessage = new_chat_message
|
bs.chatmessage = new_chat_message
|
||||||
Map._old_init = Map.__init__
|
Map._old_init = Map.__init__
|
||||||
|
|
|
||||||
|
|
@ -135,15 +135,15 @@ class SelectGameWindow(PlaylistAddGameWindow):
|
||||||
stack_offset=(0, 1) if uiscale is babase.UIScale.SMALL else (0, 0))
|
stack_offset=(0, 1) if uiscale is babase.UIScale.SMALL else (0, 0))
|
||||||
|
|
||||||
self._back_button = bui.buttonwidget(parent=self._root_widget,
|
self._back_button = bui.buttonwidget(parent=self._root_widget,
|
||||||
position=(58 + x_inset,
|
position=(58 + x_inset,
|
||||||
self._height - 53),
|
self._height - 53),
|
||||||
size=(165, 70),
|
size=(165, 70),
|
||||||
scale=0.75,
|
scale=0.75,
|
||||||
text_scale=1.2,
|
text_scale=1.2,
|
||||||
label=babase.Lstr(resource='backText'),
|
label=babase.Lstr(resource='backText'),
|
||||||
autoselect=True,
|
autoselect=True,
|
||||||
button_type='back',
|
button_type='back',
|
||||||
on_activate_call=self._back)
|
on_activate_call=self._back)
|
||||||
self._select_button = select_button = bui.buttonwidget(
|
self._select_button = select_button = bui.buttonwidget(
|
||||||
parent=self._root_widget,
|
parent=self._root_widget,
|
||||||
position=(self._width - (172 + x_inset), self._height - 50),
|
position=(self._width - (172 + x_inset), self._height - 50),
|
||||||
|
|
@ -156,17 +156,17 @@ class SelectGameWindow(PlaylistAddGameWindow):
|
||||||
|
|
||||||
if bui.app.ui_v1.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(edit=select_button,
|
bui.widget(edit=select_button,
|
||||||
right_widget=bui.get_special_widget('party_button'))
|
right_widget=bui.get_special_widget('party_button'))
|
||||||
|
|
||||||
bui.textwidget(parent=self._root_widget,
|
bui.textwidget(parent=self._root_widget,
|
||||||
position=(self._width * 0.5, self._height - 28),
|
position=(self._width * 0.5, self._height - 28),
|
||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
scale=1.0,
|
scale=1.0,
|
||||||
text=babase.Lstr(resource=self._r + '.titleText'),
|
text=babase.Lstr(resource=self._r + '.titleText'),
|
||||||
h_align='center',
|
h_align='center',
|
||||||
color=bui.app.ui_v1.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
maxwidth=250,
|
maxwidth=250,
|
||||||
v_align='center')
|
v_align='center')
|
||||||
v = self._height - 64
|
v = self._height - 64
|
||||||
|
|
||||||
self._selected_title_text = bui.textwidget(
|
self._selected_title_text = bui.textwidget(
|
||||||
|
|
@ -194,32 +194,32 @@ class SelectGameWindow(PlaylistAddGameWindow):
|
||||||
v = self._height - 60
|
v = self._height - 60
|
||||||
|
|
||||||
self._scrollwidget = bui.scrollwidget(parent=self._root_widget,
|
self._scrollwidget = bui.scrollwidget(parent=self._root_widget,
|
||||||
position=(x_inset + 61,
|
position=(x_inset + 61,
|
||||||
v - scroll_height),
|
v - scroll_height),
|
||||||
size=(self._scroll_width,
|
size=(self._scroll_width,
|
||||||
scroll_height),
|
scroll_height),
|
||||||
highlight=False)
|
highlight=False)
|
||||||
bui.widget(edit=self._scrollwidget,
|
bui.widget(edit=self._scrollwidget,
|
||||||
up_widget=self._back_button,
|
up_widget=self._back_button,
|
||||||
left_widget=self._back_button,
|
left_widget=self._back_button,
|
||||||
right_widget=select_button)
|
right_widget=select_button)
|
||||||
self._column: Optional[bui.Widget] = None
|
self._column: Optional[bui.Widget] = None
|
||||||
|
|
||||||
v -= 35
|
v -= 35
|
||||||
bui.containerwidget(edit=self._root_widget,
|
bui.containerwidget(edit=self._root_widget,
|
||||||
cancel_button=self._back_button,
|
cancel_button=self._back_button,
|
||||||
start_button=select_button)
|
start_button=select_button)
|
||||||
self._selected_game_type: Optional[Type[bs.GameActivity]] = None
|
self._selected_game_type: Optional[Type[bs.GameActivity]] = None
|
||||||
|
|
||||||
bui.containerwidget(edit=self._root_widget,
|
bui.containerwidget(edit=self._root_widget,
|
||||||
selected_child=self._scrollwidget)
|
selected_child=self._scrollwidget)
|
||||||
|
|
||||||
self._game_types: list[type[bs.GameActivity]] = []
|
self._game_types: list[type[bs.GameActivity]] = []
|
||||||
|
|
||||||
# Get actual games loading in the bg.
|
# Get actual games loading in the bg.
|
||||||
babase.app.meta.load_exported_classes(bs.GameActivity,
|
babase.app.meta.load_exported_classes(bs.GameActivity,
|
||||||
self._on_game_types_loaded,
|
self._on_game_types_loaded,
|
||||||
completion_cb_in_bg_thread=True)
|
completion_cb_in_bg_thread=True)
|
||||||
|
|
||||||
# Refresh with our initial empty list. We'll refresh again once
|
# Refresh with our initial empty list. We'll refresh again once
|
||||||
# game loading is complete.
|
# game loading is complete.
|
||||||
|
|
@ -240,29 +240,29 @@ class SelectGameWindow(PlaylistAddGameWindow):
|
||||||
self._column.delete()
|
self._column.delete()
|
||||||
|
|
||||||
self._column = bui.columnwidget(parent=self._scrollwidget,
|
self._column = bui.columnwidget(parent=self._scrollwidget,
|
||||||
border=2,
|
border=2,
|
||||||
margin=0)
|
margin=0)
|
||||||
|
|
||||||
for i, gametype in enumerate(self._game_types):
|
for i, gametype in enumerate(self._game_types):
|
||||||
|
|
||||||
def _doit() -> None:
|
def _doit() -> None:
|
||||||
if self._select_button:
|
if self._select_button:
|
||||||
bs.apptimer(0.1,
|
bs.apptimer(0.1,
|
||||||
self._select_button.activate)
|
self._select_button.activate)
|
||||||
|
|
||||||
txt = bui.textwidget(parent=self._column,
|
txt = bui.textwidget(parent=self._column,
|
||||||
position=(0, 0),
|
position=(0, 0),
|
||||||
size=(self._width - 88, 24),
|
size=(self._width - 88, 24),
|
||||||
text=gametype.get_display_string(),
|
text=gametype.get_display_string(),
|
||||||
h_align='left',
|
h_align='left',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
color=(0.8, 0.8, 0.8, 1.0),
|
color=(0.8, 0.8, 0.8, 1.0),
|
||||||
maxwidth=self._scroll_width * 0.8,
|
maxwidth=self._scroll_width * 0.8,
|
||||||
on_select_call=babase.Call(
|
on_select_call=babase.Call(
|
||||||
self._set_selected_game_type, gametype),
|
self._set_selected_game_type, gametype),
|
||||||
always_highlight=True,
|
always_highlight=True,
|
||||||
selectable=True,
|
selectable=True,
|
||||||
on_activate_call=_doit)
|
on_activate_call=_doit)
|
||||||
if i == 0:
|
if i == 0:
|
||||||
bui.widget(edit=txt, up_widget=self._back_button)
|
bui.widget(edit=txt, up_widget=self._back_button)
|
||||||
|
|
||||||
|
|
@ -276,8 +276,8 @@ class SelectGameWindow(PlaylistAddGameWindow):
|
||||||
size=(178, 50))
|
size=(178, 50))
|
||||||
if select_get_more_games_button:
|
if select_get_more_games_button:
|
||||||
bui.containerwidget(edit=self._column,
|
bui.containerwidget(edit=self._column,
|
||||||
selected_child=self._get_more_games_button,
|
selected_child=self._get_more_games_button,
|
||||||
visible_child=self._get_more_games_button)
|
visible_child=self._get_more_games_button)
|
||||||
|
|
||||||
def _add(self) -> None:
|
def _add(self) -> None:
|
||||||
_babase.lock_all_input() # Make sure no more commands happen.
|
_babase.lock_all_input() # Make sure no more commands happen.
|
||||||
|
|
@ -364,7 +364,7 @@ def _restore_state(self) -> None:
|
||||||
return # ensure that our monkey patched init ran
|
return # ensure that our monkey patched init ran
|
||||||
if self.__class__.__name__ not in bui.app.ui_v1.window_states:
|
if self.__class__.__name__ not in bui.app.ui_v1.window_states:
|
||||||
bui.containerwidget(edit=self._root_widget,
|
bui.containerwidget(edit=self._root_widget,
|
||||||
selected_child=self._coop_button)
|
selected_child=self._coop_button)
|
||||||
return
|
return
|
||||||
sel = states(self).get(
|
sel = states(self).get(
|
||||||
bui.app.ui_v1.window_states[self.__class__.__name__], None)
|
bui.app.ui_v1.window_states[self.__class__.__name__], None)
|
||||||
|
|
@ -372,7 +372,7 @@ def _restore_state(self) -> None:
|
||||||
bui.containerwidget(edit=self._root_widget, selected_child=sel)
|
bui.containerwidget(edit=self._root_widget, selected_child=sel)
|
||||||
else:
|
else:
|
||||||
bui.containerwidget(edit=self._root_widget,
|
bui.containerwidget(edit=self._root_widget,
|
||||||
selected_child=self._coop_button)
|
selected_child=self._coop_button)
|
||||||
babase.print_exception(f'Error restoring state for {self}.')
|
babase.print_exception(f'Error restoring state for {self}.')
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,8 @@ class Quickturn(babase.Plugin):
|
||||||
|
|
||||||
func(*args, **kwargs)
|
func(*args, **kwargs)
|
||||||
return wrapper
|
return wrapper
|
||||||
bascenev1lib.actor.spaz.Spaz.handlemessage = new_handlemessage(bascenev1lib.actor.spaz.Spaz.handlemessage)
|
bascenev1lib.actor.spaz.Spaz.handlemessage = new_handlemessage(
|
||||||
|
bascenev1lib.actor.spaz.Spaz.handlemessage)
|
||||||
|
|
||||||
def new_on_run(func):
|
def new_on_run(func):
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
|
|
|
||||||
|
|
@ -119,4 +119,5 @@ class RagdollBGone(babase.Plugin):
|
||||||
|
|
||||||
# Finally we """travel through the game files""" to replace the function we want with our own version.
|
# Finally we """travel through the game files""" to replace the function we want with our own version.
|
||||||
# We transplant the old function's arguments into our version.
|
# We transplant the old function's arguments into our version.
|
||||||
bascenev1lib.actor.spaz.Spaz.handlemessage = new_handlemessage(bascenev1lib.actor.spaz.Spaz.handlemessage)
|
bascenev1lib.actor.spaz.Spaz.handlemessage = new_handlemessage(
|
||||||
|
bascenev1lib.actor.spaz.Spaz.handlemessage)
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ class NewPublicGatherTab(PublicGatherTab, PingThread):
|
||||||
on_activate_call=bs.WeakCall(self._join_random_server),
|
on_activate_call=bs.WeakCall(self._join_random_server),
|
||||||
)
|
)
|
||||||
bui.widget(edit=self._random_join_button, up_widget=self._host_text,
|
bui.widget(edit=self._random_join_button, up_widget=self._host_text,
|
||||||
left_widget=self._filter_text)
|
left_widget=self._filter_text)
|
||||||
|
|
||||||
# We could place it somewhere under plugin settings which is kind of
|
# We could place it somewhere under plugin settings which is kind of
|
||||||
# official way to customise plugins. Although it's too deep:
|
# official way to customise plugins. Although it's too deep:
|
||||||
|
|
@ -100,7 +100,7 @@ class NewPublicGatherTab(PublicGatherTab, PingThread):
|
||||||
|
|
||||||
if not parties:
|
if not parties:
|
||||||
bui.screenmessage('No suitable servers found; wait',
|
bui.screenmessage('No suitable servers found; wait',
|
||||||
color=(1, 0, 0))
|
color=(1, 0, 0))
|
||||||
bui.getsound('error').play()
|
bui.getsound('error').play()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
@ -228,7 +228,7 @@ class RandomJoinSettingsPopup(bui.Window):
|
||||||
bui.textwidget(query=self._minimum_players_edit))
|
bui.textwidget(query=self._minimum_players_edit))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
bui.screenmessage('"Minimum players" should be integer',
|
bui.screenmessage('"Minimum players" should be integer',
|
||||||
color=(1, 0, 0))
|
color=(1, 0, 0))
|
||||||
bui.getsound('error').play()
|
bui.getsound('error').play()
|
||||||
errored = True
|
errored = True
|
||||||
try:
|
try:
|
||||||
|
|
@ -236,7 +236,7 @@ class RandomJoinSettingsPopup(bui.Window):
|
||||||
bui.textwidget(query=self._maximum_ping_edit))
|
bui.textwidget(query=self._maximum_ping_edit))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
bui.screenmessage('"Maximum ping" should be integer',
|
bui.screenmessage('"Maximum ping" should be integer',
|
||||||
color=(1, 0, 0))
|
color=(1, 0, 0))
|
||||||
bui.getsound('error').play()
|
bui.getsound('error').play()
|
||||||
errored = True
|
errored = True
|
||||||
if errored:
|
if errored:
|
||||||
|
|
@ -247,16 +247,16 @@ class RandomJoinSettingsPopup(bui.Window):
|
||||||
|
|
||||||
if minimum_players < 0:
|
if minimum_players < 0:
|
||||||
bui.screenmessage('"Minimum players" should be at least 0',
|
bui.screenmessage('"Minimum players" should be at least 0',
|
||||||
color=(1, 0, 0))
|
color=(1, 0, 0))
|
||||||
bui.getsound('error').play()
|
bui.getsound('error').play()
|
||||||
errored = True
|
errored = True
|
||||||
|
|
||||||
if maximum_ping <= 0:
|
if maximum_ping <= 0:
|
||||||
bui.screenmessage('"Maximum ping" should be greater than 0',
|
bui.screenmessage('"Maximum ping" should be greater than 0',
|
||||||
color=(1, 0, 0))
|
color=(1, 0, 0))
|
||||||
bui.getsound('error').play()
|
bui.getsound('error').play()
|
||||||
bui.screenmessage('(use 9999 as dont-care value)',
|
bui.screenmessage('(use 9999 as dont-care value)',
|
||||||
color=(1, 0, 0))
|
color=(1, 0, 0))
|
||||||
errored = True
|
errored = True
|
||||||
|
|
||||||
if errored:
|
if errored:
|
||||||
|
|
@ -294,7 +294,7 @@ class RandomJoin:
|
||||||
self.minimum_players = cfg['minimum_players']
|
self.minimum_players = cfg['minimum_players']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
bui.screenmessage('Error: RandomJoin config is broken, resetting..',
|
bui.screenmessage('Error: RandomJoin config is broken, resetting..',
|
||||||
color=(1, 0, 0), log=True)
|
color=(1, 0, 0), log=True)
|
||||||
bui.getsound('error').play()
|
bui.getsound('error').play()
|
||||||
self.commit_config()
|
self.commit_config()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,8 @@ class TNTRespawnText(babase.Plugin):
|
||||||
args[0]._tnt.node.add_death_action(tnt_callback)
|
args[0]._tnt.node.add_death_action(tnt_callback)
|
||||||
return wrapper
|
return wrapper
|
||||||
# Let's replace the original init function with our modified version.
|
# Let's replace the original init function with our modified version.
|
||||||
bascenev1lib.actor.bomb.TNTSpawner.__init__ = new_init(bascenev1lib.actor.bomb.TNTSpawner.__init__)
|
bascenev1lib.actor.bomb.TNTSpawner.__init__ = new_init(
|
||||||
|
bascenev1lib.actor.bomb.TNTSpawner.__init__)
|
||||||
|
|
||||||
# Our modified update function.
|
# Our modified update function.
|
||||||
# This gets called every 1.1s. Check the TNTSpawner class in the game's code for details.
|
# This gets called every 1.1s. Check the TNTSpawner class in the game's code for details.
|
||||||
|
|
@ -215,4 +216,5 @@ class TNTRespawnText(babase.Plugin):
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
# Let's replace the original update function with our modified version.
|
# Let's replace the original update function with our modified version.
|
||||||
bascenev1lib.actor.bomb.TNTSpawner._update = new_update(bascenev1lib.actor.bomb.TNTSpawner._update)
|
bascenev1lib.actor.bomb.TNTSpawner._update = new_update(
|
||||||
|
bascenev1lib.actor.bomb.TNTSpawner._update)
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue