Multiuser Experience Polish
Some stuff for the multiuser experience
This commit is contained in:
parent
8cfe895722
commit
1e41a09af3
4 changed files with 57 additions and 6 deletions
|
@ -150,6 +150,7 @@ def run(project, win):
|
||||||
win.current["draw_dot"] = "end"
|
win.current["draw_dot"] = "end"
|
||||||
win.current["calls"] = {} # Calls. See sutdio/studio_dialogs.py
|
win.current["calls"] = {} # Calls. See sutdio/studio_dialogs.py
|
||||||
win.current["script_find"] = [0,0]
|
win.current["script_find"] = [0,0]
|
||||||
|
win.current["camera_arrived"] = False
|
||||||
|
|
||||||
if "pointers" not in win.story:
|
if "pointers" not in win.story:
|
||||||
win.story["pointers"] = {} # List of text pointers per scene
|
win.story["pointers"] = {} # List of text pointers per scene
|
||||||
|
|
|
@ -27,6 +27,7 @@ from UI import UI_color
|
||||||
from studio import story
|
from studio import story
|
||||||
from studio import analytics
|
from studio import analytics
|
||||||
from studio import history
|
from studio import history
|
||||||
|
from studio import studio_dialogs
|
||||||
|
|
||||||
# network
|
# network
|
||||||
from network import multiuser_terminal
|
from network import multiuser_terminal
|
||||||
|
@ -147,7 +148,8 @@ def layer(win):
|
||||||
40,
|
40,
|
||||||
10,
|
10,
|
||||||
button=do,
|
button=do,
|
||||||
icon="server_close")
|
icon="server_close",
|
||||||
|
tip=talk.text("multiuser_server_stop"))
|
||||||
else:
|
else:
|
||||||
def do():
|
def do():
|
||||||
|
|
||||||
|
@ -161,7 +163,8 @@ def layer(win):
|
||||||
40,
|
40,
|
||||||
10,
|
10,
|
||||||
button=do,
|
button=do,
|
||||||
icon="server_new")
|
icon="server_new",
|
||||||
|
tip=talk.text("multiuser_server_start"))
|
||||||
|
|
||||||
# Server outputs part. I'm creating a layer for it just because it needs
|
# Server outputs part. I'm creating a layer for it just because it needs
|
||||||
# a clipping.
|
# a clipping.
|
||||||
|
@ -358,6 +361,22 @@ def layer(win):
|
||||||
layer.show_text(count)
|
layer.show_text(count)
|
||||||
|
|
||||||
|
|
||||||
|
# Documentation entry
|
||||||
|
def do():
|
||||||
|
def after(win, var):
|
||||||
|
pass
|
||||||
|
|
||||||
|
studio_dialogs.help(win, "help", after, SEARCH=talk.text("documentation_multiuser"))
|
||||||
|
|
||||||
|
UI_elements.roundrect(layer, win,
|
||||||
|
win.current["w"]/3*2-160,
|
||||||
|
win.current["h"]-120,
|
||||||
|
40,
|
||||||
|
40,
|
||||||
|
10,
|
||||||
|
do,
|
||||||
|
icon="question")
|
||||||
|
|
||||||
# CANCEl
|
# CANCEl
|
||||||
|
|
||||||
def do():
|
def do():
|
||||||
|
|
|
@ -1463,7 +1463,7 @@ def marker(outlayer, win, name ,x, y ):
|
||||||
outlayer.stroke()
|
outlayer.stroke()
|
||||||
|
|
||||||
|
|
||||||
def user(outlayer, win, name ,x, y ):
|
def user(outlayer, win, name ,x, y, user):
|
||||||
|
|
||||||
# This function will draw users from multiuser to the screen.
|
# This function will draw users from multiuser to the screen.
|
||||||
|
|
||||||
|
@ -1527,5 +1527,27 @@ def user(outlayer, win, name ,x, y ):
|
||||||
40,
|
40,
|
||||||
set_text=name,
|
set_text=name,
|
||||||
editable=False)
|
editable=False)
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
# Going to the other user with 1 click
|
||||||
|
|
||||||
|
def do():
|
||||||
|
|
||||||
|
nex = win.multiuser["users"][user]["camera"][0]
|
||||||
|
ney = win.multiuser["users"][user]["camera"][1]
|
||||||
|
|
||||||
|
UI_elements.animate("cameraX", win, win.story["camera"][0],nex, time=20, force=True)
|
||||||
|
UI_elements.animate("cameraY", win, win.story["camera"][1],ney, time=20, force=True)
|
||||||
|
|
||||||
|
UI_elements.roundrect(outlayer, win,
|
||||||
|
x+width-40,
|
||||||
|
y,
|
||||||
|
40,
|
||||||
|
40,
|
||||||
|
10,
|
||||||
|
button=do,
|
||||||
|
tip=name,
|
||||||
|
fill=False)
|
||||||
|
outlayer.stroke()
|
||||||
|
|
||||||
|
|
|
@ -981,7 +981,7 @@ def layer(win):
|
||||||
mx = 0-win.multiuser["users"][user]["camera"][0] +cx + win.current["w"]/2
|
mx = 0-win.multiuser["users"][user]["camera"][0] +cx + win.current["w"]/2
|
||||||
my = 0-win.multiuser["users"][user]["camera"][1] +cy + win.current["h"]/2
|
my = 0-win.multiuser["users"][user]["camera"][1] +cy + win.current["h"]/2
|
||||||
|
|
||||||
studio_nodes.user(layer, win, win.multiuser["users"][user]["username"], mx, my)
|
studio_nodes.user(layer, win, win.multiuser["users"][user]["username"], mx, my, user)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e, "USER RENDERING")
|
print(e, "USER RENDERING")
|
||||||
|
|
||||||
|
@ -1142,6 +1142,14 @@ def layer(win):
|
||||||
win.settings["Undo_Limit"] = 32
|
win.settings["Undo_Limit"] = 32
|
||||||
settings.write("Undo_Limit", 32)
|
settings.write("Undo_Limit", 32)
|
||||||
|
|
||||||
|
if win.animations["cameraX"][1] == cx:
|
||||||
|
win.current["camera_arrived"] = True
|
||||||
|
else:
|
||||||
|
win.current["camera_arrived"] = False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Save story. I'm going to do it the same way as in the old Blender-Organizer
|
# Save story. I'm going to do it the same way as in the old Blender-Organizer
|
||||||
if win.url == "story_editor":
|
if win.url == "story_editor":
|
||||||
savenow = False
|
savenow = False
|
||||||
|
@ -1153,7 +1161,8 @@ def layer(win):
|
||||||
savenow = True
|
savenow = True
|
||||||
elif win.previous["keys"] and not win.current["keys"]:
|
elif win.previous["keys"] and not win.current["keys"]:
|
||||||
savenow = True
|
savenow = True
|
||||||
|
elif win.current["camera_arrived"] and not win.previous["camera_arrived"]:
|
||||||
|
savenow = True
|
||||||
|
|
||||||
if savenow:
|
if savenow:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue