forked from LeenkxTeam/LNXSDK
41 lines
1.4 KiB
Python
41 lines
1.4 KiB
Python
from lnx.logicnode.lnx_nodes import *
|
|
|
|
|
|
class WebviewFullscreenNode(LnxLogicTreeNode):
|
|
"""Sets or gets the fullscreen state of the given WebView's detached window"""
|
|
bl_idname = 'LNWebviewFullscreenNode'
|
|
bl_label = 'Webview Fullscreen'
|
|
lnx_category = 'Krom Runtime'
|
|
lnx_section = 'webview'
|
|
lnx_version = 1
|
|
|
|
def update_sockets(self, context):
|
|
for i in self.inputs:
|
|
self.inputs.remove(i)
|
|
for o in self.outputs:
|
|
self.outputs.remove(o)
|
|
|
|
if self.property0 == 'set':
|
|
self.add_input('LnxNodeSocketAction', 'In')
|
|
self.add_input('LnxIntSocket', 'ID')
|
|
self.add_input('LnxBoolSocket', 'Fullscreen', default_value=True)
|
|
self.add_output('LnxNodeSocketAction', 'Out')
|
|
else:
|
|
self.add_input('LnxIntSocket', 'ID')
|
|
self.add_output('LnxBoolSocket', 'Is Fullscreen')
|
|
|
|
property0: HaxeEnumProperty(
|
|
'property0',
|
|
items=[('set', 'Set', 'Set fullscreen state'),
|
|
('get', 'Get', 'Get fullscreen state')],
|
|
name='Mode', default='set', update=update_sockets)
|
|
|
|
def lnx_init(self, context):
|
|
self.add_input('LnxNodeSocketAction', 'In')
|
|
self.add_input('LnxIntSocket', 'ID')
|
|
self.add_input('LnxBoolSocket', 'Fullscreen', default_value=True)
|
|
self.add_output('LnxNodeSocketAction', 'Out')
|
|
|
|
def draw_buttons(self, context, layout):
|
|
layout.prop(self, 'property0')
|