Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ny committed Mar 7, 2023
1 parent 0a40a1f commit 7a83e31
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ff_draw/func_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ def __init__(self, main: 'FFDraw'):
'glm': glm, 'main': self.main, 'safe_lazy': safe_lazy,
'actor_distance': actor_distance_func, 'action_shape_scale': self.action_shape_scale, 'math': math
}
compile_config = self.main.config.setdefault('compile', {})
self.print_compile = compile_config.setdefault('print_debug', {}).setdefault('enable', False)
self.enable_eval = compile_config.setdefault('enable_eval', False)
self.compile_config = self.main.config.setdefault('compile', {})
self.print_compile = self.compile_config.setdefault('print_debug', {}).setdefault('enable', False)
self.enable_eval = self.compile_config.setdefault('enable_eval', False)
if self.enable_eval and not self.main.rpc_password:
self.logger.warning(r'enable_eval is set as true but there is no rpc password, please set a rpc password to enable eval function')
self.enable_eval = False
Expand Down
13 changes: 13 additions & 0 deletions ff_draw/gui/panel.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import math
import os
import typing

import glfw
Expand All @@ -20,6 +21,7 @@ def __init__(self, gui: 'Drawing'):
self.window = gui.window_panel
self.is_expand = True
self.is_show = True
self.show_exit_process = False

self.current_page = ''

Expand All @@ -30,7 +32,17 @@ def __init__(self, gui: 'Drawing'):

def ffd_page(self):
mem = self.main.mem

imgui.text(f'pid: {mem.pid}')
imgui.same_line()
if self.show_exit_process:
if imgui.button(f'kill process!'):
from nylib.utils.win32.winapi.kernel32 import TerminateProcess
TerminateProcess(mem.handle, 0)
os._exit(0)
else:
self.show_exit_process = imgui.button(f'kill process?')

if me := mem.actor_table.me:
imgui.text(f'me: {me.name}#{me.id:#x}')
if (tid := mem.territory_type) != self.cached_tid:
Expand Down Expand Up @@ -69,6 +81,7 @@ def ffd_page(self):

imgui.text('sniffer')
sniffer = self.main.sniffer
imgui.text(f'fix:{sniffer.packet_fix.value}')
clicked, sniffer.print_packets = imgui.checkbox("print_packets", sniffer.print_packets)
if clicked:
sniffer.config['print_packets'] = sniffer.print_packets
Expand Down

0 comments on commit 7a83e31

Please sign in to comment.