EnergyLink: cleanup the second
This commit is contained in:
parent
db152e6790
commit
68e9368bb3
|
@ -318,6 +318,7 @@ class CommonContext():
|
|||
logger.info(f"DeathLink: Received from {data['source']}")
|
||||
|
||||
async def send_death(self, death_text: str = ""):
|
||||
if self.server and self.server.socket:
|
||||
logger.info("DeathLink: Sending death to your friends...")
|
||||
self.last_death_link = time.time()
|
||||
await self.send_msgs([{
|
||||
|
|
|
@ -183,7 +183,7 @@ async def game_watcher(ctx: FactorioContext):
|
|||
}]))
|
||||
ctx.rcon_client.send_command(
|
||||
f"/ap-energylink -{value}")
|
||||
logger.info(f"EnergyLink: Sent {value} Joules")
|
||||
logger.info(f"EnergyLink: Sent {Utils.format_SI_prefix(value)}J")
|
||||
|
||||
await asyncio.sleep(0.1)
|
||||
|
||||
|
|
14
kvui.py
14
kvui.py
|
@ -91,9 +91,9 @@ class ServerToolTip(Label):
|
|||
pass
|
||||
|
||||
|
||||
class ServerLabel(HoverBehavior, Label):
|
||||
class HovererableLabel(HoverBehavior, Label):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(ServerLabel, self).__init__(*args, **kwargs)
|
||||
super(HovererableLabel, self).__init__(*args, **kwargs)
|
||||
self.layout = FloatLayout()
|
||||
self.popuplabel = ServerToolTip(text="Test")
|
||||
self.layout.add_widget(self.popuplabel)
|
||||
|
@ -105,6 +105,12 @@ class ServerLabel(HoverBehavior, Label):
|
|||
def on_leave(self):
|
||||
App.get_running_app().root.remove_widget(self.layout)
|
||||
|
||||
@property
|
||||
def ctx(self) -> context_type:
|
||||
return App.get_running_app().ctx
|
||||
|
||||
|
||||
class ServerLabel(HovererableLabel):
|
||||
def get_text(self):
|
||||
if self.ctx.server:
|
||||
ctx = self.ctx
|
||||
|
@ -138,10 +144,6 @@ class ServerLabel(HoverBehavior, Label):
|
|||
else:
|
||||
return "No current server connection. \nPlease connect to an Archipelago server."
|
||||
|
||||
@property
|
||||
def ctx(self) -> context_type:
|
||||
return App.get_running_app().ctx
|
||||
|
||||
|
||||
class MainLayout(GridLayout):
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue