Multiuser Experience Polish

Some stuff for the multiuser experience
This commit is contained in:
Jeison Yehuda Amihud (Blender Dumbass) 2021-01-03 13:52:42 +00:00
parent 8cfe895722
commit 1e41a09af3
4 changed files with 57 additions and 6 deletions

View file

@ -150,6 +150,7 @@ def run(project, win):
win.current["draw_dot"] = "end"
win.current["calls"] = {} # Calls. See sutdio/studio_dialogs.py
win.current["script_find"] = [0,0]
win.current["camera_arrived"] = False
if "pointers" not in win.story:
win.story["pointers"] = {} # List of text pointers per scene

View file

@ -27,6 +27,7 @@ from UI import UI_color
from studio import story
from studio import analytics
from studio import history
from studio import studio_dialogs
# network
from network import multiuser_terminal
@ -147,7 +148,8 @@ def layer(win):
40,
10,
button=do,
icon="server_close")
icon="server_close",
tip=talk.text("multiuser_server_stop"))
else:
def do():
@ -161,7 +163,8 @@ def layer(win):
40,
10,
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
# a clipping.
@ -358,6 +361,22 @@ def layer(win):
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
def do():

View file

@ -1463,7 +1463,7 @@ def marker(outlayer, win, name ,x, y ):
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.
@ -1528,4 +1528,26 @@ def user(outlayer, win, name ,x, y ):
set_text=name,
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()

View file

@ -981,7 +981,7 @@ def layer(win):
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
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:
print(e, "USER RENDERING")
@ -1142,6 +1142,14 @@ def layer(win):
win.settings["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
if win.url == "story_editor":
savenow = False
@ -1153,7 +1161,8 @@ def layer(win):
savenow = True
elif win.previous["keys"] and not win.current["keys"]:
savenow = True
elif win.current["camera_arrived"] and not win.previous["camera_arrived"]:
savenow = True
if savenow: