From 5c3cdd0ce405fbcd4d580e8b1e917ec8b129dc23 Mon Sep 17 00:00:00 2001 From: themanyfaceddemon Date: Mon, 26 Aug 2024 19:01:15 +0300 Subject: [PATCH] =?UTF-8?q?Fix=20some=20=D0=B1=D0=BB=D1=8F=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Code/api/chat.py | 2 +- Code/gui/conntect.py | 10 +++++++++- Content/Client/loc/rus/connect_window.loc | 6 ++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 Content/Client/loc/rus/connect_window.loc diff --git a/Code/api/chat.py b/Code/api/chat.py index 2341e27..b7f3318 100644 --- a/Code/api/chat.py +++ b/Code/api/chat.py @@ -11,5 +11,5 @@ async def net_ooc_chat(self, sender: str, msg: str): @staticmethod async def send_ooc(msg: str): - await Client.request_method("net", "ooc_chat", msg=msg) + await Client.request_method("ooc_chat", msg=msg) return diff --git a/Code/gui/conntect.py b/Code/gui/conntect.py index 83f8575..6bad78a 100644 --- a/Code/gui/conntect.py +++ b/Code/gui/conntect.py @@ -5,7 +5,7 @@ from DMBotNetwork import Client from root_path import ROOT_PATH from systems.loc import Localization as loc - +from api.chat import ChatModule logger = logging.getLogger("Connect") class ConnectManager: @@ -24,8 +24,16 @@ def create_connect_window(self): dpg.add_input_int (label=loc.get_string("connect_port_lable") , tag="connect_port") dpg.add_button(label=loc.get_string("connect_button"), callback=self.run_client) + + dpg.add_input_text(hint="send_msg_debug", tag="OOC_CHAT") + dpg.add_button(label="send", callback=self.send_chat_msg) + + async def send_chat_msg(self, *args): + await ChatModule.send_ooc(dpg.get_value("OOC_CHAT")) async def run_client(self, sender, app_data, user_data): + await Client.close_connection() + login_value = dpg.get_value("connect_login") password_value = dpg.get_value("connect_password") host_value = dpg.get_value("connect_host") diff --git a/Content/Client/loc/rus/connect_window.loc b/Content/Client/loc/rus/connect_window.loc new file mode 100644 index 0000000..024b034 --- /dev/null +++ b/Content/Client/loc/rus/connect_window.loc @@ -0,0 +1,6 @@ +connect_main_text = Соединение с сервером +connect_login_hint = Логин +connect_password_hint = Пароль +connect_host_hint = IP +connect_port_lable = Порт +connect_button = Соединиться