Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Net part 6 #5

Merged
merged 21 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Set PYTHONPATH
run: echo "PYTHONPATH=$PYTHONPATH:$(pwd)/Code" >> $GITHUB_ENV

- name: Run tests
timeout-minutes: 10
run: |
python -m unittest discover -s Tests -p "*.py" -v -f
python -m unittest discover -s Tests -p "*.py" -v
env:
pythonLocation: /opt/hostedtoolcache/Python/3.12.3/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.3/x64/lib
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,10 @@ ENV/
env.bak/
venv.bak/

# VS and VSC
.vs/*
.vscode/*

# Server data
Content/Servers/*

# Texture
Content/Compiled/*
*_compiled*.gif
*_compiled*.png

# PyQT6
*_ui.py
12 changes: 12 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Start client",
"type": "debugpy",
"request": "launch",
"program": "Code/main.py",
"console": "integratedTerminal"
}
]
}
File renamed without changes.
3 changes: 3 additions & 0 deletions Code/api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .chat import ChatModule

__all__ = ['ChatModule']
15 changes: 15 additions & 0 deletions Code/api/chat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import logging

from DMBotNetwork import Client

logger = logging.getLogger("Chat")

class ChatModule(Client):
async def net_ooc_chat(self, sender: str, msg: str):
logger.info(f"[OOC] {sender}: {msg}")
return

@staticmethod
async def send_ooc(msg: str):
await Client.request_method("ooc_chat", msg=msg)
return
10 changes: 0 additions & 10 deletions Code/app_client_main.py

This file was deleted.

1 change: 0 additions & 1 deletion Code/gui/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
from gui.login_window import LoginWindow
31 changes: 31 additions & 0 deletions Code/gui/fonts_setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import sys

import dearpygui.dearpygui as dpg
from root_path import ROOT_PATH


class FontManager:
@staticmethod
def load_fonts():
with dpg.font_registry():
with dpg.font(str(ROOT_PATH / 'Content' / 'Client' / 'fronts' / 'Monocraft' / 'Monocraft.otf'), 13) as default_font:
dpg.add_font_range_hint(dpg.mvFontRangeHint_Default)
dpg.add_font_range_hint(dpg.mvFontRangeHint_Cyrillic)

dpg.add_font_range(0x0391, 0x03C9) #Greek character range
dpg.add_font_range(0x2070, 0x209F) #Range of upper and lower numerical indices

if sys.platform == 'win32': # Иди нахуй винда
_remap_chars()

dpg.bind_font(default_font)

def _remap_chars():
biglet = 0x0410
for i1 in range(0x00C0, 0xE0):
dpg.add_char_remap(i1, biglet)
dpg.add_char_remap(i1 + 0x20, biglet + 0x20)
biglet += 1

dpg.add_char_remap(0x00A8, 0x0401) # Ё
dpg.add_char_remap(0x00B8, 0x0451) # ё
221 changes: 0 additions & 221 deletions Code/gui/login_window.py

This file was deleted.

18 changes: 0 additions & 18 deletions Code/gui/main_window.py

This file was deleted.

Loading
Loading