-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtexts_panel.py
59 lines (50 loc) · 2.27 KB
/
texts_panel.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Nikita Akimov
#
# GitHub
# https://github.com/Korchy/BIS
from bpy.types import Panel
from bpy.utils import register_class, unregister_class
from .WebRequests import WebAuthVars
class BISTextsPanel(Panel):
bl_idname = 'BIS_PT_texts_panel'
bl_label = 'BIS - TEXTS'
bl_space_type = 'TEXT_EDITOR'
bl_region_type = 'UI'
bl_category = 'BIS'
def draw(self, context):
layout = self.layout
if WebAuthVars.logged:
row = layout.row(align=True)
row.label(text='')
help_button = row.operator('bis.messagebox', icon='HELP')
help_button.width = 600
help_button.message = '- Why I can not get materials?\n' \
'This panel is for TEXTS! Switch to the Shader Editor window to get materials.\n'
if WebAuthVars.userProStatus:
layout.prop(context.window_manager.bis_get_texts_info_from_storage_vars, 'search_filter')
layout.operator('bis.get_texts_info_from_storage', icon='VIEWZOOM', text=' Search')
row = layout.row()
row.operator('bis.get_texts_info_from_storage_prev_page', text='Prev')
row.operator('bis.get_texts_info_from_storage_next_page', text='Next')
else:
layout.operator('bis.get_texts_info_from_storage', icon='FILE_REFRESH', text=' Get active texts')
layout.separator()
layout.separator()
layout.prop(context.window_manager.bis_get_texts_info_from_storage_vars, 'items')
layout.separator()
layout.separator()
layout.prop(context.window_manager.bis_add_text_to_storage_vars, 'tags')
button = layout.operator('bis.add_text_to_storage', text='Save as New')
button.show_message = True
button = layout.operator('bis.update_text_in_storage', text='Update')
button.show_message = True
layout.separator()
layout.separator()
layout.operator('bis.web_auth', icon='FILE_TICK', text='Sign out')
else:
layout.operator('bis.web_auth', icon='WORLD', text='Sign in')
def register():
register_class(BISTextsPanel)
def unregister():
unregister_class(BISTextsPanel)