Skip to content

Commit

Permalink
svn_sync
Browse files Browse the repository at this point in the history
  • Loading branch information
LiXizhi committed Mar 10, 2020
1 parent 395c9da commit 130339b
Show file tree
Hide file tree
Showing 12 changed files with 2,047 additions and 2,418 deletions.
Binary file modified config/Aries/creator/language/paracraft_enUS.mo
Binary file not shown.
4,252 changes: 1,854 additions & 2,398 deletions config/Aries/creator/language/paracraft_enUS.po

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions script/apps/Aries/Creator/Game/Code/NplCad/NplCad.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,14 @@ end
function NplCad.OnSelect()
if(CodeBlockWindow.GetSceneContext and CodeBlockWindow:GetSceneContext())then
CodeBlockWindow:GetSceneContext():SetShowBones(true);
CodeBlockWindow:GetSceneContext():ShowGrid(true);
end
end

function NplCad.OnDeselect()
if(CodeBlockWindow.GetSceneContext and CodeBlockWindow:GetSceneContext())then
CodeBlockWindow:GetSceneContext():SetShowBones(false);
CodeBlockWindow:GetSceneContext():ShowGrid(false);
end
end

Expand Down
1 change: 1 addition & 0 deletions script/apps/Aries/Creator/Game/Entity/EntityChest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ local EntityManager = commonlib.gettable("MyCompany.Aries.Game.EntityManager");
local Packets = commonlib.gettable("MyCompany.Aries.Game.Network.Packets");

local Entity = commonlib.inherit(commonlib.gettable("MyCompany.Aries.Game.EntityManager.EntityBlockBase"), commonlib.gettable("MyCompany.Aries.Game.EntityManager.EntityChest"));
Entity:Signal("remotelyUpdated")

-- class name
Entity.class_name = "EntityChest";
Expand Down
3 changes: 2 additions & 1 deletion script/apps/Aries/Creator/Game/Entity/EntityRailcar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,8 @@ function Entity:ApplyEntityCollision(fromEntity, deltaTime)
local dz1 = from_z - z;

local vecDir = vector3d:new_from_pool(dx1, 0, dz1):normalize();
local cosAngle = math.abs(vecDir:dot(math.cos(self.facing), 0, math.sin(self.facing)));
local facing = self.facing or 0;
local cosAngle = math.abs(vecDir:dot(math.cos(facing), 0, math.sin(facing)));

