From 21ec0cd55fa7ab86b1318e42ff6f96c8735f3aee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E7=91=97=E6=9D=B0?= <3695888@qq.com> Date: Fri, 26 Feb 2021 13:59:37 +0800 Subject: [PATCH] V0.2! --- bin/client.py | 11 ++++++----- sys_value/lang/en-us.json5 | 4 +++- sys_value/lang/zh-cn.json5 | 3 ++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/bin/client.py b/bin/client.py index f20c590..e25f9d1 100644 --- a/bin/client.py +++ b/bin/client.py @@ -94,7 +94,7 @@ class window(pyglet.window.Window): pyglet.resource.reindex() # dic self.button_hitbox = {} - self.button_show = {} + self.button_toggled = {} self.ships = {} # all ship(part) self.planet_system = tools.config('sys_value/planet.json5') # hole planet system # list @@ -139,7 +139,7 @@ class window(pyglet.window.Window): # self.textures['runtime'][runtime] = runtime_image self.textures['runtime'][runtime] = runtime_sprite self.button_hitbox[runtime] = [runtime_image.width, runtime_image.height] - self.button_show[runtime] = -1 + self.button_toggled[runtime] = -1 # info_label self.info_label = pyglet.text.Label(text='test %s' % pyglet.clock.get_fps(), @@ -204,7 +204,7 @@ class window(pyglet.window.Window): self.textures['runtime']['stage'].y = tool_y self.textures['runtime']['zoom'].x = 260 self.textures['runtime']['zoom'].y = tool_y - if self.button_show['zoom'] != -1: + if self.button_toggled['zoom'] != -1: self.textures['runtime']['zoom_in'].x = 260 - 40 self.textures['runtime']['zoom_in'].y = tool_y + 25 + 50 self.textures['runtime']['zoom_out'].x = 260 + 40 @@ -242,8 +242,9 @@ class window(pyglet.window.Window): for hit_box in self.button_hitbox: box = self.button_hitbox[hit_box] if (box[0] <= x <= box[2]) and (box[1] <= y <= box[3]): - self.button_show[hit_box] *= -1 - self.logger.info('%s 被左键点击 显示状态为:%s' % (hit_box, self.button_show[hit_box])) + self.button_toggled[hit_box] *= -1 + self.logger.debug( + '%s %s %s' % (hit_box, self.lang['button.been_press'], self.button_toggled[hit_box])) break elif button == mouse.RIGHT: self.logger.info('右键! 在 x:%s y:%s' % (x, y)) diff --git a/sys_value/lang/en-us.json5 b/sys_value/lang/en-us.json5 index 5db5406..a103e86 100644 --- a/sys_value/lang/en-us.json5 +++ b/sys_value/lang/en-us.json5 @@ -13,7 +13,9 @@ 'client': { 'setup.done': 'Client load complete ', 'os.pid_is1': 'Client is using PID :', - 'os.pid_is2': 'To Run' + 'os.pid_is2': 'To Run', + 'button.been_press': '按钮被按下,目前状态为:' + //todo 翻译! }, 'server': { 'setup.done': 'server load complete ', diff --git a/sys_value/lang/zh-cn.json5 b/sys_value/lang/zh-cn.json5 index 38685ea..2f49528 100644 --- a/sys_value/lang/zh-cn.json5 +++ b/sys_value/lang/zh-cn.json5 @@ -13,7 +13,8 @@ 'client': { 'setup.done': '客户端载入完成', 'os.pid_is1': '客户端正在以pid', - 'os.pid_is2': '运行' + 'os.pid_is2': '运行', + 'button.been_press': '按钮被按下,目前状态为:' }, 'server': { 'setup.done': '服务端载入完成',