Python-Dateien

Neu laden
Gefunden: 162 Datei(en)
editor_init.py
# Source Generated with Decompyle++
# File: editor_init.pyc (Python 3.13)

g_log_console = None

def start_log_console():
    global g_log_console
    InteractiveConsole = InteractiveConsole
    import code
    g_log_console = InteractiveConsole()
    import game
    game.on_debug_input = on_debug_input


def on_debug_input(line):
    g_log_console.last_line = line
    g_log_console.push(line)


def start():
    start_log_console()

EDITOR_CLIENT = None
TICKABLE_PLUGINS = []

def init_dcs():
    Env = Env
    import dcs_core.Env
    Env.initialize(is_server = False, is_publish = False, debug_master_switch = False)
    LogManager = LogManager
    import mbs.mobilelog.log_manager
    Env.set_log_proxy(LogManager)
    CB = CB
    import dcs_engine
    Env.set_cb_proxy(CB)
    import math3d
    Env.set_math3d_module(math3d)
    DcsPropertyDefProxy = DcsPropertyDefProxy
    import game_common.helper
    Env.set_property_def_proxy(DcsPropertyDefProxy)
    IdManager = IdManager
    import mbs.common.id_manager
    Env.set_id_mgr_proxy(IdManager)


def _tick():
    if EDITOR_CLIENT:
        EDITOR_CLIENT.Update()
    for plugin in TICKABLE_PLUGINS:
        plugin.tick()
        return None

ORI_FRAME_RATE = 0

def start_sunshine(init_arg):
    global EDITOR_CLIENT, EDITOR_CLIENT, ORI_FRAME_RATE
    init_dcs()
    if EDITOR_CLIENT:
        if not EDITOR_CLIENT.connectReady:
            return None
        None.Close()
        EDITOR_CLIENT = None
    import render
    render.logic = _tick
    SunshineClient = SunshineClient
    import SunshineSDK2.SunshineClient
    EDITOR_CLIENT = SunshineClient()
    NeoXEditorRPDClient = NeoXEditorRPDClient
    import sunshine2.RecordPlayDebuger.Plugin
    RecordPlayDebuger = NeoXEditorRPDClient.NeoXEditorRPDClient()
    EDITOR_CLIENT.RegisterPlugin(RecordPlayDebuger)
    (ip, port) = ('127.0.0.1', 29102)
    EDITOR_CLIENT.Connect((ip, port))
    EDITOR_CLIENT.RegisterCloseCallback(close_sunshine)
    import game3d
    ORI_FRAME_RATE = game3d.get_frame_rate()
    game3d.set_frame_rate(30)


def close_sunshine():
    global EDITOR_CLIENT, TICKABLE_PLUGINS, ORI_FRAME_RATE
    import render
    render.logic = None
    render.post_logic = None
    EDITOR_CLIENT.Close()
    EDITOR_CLIENT = None
    TICKABLE_PLUGINS = []
    if ORI_FRAME_RATE:
        import game3d
        game3d.set_frame_rate(ORI_FRAME_RATE)
        ORI_FRAME_RATE = None
        return None