if (cosAngle < 0.800000011920929) then
return;
Expand Down
2 changes: 1 addition & 1 deletion script/apps/Aries/Creator/Game/Entity/PlayerSkins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ end
-- @param id: integer
function PlayerSkins:GetSkinByID(id)
local skins = self:GetSkinsById(defaultModelFile, 2)
if(skins) then
if(skins and id) then
id = ((id) % (#skins)) + 1;
local skin = skins[id];
if(skin) then
Expand Down
6 changes: 4 additions & 2 deletions script/apps/Aries/Creator/Game/Login/ParaWorldAnalytics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,14 @@ function ParaWorldAnalytics:Init(UA)

LOG.std(nil, "info", "ParaWorldAnalytics", "analytics client initialized with UA, user_id, client_id, app_name, app_version, api_rate: %s %s %s %s %s %d",
self.UA, self.user_id or "", self.client_id or "", self.app_name, self.app_version, self.api_rate);


NPL.load("(gl)script/ide/debug.lua");
if(GoogleAnalytics.LogCollector and commonlib.debug.SetNPLRuntimeErrorCallback) then
ParaWorldAnalytics.logger = ParaWorldAnalytics.logger or GoogleAnalytics.LogCollector:new():init(nil, self.app_name);
NPL.load("(gl)script/ide/debug.lua");
commonlib.debug.SetNPLRuntimeErrorCallback(ParaWorldAnalytics.OnNPLErrorCallBack)
LOG.std(nil, "info", "ParaWorldAnalytics", "log server enabled: %s", self.logger.server_url or "");
else
LOG.std(nil, "warn", "ParaWorldAnalytics", "log collector client not found");
end

return self;
Expand Down
32 changes: 32 additions & 0 deletions script/apps/Aries/Creator/Game/Movie/CopyActorTimeSeries.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!-- "script/apps/Aries/Creator/Game/Movie/CopyActorTimeSeries.html" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<pe:mcml>
<script refresh="false" type="text/npl" src="CopyActorTimeSeries.lua"><![CDATA[
CopyActorTimeSeries = commonlib.gettable("MyCompany.Aries.Game.Movie.CopyActorTimeSeries");
CopyActorTimeSeries.OnInit();
]]></script>
<aries:window mode="thin" style="width:512px;" title='<%=L"复制关键帧"%>' onclose="CopyActorTimeSeries.OnClose">
<div style="margin: 10px; margin-bottom: 15px; color: #ffffff;">
<pe:gridview name="nameGvw" style="height:300px;" DataSource="<%=CopyActorTimeSeries.GetDs%>" CellPadding="0" DefaultNodeHeight = "34" ItemsPerLine="3" AllowPaging="false" pagesize="512">
<Columns>
<div style="float:left;height:30px;min-width:120px">
<input name="<%=Eval('name')>" type="checkbox" checked="checked"/>
<div style="float:left;" for="<%=Eval('name')>"><%=Eval("displayName")%></div>
</div>
</Columns>
</pe:gridview>
<hr />
<div style="margin-top:10px;">
<input type="button" name="OK" DefaultButton="true" style="margin-left:260px;min-width:70px;" class="mc_light_grey_button_with_fillet" onclick="CopyActorTimeSeries.OnClickCopy" value='<%=L"复制"%>' />
</div>
</div>
</aries:window>
</pe:mcml>
</body>
</html>
107 changes: 107 additions & 0 deletions script/apps/Aries/Creator/Game/Movie/CopyActorTimeSeries.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
--[[
Title: copy actor time series
Author(s): LiXizhi
Date: 2020/3/9
Desc: copy and paste actor time series
use the lib:
-------------------------------------------------------
NPL.load("(gl)script/apps/Aries/Creator/Game/Movie/CopyActorTimeSeries.lua");
local CopyActorTimeSeries = commonlib.gettable("MyCompany.Aries.Game.Movie.CopyActorTimeSeries");
CopyActorTimeSeries.ShowPage()
-------------------------------------------------------
]]
NPL.load("(gl)script/apps/Aries/Creator/Game/Movie/MovieClipTimeLine.lua");
local MovieClipTimeLine = commonlib.gettable("MyCompany.Aries.Game.Movie.MovieClipTimeLine");

local CopyActorTimeSeries = commonlib.gettable("MyCompany.Aries.Game.Movie.CopyActorTimeSeries");

local page;
local nameDS = {};
function CopyActorTimeSeries.OnInit()
page = document:GetPageCtrl();
end

function CopyActorTimeSeries.GetDs(index)
if(not index) then
return #nameDS;
else
return nameDS[index];
end
end

function CopyActorTimeSeries.CreatePropertyDs(actor)
local ds = {};
if(actor) then
if(actor:CanShowCommandVariables()) then
local cmdActor = self:GetCmdActor(true);
if(cmdActor) then
for index, name in ipairs(cmdActor:GetEditableVariableList()) do
if(name ~= "---") then
ds[#ds+1] = {name=name, displayName = MovieClipTimeLine:GetVariableDisplayName(name), };
end
end
end
end
for index, name in ipairs(actor:GetEditableVariableList()) do
if(name ~= "---") then
ds[#ds+1] = {name=name, displayName = MovieClipTimeLine:GetVariableDisplayName(name), };
end
end
end
return ds
end

-- @param OnOK: function(values) end
-- @param old_value: {name="ximi", isAgent=true, isServer=false}
function CopyActorTimeSeries.ShowPage(actor, fromTime, toTime)
CopyActorTimeSeries.result = nil;

actor = actor or MovieClipTimeLine:GetSelectedActor();
if(not actor) then
return
end
nameDS = CopyActorTimeSeries.CreatePropertyDs(actor)

local params = {
url = "script/apps/Aries/Creator/Game/Movie/CopyActorTimeSeries.html",
name = "CopyActorTimeSeries.ShowPage",
isShowTitleBar = false,
DestroyOnClose = true,
bToggleShowHide=false,
style = CommonCtrl.WindowFrame.ContainerStyle,
allowDrag = true,
click_through = false,
enable_esc_key = true,
bShow = true,
isTopLevel = true,
app_key = MyCompany.Aries.Creator.Game.Desktop.App.app_key,
directPosition = true,
align = "_ct",
x = -256,
y = -200,
width = 512,
height = 400,
};
System.App.Commands.Call("File.MCMLWindowFrame", params);
end


function CopyActorTimeSeries.UpdateUIFromValue(values)
if(page and values) then
page:SetValue("name", values.name or "");
end
end

function CopyActorTimeSeries.OnClickCopy()
if(page) then
local v = {};
local isServer = page:GetValue("isServer") or false;
v.isServer = isServer;
CopyActorTimeSeries.last_values = v;
page:CloseWindow();
end
end

function CopyActorTimeSeries.OnClose()
page:CloseWindow();
end
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function EditCodeBlockContext:HandleGlobalKey(event)
end

function EditCodeBlockContext:UpdateCodeBlock()
self:updateManipulators();
self:updateManipulators(0.01);
end

function EditCodeBlockContext:GetMovieEntity()
Expand Down Expand Up @@ -181,7 +181,26 @@ function EditCodeBlockContext:GetActor()
return self.actor;
end

function EditCodeBlockContext:updateManipulators()
function EditCodeBlockContext:ShowGrid(bShow)
if(self.isShowGrid ~= bShow) then
self.isShowGrid = bShow
self:updateManipulators(0.01);
end
end

function EditCodeBlockContext:IsShowGrid()
return self.isShowGrid;
end

function EditCodeBlockContext:updateManipulators(delaySeconds)
if(delaySeconds and delaySeconds>0) then
self.updateTimer = self.updateTimer or commonlib.Timer:new({callbackFunc = function(timer)
self:updateManipulators();
end})
self.updateTimer:Change(math.floor(delaySeconds*1000));
return;
end

self:DeleteManipulators();
self:RemoveActor();
if(self:IsCodeRunning()) then
Expand All @@ -200,17 +219,14 @@ function EditCodeBlockContext:updateManipulators()
self:AddManipulator(manipCont);
manipCont:connectToDependNode(actor);


NPL.load("(gl)script/ide/System/Scene/Manipulators/RotateManipContainer.lua");
local RotateManipContainer = commonlib.gettable("System.Scene.Manipulators.RotateManipContainer");
local manipCont = RotateManipContainer:new();
manipCont:init();
manipCont:SetYawPlugName("facing");
manipCont:SetYawEnabled(true);
manipCont:SetPitchEnabled(false);
manipCont:SetRollEnabled(false);
self:AddManipulator(manipCont);
manipCont:connectToDependNode(actor);
if(self:IsShowGrid()) then
manipCont.translateManip:SetPlaneSize(10);
manipCont.translateManip:SetPlaneColor(0);
manipCont.translateManip:SetPlainLineColor(0x20000000);
--manipCont.translateManip:SetShowXPlane(true)
manipCont.translateManip:SetShowYPlane(true)
--manipCont.translateManip:SetShowZPlane(true)
end

if(self:IsShowBones()) then
NPL.load("(gl)script/ide/System/Scene/Manipulators/BonesManipContainer.lua");
Expand All @@ -219,6 +235,18 @@ function EditCodeBlockContext:updateManipulators()
manipCont:init();
self:AddManipulator(manipCont);
manipCont:connectToDependNode(actor);
else
-- rotation is disabled when bone is displayed such as for cad block
NPL.load("(gl)script/ide/System/Scene/Manipulators/RotateManipContainer.lua");
local RotateManipContainer = commonlib.gettable("System.Scene.Manipulators.RotateManipContainer");
local manipCont = RotateManipContainer:new();
manipCont:init();
manipCont:SetYawPlugName("facing");
manipCont:SetYawEnabled(true);
manipCont:SetPitchEnabled(false);
manipCont:SetRollEnabled(false);
self:AddManipulator(manipCont);
manipCont:connectToDependNode(actor);
end
end
local codeblock = self:GetCodeBlock();
Expand All @@ -230,7 +258,7 @@ end
function EditCodeBlockContext:SetShowBones(bShowBones)
if(self.showBones ~= bShowBones) then
self.showBones = bShowBones;
self:updateManipulators();
self:updateManipulators(0.01);
end
end

Expand Down
2 changes: 1 addition & 1 deletion script/kids/3DMapSystemApp/API/paraworld.users.lua
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ end,
-- Post Processor
function (self, msg, id,callbackFunc, callbackParams, postMsgTranslator, raw_msg, inputMsg, originalMsg)

if(type(msg) == "table") then
if(type(msg) == "table" and msg.user and msg.dragon) then
local ls = System.localserver.CreateStore(nil, 3);
if(ls) then
-- make url
Expand Down
2 changes: 1 addition & 1 deletion script/kids/3DMapSystemItem/Item_PetTransformMarker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function Item_PetTransformMarker:OnClick(mouse_button, callback_func)
local hook_msg = { aries_type = "OnUnEquipItem", wndName = "main"};
CommonCtrl.os.hook.Invoke(CommonCtrl.os.hook.HookType.WH_CALLWNDPROCRET, 0, "Aries", hook_msg);

if(callback_func) then
if(type(callback_func) == "function") then
callback_func();
end

Expand Down

0 comments on commit 130339b

Please sign in to comment.