Skip to content

Commit

Permalink
refactor: rewrite to composition api
Browse files Browse the repository at this point in the history
  • Loading branch information
rendrom committed Nov 6, 2024
1 parent c421190 commit 19f911d
Show file tree
Hide file tree
Showing 63 changed files with 8,719 additions and 6,187 deletions.
9 changes: 0 additions & 9 deletions .eslintrc

This file was deleted.

25 changes: 25 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
extends: [
'@nextgis/eslint-config',
'plugin:vue/recommended',
'@vue/typescript/recommended',
'plugin:prettier/recommended',
],
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
rules: {
'vue/script-setup-uses-vars': 'error',
'vue/no-mutating-props': 'error',
'vue/require-default-prop': 'off',
'vue/no-v-html': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'prefer-rest-params': 0,
'@typescript-eslint/no-use-before-define': 0,
},
};
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "@nextgis"]
path = @nextgis
url = [email protected]:nextgis/nextgis_frontend.git
[submodule "@nextgis_vue2"]
path = @nextgis_vue2
url = [email protected]:nextgis/nextgis_frontend_vue2.git
2 changes: 1 addition & 1 deletion @nextgis
Submodule @nextgis updated 1157 files
1 change: 1 addition & 0 deletions @nextgis_vue2
Submodule @nextgis_vue2 added at 0ca608
50 changes: 50 additions & 0 deletions game.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import curses

def main(stdscr):
# Отключаем отображение курсора
curses.curs_set(0)

# Получаем размеры окна
height, width = stdscr.getmaxyx()

# Определяем меню
menu = ["Начать игру", "Выход"]
current_row = 0

def print_menu(stdscr, selected_row_idx):
stdscr.clear()
for idx, row in enumerate(menu):
x = width//2 - len(row)//2
y = height//2 - len(menu)//2 + idx
if idx == selected_row_idx:
stdscr.attron(curses.color_pair(1))
stdscr.addstr(y, x, row)
stdscr.attroff(curses.color_pair(1))
else:
stdscr.addstr(y, x, row)
stdscr.refresh()

# Настраиваем цветовую пару для выделения
curses.start_color()
curses.init_pair(1, curses.COLOR_BLACK, curses.COLOR_WHITE)

print_menu(stdscr, current_row)

while True:
key = stdscr.getch()

if key == curses.KEY_UP and current_row > 0:
current_row -= 1
elif key == curses.KEY_DOWN and current_row < len(menu) - 1:
current_row += 1
elif key == curses.KEY_ENTER or key in [10, 13]:
if current_row == 0:
stdscr.addstr(height//2 + len(menu)//2 + 1, width//2 - len("Начинаем игру...")//2, "Начинаем игру...")
stdscr.refresh()
stdscr.getch()
elif current_row == 1:
break

print_menu(stdscr, current_row)

curses.wrapper(main)
Loading

0 comments on commit 19f911d

Please sign in to comment.