Skip to content

Instantly share code, notes, and snippets.

@Kakise
Created January 6, 2017 19:30
Show Gist options
  • Save Kakise/155d6d629fcf60ab4052aa21b3a049ce to your computer and use it in GitHub Desktop.
Save Kakise/155d6d629fcf60ab4052aa21b3a049ce to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
!function(a, b, c) {
"use strict";
function d() {
document.body.style.background = "rgb(44, 45, 49)",
qc.widget.List.prototype._labelFont = "13px Arial",
qc.widget.List.prototype._labelColor = "rgb(117, 130, 138)",
qc.widget.List.prototype._labelSelectColor = "white",
qc.widget.List.prototype._selectBackground = "rgb(77, 92, 108)",
qc.widget.List.prototype._inactiveSelectBackground = "rgb(78, 92, 106)",
qc.widget.Tree.prototype._labelColor = "#caccd8",
qc.widget.Tree.prototype._labelSelectColor = "rgb(251, 156, 109)",
qc.widget.Tree.prototype._selectBackground = "rgb(49, 52, 57)",
qc.widget.Tree.prototype._inactiveSelectBackground = "rgb(78, 92, 106)",
qc.widget.TextField.prototype._background = "rgb(64, 69, 73)",
qc.widget.TextField.prototype._gradientColor = null,
qc.widget.TextField.prototype._activeBackground = "rgb(49, 52, 57)",
qc.widget.TextField.prototype._activeGradientColor = null,
qc.widget.TextField.prototype._activeTextColor = "rgb(180, 110, 74)",
qc.widget.TextField.prototype._borderColor = null,
qc.widget.TextField.prototype._textColor = "rgb(201, 203, 212)",
qc.editor.Dialog.prototype._ninePatchImage = "dialog.9",
qc.editor.Dialog.prototype._ninePatchBorder = [51, 19, 24, 19],
qc.editor.Dialog.prototype._titleBackground = null,
qc.editor.Dialog.prototype._titleColor = "#ff6418",
qc.editor.Dialog.prototype._titleFont = "14px Arial",
qc.editor.Dialog.prototype._htmlColor = "#caccd8",
qc.editor.Dialog.prototype._buttonNinePatchImage = "dialog_button.9",
qc.editor.Dialog.prototype._buttonNinePatchBorder = [20, 20, 20, 20],
qc.editor.Dialog.prototype._buttonActiveNinePatchImage = "dialog_button_active.9",
qc.editor.Dialog.prototype._buttonActiveNinePatchBorder = [20, 20, 20, 20],
qc.editor.Dialog.prototype._closeBackgroundImage = "dialogCloseBackgroundImage",
qc.editor.Dialog.prototype._activeCloseBackgroundImage = "dialogActiveCloseBackgroundImage",
qc.editor.Dialog.prototype._buttonColor = "rgb(216, 246, 251)",
qc.editor.Dialog.prototype._closeIcon = "dialogClose",
qc.editor.Dialog.prototype._activeCloseIcon = "dialogActiveClose",
qc.widget.ButtonBase.prototype._background = "rgb(93, 93, 93)",
qc.widget.ButtonBase.prototype._gradientColor = "rgb(60, 60, 60)",
qc.widget.ButtonBase.prototype._hoverBackground = "rgb(93, 93, 93)",
qc.widget.ButtonBase.prototype._hoverGradientColor = "rgb(60, 60, 60)",
qc.widget.ButtonBase.prototype._activeBackground = "rgb(99, 99, 99)",
qc.widget.ButtonBase.prototype._activeGradientColor = "rgb(130, 130, 130)",
qc.widget.ButtonBase.prototype._borderColor = "rgb(32, 32, 32)",
qc.widget.ButtonBase.prototype._textColor = "rgb(177, 177, 177)",
qc.widget.graph.GraphView.prototype._labelColor = "#caccd8",
qc.widget.graph.GraphView.prototype._labelSelectColor = "rgb(251, 156, 109)",
qc.widget.graph.GraphView.prototype._selectBackground = "rgb(49, 52, 57)",
qc.widget.graph.GraphView.prototype._inactiveSelectBackground = "rgb(78, 92, 106)",
qc.editor.InspectorButton.prototype._ninePatchImage = "inspector_button.9",
qc.editor.InspectorButton.prototype._ninePatchBorder = [9, 9, 9, 9],
qc.editor.InspectorButton.prototype._hoverNinePatchImage = "inspector_button.9",
qc.editor.InspectorButton.prototype._hoverNinePatchBorder = [9, 9, 9, 9],
qc.editor.InspectorButton.prototype._activeNinePatchImage = "inspector_button_active.9",
qc.editor.InspectorButton.prototype._activeNinePatchBorder = [9, 9, 9, 9],
qc.editor.InspectorButton.prototype._borderColor = 0,
qc.editor.InspectorButton.prototype._textColor = "#b7ceda",
qc.widget.ContextMenu.prototype._background = "rgb(44, 48, 52)",
qc.widget.ContextMenu.prototype._gradientColor = null,
qc.widget.ContextMenu.prototype._borderWidth = 0,
qc.widget.ContextMenu.prototype._labelColor = "#b6bac2",
qc.widget.ContextMenu.prototype._disabledLabelColor = "#686b70",
qc.widget.ContextMenu.prototype._hoverLabelColor = "white",
qc.widget.ContextMenu.prototype._hoverBackground = "rgb(77, 92, 108)",
qc.widget.ContextMenu.prototype._borderColor = "rgb(35, 35, 35)",
qc.widget.ContextMenu.prototype._radioOnIcon = "radioOnIcon",
qc.widget.ContextMenu.prototype._radioOffIcon = "radioOffIcon",
qc.widget.Slider.prototype._background = "rgb(38, 40, 42)",
qc.widget.Slider.prototype._forecolor = "rgb(80, 122, 134)",
qc.widget.Slider.prototype._thumbBackground = "rgb(96, 159, 174)",
qc.widget.Slider.prototype._thumbGradientColor = "rgb(96, 159, 174)",
qc.widget.Slider.prototype._thumbGradient = "linear.north",
qc.widget.Slider.prototype._thumbBorderColor = "rgba(0, 0, 0, 0)",
qc.editor.ProgressBar.prototype._textColor = "#caccd8"
}
function e() {
qc.widget.Container.prototype._background = "rgb(38, 50, 56)",
qc.widget.Button.prototype._textColor = "#caccd8",
qc.widget.Button.prototype._ninePatchImage = "inspector_button.9",
qc.widget.Button.prototype._ninePatchBorder = [8, 8, 8, 8],
qc.widget.Button.prototype._hoverNinePatchImage = "inspector_button.9",
qc.widget.Button.prototype._hoverNinePatchBorder = [8, 8, 8, 8],
qc.widget.Button.prototype._activeNinePatchImage = "inspector_button_active.9",
qc.widget.Button.prototype._activeNinePatchBorder = [8, 8, 8, 8]
}
function f() {
document.body.style.background = "#2c2d31",
k.Color.iconBackground = "rgb(105, 105, 105)",
k.Color.selectColor = "rgba(0, 0, 0, 0)",
k.Color.checkColor = "#fff",
k.Color.disabledBackground = "rgba(255, 255, 255, 0.4)",
qc.widget.Menu.prototype._background = "rgb(75, 86, 90)",
qc.widget.Menu.prototype._gradientColor = null,
qc.widget.Menu.prototype._hoverBackground = "rgb(54, 59, 63)",
qc.widget.Menu.prototype._activeBackground = "rgb(49, 52, 57)",
qc.widget.Menu.prototype._hoverGradientColor = null,
qc.widget.Menu.prototype._labelColor = "rgb(154, 202, 214)",
qc.widget.Menu.prototype._activeLabelColor = "rgb(187, 114, 77)",
qc.widget.Menu.prototype._topGap = 0,
qc.widget.Menu.prototype._bottomGap = 0,
qc.widget.ContextMenu.prototype._background = "rgb(44, 48, 52)",
qc.widget.ContextMenu.prototype._gradientColor = null,
qc.widget.ContextMenu.prototype._borderWidth = 0,
qc.widget.ContextMenu.prototype._labelColor = "#b6bac2",
qc.widget.ContextMenu.prototype._disabledLabelColor = "#686b70",
qc.widget.ContextMenu.prototype._hoverLabelColor = "white",
qc.widget.ContextMenu.prototype._hoverBackground = "rgb(77, 92, 108)",
qc.widget.ContextMenu.prototype._borderColor = "rgb(35, 35, 35)",
qc.widget.ContextMenu.prototype._radioOnIcon = "radioOnIcon",
qc.widget.ContextMenu.prototype._radioOffIcon = "radioOffIcon",
qc.widget.CheckBox.prototype._checkIcon = "checkIcon",
qc.widget.CheckBox.prototype._uncheckIcon = "uncheckIcon",
qc.widget.TextField.prototype._background = "rgb(64, 69, 73)",
qc.widget.TextField.prototype._gradientColor = null,
qc.widget.TextField.prototype._activeBackground = "rgb(49, 52, 57)",
qc.widget.TextField.prototype._activeGradientColor = null,
qc.widget.TextField.prototype._activeTextColor = "rgb(254, 179, 141)",
qc.widget.TextField.prototype._borderColor = null,
qc.widget.TextField.prototype._textColor = "rgb(201, 203, 212)",
qc.editor.DropDownList.prototype._background = "rgb(55, 60, 64)",
qc.editor.DropDownList.prototype._gradientColor = null,
qc.editor.DropDownList.prototype._borderWidth = 0,
qc.editor.DropDownList.prototype._textColor = "#caccd8",
qc.editor.DropDownList.prototype._dropDownBackground = "rgb(44, 48, 52)",
qc.editor.DropDownList.prototype._filterColor = "rgb(220, 220, 220)",
qc.editor.DropDownList.prototype._iconBackground = "rgb(105, 113, 123)",
qc.editor.DropDownList.prototype._iconForeColor = "rgb(95, 153, 163)",
qc.widget.Slider.prototype._background = "rgb(38, 40, 42)",
qc.widget.Slider.prototype._forecolor = "rgb(80, 122, 134)",
qc.widget.Slider.prototype._thumbBackground = "rgb(96, 159, 174)",
qc.widget.Slider.prototype._thumbGradientColor = "rgb(96, 159, 174)",
qc.widget.Slider.prototype._thumbGradient = "linear.north",
qc.widget.Slider.prototype._thumbBorderColor = "rgba(0, 0, 0, 0)",
qc.widget.ButtonBase.prototype._background = "rgb(93, 93, 93)",
qc.widget.ButtonBase.prototype._gradientColor = "rgb(60, 60, 60)",
qc.widget.ButtonBase.prototype._hoverBackground = "rgb(93, 93, 93)",
qc.widget.ButtonBase.prototype._hoverGradientColor = "rgb(60, 60, 60)",
qc.widget.ButtonBase.prototype._activeBackground = "rgb(99, 99, 99)",
qc.widget.ButtonBase.prototype._activeGradientColor = "rgb(130, 130, 130)",
qc.widget.ButtonBase.prototype._borderColor = "rgb(32, 32, 32)",
qc.widget.ButtonBase.prototype._textColor = "rgb(177, 177, 177)",
qc.editor.PreviewView.prototype._background = "rgb(53, 54, 56)",
qc.editor.InspectorButton.prototype._ninePatchImage = "inspector_button.9",
qc.editor.InspectorButton.prototype._ninePatchBorder = [9, 9, 9, 9],
qc.editor.InspectorButton.prototype._hoverNinePatchImage = "inspector_button.9",
qc.editor.InspectorButton.prototype._hoverNinePatchBorder = [9, 9, 9, 9],
qc.editor.InspectorButton.prototype._activeNinePatchImage = "inspector_button_active.9",
qc.editor.InspectorButton.prototype._activeNinePatchBorder = [9, 9, 9, 9],
qc.editor.InspectorButton.prototype._borderColor = 0,
qc.editor.InspectorButton.prototype._textColor = "#b7ceda",
qc.editor.ProgressBar.prototype._textColor = "#caccd8",
qc.editor.Text.prototype._textColor = "#caccd8",
qc.widget.Label.prototype._textColor = "#caccd8",
qc.widget.Tree.prototype._labelColor = "#caccd8",
qc.widget.Tree.prototype._labelSelectColor = "rgb(251, 156, 109)",
qc.widget.Tree.prototype._selectBackground = "rgb(49, 52, 57)",
qc.widget.Tree.prototype._inactiveSelectBackground = "rgb(78, 92, 106)",
qc.widget.List.prototype._labelColor = "rgb(117, 130, 138)",
qc.widget.List.prototype._labelSelectColor = "white",
qc.widget.List.prototype._selectBackground = "rgb(77, 92, 108)",
qc.widget.List.prototype._inactiveSelectBackground = "rgb(78, 92, 106)",
qc.widget.graph.GraphView.prototype._labelColor = "#caccd8",
qc.widget.graph.GraphView.prototype._labelSelectColor = "rgb(251, 156, 109)",
qc.widget.graph.GraphView.prototype._selectBackground = "rgb(49, 52, 57)",
qc.widget.graph.GraphView.prototype._inactiveSelectBackground = "rgb(78, 92, 106)",
qc.widget.ColorChooser.prototype._background = "rgb(49, 49, 49)",
qc.widget.ColorChooser.prototype._color = "rgb(177, 177, 177)",
qc.widget.ColorChooser.prototype._shadow = !1,
qc.widget.ColorChooser.prototype._thumbBorderColor = "white",
qc.widget.ColorChooser.prototype._titleColor = "black",
qc.widget.layout.BorderLayout.prototype._splitterColor = "rgb(44, 45, 49)",
qc.widget.layout.BorderLayout.prototype._toggleIconBackground = "rgb(49, 49, 49)",
qc.widget.layout.SplitLayout.prototype._splitterColor = "rgb(44, 45, 49)",
qc.widget.Tabs.prototype._titleBackground = "rgb(51, 55, 58)",
qc.widget.Tabs.prototype._tabBackground = "rgb(73, 81, 84)",
qc.widget.Tabs.prototype._tabGradientColor = null,
qc.widget.Tabs.prototype._tabActiveBackground = "rgb(73, 81, 84)",
qc.widget.Tabs.prototype._tabActiveGradientColor = null,
qc.widget.Tabs.prototype._labelColor = "rgb(224, 223, 224)",
qc.widget.Tabs.prototype._borderWidth = 0,
qc.widget.Tabs.prototype._splitterColor = "rgba(0, 0, 0, 0)",
qc.editor.Dialog.prototype._ninePatchImage = "dialog.9",
qc.editor.Dialog.prototype._ninePatchBorder = [51, 19, 24, 19],
qc.editor.Dialog.prototype._titleBackground = null,
qc.editor.Dialog.prototype._titleColor = "#ff6418",
qc.editor.Dialog.prototype._titleFont = "14px Arial",
qc.editor.Dialog.prototype._htmlColor = "#caccd8",
qc.editor.Dialog.prototype._buttonNinePatchImage = "dialog_button.9",
qc.editor.Dialog.prototype._buttonNinePatchBorder = [20, 20, 20, 20],
qc.editor.Dialog.prototype._buttonActiveNinePatchImage = "dialog_button_active.9",
qc.editor.Dialog.prototype._buttonActiveNinePatchBorder = [20, 20, 20, 20],
qc.editor.Dialog.prototype._closeBackgroundImage = "dialogCloseBackgroundImage",
qc.editor.Dialog.prototype._activeCloseBackgroundImage = "dialogActiveCloseBackgroundImage",
qc.editor.Dialog.prototype._buttonColor = "rgb(216, 246, 251)",
qc.editor.Dialog.prototype._closeIcon = "dialogClose",
qc.editor.Dialog.prototype._activeCloseIcon = "dialogActiveClose",
qc.editor.FrameList.prototype._background = "rgb(65, 65, 65)",
qc.editor.FrameList.prototype._borderColor = "rgb(32, 32, 32)",
qc.editor.ResourceList.prototype._background = "rgb(65, 65, 65)",
qc.editor.ResourceList.prototype._borderColor = "rgb(32, 32, 32)",
qc.editor.ObjectSelectPane.prototype._background = "rgb(59, 60, 64)",
qc.widget.ComboBox.prototype._border = "1px solid rgb(32, 32, 32)",
qc.widget.ComboBox.prototype._background = "rgb(65, 65, 65)",
Qa.prototype._background = null,
Qa.prototype._gradientColor = null,
Qa.prototype._titleBackground = "rgb(55, 60, 64)",
Qa.prototype._titleColor = "rgb(177, 177, 177)",
Qa.prototype._titleLineColor = "rgb(89, 89, 89)",
qc.editor.InspectorList.prototype._background = "rgb(65, 65, 65)",
qc.editor.InspectorList.prototype._borderColor = "rgb(32, 32, 32)",
qc.editor.FilterList.prototype._background = "rgb(65, 65, 65)",
qc.editor.FilterList.prototype._borderColor = "rgb(32, 32, 32)",
qc.editor.Painter.prototype._background = "rgb(65, 65, 65)",
qc.editor.Painter.prototype._borderColor = "rgb(32, 32, 32)",
qc.editor.ProgressBar.prototype._background = null,
qc.editor.AnchorPresetsView.prototype._background = "rgb(66, 71, 74)",
qc.editor.AnchorPresetsView.prototype._titleBackground = "rgb(56, 61, 64)",
qc.editor.AnchorPresetsView.prototype._borderColor = "rgb(110, 110, 110)",
qc.editor.AnchorButton.prototype._labelColor = "rgb(177, 177, 177)",
qc.editor.AnchorButton.prototype._imageBackground = "rgb(77, 82, 85)",
qc.editor.CurveButton.prototype._imageBackground = "rgb(61, 61, 61)",
qc.editor.CurveButton.prototype._imageBorderColor = "rgb(32, 32, 32)",
qc.editor.ComponentsPanel.prototype._background = "rgb(49, 49, 49)",
qc.editor.ComponentsPanel.prototype._titleBackground = "rgb(62, 64, 66)",
qc.editor.ComponentsPanel.prototype._borderColor = "rgb(110, 110, 110)",
qc.editor.AddComponentButton.prototype._background = "rgb(187, 109, 71)",
qc.editor.AddComponentButton.prototype._gradientColor = null,
qc.editor.AddComponentButton.prototype._hoverBackground = "rgb(187, 109, 71)",
qc.editor.AddComponentButton.prototype._hoverGradientColor = null,
qc.editor.AddComponentButton.prototype._activeBackground = "rgb(167, 89, 51)",
qc.editor.AddComponentButton.prototype._activeGradientColor = null,
qc.editor.AddComponentButton.prototype._textColor = "rgb(215, 215, 215)",
qc.editor.AddComponentButton.prototype.activeTextColor = "rgb(215, 215, 215)",
qc.editor.AddComponentButton.prototype._borderWidth = 0;
var a = "rgba(153, 153, 155, 0.5)";
qc.widget.List.prototype._scrollBarColor = a,
qc.widget.Tree.prototype._scrollBarColor = a,
qc.widget.graph.GraphView.prototype._scrollBarColor = a,
qc.widget.Container.prototype._scrollBarColor = a,
fa.vBanner.children[0].view.style.background = "#505356",
fa.leftBanner.findViewById("editMode").activeBackground = "#3a3a3a",
fa.leftBanner.findViewById("editMode").ninePatchBorder = [8, 8, 8, 8],
fa.leftBanner.findViewById("sceneHandler").ninePatchImage = "banner_button.9",
fa.leftBanner.findViewById("sceneHandler").ninePatchBorder = [8, 8, 8, 8],
fa.project.background = "rgb(73, 81, 84)",
fa.project.gradientColor = null,
fa.project.layout.leftSplitterColor = "rgb(67, 71, 74)",
fa.project.children[2].background = "rgb(58, 62, 65)",
fa.inspector.background = "rgb(77, 82, 85)",
fa.inspector._container.layout.splitterColor = "rgb(49, 69, 78)",
fa.inspector._container.layout._bottomSplitter.innerHTML = '<div style="font: 13px Arial; display: inline-block; height: 100%;padding-left: 10px; padding-right: 12px; color:#95edff;">Preview</div><div style="display: inline-block; vertical-align: top; width: calc(100% - 85px); background: url(' + fa.assetSkinPath + 'splitter_line.png); background-position-y: center; background-repeat: repeat-x; height: 100%;"></div>',
fa.rightBanner.ninePatchImage = "banner_resolution.9",
fa.rightBanner.ninePatchBorder = [22, 30, 22, 4],
fa.hierarchyContainer.background = "rgb(75, 83, 86)",
fa.hierarchyContainer.parent.tabW = 105,
fa.hierarchyContainer.parent.isPanel = !0,
fa.hierarchyContainer.parent.tabNinePatchImage = "hierarchy.tab.9",
fa.hierarchyContainer.parent.tabActiveNinePatchImage = "hierarchy.tab.9",
fa.hierarchyContainer.parent.tabNinePatchBorder = [8, 8, 1, 8],
fa.hierarchyContainer.parent.tabActiveNinePatchBorder = [8, 8, 1, 8],
fa.hierarchy.view.style.background = "rgb(66, 71, 74)",
fa.inspector.background = "rgb(77, 82, 85)",
fa.inspector.parent.tabW = 105,
fa.inspector.parent.isPanel = !0,
fa.inspector.parent.tabNinePatchImage = "inspector.tab.9",
fa.inspector.parent.tabActiveNinePatchImage = "inspector.tab.9",
fa.inspector.parent.tabNinePatchBorder = [8, 8, 1, 8],
fa.inspector.parent.tabActiveNinePatchBorder = [8, 8, 1, 8],
fa.project.background = "rgb(74, 81, 85)",
fa.project.parent.tabW = 105,
fa.project.parent.isPanel = !0,
fa.project.parent.tabNinePatchImage = "project.tab.9",
fa.project.parent.tabActiveNinePatchImage = "project.tab.9",
fa.project.parent.tabNinePatchBorder = [8, 8, 1, 8],
fa.project.parent.tabActiveNinePatchBorder = [8, 8, 1, 8],
fa.project.view.style.background = "rgb(74, 81, 85)",
qc.editor.ActionInspector.prototype._background = "rgb(73, 81, 84)",
qc.editor.ActionManagerInspector.prototype._background = "rgb(73, 81, 84)",
qc.editor.animation.PropertyPane.prototype._background = "rgb(66, 71, 74)",
qc.editor.animation.ActionPane.prototype._background = "rgb(66, 71, 74)",
fa.mainContainer.iv(!0)
}
function g() {}
function h() {}
function i() {}
if (!qc.editor) {
qc.editor = {},
qc.editor.gui = {};
var j = 2 * Math.PI
, k = qc.widget.Default
, l = k.devicePixelRatio
, m = k.define
, n = k.layout
, o = k.inflate
, p = k.createDiv
, q = k.createCanvas
, r = k.removeHTML
, s = k.initContext
, t = k.setCanvas
, u = k.unionPoint
, v = k.containsPoint
, w = k.intersectionLineRect
, x = k.intersectionLineLine
, y = k.getDistance
, z = k.startDragging
, A = k.isDragging
, B = k.getClientPoint
, C = k.getPagePoint
, D = k.isSelectAll
, E = k.isDelete
, F = k.isEsc
, G = k.isEnter
, H = k.isLeft
, I = k.isRight
, J = k.isUp
, K = k.isDown
, L = k.isDoubleClick
, M = k.getTouchCount
, N = k.isLeftButton
, O = k.isShiftDown
, P = k.isCtrlDown
, Q = k.initDash
, R = k.restoreDash
, S = k.drawText
, T = k.drawArc
, U = k.callLater
, V = k.createAnim
, W = k.startAnim
, X = k.timeNow
, Y = k.preventDefault
, Z = k.isMac
, $ = (a && a.process && a.process.versions.electron,
function(b, d) {
d = d || a;
var e, f, g = decodeURIComponent(d.location.search.substring(1)), h = g.split("&");
for (f = 0; f < h.length; f++)
if (e = h[f].split("="),
e[0] === b)
return e[1] === c ? !0 : e[1]
}
)
, _ = qc.editor.gui;
qc.editor.VERSION = "1.0.9",
qc.editor.version = {
latestVersion: {},
_hasNotifiedUpdate: !1
},
qc.editor.version.showUpdateDialog = function() {
if (!(qc.editor._progressUpdateDialog && qc.editor._progressUpdateDialog.visible || qc.editor.version._hasNotifiedUpdate)) {
{
Hb(fa._("A new version of QICI Engine is available!"), fa._("Update Info"), [{
text: fa._("Update"),
key: "enter",
onClick: function() {
qc.editor.version.updateVersion(),
this.hide()
}
}, {
text: fa._("Cancel"),
key: "esc",
onClick: function() {
this.hide()
}
}])
}
qc.editor.version._hasNotifiedUpdate = !0
}
}
,
qc.editor.version.updateVersion = function() {
qc.editor.Operation.UPDATE_VERSION(function(a) {
fa.notification.info(0 !== a.result ? fa._("You are using the latest version.") : fa._("Begin to update..."))
})
}
,
qc.editor.version.showProgressUpdateDialog = function() {
if (qc.editor._updateFailedDialog && qc.editor._updateFailedDialog.visible)
return null;
if (!qc.editor._progressUpdateDialog) {
var a = qc.editor._progressUpdateDialog = new qc.editor.ProgressDialog;
a.title = fa._("Update version"),
a.modal = !0,
a.width = 300,
a.height = 100,
a.tools = [],
a.show()
}
return qc.editor._progressUpdateDialog.visible || qc.editor._progressUpdateDialog.show(),
qc.editor._progressUpdateDialog
}
,
qc.editor.version.progressUpdateDialog = function(a, b) {
var c = qc.editor.version.showProgressUpdateDialog();
c && (c.progressBar.percent = a,
c.progressBar.text = b)
}
,
qc.editor.version.showUpdateFailed = function(a) {
if (qc.editor._progressUpdateDialog && qc.editor._progressUpdateDialog.hide(),
qc.editor._updateFailedDialog)
qc.editor._updateFailedDialog.show(),
qc.editor._updateFailedDialog.requestFocus();
else {
var b;
switch (a) {
case -2:
b = fa._("Download failed, please try again.");
break;
case -1:
default:
b = fa._("Failed to update, please make sure no files are occupied by other process.")
}
qc.editor._updateFailedDialog = Hb(b, fa._("Prompt"), [{
text: fa._("OK"),
key: "enter",
onClick: function() {
this.hide()
}
}])
}
}
,
qc.editor.version.showUpdateFinished = function() {
qc.editor._progressUpdateDialog && qc.editor._progressUpdateDialog.hide(),
Hb(fa._("The update is completed, and refresh to load the new version?"), fa._("Prompt"), [{
text: fa._("Refresh"),
key: "enter",
onClick: function() {
this.hide(),
a.location.reload(!0)
}
}, {
text: fa._("Cancel"),
key: "esc",
onClick: function() {
this.hide()
}
}])
}
,
qc.editor.version.checkLatestUpdates = function() {
var a = qc.editor
, b = qc.editor.version.latestVersion;
a.Operation.CHECK_FOR_UPDATES(!1, function(c) {
a.version.mixin(c, b),
a.version.versionCompare(qc.editor.VERSION, b.editor) < 0 && qc.editor.version.showUpdateDialog()
})
}
,
qc.editor.version.versionCompare = function(a, b) {
if ("string" != typeof a || "string" != typeof b)
return 1;
for (var c = a.split("."), d = b.split("."), e = Math.max(c.length, d.length), f = 0; e > f; ++f) {
var g = c[f] ? parseInt(c[f]) : 0
, h = d[f] ? parseInt(d[f]) : 0;
if (g !== h)
return g - h
}
return 0
}
,
qc.editor.version.mixin = function(a, b) {
if (!a || "object" != typeof a)
return b;
for (var c in a) {
var d = typeof a[c]
, e = a[c];
b[c] = a[c] && "object" === d ? typeof b[c] === d ? qc.editor.version.mixin(a[c], b[c]) : qc.editor.version.mixin(a[c], new e.constructor) : a[c]
}
return b
}
,
qc.editor.version.archiveVersion = function(a) {
qc.editor.Operation.ARCHIVE_VERSION(a, function() {})
}
,
_._containers = [],
_.titleLine = function(a, b, c, d) {
var e = _._containers
, f = e[e.length - 1]
, g = {
cells: []
}
, h = [];
0 === f.length && (g.widths = _.columnWidths);
var i = new qc.widget.Label({
text: a,
align: "left",
iconWidth: 9,
iconHeight: 9,
padding: 0,
icon: b ? "collapse" : "expand"
});
if (i._expand = !b,
c) {
g.cells.push({
colspan: _.columnWidths.length - (c._layoutConfig.colspan || 0),
fill: "none",
element: i
});
var j = c._layoutConfig;
delete c._layoutConfig,
j.element = c,
g.cells.push(j)
} else
g.cells.push({
colspan: _.columnWidths.length,
fill: "none",
element: i
});
return f.push(g),
i.addEventListener("click", function() {
i._expand = !i._expand,
i.icon = i._expand ? "expand" : "collapse";
for (var a = i; a && !(a instanceof qc.widget.Container && a.layout instanceof qc.widget.layout.TableLayout); )
a = a.parent;
if (a)
for (var b = 0; b < h.length; b++)
i._expand ? a.layout.showRow(h[b]) : a.layout.hideRow(h[b]);
d && d(!i._expand)
}),
{
get toolTip() {
return i.toolTip
},
set toolTip(a) {
a ? i.enableToolTip() : i.disableToolTip(),
i.toolTip = a
},
get collapse() {
return !i._expand
},
index: f.length - 1,
add: function(a) {
var c = a.index;
a = e[e.length - 1][c],
a.visible = !b,
h.push(c)
}
}
}
,
_.line = function(a, b) {
var d = _._containers
, e = d[d.length - 1]
, f = {
cells: []
};
null != b && (f.height = b),
0 === e.length && (f.widths = _.columnWidths);
for (var g = 0; g < a.length; g++) {
var h = a[g]
, i = h._layoutConfig;
0 === g && i && i.cellPadding === c && (i.cellPadding = [1, 1, 1, 15]),
f.cells.push(i),
delete h._layoutConfig
}
return e.push(f),
{
index: e.length - 1,
row: f
}
}
,
_.divider = function(a, b) {
var c = new qc.editor.Divider;
b = b || {},
b.element = c,
c._layoutConfig = b;
for (var d in a)
c[d] = a[d];
return c
}
,
_.label = function(a, b, c) {
var d = new qc.editor.Label;
c = c || {},
c.element = d,
d._layoutConfig = c,
d.text = a;
for (var e in b)
d[e] = b[e];
return d
}
,
_.text = function(a, b, c) {
var d = new qc.editor.Text;
c = c || {},
c.element = d,
d._layoutConfig = c,
d.text = a;
for (var e in b)
d[e] = b[e];
return d
}
,
_.empty = function(a) {
var b = {};
return a = a || {},
a.element = null,
b._layoutConfig = a,
b
}
,
_.comp = function(a, b, c) {
c = c || {},
c.element = a,
a._layoutConfig = c;
for (var d in b)
a[d] = b[d];
return a
}
,
_.button = function(a, b, c) {
var d = new qc.editor.InspectorButton;
c = c || {},
c.element = d,
d._layoutConfig = c,
d.text = a;
for (var e in b)
d[e] = b[e];
return d
}
,
_.curveButton = function(a, b) {
var c = new qc.editor.CurveButton;
b = b || {},
b.element = c,
c._layoutConfig = b;
for (var d in a)
c[d] = a[d];
return c
}
,
_.buttonGroup = function(a, b, c) {
var d = new qc.editor.ButtonGroup;
if (c = c || {},
c.element = d,
d._layoutConfig = c,
a) {
for (var e = [], f = 0; f < a.length; f++) {
var g = new qc.editor.ToggleButton(a[f]);
g.background = "rgb(80, 122, 134)",
g.gradientColor = null,
g.hoverBackground = "rgb(80, 122, 134)",
g.hoverGradientColor = null,
g.activeBackground = "rgb(62, 68, 72)",
g.activeGradientColor = null,
g.borderColor = "rgba(0, 0, 0, 0)",
g.textColor = "rgb(224, 223, 224)",
g.selectedTextColor = "rgb(251, 156, 109)",
e.push(g)
}
d.setItems(e)
}
for (var h in b)
d[h] = b[h];
return d
}
,
_.imageList = function(a, b) {
var c = new qc.editor.ImageList;
b = b || {},
b.element = c,
c._layoutConfig = b;
for (var d in a)
c[d] = a[d];
return c
}
,
_.painter = function(a, b) {
var c = new qc.editor.Painter;
b = b || {},
b.element = c,
c._layoutConfig = b;
for (var d in a)
c[d] = a[d];
return c
}
,
_.stringInput = function(a, b, c, d) {
var e = new qc.editor.StringInput;
b = b || {},
b.element = e,
e._layoutConfig = b;
for (var f in a)
e[f] = a[f];
return c && (e.onValueChanged = function(a) {
c.call(e, a)
}
),
d && (e.onEndEdit = function(a) {
d.call(e, a)
}
),
e
}
,
_.objectInput = function(a, b) {
var c, d = a.objectType;
null == a.targetField && (a.targetField = a.bind),
c = "texture" === d ? _._textureInput(a) : "font" === d || "bitmapFont" === d ? _._fontInput(a) : "allFont" === d ? _._allFontInput(a) : "sound" === d ? _._soundInput(a) : "textAsset" === d ? _._textAssetInput(a) : "excelAsset" === d ? _._excelAssetInput(a) : "prefab" === d ? _._prefabInput(a) : "action" === d ? _._actionInput(a) : "actionManager" === d ? _._actionManagerInput(a) : "animator" === d ? _._animatorInput(a) : "node" === d ? _._nodeInput(a) : new qc.editor.ObjectInput,
b = b || {},
b.element = c,
c._layoutConfig = b;
for (var e in a)
c[e] = a[e];
return c
}
,
_._textureInput = function(a) {
var b = a.onValueChanged
, c = a.targetField
, d = a.target;
delete a.onValueChanged;
var e = new Ga(a)
, f = function(a) {
var b = a.view;
if (b instanceof Ye) {
var c = a.view.draggingData;
if (!c)
return;
if (!(c instanceof qc.editor.FileNode))
return;
var d = (c.master || c).treeData.resUUID
, e = fa.game.assets.find(d);
if (!(e instanceof qc.Atlas))
return;
return !0
}
};
return e.objectInput.handleCrossDrag = function(a, b, c) {
if ("exit" === b || "cancel" === b)
e.resetNinePatchImage();
else if ("enter" === b)
f(c) && (e._objectInput.background = "rgb(78, 92, 106)");
else if ("drop" === b && f(c)) {
var d = c.view.draggingData
, g = (d.master || d).treeData.resUUID
, h = fa.game.assets.find(g);
e.resetNinePatchImage(),
e.setTextureObjectValue(new qc.Texture(h,d.master ? d.name : 0), !0)
}
}
,
e.setTextureObjectValue(ec(d, c)),
e.onValueChanged = b,
e
}
,
_._allFontInput = function(a) {
var b = a.onValueChanged
, c = a.targetField
, d = a.target;
delete a.onValueChanged;
var e = new Ga(a)
, f = function(a) {
var b = a.view;
if (b instanceof Ye) {
var c = a.view.draggingData;
if (!c)
return;
if (c.master)
return;
if (!(c instanceof qc.editor.FileNode))
return;
var d = c.treeData.resUUID
, e = fa.game.assets.find(d);
if (!(e instanceof qc.Font))
return;
return !0
}
};
e.objectInput.handleCrossDrag = function(a, b, c) {
if ("exit" === b || "cancel" === b)
e.resetNinePatchImage();
else if ("enter" === b)
f(c) && (e._objectInput.background = "rgb(78, 92, 106)");
else if ("drop" === b && f(c)) {
var d = c.view.draggingData
, g = d.treeData.resUUID
, h = fa.game.assets.find(g);
e.resetNinePatchImage(),
e.setObjectValue(h, !0)
}
}
;
var g = d[c];
return e.setObjectValue(g),
e.onValueChanged = b,
e
}
,
_._fontInput = function(a) {
var b = a.onValueChanged
, c = a.targetField
, d = a.target;
delete a.onValueChanged;
var e = new Ga(a)
, f = "bitmapFont" === a.objectType ? qc.UIText.BITMAPFONT : qc.UIText.WEBFONT
, g = function(a) {
var b = a.view;
if (b instanceof Ye) {
var c = a.view.draggingData;
if (!c)
return;
if (c.master)
return;
if (!(c instanceof qc.editor.FileNode))
return;
var d = c.treeData.resUUID
, e = fa.game.assets.find(d);
if (!(e instanceof qc.Font))
return;
if (e._fontFamily !== f)
return;
return !0
}
};
e.objectInput.handleCrossDrag = function(a, b, c) {
if ("exit" === b || "cancel" === b)
e.resetNinePatchImage();
else if ("enter" === b)
g(c) && (e._objectInput.background = "rgb(78, 92, 106)");
else if ("drop" === b && g(c)) {
var d = c.view.draggingData
, f = d.treeData.resUUID
, h = fa.game.assets.find(f);
e.resetNinePatchImage(),
e.setObjectValue(h, !0)
}
}
;
var h = d[c];
return e.setObjectValue(h),
e.onValueChanged = b,
e
}
,
_._soundInput = function(a) {
var b = a.onValueChanged
, c = a.targetField
, d = a.target;
delete a.onValueChanged;
var e = new Ga(a)
, f = function(a) {
var b = a.view;
if (b instanceof Ye) {
var c = a.view.draggingData;
if (!c)
return;
if (c.master)
return;
if (!(c instanceof qc.editor.FileNode))
return;
var d = c.treeData.resUUID
, e = fa.game.assets.find(d);
if (!(e instanceof qc.SoundAsset))
return;
return !0
}
};
e.objectInput.handleCrossDrag = function(a, b, c) {
if ("exit" === b || "cancel" === b)
e.resetNinePatchImage();
else if ("enter" === b)
f(c) && (e._objectInput.background = "rgb(78, 92, 106)");
else if ("drop" === b && f(c)) {
var d = c.view.draggingData
, g = d.treeData.resUUID
, h = fa.game.assets.find(g);
e.resetNinePatchImage(),
e.setObjectValue(h, !0)
}
}
;
var g = d[c];
return e.setObjectValue(g),
e.onValueChanged = b,
e
}
,
_._textAssetInput = function(a) {
var b = a.onValueChanged
, c = a.targetField
, d = a.target;
delete a.onValueChanged;
var e = new Ga(a)
, f = function(a) {
var b = a.view;
if (b instanceof Ye) {
var c = a.view.draggingData;
if (!c)
return;
if (c.master)
return;
if (!(c instanceof qc.editor.FileNode))
return;
var d = c.treeData.resUUID
, e = fa.game.assets.find(d);
if (!(e instanceof qc.TextAsset))
return;
return !0
}
};
e.objectInput.handleCrossDrag = function(a, b, c) {
if ("exit" === b || "cancel" === b)
e.resetNinePatchImage();
else if ("enter" === b)
f(c) && (e._objectInput.background = "rgb(78, 92, 106)");
else if ("drop" === b && f(c)) {
var d = c.view.draggingData
, g = d.treeData.resUUID
, h = fa.game.assets.find(g);
e.resetNinePatchImage(),
e.setObjectValue(h, !0)
}
}
;
var g = d[c];
return e.setObjectValue(g),
e.onValueChanged = b,
e
}
,
_._excelAssetInput = function(a) {
var b = a.onValueChanged
, c = a.targetField
, d = a.target;
delete a.onValueChanged;
var e = new Ga(a)
, f = function(a) {
var b = a.view;
if (b instanceof Ye) {
var c = a.view.draggingData;
if (!c)
return;
if (c.master)
return;
if (!(c instanceof qc.editor.FileNode))
return;
var d = c.treeData.resUUID
, e = fa.game.assets.find(d);
if (!(e instanceof qc.ExcelAsset))
return;
return !0
}
};
e.objectInput.handleCrossDrag = function(a, b, c) {
if ("exit" === b || "cancel" === b)
e.resetNinePatchImage();
else if ("enter" === b)
f(c) && (e._objectInput.background = "rgb(78, 92, 106)");
else if ("drop" === b && f(c)) {
var d = c.view.draggingData
, g = d.treeData.resUUID
, h = fa.game.assets.find(g);
e.resetNinePatchImage(),
e.setObjectValue(h, !0)
}
}
;
var g = d[c];
return e.setObjectValue(g),
e.onValueChanged = b,
e
}
,
_._prefabInput = function(a) {
var b = a.onValueChanged
, c = a.targetField
, d = a.target;
delete a.onValueChanged;
var e = new Ga(a)
, f = function(a) {
var b = a.view;
if (b instanceof Ye) {
var c = a.view.draggingData;
if (!c)
return;
if (c.master)
return;
if (!(c instanceof qc.editor.FileNode))
return;
var d = c.treeData.resUUID
, e = fa.game.assets.find(d);
if (!(e instanceof qc.Prefab))
return;
return !0
}
};
return e.objectInput.handleCrossDrag = function(a, b, c) {
if ("exit" === b || "cancel" === b)
e.resetNinePatchImage();
else if ("enter" === b)
f(c) && (e._objectInput.background = "rgb(78, 92, 106)");
else if ("drop" === b && f(c)) {
var d = c.view.draggingData
, g = d.treeData.resUUID
, h = fa.game.assets.find(g);
e.resetNinePatchImage(),
e.setObjectValue(h, !0)
}
}
,
e.onValueChanged = b,
e.setObjectValue(d[c]),
e
}
,
_._actionInput = function(a) {
var b = a.onValueChanged
, c = a.targetField
, d = a.target;
delete a.onValueChanged;
var e = new Ga(a)
, f = function(a) {
var b = a.view;
if (b instanceof Ye) {
var c = a.view.draggingData;
if (!c)
return;
if (c.master)
return;
if (!(c instanceof qc.editor.FileNode))
return;
var d = c.treeData.resUUID
, e = fa.game.assets.find(d);
if (!(e instanceof qc.ActionAsset))
return;
return !0
}
};
return e.objectInput.handleCrossDrag = function(a, b, c) {
if ("exit" === b || "cancel" === b)
e.resetNinePatchImage();
else if ("enter" === b)
f(c) && (e._objectInput.background = "rgb(78, 92, 106)");
else if ("drop" === b && f(c)) {
var d = c.view.draggingData
, g = d.treeData.resUUID
, h = fa.game.assets.find(g);
e.resetNinePatchImage(),
e.setObjectValue(h, !0)
}
}
,
e.onValueChanged = b,
e.setObjectValue(d[c]),
e
}
,
_._actionManagerInput = function(a) {
var b = a.onValueChanged
, c = a.targetField
, d = a.target;
delete a.onValueChanged;
var e = new Ga(a)
, f = function(a) {
var b = a.view;
if (b instanceof Ye) {
var c = a.view.draggingData;
if (!c)
return;
if (c.master)
return;
if (!(c instanceof qc.editor.FileNode))
return;
var d = c.treeData.resUUID
, e = fa.game.assets.find(d);
if (!(e instanceof qc.ActionManagerAsset))
return;
return !0
}
};
return e.objectInput.handleCrossDrag = function(a, b, c) {
if ("exit" === b || "cancel" === b)
e.resetNinePatchImage();
else if ("enter" === b)
f(c) && (e._objectInput.background = "rgb(78, 92, 106)");
else if ("drop" === b && f(c)) {
var d = c.view.draggingData
, g = d.treeData.resUUID
, h = fa.game.assets.find(g);
e.resetNinePatchImage(),
e.setObjectValue(h, !0)
}
}
,
e.onValueChanged = b,
e.setObjectValue(d[c]),
e
}
,
_._animatorInput = function(a) {
var b = a.onValueChanged
, c = a.targetField
, d = a.target;
delete a.onValueChanged;
var e = new Ga(a)
, f = function(a) {
var b = a.view;
if (b instanceof Ye) {
var c = a.view.draggingData;
if (!c)
return;
if (c.master)
return;
if (!(c instanceof qc.editor.FileNode))
return;
var d = c.treeData.resUUID
, e = fa.game.assets.find(d);
if (!(e instanceof qc.ActionAsset || e instanceof qc.ActionManagerAsset))
return;
return !0
}
};
return e.objectInput.handleCrossDrag = function(a, b, c) {
if ("exit" === b || "cancel" === b)
e.resetNinePatchImage();
else if ("enter" === b)
f(c) && (e._objectInput.background = "rgb(78, 92, 106)");
else if ("drop" === b && f(c)) {
var d = c.view.draggingData
, g = d.treeData.resUUID
, h = fa.game.assets.find(g);
e.resetNinePatchImage(),
e.setObjectValue(h, !0);
}
}
,
e.onValueChanged = b,
e.setObjectValue(d[c]),
e
}
,
_._nodeInput = function(a) {
var b = a.onValueChanged
, c = a.targetField
, d = a.target
, e = a.nodeType || qc.Node;
delete a.onValueChanged;
var f = new Ga(a)
, g = d[c];
f.setObjectValue(g);
var h = function(a) {
var b = a.view.draggingData;
return b = b.node,
b instanceof e ? !0 : void 0
};
return f.objectInput.handleCrossDrag = function(a, b, c) {
if ("exit" === b || "cancel" === b)
f.resetNinePatchImage();
else if ("enter" === b)
h(c) && (f._objectInput.background = "rgb(78, 92, 106)");
else if ("drop" === b && h(c)) {
var d = c.view.draggingData.node;
f.resetNinePatchImage(),
f.setObjectValue(d, !0)
}
}
,
f.onValueChanged = b,
f
}
,
_.textArea = function(a, b) {
var c = new qc.editor.TextAreaContainer;
b = b || {},
b.element = c,
c._layoutConfig = b;
for (var d in a)
c[d] = a[d];
return c
}
,
_.numberInput = function(a, b, c, d) {
var e = new qc.editor.NumberInput;
b = b || {},
b.element = e,
e._layoutConfig = b;
for (var f in a)
e[f] = a[f];
return c && (e.onValueChanged = function(a) {
c.call(e, a)
}
),
d && (e.onEndEdit = function(a) {
d.call(e, a)
}
),
e
}
,
_.angleInput = function(a, b, c) {
var d = new qc.editor.AngleInput;
b = b || {},
b.element = d,
d._layoutConfig = b;
for (var e in a)
d[e] = a[e];
return c && (d.onValueChanged = function(a) {
c.call(d, a)
}
),
d
}
,
_.sliderInput = function(a, b) {
var c = new qc.editor.SliderInput(a);
b = b || {},
b.element = c,
c._layoutConfig = b;
for (var d in a)
c[d] = a[d];
return c
}
,
_.intInput = function(a, b, c, d) {
var e = new qc.editor.IntInput;
b = b || {},
b.element = e,
e._layoutConfig = b;
for (var f in a)
e[f] = a[f];
return c && (e.onValueChanged = function(a) {
c.call(e, a)
}
),
d && (e.onEndEdit = function(a) {
d.call(e, a)
}
),
e
}
,
_.checkBox = function(a, b, c) {
var d = new qc.editor.CheckBox;
b = b || {},
b.element = d,
d._layoutConfig = b;
for (var e in a)
d[e] = a[e];
return c && (d.onValueChanged = c),
d
}
,
_.toggleButton = function(a, b) {
var c = new qc.editor.ToggleButton;
b = b || {},
b.element = c,
c._layoutConfig = b;
for (var d in a)
c[d] = a[d];
return c
}
,
_.dropDownList = function(a, b, c) {
var d = new qc.editor.DropDownList;
b = b || {},
b.element = d,
d._layoutConfig = b;
for (var e in a)
d[e] = a[e];
return c && (d.onValueChanged = function(a) {
c.call(d, a)
}
),
d
}
,
_.textureSelector = function(a, b) {
var c = new qc.editor.TextureSelector;
b = b || {},
b.element = c,
c._layoutConfig = b;
for (var d in a)
c[d] = a[d];
return c
}
,
_.multiDropDownList = function(a, b) {
var c = new qc.editor.MultiDropDownList;
b = b || {},
b.element = c,
c._layoutConfig = b;
for (var d in a)
c[d] = a[d];
return c
}
,
_.colorPicker = function(a, b, c, d) {
var e, f = {};
a && null !== a["dropDown.colorChooser.alphaEnabled"] ? (e = a["dropDown.colorChooser.alphaEnabled"],
delete a["dropDown.colorChooser.alphaEnabled"]) : e = !0,
f["dropDown.colorChooser.alphaEnabled"] = e;
var g = new qc.editor.ColorPicker(f);
b = b || {},
b.element = g,
g._layoutConfig = b;
for (var h in a)
g[h] = a[h];
return c && (g.onValueChanged = c),
d && (g.onEndEdit = d),
g
}
,
_.pathSelector = function(a, b, c, d) {
var e = new qc.editor.PathSelector(a);
b = b || {},
b.element = e,
e._layoutConfig = b;
for (var f in a)
e[f] = a[f];
return c && (e.onValueChanged = c),
d && (colorPicker.onEndEdit = d),
e
}
,
b.defineProperty(_, "containers", {
get: function() {
var a = this._containers;
return this._columnWidths = [],
this._containers = [],
a
}
}),
b.defineProperty(_, "columnWidths", {
get: function() {
return this._columnWidths
},
set: function(a) {
this._columnWidths = a,
this._containers.push([])
}
}),
qc.editor.CustomInspectorTips = {
"CNode.pivot": {
zh: "节点自身的原点位置",
en: "The normalized position in this RectTransform that it rotates around"
},
"CNode.scale": {
zh: "节点的缩放",
en: "The scale of the transform relative to the parent"
},
"CUIImage.skew": {
zh: "图片在水平和垂直方向上的拉伸角度",
en: "The skew angle of the image"
},
"TableLayout.spacing": {
zh: "单元格的水平间距和垂直间距",
en: "Spacing in x axis and y axis"
},
"TableLayout.cellSize": {
zh: "单元格的宽度和高度",
en: "Width and height of cell"
}
},
qc.editor.InspectorTips = {
"CNode.uuid": {
zh: "对象的唯一标识符 ",
en: "Unique identity of the node. "
},
"CNode.name": {
zh: "节点的名字 ",
en: "The node's name. "
},
"CNode.ignoreDestroy": {
zh: "节点及其孩子在切换场景时不会被析构。一定要置于根节点才起效 ",
en: "Makes the object target not be destroyed automatically when loading a new scene. "
},
"CNode.alpha": {
zh: "透明度值,0 - 1 ",
en: "The node's alpha: 0 - 1 "
},
"CNode.visible": {
zh: "是否可见,注意 visible 为 false 时则所有孩子都不显示,visible 为 true 的时则使用孩子们自己的 visible;另外 visiable 为 false 时连 transform 都不再更新计算 ",
en: "The visible state of the node. Non-visible nodes and all of their children are not rendered. "
},
"CNode.parent": {
zh: "父亲节点 ",
en: "The parent of the node. "
},
"CNode.worldVisible": {
zh: "只读,节点最终的 visible ",
en: "Read only. Indicates if the node is globally visible. "
},
"CNode.mask": {
zh: "遮罩,必须为 PIXI.Graphics 对象 ",
en: "Set mask, must be PIXI.Graphics "
},
"CNode.children": {
zh: "只读,儿子列表 ",
en: "Read only. The list of the node' children. "
},
"CNode.colorTint": {
zh: "混合颜色 ",
en: "The tint applied to the node. "
},
"CNode.scripts": {
zh: "只读。挂载的逻辑脚本列表 ",
en: "Read only. The list of the components that this node attacks. "
},
"CNode.x": {
zh: "本地 x 坐标(相对于父节点) ",
en: "X position of the transform relative to the parent transform. "
},
"CNode.y": {
zh: "本地 y 坐标(相对于父节点) ",
en: "Y position of the transform relative to the parent transform. "
},
"CNode.anchoredX": {
zh: "相对于父亲anchor的X偏移量。UI中大部分使用此属性,而不是x属性。 ",
en: "The x position of the pivot of this RectTransform relative to the anchor reference point. "
},
"CNode.anchoredY": {
zh: "相对于父亲anchor的Y偏移量。UI中大部分使用此属性,而不是y属性。 ",
en: "The y position of the pivot of this RectTransform relative to the anchor reference point. "
},
"CNode.scaleX": {
zh: "节点在 X 轴上的缩放 ",
en: "The scale.x of the transform relative to the parent. "
},
"CNode.scaleY": {
zh: "节点在 Y 轴上的缩放 ",
en: "The scale.y of the transform relative to the parent. "
},
"CNode.pivotX": {
zh: "节点自身的原点X位置(0为左边,1为右边) ",
en: "The x normalized position in this RectTransform that it rotates around. "
},
"CNode.pivotY": {
zh: "节点自身的原点Y位置(0为上边,1为下边) ",
en: "The y normalized position in this RectTransform that it rotates around. "
},
"CNode.rotation": {
zh: "旋转角度。在代码中,使用弧度为单位。在编辑器的Inspector面板中,使用角度为单位。 ",
en: "The rotation of the transform relative to the parent transform's rotation. "
},
"CNode.width": {
zh: "节点的宽度 ",
en: "The width of node. "
},
"CNode.height": {
zh: "节点的高度 ",
en: "The height of node. "
},
"CNode.minAnchor": {
zh: "只读,定位矩形左上角的坐标(相对于父亲长宽的比例值),请使用方法 setAnchor 进行设置。",
en: "Read only. The normalized position in the parent RectTransform that the lower left corner is anchored to. Call setAnchor to set minAnchor."
},
"CNode.maxAnchor": {
zh: "只读,定位矩形右下角的坐标(相对于父亲长宽的比例值),请使用方法 setAnchor 进行设置。 ",
en: "Read only. The normalized position in the parent RectTransform that the upper right corner is anchored to. Call setAnchor to set maxAnchor. "
},
"CNode.left": {
zh: "距离左边的位置(如果minAnchor.x = maxAnchor.x,此时不起效) ",
en: "Distance left relative to the parent transform. "
},
"CNode.right": {
zh: "距离右边的位置(如果minAnchor.x = maxAnchor.x,此时不起效) ",
en: "Distance right relative to the parent transform. "
},
"CNode.top": {
zh: "距离上边的位置(如果minAnchor.y = maxAnchor.y,此时不起效) ",
en: "Distance top relative to the parent transform. "
},
"CNode.bottom": {
zh: "距离下边的位置(如果minAnchor.y = maxAnchor.y,此时不起效) ",
en: "Distance bottom relative to the parent transform. "
},
"CNode.rect": {
zh: "相对父亲节点的矩形包围盒 ",
en: "The calculated rectangle in the local space of the Transform. "
},
"CNode.worldTransform": {
zh: "在世界中的最终变换矩阵 ",
en: "Current transform of the object based on world (parent) factors "
},
"CNode.localBounds": {
zh: "节点自身的显示范围 ",
en: "Retrieves the local bounds of the node as a rectangle object "
},
"CNode.onRelayout": {
zh: "节点重新布局的事件通知 ",
en: "When transform changed, this event is triggered. "
},
"CNode.interactive": {
zh: "节点是否允许交互(即:是否有能力接受输入事件) ",
en: "Can pick up mouse / touch events? "
},
"CNode.hitArea": {
zh: "碰撞区域 ",
en: "This is the defined area that will pick up mouse / touch events. It is null by default. "
},
"CNode.onDown": {
zh: "按下的事件 ",
en: "When pointer pressed, this event is triggered. "
},
"CNode.onUp": {
zh: "松开的事件 ",
en: "When pointer released, this event is triggered. "
},
"CNode.onClick": {
zh: "点击的事件 ",
en: "When the node is click, this event is triggered. "
},
"CNode.onDragStart": {
zh: "拖拽开始事件 ",
en: "When starting a drag operation, onDragStart is called. "
},
"CNode.onDrag": {
zh: "拖拽事件,每帧触发 ",
en: "When dragging, onDrag is called. "
},
"CNode.onDragEnd": {
zh: "拖拽结束事件 ",
en: "When ending a drag operation, onDragEnd is called. "
},
"CNode.onDragDrop": {
zh: "拖拽放下事件(目标节点触发) ",
en: "When dropped, onDragDrop is called. "
},
"CNode.onWheel": {
zh: "滚轮事件 ",
en: "When mouse wheels, onWheel is called. "
},
"CNode.onEnter": {
zh: "光标进入事件 ",
en: "When mouse enters, onEnter is called. "
},
"CNode.onExit": {
zh: "光标移出事件 ",
en: "When mouse exits, onExit is called. "
},
"CNode.Variable": {
en: "Description "
},
"CUIImage.texture": {
zh: "图片资源 ",
en: "The texture altas used for UIImage. "
},
"CUIImage.frame": {
zh: "具体的图片帧,在 texture 为图集的时候,可以指定该 frame 表示子图片,如果是普通图片而不是图集,frame设置无效(默认为 0) ",
en: "The frame's name in the texture atlas. "
},
"CUIImage.nativeSize": {
zh: "只读,图片原始大小(不带任何缩放) ",
en: "Read only. The frame's size. "
},
"CUIImage.imageType": {
zh: "图片显示的方式,包含三种:UIImage.IMAGE_TYPE_SIMPLE(简单缩放)、UIImage.IMAGE_TYPE_SLICED(九宫格缩放)、UIImage.IMAGE_TYPE_TILED(九宫格平铺),详见 UIImage.imageType ",
en: "How the Image is draw: UIImage.IMAGE_TYPE_SIMPLE, UIImage.IMAGE_TYPE_SLICED, UIImage.IMAGE_TYPE_TILED. See: UIImage.imageType "
},
"CUIImage.Variable": {
en: "Description "
},
"CSprite.animationNameList": {
zh: "只读,当前资源的动作名列表 ",
en: "Read only. The list of animation names. "
},
"CSprite.animationType": {
zh: "只读,动画的类型(Sprite.NONE_ANIMATION,Sprite.FRAME_ANIMATION,Sprite.DRAGON_BONES,Sprite.FRAME_SAMPLES) ",
en: "Read only. The type of Animation: Sprite.NONE_ANIMATION, Sprite.FRAME_ANIMATION, Sprite.DRAGON_BONES, Sprite.FRAME_SAMPLES "
},
"CSprite.defaultAnimation": {
zh: "默认的动作名称,反序列化将自动播放。 ",
en: "The default animation' name. It will automatic play when awake. "
},
"CSprite.armature": {
zh: "获取当前使用的骨骼根节点 ",
en: "current armature node "
},
"CSprite.frame": {
zh: "具体的图片帧(播放动作中以及骨骼动画情况下,设置 frame 是无效的) ",
en: "The frame' name in the texture atlas. "
},
"CSprite.colorTint": {
zh: "设置颜色混合 ",
en: "Get or set tint color. "
},
"CSprite.isPlaying": {
zh: "只读,动作是否在播放中 ",
en: "Read only. Is the sprite playing an animation? "
},
"CSprite.isComplete": {
zh: "只读,动作是否结束 ",
en: "Read only. Is the animation is finished? "
},
"CSprite.lastAnimationName": {
zh: "只读,上一个(如果正在播放中,则为当前)播放的动作名 ",
en: "Read only. Last animation name played. "
},
"CSprite.nativeSize": {
zh: "当前 Sprite 所用到的图片的原始大小 ",
en: "The texture's real size. "
},
"CSprite.paused": {
zh: "属性,动作是否暂停 && 设置暂停动作 ",
en: "Pause / Resume playing animation. "
},
"CSprite.texture": {
zh: "动画资源(qc.Texture对象,可通过 game.assets.find(key).getTexture(0) 来获取),若有动画信息,则创建动画管理器 ",
en: "The texture atlas. "
},
"CSprite.Variable": {
en: "Description "
},
"CUIText.autoSize": {
zh: "是否自动根据文字内容的宽高调整 text 的宽高 ",
en: "Should the text be allowed to auto resized. "
},
"CUIText.fontFamily": {
zh: "字体类型,目前有:UIText.SYSTEMFONT(系统字体)、UIText.WEBFONT(自定义字体资源)、UIText.BITMAPFONT(自定义图片字体) ",
en: "The FontType used by the text: UIText.SYSTEMFONT, UIText.WEBFONT, UIText.BITMAPFONT "
},
"CUIText.alignH": {
zh: "水平对齐方式,目前有:UIText.LEFT(左对齐)、UIText.CENTER(居中对齐)、UIText.RIGHT(右对齐) ",
en: "Horizontal alignment for text: UIText.LEFT, UIText.CENTER, UIText.RIGHT "
},
"CUIText.alignV": {
zh: "垂直对齐方式,目前有:UIText.TOP(上对齐)、UIText.MIDDLE(居中对齐)、UIText.BOTTOM(下对齐) ",
en: "Vertical alignment for text: UIText.TOP, UIText.MIDDLE, UIText.BOTTOM "
},
"CUIText.font": {
zh: "字体,fontFamily为SYSTEMFONT时font类型为string,值为字体名字;fontFamily为其他类型的时候,font为字体资源 ",
en: "When fontFamily is SYSTEMFONT, font is string type; fontFamily is other type,font is qcFont "
},
"CUIText.bold": {
zh: "字体是否加粗 ",
en: "Bold style applied to your texts. "
},
"CUIText.fontSize": {
zh: "字体大小,单位为 px ",
en: "The size that the Font should render at. "
},
"CUIText.colorTint": {
zh: "颜色混合 ",
en: "Tint color "
},
"CUIText.color": {
zh: "字体颜色 ",
en: "Base color of the font. "
},
"CUIText.text": {
zh: "文本内容 ",
en: "The string value this text will display. "
},
"CUIText.lineSpacing": {
zh: "行间距,单位是 px ",
en: "Line spacing, specified as a factor of font line height. A value of 1 will produce normal line spacing. "
},
"CUIText.wrap": {
zh: "是否换行显示 ",
en: "Is the text can be wrap? "
},
"CUIText.overflow": {
zh: "定义内容溢出的行为:如果为 true 则裁切,否则不裁切 ",
en: "Text flows freely outside the element. "
},
"CUIText.pivotX": {
zh: "节点自身的原点X位置,0到1 ",
en: "Rotations, size, and scale modifications occur around the pivot "
},
"CUIText.pivotY": {
zh: "节点自身的原点Y位置,0到1 ",
en: "Rotations, size, and scale modifications occur around the pivot "
},
"CUIText.width": {
zh: "获取或设置文本的宽度 ",
en: "The width of text "
},
"CUIText.height": {
zh: "获取或设置文本的高度 ",
en: "The height of text "
},
"CUIText.gradient": {
zh: "是否开启渐变 ",
en: "Is the effect of gradient enabled? "
},
"CUIText.startColor": {
zh: "渐变开始的颜色 ",
en: "Start gradient color "
},
"CUIText.endColor": {
zh: "渐变结束的颜色 ",
en: "End gradient color "
},
"CUIText.stroke": {
zh: "描边的颜色 ",
en: "Stroke color "
},
"CUIText.strokeThickness": {
zh: "描边的宽度 ",
en: "Stroke width "
},
"CUIText.enableShadow": {
zh: "是否显示阴影 ",
en: "Is the effect of shadow enable? "
},
"CUIText.shadowColor": {
zh: "阴影的颜色 ",
en: "The shadow's color. "
},
"CUIText.shadowBlur": {
zh: "阴影的模糊程度 ",
en: "The shadow's blur. "
},
"CUIText.shadowOffsetX": {
zh: "阴影偏移量X ",
en: "How far is the shadow from the text. "
},
"CUIText.shadowOffsetY": {
zh: "阴影偏移量Y ",
en: "How far is the shadow from the text. "
},
"CUIText.enableGlow": {
zh: "是否启用外发光 ",
en: "Is the effect of glow enable? "
},
"CUIText.glowColor": {
zh: "外发光的颜色 ",
en: "The glow's color. "
},
"CUIText.glowBlur": {
zh: "外发光模糊值 ",
en: "The glow's blur. "
},
"CUIText.nativeSize": {
zh: "text实际大小 ",
en: "text real size "
},
"CUIText.Variable": {
en: "Description "
},
"CButton.state": {
zh: "当前按钮的状态,包括:UIState.NORMAL(正常状态)、UIState.PRESSED(按下状态)、UIState.DISABLED(不可用) ",
en: "The state of button: UIState.NORMAL(normal state), UIState.PRESSED(button pressed), UIState.DISABLED(button is disable) "
},
"CButton.text": {
zh: "按钮上的文本对象 ",
en: "The reference text node. "
},
"CButton.supportNativeEvent": {
zh: "是否响应浏览器直接事件 ",
en: "Is the button support native event of browser. "
},
"CButton.Variable": {
en: "Description "
},
"CToggle.background": {
zh: "背景图片 ",
en: "The reference of background image. "
},
"CToggle.checkMark": {
zh: "选中标记图片 ",
en: "The reference of checking mark image. "
},
"CToggle.text": {
zh: "挂载在开关上的文本组件 ",
en: "The reference of text node. "
},
"CToggle.on": {
zh: "开关是否处于开的状态 ",
en: "Is the toggle on. "
},
"CToggle.state": {
zh: "开关的点击状态,包括:UIState.NORMAL(正常状态)、UIState.PRESSED(按下状态)、UIState.DISABLED(不可用) ",
en: "The state of toggle: UIState.NORMAL, UIState.PRESSED, UIState.DISABLED "
},
"CToggle.Variable": {
en: "Description "
},
"CScrollBar.sliders": {
zh: "滑块对象 ",
en: "The reference to slider Node. "
},
"CScrollBar.direction": {
zh: "滚动条的滑动方向 ",
en: "The direction of the scrollbar from minimum to maximum value. "
},
"CScrollBar.value": {
zh: "当前滑动的值,[0-1] ",
en: "The current value of the scrollbar, between 0 and 1. "
},
"CScrollBar.size": {
zh: "滑块长度和滑块区域的比例,(0,1], 滑块最小5个像素 ",
en: "The size of the scrollbar handle where 1 means it fills the entire scrollbar. "
},
"CScrollBar.numberOfStep": {
zh: "滑动时,滑块从 0 到 1 的步数 ",
en: "The number of steps to use for the value. A value of 0 disables use of steps. "
},
"CScrollBar.stepSize": {
zh: "滚动时每步改变的值 ",
en: "The Step size. "
},
"CScrollBar.fixSlidersSize": {
zh: "是否固定滑条大小 ",
en: "The size of slider is fixed. "
},
"CScrollBar.autoHide": {
zh: "当滑块长度和滑块区域长度相等时,是否将滚动条隐藏 ",
en: "Whether hide the scrollbar automatically when the slider size is equal to slide area. "
},
"CScrollBar.Variable": {
en: "作用 "
},
"CScrollView.canHorizontal": {
zh: "是否响应水平滑动 ",
en: "Should horizontal scrolling be enabled? "
},
"CScrollView.canVertical": {
zh: "是否响应垂直滑动 ",
en: "Should vertical scrolling be enabled? "
},
"CScrollView.movementType": {
zh: "边界限制类型,ScrollView.MOVEMENT_UNRESTRICTED(滚动区域无限制)、ScrollView.MOVEMENT_ELASTIC(滚动区域有限制,但可以超越边界,之后被拖回)、ScrollView.MOVEMENT_CLAMPED(滚动区域有限制,无法超过边界) ",
en: "The behavior to use when the content moves beyond the scroll rect: ScrollView.MOVEMENT_UNRESTRICTED(Unrestricted movement. The content can move forever.), ScrollView.MOVEMENT_ELASTIC(Elastic movement. The content is allowed to temporarily move beyond the container, but is pulled back elastically.), ScrollView.MOVEMENT_CLAMPED(Clamped movement. The content can not be moved beyond its container.) "
},
"CScrollView.elasticity": {
zh: "当 moveMentType 为 MOVEMENT_ELASTIC 时生效,用于表示复位速度 ",
en: "The amount of elasticity to use when the content moves beyond the scroll rect. "
},
"CScrollView.inertia": {
zh: "是否惯性滑动 ",
en: "Should movement inertia be enabled? "
},
"CScrollView.decelerationRate": {
zh: "惯性滑动的减速参数 ",
en: "The rate at which movement slows down. "
},
"CScrollView.scrollSensitivity": {
zh: "响应滚动时的倍率 ",
en: "The sensitivity to scroll wheel and track pad scroll events. "
},
"CScrollView.propagationScroll": {
zh: "是否向上传递滚动事件 ",
en: "Whether the scroll event is passed to the upper. "
},
"CScrollView.content": {
zh: "需要滚动显示的内容 ",
en: "The content that can be scrolled. It should be a child of this scrollView. "
},
"CScrollView.horizontalScrollBar": {
zh: "水平滚动条,该 ScrollBar 的滑动会影响 ScrollView 的水平值,反之亦然 ",
en: "Optional Scrollbar object linked to the horizontal scrolling of the ScrollView. "
},
"CScrollView.horizontalNormalizedPosition": {
zh: "水平方向滚动的比例(0 - 1) ",
en: "The horizontal scroll position between 0 and 1. "
},
"CScrollView.verticalScrollBar": {
zh: "垂直滚动条,该 ScrollBar 的滑动会影响 ScrollView 的纵向值,反之亦然 ",
en: "Optional Scrollbar object linked to the vertical scrolling of the ScrollView. "
},
"CScrollView.verticalNormalizedPosition": {
zh: "垂直方向滚动的比例(0 - 1) ",
en: "The vertical scroll position between 0 and 1. "
},
"CScrollView.Variable": {
en: "Description "
},
"CProgressBar.style": {
zh: "显示样式,包括 ProgressBar.STYLE_HORIZONTAL(水平进度条)、ProgressBar.STYLE_VERTICAL(竖直进度条)、ProgressBar.STYLE_CIRCLE(圆形进度条) ",
en: "The manner in which progress should be indicated on the progress bar: ProgressBar.STYLE_HORIZONTAL(From left to right), ProgressBar.STYLE_VERTICAL(From up to bottom), ProgressBar.STYLE_CIRCLE(Circle progressbar) "
},
"CProgressBar.sliders": {
zh: "滑块对象 ",
en: "The referebce to the slider Node. "
},
"CProgressBar.indeterminable": {
zh: "是否是不确定类型,如果无法明确知道进度或者结束值,则使用不确定类型,进度条将循环播放 ",
en: "Whether the ProgressBar shows actual values or generic, continuous progress feedback. "
},
"CProgressBar.minValue": {
zh: "当前进度条的最小值 ",
en: "The minimum allowed value of the progressBar. "
},
"CProgressBar.maxValue": {
zh: "当前进度条的最大值 ",
en: "The maximum allowed value of the progressBar. "
},
"CProgressBar.length": {
zh: "只读,进度条的长度(值为 maxValue - minValue) ",
en: "Read only. = maxValue - minValue "
},
"CProgressBar.value": {
zh: "当前的进度值 ",
en: "The current value of the progressBar. "
},
"CProgressBar.loopTime": {
zh: "循环时间,当 indeterminable 为 true 时候生效 ",
en: "When indeterminable=true, loopTime works. "
},
"CProgressBar.numberOfStep": {
zh: "在循环播放时,从0到max的步数,仅当indeterminable为true时有效, 小于等于0时,按实际值显示 ",
en: "Then number of steps from 0 to max when play in loop. It is only effect when indeterminable variable is true. "
},
"CProgressBar.stepSize": {
zh: "步进距离 ",
en: "The size of each step "
},
"CProgressBar.fixedSize": {
zh: "滑块的大小,值为占整个进度条区域的百分比,1为整个区域, < 0 时表示不限制大小 ",
en: "The size of the slider. Value is percent. 1: full area "
},
"CProgressBar.clipSliders": {
zh: "是否裁切滑块 ",
en: "Whether to cut slider "
},
"CProgressBar.showMode": {
zh: "显示模式,ProgressBar.SHOW_PROCESSED(显示进行了的部分)、ProgressBar.SHOW_REMAINED(显示剩余的部分 )",
en: "Show mode. You can take the following two values: ProgressBar.SHOW_PROCESSED(show processed part), and ProgressBar.SHOW_REMAINED(show left part)"
},
"CProgressBar.reverse": {
zh: "是否反向显示 ",
en: "Whether to show reverse "
},
"CProgressBar.startRadian": {
zh: "开始的弧度,仅当style为STYLE_CIRCLE时有效 ",
en: "The start radian. It is only effect when style is STYLE_CIRCLE. "
},
"CProgressBar.endRadian": {
zh: "结束的弧度,仅当style为STYLE_CIRCLE时有效,endRadian > startRadian && endRadian <= startRadian + Math.PI * 2 ",
en: "The end radian. It is only effect when style is STYLE_CIRCLE. "
},
"CProgressBar.startAngle": {
zh: "开始的角度,仅当style为STYLE_CIRCLE时有效 ",
en: "The start angle. It is only effect when style is STYLE_CIRCLE. "
},
"CProgressBar.endAngle": {
zh: "结束的角度,仅当style为STYLE_CIRCLE时有效,endRadian > startRadian && endRadian <= startRadian + Math.PI * 2 ",
en: "The end angle. It is only effect when style is STYLE_CIRCLE. "
},
"CProgressBar.showRadian": {
zh: "只读,当前显示的弧度 ",
en: "Read only. current radian "
},
"CProgressBar.Variable": {
en: "Description "
},
"CSlider.canPursue": {
zh: "是否允许滑块追赶点击位置 ",
en: "Whether to allow the slider to pursue the click position "
},
"CSlider.style": {
zh: "滑条类型,包含:Slider.STYLE_HORIZONTAL(水平进度条)、Slider.STYLE_VERTICAL(竖直进度条)、Slider.STYLE_CIRCLE(圆形进度条)",
en: "The manner in which progress should be indicated on the progress bar: Slider.STYLE_HORIZONTAL(From left to right), Slider.STYLE_VERTICAL(From up to bottom), Slider.STYLE_CIRCLE(Circle progressbar) "
},
"CSlider.state": {
zh: "滑块的状态 ",
en: "State of the slider. "
},
"CSlider.Variable": {
en: "Description "
},
"CInputField.state": {
zh: "输入框的状态,包含:UIState.NORMAL(正常)、UIState.PRESSED(按下)、UIState.DISABLED(不可用) ",
en: "The state for this object: UIState.NORMAL(normal state), UIState.PRESSED(node is pressed), UIState.DISABLED(node is disable) "
},
"CInputField.lineType": {
zh: "编辑框是多行or单行,InputField.SINGLE_LINE(单行)、InputField.MULTI_LINE(多行) ",
en: "The LineType used by the InputField: InputField.SINGLE_LINE(single line), InputField.MULTI_LINE(multiline) "
},
"CInputField.contentType": {
zh: "输入框的类型,包括有:InputField.STANDARD(任意字符串)、InputField.INT(整数)、InputField.NUMBER(数字)、InputField.TEL(电话号码)、InputField.EMAIL(电子邮件)、InputField.PASSWORD(密码) ",
en: "Specifies the type of the input text content.InputField.STANDARD(Allows all input), InputField.INT(Allow whole numbers), InputField.NUMBER(Allows decimal numbers), InputField.TEL(Allows phone), InputField.EMAIL(The input is used for typing in an email address), InputField.PASSWORD(Allows all input and hides the typed characters by showing them as asterisks characters.) "
},
"CInputField.text": {
zh: "编辑框的内容 ",
en: "The current value of the input field. "
},
"CInputField.placeholderText": {
zh: "占位符字符串 ",
en: "The placeholder text "
},
"CInputField.characterLimit": {
zh: "输入字符的限制。-1表示不受限 ",
en: "How many characters the input field is limited to. -1 = infinite. "
},
"CInputField.overflow": {
zh: "超出部分是否要裁切掉,默认为true ",
en: "Text flows freely outside the element. Default: true. "
},
"CInputField.isFocused": {
zh: "是否处于编辑状态 ",
en: "ture:is editing "
},
"CInputField.textComponent": {
zh: "关联的输入文本对象 ",
en: "The reference of input text node. "
},
"CInputField.placeholder": {
zh: "关联的占位符文本对象 ",
en: "The reference of placeholder text node. "
},
"CInputField.Variable": {
en: "Description "
},
"CSound.audio": {
zh: "声音源 ",
en: "The asset of audio clip. "
},
"CSound.destroyWhenStop": {
zh: "播放完毕之后是否自动销毁 ",
en: "When the sound stop, destroy it. "
},
"CSound.loop": {
zh: "是否循环播放当前声音 ",
en: "Is the audio clip looping? "
},
"CSound.mute": {
zh: "静音 ",
en: "Un- / Mutes the Audio. "
},
"CSound.playOnAwake": {
zh: "是否创建时自动播放 ",
en: "If set to be true, the sound will automatically start playing on awake. "
},
"CSound.volume": {
zh: "音量, 0 - 1 ",
en: "The volume of the audio (0.0 to 1.0). "
},
"CSound.isPlaying": {
zh: "是否正在播放 ",
en: "Whether is playing "
},
"CSound.isPaused": {
zh: "是否暂停中 ",
en: "Whether is paused "
},
"CSound.Variable": {
en: "Description "
},
"CDom.div": {
zh: "对应的div元素 ",
en: "div element "
},
"CDom.pos": {
zh: "节点的位置,qc.Dom.BACK(背景层); qc.Dom.FRON(顶层) ",
en: "The pos of node. There are two values: qc.Dom.BACK(back layer); qc.Dom.FRONT(top layer) "
},
"CDom.innerHTML": {
zh: "内部的HTML元素,当serializable=false时,本字段不能被序列化 ",
en: "innerHTML property of div "
},
"CDom.className": {
zh: "使用的样式表 ",
en: "CSS class "
},
"CDom.serializable": {
zh: "innerHTML信息是否需要保存,默认为true ",
en: "Is innerHTML information needs to be saved, the default value is true "
},
"CDom.overflow": {
zh: "对应于style.overflow,可取值:auto、hidden、visible、scroll ",
en: "Corresponding to style.overflow, possible values: auto, hidden, visible, scroll "
},
"CDom.zIndex": {
zh: "对应于style.zIndex。不能设置为0(游戏场景),值越大表示在上层 ",
en: "Corresponding to style.zIndex, element with greater zIndex is always in front of another element with lower zIndex. Can not be set to zero. "
},
"CDom.Variable": {
en: "Description "
},
"CTilemap.nativeSize": {
zh: "只读,地图的实际大小(不带任何缩放) ",
en: "Read only. native size(not scale) "
},
"CTilemap.layers": {
zh: "图层数组 ",
en: "The layer array "
},
"CTilemap.tilesets": {
zh: "图集数组 ",
en: "The tileset array "
},
"CTilemap.scrollX": {
zh: "水平滚动距离 ",
en: "The scroll distance in axis x "
},
"CTilemap.scrollY": {
zh: "垂直滚动距离 ",
en: "The scroll distance in axis y "
},
"CTilemap.tileWidth": {
zh: "平铺格子的宽度 ",
en: "The width of tile "
},
"CTilemap.tileHeight": {
zh: "平铺格子的高度 ",
en: "The height of tile "
},
"CTilemap.mapWidth": {
zh: "地图X轴上格子的数量 ",
en: "The cell count in axis x "
},
"CTilemap.mapHeight": {
zh: "地图Y轴上格子的数量 ",
en: "The cell count in axis y "
},
"CTilemap.data": {
zh: "Tilemap数据 ",
en: "Tilemap data "
},
"CTilemap.Variable": {
en: "Description "
},
"TransitionBehaviour.target": {
zh: "行为的目标 ",
en: "The target node to apply transition. "
},
"TransitionBehaviour.transition": {
zh: "按钮切换的方式,目前包含 4 种qc.Transition,Transition.Node(不需要变换)、Transition.COLOR_TINT(变换颜色)、Transition.TEXTURE_SWAP(替换贴图)、Transition.ANIMATION(使用自定义动画) ",
en: "Transition mode: Transition.Node(No Transition), Transition.COLOR_TINT(Use an color tint transition), Transition.TEXTURE_SWAP(Use a sprite swap transition), Transition.ANIMATION(Use an animation transition) "
},
"TransitionBehaviour.disabledColor": {
zh: "Transition.COLOR_TINT模式 && 置灰状态下的颜色 ",
en: "transition=Transition.COLOR_TINT && The color when disable "
},
"TransitionBehaviour.disabledTexture": {
zh: "Transition.TEXTURE_SWAP模式 && 置灰状态下的贴图 ",
en: "transition=Transition.TEXTURE_SWAP && The Texture when disable "
},
"TransitionBehaviour.normalColor": {
zh: "Transition.COLOR_TINT模式 && 普通状态下的颜色 ",
en: "transition=Transition.COLOR_TINT && The normal color "
},
"TransitionBehaviour.normalTexture": {
zh: "Transition.TEXTURE_SWAP模式 && 普通状态下的贴图 ",
en: "transition=Transition.TEXTURE_SWAP && The normal texture "
},
"TransitionBehaviour.pressedColor": {
zh: "Transition.COLOR_TINT模式 && 按下状态下的颜色 ",
en: "transition=Transition.COLOR_TINT && The color when pressed "
},
"TransitionBehaviour.pressedTexture": {
zh: "Transition.TEXTURE_SWAP模式 && 按下状态下的贴图 ",
en: "transition=Transition.TEXTURE_SWAP && The texture when pressed "
},
"TransitionBehaviour.Variable": {
en: "Description "
},
"ScaleAdapter.target": {
zh: "行为的目标 ",
en: "target object "
},
"ScaleAdapter.referenceResolution": {
zh: "希望使用的分辨率 ",
en: "Reference resolution "
},
"ScaleAdapter.manualType": {
zh: "分辨率适应的缩放类型",
en: "Scale type"
},
"ScaleAdapter.fullTarget": {
zh: "是否使内容填满 ",
en: "Whether to fill full area "
},
"ScaleAdapter.ScaleAdapter": {
zh: "对宽高分别进行缩放,使得目标区域的分辨率为referenceResolution ",
en: "Scale width and height individually, make target resolution is equal to referenceResolution "
},
"ScaleAdapter.Variable": {
en: "Description "
},
"ScaleAdapter.Constant": {
en: "Description "
},
"ToggleGroup.toggle": {
zh: "当前处于激活状态的开关 ",
en: "Currently active toggle "
},
"ToggleGroup.allowSwitchOff": {
zh: "是否允许选择为空 ",
en: "Is it allowed that no toggle is switched on "
},
"ToggleGroup.toggles": {
zh: "所有的开关列表 ",
en: "List of managed toggles "
},
"ToggleGroup.onValueChange": {
zh: "开关组选中状态变化产生的事件 ",
en: "When current toggle changed, this event will be fired "
},
"ToggleGroup.Variable": {
en: "Description "
},
"NodeMask.checkInField": {
zh: "是否检测子节点是否在范围内 ",
en: "Whether to detect whether the child node is in the range "
},
"NodeMask.mode": {
zh: "裁切模式。(NodeMask.MODE_DEFAULT:以当前节点的显示矩形进行裁切、NodeMask.MODE_PIXEL:以当前节点的显示内容进行裁切、NodeMask.MODE_GRAPHICS:以自定义的图形进行裁切) ",
en: "mask mode.(NodeMask.MODE_DEFAULT:cut the display rectangle of the current node、NodeMask.MODE_PIXEL:cut the display content of the current node、NodeMask.MODE_GRAPHICS:cut with custom graphics) "
},
"NodeMask.customGraphics": {
zh: "自定义的裁切图形 ",
en: "custom graphics "
},
"NodeMask.Variable": {
en: "Description "
},
"Bounds.sizeProvider": {
zh: "尺寸提供方式,有两个取值:Bounds.USE_BOUNDS(使用实际显示范围作为边框)、Bounds.USE_RECTTRANSFORM(使用 rectTransform 作为边框,不受旋转缩放的影响) ",
en: "The way for size calculate. There are two values:Bounds.USE_BOUNDS(Use the actual display range as the border)、Bounds.USE_RECTTRANSFORM(Use rectTransform as border, unUnaffected by rotation、scale and so on) "
},
"Bounds.marginTop": {
zh: "相对父节点的上边边距 ",
en: "The top margin relative to the parent "
},
"Bounds.marginBottom": {
zh: "相对父节点的下边边距 ",
en: "The bottom margin relative to the parent "
},
"Bounds.marginLeft": {
zh: "相对父节点的左边边距 ",
en: "The left margin relative to the parent "
},
"Bounds.marginRight": {
zh: "相对父节点的右边边距 ",
en: "The right margin relative to the parent "
},
"Bounds.paddingTop": {
zh: "相对子节点的上边边距 ",
en: "The top margin relative to the child "
},
"Bounds.paddingBottom": {
zh: "相对子节点的下边边距 ",
en: "The bottom margin relative to the child "
},
"Bounds.paddingLeft": {
zh: "相对子节点的左边边距 ",
en: "The left margin relative to the child "
},
"Bounds.paddingRight": {
zh: "相对子节点的右边边距 ",
en: "The right margin relative to the child "
},
"Bounds.Variable": {
en: "Description "
},
"TableLayout.constraint": {
zh: "表格元素布局限制",
en: "Layout constraint"
},
"TableLayout.startCorner": {
zh: "布局开始的角,默认从左上开始 ",
en: "Layout start corner, left top by default "
},
"TableLayout.startAxis": {
zh: "布局开始添加的轴,默认优先填充水平方向 ",
en: "Layout start direction, horizontal by default "
},
"TableLayout.contentSizeProvider": {
zh: "内容尺寸提供器,见Bounds中的sizeProvider ",
en: "Size calculate mode. seeBounds's sizeProvider "
},
"TableLayout.style": {
zh: "当前布局器的样式,是保持子节点大小还是以本节点 RectTransform 对子节点进行调整,默认保持子节点尺寸",
en: "Current layout style. TableLayout.STYLE_WRAP_ELEMENT、TableLayout.STYLE_RESIZE_ELEMENT"
},
"TableLayout.spacingX": {
zh: "单元格的水平间距 ",
en: "Spacing in x axis "
},
"TableLayout.spacingY": {
zh: "单元格的垂直间距 ",
en: "Spacing in y axis "
},
"TableLayout.cellWidth": {
zh: "单元格的宽度",
en: "Width of cell"
},
"TableLayout.cellHeight": {
zh: "单元格的高度",
en: "Height of cell "
},
"TableLayout.contentAlignment": {
zh: "内容在容器中的对齐方式,仅在style为TableLayout.STYLE_RESIZE_ELEMENT时生效 ",
en: "Alignment mode of content, effective only while style is TableLayout.STYLE_RESIZE_ELEMENT. "
},
"TableLayout.cellAlignment": {
zh: "单元格的内容在容器中的对齐方式 ",
en: "Alignment mode of cell "
},
"TableLayout.columnsCount": {
zh: "只读,当前列数 ",
en: "Read Only. current column count "
},
"TableLayout.rowsCount": {
zh: "只读,当前行数 ",
en: "Read Only. current row count "
},
"TableLayout.ignoreX": {
zh: "是否不调整 x 坐标 ",
en: "Whether ignore the adjustment on the x-axis direction. "
},
"TableLayout.ignoreY": {
zh: "是否不调整 y 坐标 ",
en: "Whether ignore the adjustment on the y-axis direction. "
},
"TableLayout.autoUpdate": {
zh: "是否每帧自动重排 ",
en: "Whether relayout per frame automatically. "
},
"TableLayout.Variable": {
en: "Description "
},
"TableLayout.Constant": {
en: "Description "
},
"HorizontalLayout.spacing": {
zh: "表格元素布局限制,见本文下方的[常量] ",
en: "Spacing value "
},
"HorizontalLayout.childForceExpandWidth": {
zh: "是否强制拉伸宽度",
en: "Whether to stretch width forcely "
},
"HorizontalLayout.childForceExpandHeight": {
zh: "是否强制拉伸高度 ",
en: "Whether to stretch height forcely"
},
"HorizontalLayout.Variable": {
en: "Description "
},
"VerticalLayout.spacing": {
zh: "y轴方向布局间距 ",
en: "Spacing value "
},
"VerticalLayout.childForceExpandWidth": {
zh: "是否强制拉伸宽度",
en: "Whether to stretch width forcely "
},
"VerticalLayout.childForceExpandHeight": {
zh: "是否强制拉伸高度 ",
en: "Whether to stretch height forcely"
},
"VerticalLayout.Variable": {
en: "Description "
},
"LayoutElement.ignoreLayout": {
zh: "是否允许忽略布局参数 ",
en: "Whether to allow to ignore layout "
},
"LayoutElement.minWidth": {
zh: "节点允许的最小宽度 ",
en: "Minimum width "
},
"LayoutElement.minHeight": {
zh: "节点允许的最小高度 ",
en: "Minimum height "
},
"LayoutElement.preferredWidth": {
zh: "首选宽度 ",
en: "Preferred width "
},
"LayoutElement.preferredHeight": {
zh: "首选高度 ",
en: "Preferred height "
},
"LayoutElement.flexibleWidth": {
zh: "可变宽度",
en: "Flexible width"
},
"LayoutElement.flexibleHeight": {
zh: "可变高度 ",
en: "Flexible height "
},
"LayoutElement.hasMinWidth": {
zh: "是否设置了最小宽度 ",
en: "Has minimum width set "
},
"LayoutElement.hasMinHeight": {
zh: "是否设置了最小高度",
en: "Has minimum height set"
},
"LayoutElement.hasPreferredWidth": {
zh: "是否设置了首选宽度",
en: "Has preferred width set"
},
"LayoutElement.hasPreferredHeight": {
zh: "是否设置了首选高度 ",
en: "Has preferred height set "
},
"LayoutElement.hasFlexibleWidth": {
zh: "是否设置了拓展宽度 ",
en: "Has flexible width set "
},
"LayoutElement.hasFlexibleHeight": {
zh: "是否设置了拓展高度 ",
en: "Has flexible height set "
},
"LayoutElement.Variable": {
en: "Description "
},
"AspectRatioFitter.mode": {
zh: "控制比例的方式",
en: "The mode to use to enforce the aspect ratio"
},
"AspectRatioFitter.ratio": {
zh: "长宽的比例 ",
en: "The aspect ratio "
},
"AspectRatioFitter.AspectRatioFitter": {
zh: "填满父亲节点大小 ",
en: "Sizes the rectangle such that the parent rectangle is fully contained within. "
},
"AspectRatioFitter.Variable": {
en: "Description "
},
"AspectRatioFitter.Name": {
en: "Description "
},
"CacheAsBitmap.cacheType": {
zh: "缓存的类型,有两个取值:CacheAsBitmap.CACHE_FOR_SCREEN(为屏幕显示创建缓存)、CacheAsBitmap.CACHE_FOR_SELF(为自身显示创建缓存) ",
en: "The cache type, there are two possible values: CacheAsBitmap.CACHE_FOR_SCREEN, CacheAsBitmap.CACHE_FOR_SELF "
},
"CacheAsBitmap.boundsType": {
zh: "缓存的边界类型,有两个取值:CacheAsBitmap.BOUNDS_SELF(只缓存单个节点)、CacheAsBitmap.BOUNDS_ALL(缓存自己和子孙) ",
en: "The bound type, there are two possible values: CacheAsBitmap.BOUNDS_SELF(only cache self)、CacheAsBitmap.BOUNDS_ALL(cache self and child) "
},
"CacheAsBitmap.boundsInScreen": {
zh: "是否限制缓存区域大小,默认为false ",
en: "Whether to limit the size of the cache, false by default "
},
"CacheAsBitmap.dirty": {
zh: "是否需要更新缓存内容 ",
en: "Whether need to refresh cache "
},
"CacheAsBitmap.Variable": {
en: "Description "
},
"Tween.playOnAwake": {
zh: "创建时是否自动播放动作,默认为false ",
en: "If set to be true, the tween will automatically start playing on awake. "
},
"Tween.flag": {
zh: "组件的标记。当一个对象挂载多个相同Tween组件时会有用 ",
en: "The flag of tween. "
},
"Tween.style": {
zh: "循环类型,有3个取值:Tween.STYLE_ONCE(执行一次)、Tween.STYLE_LOOP(循环播放动画)、Tween.STYLE_PINGPONG(来回播放动画) ",
en: "Does it play once? Does it loop? Value: Tween.STYLE_ONCE(Play Once)、Tween.STYLE_LOOP(Loop the tween)、Tween.STYLE_PINGPONG(Pingpong the tween) "
},
"Tween.curve": {
zh: "动画曲线 ",
en: "Curve of tween. "
},
"Tween.delay": {
zh: "延迟开始播放动画的时间,单位为秒 ",
en: "How long will the tweener wait before starting the tween? Unit: second. "
},
"Tween.duration": {
zh: "动作的持续时间,单位为秒 ",
en: "How long is the duration of the tween? Unit: second. "
},
"Tween.tweenGroup": {
zh: "Tween的动作编组 ",
en: "Used by buttons and tween sequences. Group of '0' means not in a sequence. "
},
"Tween.Variable": {
en: "Description "
},
"TweenPosition.from": {
zh: "初始的位置(x、y坐标) ",
en: "From position(x and y, but not anchoredX or anchoredY). "
},
"TweenPosition.to": {
zh: "结束的位置(x、y坐标) ",
en: "To Position(x and y, but not anchoredX or anchoredY). "
},
"TweenPosition.moveAxis": {
zh: "位置改变的类型,TweenPosition.ONLY_X(只改变X坐标)、TweenPosition.ONLY_Y(只改变Y坐标)、TweenPosition.BOTH(X、Y都改变) ",
en: "TweenPosition.ONLY_X(move x position only)、TweenPosition.ONLY_Y(move y position only)、TweenPosition.BOTH(move x and y) "
},
"TweenPosition.Variable": {
en: "Description "
},
"TweenTransform.from": {
zh: "决定初始位置的物体 ",
en: "Game object which determines the start position. "
},
"TweenTransform.to": {
zh: "决定终点位置的物体 ",
en: "Game object which determines the end position. "
},
"TweenTransform.Variable": {
en: "Description "
},
"TweenRotation.from": {
zh: "初始的弧度 ",
en: "From radian "
},
"TweenRotation.to": {
zh: "结束的弧度 ",
en: "To radian "
},
"TweenRotation.Variable": {
en: "Description "
},
"TweenAlpha.from": {
zh: "初始的透明度,0-1 ",
en: "From alpha, 0-1 "
},
"TweenAlpha.to": {
zh: "结束的透明度,0-1 ",
en: "To alpha, 0-1 "
},
"TweenAlpha.Variable": {
en: "Description "
},
"TweenScale.from": {
zh: "初始的缩放 ",
en: "From scale "
},
"TweenScale.to": {
zh: "结束的缩放 ",
en: "To Scale "
},
"TweenScale.Variable": {
en: "Description "
},
"TweenColor.from": {
zh: "初始的颜色值 ",
en: "From color. "
},
"TweenColor.to": {
zh: "结束的颜色值 ",
en: "To color. "
},
"TweenColor.Variable": {
en: "Description "
},
"TweenProperty.property": {
zh: "对象的属性 ",
en: "Property of the object. "
},
"TweenProperty.from": {
zh: "初始的数值 ",
en: "From value. "
},
"TweenProperty.to": {
zh: "结束的数值 ",
en: "To value. "
},
"TweenProperty.Variable": {
en: "Description "
},
"DebugView.debugOn": {
zh: "是否打开调试功能,详见Debug ",
en: "The debug mode is enable if true. See: Debug "
},
"DebugView.Variable": {
en: "Description "
},
"CParticleSystem.texture": {
zh: "粒子使用的图片 ",
en: "The texture that particles will use. "
},
"CParticleSystem.emissionSpace": {
zh: "发射空间,自身坐标系(LOCAL)还是世界坐标系(WORLD) "
},
"CParticleSystem.zoneType": {
zh: "发射区域,支持四种类型:Zone.POINT(点)、Zone.LINE(直线)、Zone.CIRCLE(圆)、Zone.RECTANGLE(矩形) ",
en: "The shape of the emission zone. Currently supports four types: Zone.POINT(point), Zone.LINE(line), Zone.CIRCLE(circle) and Zone.RECTANGLE(rectangle) "
},
"CParticleSystem.zoneLength": {
zh: "发射区域长度,仅当zoneType为Zone.LINE时起效 ",
en: "The length of emission zone. Only takes effect when zoneType is Zone.LINE. "
},
"CParticleSystem.zoneRotation": {
zh: "发射区域旋转角度,仅当zoneType为Zone.LINE时起效 ",
en: "The rotation of emission zone. Only takes effect when zoneType is Zone.LINE. "
},
"CParticleSystem.zoneRadius": {
zh: "发射区域半径,仅当zoneType为Zone.CIRCLE时起效 ",
en: "The radius of emission zone. Only takes effect when zoneType is Zone.CIRCLE. "
},
"CParticleSystem.zoneWidth": {
zh: "发射区域宽度,仅当zoneType为Zone.RECTANGLE时起效 ",
en: "The width of emission zone. Only takes effect when zoneType is Zone.RECTANGLE. "
},
"CParticleSystem.zoneHeight": {
zh: "发射区域高度,仅当zoneType为Zone.RECTANGEL时起效 ",
en: "The height of emission zone. Only takes effect when zoneType is Zone.RECTANGLE. "
},
"CParticleSystem.edgeEmission": {
zh: "是否从发射区域的边缘发射粒子 ",
en: "Whether the particles will be emitted from the edge of the zone. "
},
"CParticleSystem.frequency": {
zh: "发射频率,即多久发射一次粒子,单位为秒 ",
en: "How often per emission, in seconds. "
},
"CParticleSystem.quantity": {
zh: "每次发射的粒子数量 ",
en: "How many particles will be generated per emission. "
},
"CParticleSystem.repeat": {
zh: "重复发射次数,-1表示循环发射 ",
en: "The repeat count of emission, -1 means loop always. "
},
"CParticleSystem.delay": {
zh: "发射延迟,单位为秒 ",
en: "The delay time of the first emission in seconds. "
},
"CParticleSystem.lifespan": {
zh: "粒子生命时长,单位为秒,在指定范围内随机取值 ",
en: "How long each particle lives once it is emitted in seconds. "
},
"CParticleSystem.angle": {
zh: "粒子发射角度,在指定范围内随机取值 ",
en: "The emission angle of particles, the value is picked at random within specified min-max range. "
},
"CParticleSystem.blendMode": {
zh: "混合模式 ",
en: "The blend mode of particle. "
},
"CParticleSystem.startColor": {
zh: "粒子初始颜色 ",
en: "The start color of particle. "
},
"CParticleSystem.startColorVariation": {
zh: "粒子初始颜色浮动 ",
en: "The variation of start color. "
},
"CParticleSystem.endColor": {
zh: "粒子目标颜色 ",
en: "The target color of particle. "
},
"CParticleSystem.endColorVariation": {
zh: "粒子目标颜色浮动 ",
en: "The variation of end color. "
},
"CParticleSystem.startAlpha": {
zh: "粒子初始透明度,在指定范围内随机取值 ",
en: "The transparency of particles, the value is picked at random within specified min-max range. "
},
"CParticleSystem.startScale": {
zh: "粒子初始缩放,在指定范围内随机取值 ",
en: "The start scale of particles, the value is picked at random within specified min-max range. "
},
"CParticleSystem.startRotation": {
zh: "粒子初始旋转,在指定范围内随机取值 ",
en: "The start rotation of particles, the value is picked at random within specified min-max range. "
},
"CParticleSystem.startVelocity": {
zh: "粒子初始速度,在指定范围内随机取值 ",
en: "The start velocity of particles, the value is picked at random within specified min-max range. "
},
"CParticleSystem.angularVelocity": {
zh: "粒子旋转角速度,在指定范围内随机取值 ",
en: "The start angular velocity of particles, the value is picked at random within specified min-max range. "
},
"CParticleSystem.gravity": {
zh: "重力 ",
en: "The gravity of particle systems. "
},
"CParticleSystem.maxParticles": {
zh: "最大粒子数量,当粒子数量超过此值时将停止发射粒子 ",
en: "The maximum number of particles, the emission will be stopped when the number of particles exceeds this value. "
},
"CParticleSystem.playOnAwake": {
zh: "激活时是否自动开始发射粒子 ",
en: "Whether the particle system will start playing automatically. "
},
"CParticleSystem.initialFrame": {
zh: "粒子播放帧动画时的初始帧,在指定范围内随机取值 ",
en: "The initial frame of a particle when play sprite sheet animation, the value is picked at random within specified min-max range. "
},
"CParticleSystem.frameRate": {
zh: "粒子帧动画速率,在指定范围内随机取值 ",
en: "The frame rate of animation, the value is picked at random within specified min-max range. "
},
"CParticleSystem.enableColorCurve": {
zh: "是否开启颜色控制曲线 ",
en: "Whether enable a curve to control the color of particles. "
},
"CParticleSystem.colorCurve": {
zh: "粒子颜色控制曲线,若将此项关闭则粒子颜色将在起始颜色和目标颜色之间线性变化 ",
en: "Curve to control the color of particles, the color will vary linearly between start color and target color if the curve is disabled. "
},
"CParticleSystem.enableAlphaCurve": {
zh: "是否开启透明度控制曲线 ",
en: "Whether enable a curve to control the transparency of particles. "
},
"CParticleSystem.alphaCurve": {
zh: "粒子透明度控制曲线 ",
en: "Curve to control the transparency of each particle duration its lifespan.. "
},
"CParticleSystem.enableScaleCurve": {
zh: "是否开启缩放控制曲线 ",
en: "Whether enable a curve to control the scale of particles. "
},
"CParticleSystem.scaleCurve": {
zh: "粒子缩放控制曲线 ",
en: "Curve to control the scale of each particle duration its lifespan. "
},
"CParticleSystem.enableVelocityCurve": {
zh: "是否开启速度控制曲线 ",
en: "Whether enable a curve to control the velocity of particles. "
},
"CParticleSystem.velocityCurve": {
zh: "粒子速度控制曲线 ",
en: "Curve to control the velocity of each particle duration its lifespan. "
},
"CParticleSystem.enableAngularVelocityCurve": {
zh: "是否开启角速度控制曲线 ",
en: "Whether enable a curve to control the angular velocity of particles. "
},
"CParticleSystem.angularVelocityCurve": {
zh: "粒子角速度控制曲线 ",
en: "Curve to control the angular velocity of each particle duration its lifespan. "
},
"CParticleSystem.Variable": {
en: "Description "
}
},
qc.editor.Language = {
"QICI Engine/About QICI Engine": {
zh: "青瓷引擎/关于青瓷引擎"
},
"QICI Engine/Check for Updates...": {
zh: "青瓷引擎/检测更新..."
},
"QICI Engine/Preference...": {
zh: "青瓷引擎/偏好设置..."
},
"Project/New Scene": {
zh: "工程/新场景"
},
"Project/Save Scene": {
zh: "工程/保存场景"
},
"Project/Reload Scene": {
zh: "工程/刷新场景"
},
"Project/Open Recent": {
zh: "工程/打开最近工程"
},
"Project/New Project": {
zh: "工程/新建工程"
},
"Project/Open Project": {
zh: "工程/打开工程"
},
"Project/TypeScript/Init": {
zh: "工程/TypeScript/初始化"
},
"Project/TypeScript/Build": {
zh: "工程/TypeScript/编译"
},
"Project/Publish...": {
zh: "工程/发布..."
},
"Project/Settings...": {
zh: "工程/设置..."
},
"Edit/Undo": {
zh: "编辑/回退"
},
"Edit/Redo": {
zh: "编辑/重做"
},
"Edit/Cut": {
zh: "编辑/剪切"
},
"Edit/Copy": {
zh: "编辑/拷贝"
},
"Edit/Paste": {
zh: "编辑/粘贴"
},
"Edit/Duplicate": {
zh: "编辑/复制"
},
"Edit/Delete": {
zh: "编辑/删除"
},
"Edit/Preview (WebGL)": {
zh: "编辑/预览(WebGL)"
},
"Edit/Preview (Canvas)": {
zh: "编辑/预览(Canvas)"
},
"Edit/Play": {
zh: "编辑/运行"
},
"Edit/Play from Entry": {
zh: "编辑/从入口场景运行"
},
"Edit/Apply to Prefab": {
zh: "编辑/应用预制修改"
},
"Edit/Break Prefab": {
zh: "编辑/断开预制关联"
},
"GameObject/Empty Node": {
zh: "游戏对象/空节点"
},
"GameObject/Image": {
zh: "游戏对象/图片"
},
"GameObject/Sprite": {
zh: "游戏对象/精灵"
},
"GameObject/Text": {
zh: "游戏对象/文本"
},
"GameObject/Button": {
zh: "游戏对象/按钮"
},
"GameObject/Toggle": {
zh: "游戏对象/开关"
},
"GameObject/ScrollBar": {
zh: "游戏对象/滚动条"
},
"GameObject/ScrollView": {
zh: "游戏对象/滚动视图"
},
"GameObject/ProgressBar": {
zh: "游戏对象/进度条"
},
"GameObject/Slider": {
zh: "游戏对象/拉条"
},
"GameObject/Dropdown": {
zh: "游戏对象/下拉框"
},
"GameObject/Input Field": {
zh: "游戏对象/输入框"
},
"GameObject/Sound": {
zh: "游戏对象/音效"
},
"GameObject/Dom": {
zh: "游戏对象/Dom节点"
},
"GameObject/UIRoot": {
zh: "游戏对象/UIRoot"
},
"GameObject/Emitter": {
zh: "游戏对象/粒子发射器"
},
"GameObject/Tilemap": {
zh: "游戏对象/瓦片地图"
},
"GameObject/Graphics": {
zh: "游戏对象/绘图"
},
"Empty Node": {
zh: "空节点"
},
Image: {
zh: "图片"
},
Sprite: {
zh: "精灵"
},
Text: {
zh: "文本"
},
Button: {
zh: "按钮"
},
Toggle: {
zh: "开关"
},
ScrollBar: {
zh: "滚动条"
},
ScrollView: {
zh: "滚动视图"
},
ProgressBar: {
zh: "进度条"
},
Slider: {
zh: "拉条"
},
"Input Field": {
zh: "输入框"
},
Dropdown: {
zh: "下拉框"
},
Sound: {
zh: "音效"
},
Emitter: {
zh: "粒子发射器"
},
Graphics: {
zh: "绘图"
},
Tilemap: {
zh: "瓦片地图"
},
"Tool/Frame Animation Editor": {
zh: "工具/帧动画编辑器"
},
"Tool/Action Editor": {
zh: "工具/动作编辑器"
},
"Tool/Action Manager": {
zh: "工具/动作管理器"
},
"Tool/Repack Texture Atlases": {
zh: "工具/重打包图集"
},
"Tool/Import Assets": {
zh: "工具/资源导入"
},
"Tool/Create WebFont": {
zh: "工具/创建WebFont"
},
"Plugins/Plugin Manager": {
zh: "插件/插件管理"
},
"Plugins/Plugin Store": {
zh: "插件/插件商店"
},
"Plugins/Export Plugin": {
zh: "插件/导出插件"
},
"Language/Zh": {
zh: "语言/简体中文",
en: "Language/简体中文"
},
"Language/English": {
zh: "语言/English"
},
"Help/Manual/Zh": {
zh: "帮助/手册/简体中文",
en: "Help/Manual/简体中文"
},
"Help/API/Zh": {
zh: "帮助/API/简体中文",
en: "Help/API/简体中文"
},
"Help/Forum/Zh": {
zh: "帮助/论坛/简体中文",
en: "Help/Forum/简体中文"
},
"Help/Manual/En": {
zh: "帮助/手册/English",
en: "Help/Manual/English"
},
"Help/API/En": {
zh: "帮助/API/English",
en: "Help/API/English"
},
"Help/Forum/En": {
zh: "帮助/论坛/English",
en: "Help/Forum/English"
},
"Quit running mode first": {
zh: "请先退出运行模式"
},
"Stop editing prefab first": {
zh: "请先结束预制编辑"
},
"Enter the new scene name": {
zh: "请输入新场景名"
},
"Enter the new file name": {
zh: "请输入新文件名"
},
"Enter the new name": {
zh: "请输入新名字"
},
"File already exists": {
zh: "文件已存在"
},
"Action Editor": {
zh: "动作编辑器"
},
"Action Manager": {
zh: "动作管理器"
},
"Remove Action": {
zh: "移除动作"
},
"Delete Event": {
zh: "删除事件"
},
"Add Event": {
zh: "新增事件"
},
"Add Property": {
zh: "添加属性"
},
"Add Action": {
zh: "添加动作"
},
Samples: {
zh: "帧数"
},
endLine: {
en: "Show the end line that indicates the duration of a single loop.",
zh: "是否显示结束时间线,结束时间线指向的帧数为单次播放的时长"
},
Duration: {
en: "The duration of a single loop.",
zh: "动作单次播放的时长"
},
"Recursive Error": {
en: "Failed to add this action({0}) because of recursive reference.",
zh: "由于递归引用,无法添加该动作({0})。"
},
"Play In Editor": {
en: "Whether to trigger event in the editor",
zh: "是否在编辑器中触发动作事件"
},
"Original value": {
zh: "初始值"
},
"The value according to point(0,0) of Tween Editor": {
zh: "曲线编辑器中(0,0)点对应的数值"
},
"The value according to point(0,1) of Tween Editor": {
zh: "曲线编辑器中(0,1)点对应的数值"
},
"The distance between point(0,0) and point(0,1) of Tween Editor": {
zh: "曲线编辑器中(0,0)点到(0,1)点的距离值"
},
"Target Locked": {
en: "Target object is locked. It won't be changed to the Animator's gameObject.",
zh: "锁定目标对象,不会变更为 Animator 组件的 gameObject。"
},
"Curve Type": {
en: "Absolute: The tween value is absolute value, directly set as target object's attrib.</br>Relative: Using target object's attrib value as 'From' value, the tween value is the offset value according to 'From' value.</br>TweenAbsolute: The tween value is ratio value of (to - from).</br>TweenRelative: Using target object's attrib value as 'From' value, the tween value is ratio value of distance.",
zh: "Absolute: 曲线值是目标对象的属性值</br>Relative: 使用目标对象的当前属性值作为'From', 曲线值是相对于'From'的偏移值</br>TweenAbsolute: 曲线值是(to-from)值的百分比值</br>TweenRelative: 使用目标对象的当前属性值作为'From', 曲线值是相对于distance值的百分比值</br>"
},
"Do you want to save the scene?": {
zh: "是否保存当前场景?"
},
"Do you want to save the changes?": {
zh: "是否保存改变?"
},
"Don't Save": {
zh: "不保存"
},
Save: {
zh: "保存"
},
Cancel: {
zh: "取消"
},
"Add Component": {
zh: "添加组件"
},
"Add New Script": {
zh: "新建...",
en: "New Script..."
},
Components: {
zh: "脚本列表"
},
Rebuild: {
zh: "重新生成"
},
Preference: {
zh: "偏好设置"
},
"UI Atlas": {
zh: "图集"
},
"Normal Texture": {
zh: "普通贴图"
},
Atlas: {
zh: "图集"
},
"Frame Animation": {
zh: "帧动画"
},
DragonBone: {
zh: "骨骼动画"
},
"DragonBone(Sampled)": {
zh: "骨骼动画(采样)"
},
"Edit Frame Animation": {
zh: "编辑帧动画"
},
Sampled: {
zh: "动作采样"
},
"DragonBone({0}) sampling is done": {
zh: "骨骼({0})采样完成"
},
"Animations List": {
zh: "动作列表"
},
Name: {
zh: "名称"
},
Loop: {
zh: "循环"
},
Speed: {
zh: "速度"
},
Operation: {
zh: "操作"
},
Play: {
zh: "运行"
},
Pause: {
zh: "暂停"
},
"Next Frame": {
zh: "下一帧"
},
Frames: {
zh: "图片帧"
},
"Nine Patch Padding": {
zh: "九宫格间距"
},
"Web Font": {
zh: "Web Font"
},
"Font Name": {
en: "Name",
zh: "字体名称"
},
"Font URLs (One URL per line)": {
zh: "字体地址(按行分开)"
},
"Font URLs are invalid": {
zh: "字体的地址非法"
},
"Name must be digital or letter": {
zh: "字体名称应该为数字或字母"
},
"Web font is saved to: ": {
zh: "字体被保存到:"
},
"JavaScript Management": {
zh: "脚本管理"
},
Script: {
zh: "脚本"
},
Path: {
zh: "路径"
},
Entry: {
zh: "入口脚本"
},
"Drop JavaScript File Here": {
zh: "将JS文件拖拽到这里"
},
"Dependence List": {
zh: "依赖列表"
},
"Add Filter": {
zh: "添加着色器"
},
"Apply Prefab": {
zh: "应用预制修改"
},
"Break Prefab": {
zh: "断开预制关联"
},
"Plugin Manager": {
zh: "插件管理"
},
"Plugin List": {
zh: "插件列表"
},
"Check for Updates": {
zh: "检测更新"
},
"Version Info": {
zh: "版本信息"
},
Update: {
zh: "更新"
},
"Project Settings": {
zh: "工程设置"
},
"Project Name": {
zh: "工程名称"
},
"Game Name": {
zh: "游戏名称"
},
Identifier: {
zh: "标识符"
},
"Local Storage ID": {
zh: "本地存储标识符"
},
"Instance Name": {
zh: "实例名称"
},
Version: {
zh: "版本号"
},
"Script Version": {
zh: "代码版本号"
},
"Fixed Game Size": {
zh: "固定画布大小"
},
ResolutionRatio: {
zh: "清晰度"
},
ResolutionRatioTip: {
en: "The value's range is between 0 and 1. When value is 0, resolution is 1, value is 1, resolution is window.devicePixelRatio.",
zh: "0 到 1 取值,越大越清晰,canvas尺寸也越大。为 0 时,resolution 为 1;为 1 时,resolution 为 window.devicePixelRatio。"
},
Width: {
zh: "宽度"
},
Height: {
zh: "高度"
},
Orientation: {
zh: "转向"
},
"Auto Rotate": {
zh: "自动旋转"
},
Portrait: {
zh: "竖屏"
},
Landscape: {
zh: "横屏"
},
"Frame Rate": {
zh: "帧率"
},
"Background Color": {
zh: "背景色"
},
Apply: {
zh: "应用"
},
"Scene List": {
zh: "场景列表"
},
"Reset Native Size": {
zh: "重置大小"
},
"Generate Layers": {
zh: "生成图层"
},
Relayout: {
zh: "重排"
},
On: {
zh: "开启"
},
"Frame Animation Editor": {
zh: "帧动画编辑"
},
"File must be texture atlas": {
zh: "文件必须为图集资源"
},
"DragonBone cannot be modified.": {
zh: "骨骼动画不能被编辑"
},
"Drop Atlas File Here": {
zh: "将图集文件拖到这里"
},
Animation: {
zh: "动作"
},
" New ": {
zh: " 新建 "
},
" Save ": {
zh: " 保存 "
},
" Delete ": {
zh: " 删除 "
},
" Back ": {
zh: " 返回 "
},
"Animation is empty": {
zh: "动作帧信息不能为空"
},
"Animation's name is invalid": {
zh: "动作名非法"
},
"Please create an animation": {
zh: "请先创建一个动作"
},
"Import Assets": {
zh: "资源导入"
},
Import: {
zh: "导入"
},
"Asset Name": {
zh: "资源名称"
},
"Asset Path": {
zh: "资源路径"
},
"Asset Type": {
zh: "资源类型"
},
"List of Files": {
zh: "文件列表"
},
"Drop files here": {
zh: "拖拽文件到此处"
},
"Invalid asset": {
zh: "未检测到资源"
},
"The asset name is invalid": {
zh: "资源名称非法"
},
"Asset path is empty": {
zh: "请选择保存路径"
},
"Files is empty": {
zh: "导入文件列表为空"
},
"Import is done": {
zh: "资源导入成功"
},
"Import error:": {
zh: "资源导入失败:"
},
"Double click to select the folder": {
zh: "双击选择文件夹"
},
"Set Curr To Start": {
zh: "设置当前值为起始值"
},
"Set Curr To End": {
zh: "设置当前值为结束值"
},
"Play/Stop": {
zh: "运行/停止"
},
"Reset To Begin": {
zh: "重置到起始值"
},
"Play/Stop Group": {
zh: "运行组/停止组"
},
"Reset Group to Begin": {
zh: "重置组到起始值"
},
"Stop editing frame animation?": {
zh: "正在编辑帧动画,确定要退出吗?"
},
Yes: {
zh: "是"
},
"New Folder": {
zh: "创建目录"
},
"Open in Local File Explorer": {
zh: "在本地文件管理器中打开"
},
Delete: {
zh: "删除"
},
Rename: {
zh: "重命名"
},
"New JavaScript File": {
zh: "创建JavaScript脚本"
},
"New TypeScript File": {
zh: "创建TypeScript脚本"
},
Reimport: {
zh: "重新导入资源"
},
"Sure to delete this file?": {
zh: "确认删除选择文件?"
},
"{0} cannot be removed(builtin files).": {
zh: "{0}为内置文件,无法删除。"
},
"{0} cannot be modified(builtin files).": {
zh: "{0}为内置文件,无法编辑。"
},
"JavaScript File": {
en: "JavaScript",
zh: "JavaScript文件"
},
"TypeScript File": {
en: "TypeScript",
zh: "TypeScript文件"
},
"Enter a new JavaScript file name": {
zh: "输入JavaScript文件名"
},
"Enter a new TypeScript file name": {
zh: "输入TypeScript文件名"
},
Expand: {
zh: "展开"
},
Collapse: {
zh: "合并"
},
"Enter a new folder name": {
zh: "请输入目录名"
},
"Downscaling is done.": {
zh: "缩放成功"
},
"Please select an animation asset": {
zh: "请选中一个动画资源"
},
"Folder created": {
zh: "创建目录成功"
},
"Failed to create folder": {
zh: "创建目录失败"
},
"Failed to create js file, duplicate file names": {
zh: "创建JavaScript脚本失败,文件名重复"
},
"Failed to create typescript file, duplicate file names": {
zh: "创建TypeScript脚本失败,文件名重复"
},
"Stop running game?": {
zh: "是否停止当前运行中的游戏?"
},
Stop: {
zh: "停止"
},
"Publish failed:": {
zh: "发布失败:"
},
"Publish succeeded": {
zh: "发布成功"
},
"Remove completed": {
zh: "删除成功"
},
"Remove failed:": {
zh: "删除失败"
},
"Rename succeeded": {
zh: "重命名完成"
},
"Scene saved": {
zh: "场景保存完成"
},
"Prefab saved": {
zh: "预制保存完成"
},
"Built-in files cannot be modified": {
zh: "内置文件不能被编辑"
},
"Reimport completed": {
zh: "资源重导入完成"
},
"Operation completed": {
zh: "操作成功"
},
"Connect failed": {
zh: "连接失败"
},
"Sure to remove this component?": {
zh: "确定删除此组件?"
},
"Resolution Settings": {
zh: "分辨率设置"
},
Add: {
zh: "添加"
},
Remove: {
zh: "删除"
},
Reset: {
zh: "重置"
},
OK: {
zh: "确定"
},
BitmapFont: {
zh: "BitmapFont"
},
Cut: {
zh: "剪切"
},
Copy: {
zh: "拷贝"
},
Paste: {
zh: "粘贴"
},
Create: {
zh: "创建"
},
Duplicate: {
zh: "复制"
},
"Sure to remove this node?": {
zh: "确定删除选中节点吗?"
},
"Failed to fetch recent projects list": {
zh: "获取最近打开的工程列表失败。"
},
Open: {
zh: "打开"
},
"Open Project": {
zh: "打开工程"
},
"Failed to open project": {
zh: "打开工程失败。"
},
"Failed to create project": {
zh: "创建工程失败。"
},
"Close Tip": {
en: "Make sure the changes you made in the scene are saved.\nYour changes will be lost if you do not save them.\nDo you really want to exit?",
zh: "请确定所有数据已保存,确定要退出编辑吗?"
},
Folder: {
zh: "文件夹"
},
"Choose Folder": {
zh: "选择文件夹"
},
"Double click to choose the folder": {
zh: "双击选择文件夹"
},
"Please choose a folder to create the project": {
zh: "请选择创建工程路径"
},
"Create a new project": {
zh: "创建新工程"
},
"Project Folder": {
zh: "工程路径"
},
"Recent Opened Projects": {
en: "Recent Projects",
zh: "最近打开的工程"
},
"Recent Projects": {
zh: "最近工程"
},
"New Project": {
zh: "新建工程"
},
"Code Editor": {
zh: "代码编辑器"
},
"Code Preview": {
zh: "代码预览"
},
"Code Saved": {
zh: "代码已保存"
},
"Select Object": {
zh: "选择对象"
},
"You are using the latest version.": {
zh: "当前使用的已经是最新版本。"
},
"Local Editor Version: ": {
zh: "本地编辑器版本:"
},
"Latest Editor Version: ": {
zh: "最新编辑器版本:"
},
"Local Core Version: ": {
zh: "本地核心库版本:"
},
"Latest Core Version: ": {
zh: "最新核心库版本:"
},
"Begin to update...": {
zh: "开始更新版本..."
},
"Update failed, please try again later.": {
zh: "更新失败,请稍后重试。"
},
"Updated successfully, restart the node.js server and refresh this page": {
zh: "更新成功,请重启后台Node.js服务,并刷新本页面。"
},
"Update Info": {
zh: "更新信息"
},
"A new version of QICI Engine is available!": {
zh: "青瓷引擎有新的版本发布了!"
},
"Pan Mode": {
en: "Pan",
zh: "移动场景"
},
"Move Mode": {
en: "Move",
zh: "移动元素"
},
"Scale Mode": {
en: "Scale",
zh: "缩放"
},
"Transform Mode": {
en: "Transform",
zh: "变换"
},
"Fit Content": {
zh: "重置场景大小"
},
"Edit in Run": {
zh: "运行模式下编辑"
},
"Show/Hide Grid": {
zh: "显示/隐藏标尺"
},
"Show/Hide Debug": {
zh: "显示/隐藏调试信息"
},
"Checking...": {
zh: "检查中..."
},
Install: {
zh: "安装"
},
"Installing...": {
zh: "安装中..."
},
Installed: {
zh: "已安装"
},
"{0} has been successfully installed.": {
zh: "{0}安装成功"
},
"{0} failed to install.": {
zh: "{0}安装失败"
},
"Operate Failed": {
zh: "操作失败。"
},
"Revert to Dragonbones successfully.": {
zh: "成功还原动作为骨骼动画。"
},
Revert: {
zh: "还原为骨骼动画"
},
"Loading Prefab": {
zh: "加载预制"
},
"Project has been removed successfully.": {
zh: "工程已删除"
},
Warning: {
zh: "警告"
},
Confirm: {
zh: "确认"
},
Prompt: {
zh: "提示"
},
"Search:": {
zh: "搜索:"
},
"Search...": {
zh: "搜索..."
},
"Downloading...": {
zh: "下载中..."
},
"Backup current version...": {
zh: "备份现有版本中..."
},
"Completing update...": {
zh: "正在完成更新,请稍候..."
},
"Update version": {
zh: "版本更新"
},
"The update is completed, and refresh to load the new version?": {
zh: "更新完成,是否载入新版本?",
en: "Update complete, do you want to load the new version?"
},
Refresh: {
zh: "更新"
},
"Failed to update, please make sure no files are occupied by other process.": {
zh: "更新失败。请确认文件未被其他进程使用。"
},
"Download failed, please try again.": {
zh: "下载更新失败,请重试。"
},
"Script added.": {
zh: "脚本成功挂载在节点上。"
},
"Start to download images, count: ": {
zh: "开始下载图元,数量"
},
"Images downloaded, Start to pack atlas.": {
zh: "所有图元已成功下载,开始打包"
},
"All atlases has been packed.": {
zh: "全部图集打包完毕!!!"
},
"Show Retainers": {
zh: "查看引用者"
},
Retainers: {
zh: "引用者"
},
"No retainer": {
zh: "没有其它节点引用此节点"
},
"Run in Background": {
zh: "后台运行"
},
Antialias: {
zh: "抗锯齿"
},
Transparent: {
zh: "背景透明"
},
Renderer: {
zh: "渲染器"
},
"Can not move file into raw floder": {
zh: "无法将文件移动到raw目录下"
},
"Prefab cannot be removed": {
zh: "Prefab不能删除"
},
"Failed to add component": {
en: "The component isn't supported by this node.",
zh: "此节点不支持挂载该组件。"
},
"TweenFunction func error": {
en: "More than one function with the same name: ",
zh: "存在多个相同函数名的函数:"
},
Edit: {
zh: "编辑"
},
"Edit Text": {
zh: "编辑文本"
},
"Please input an integer between 1 - 60": {
zh: "请输入一个 1 - 60 的整数"
},
"Sample Frame Rate(1-60, default 15)": {
zh: "每秒采样帧率(1-60,默认15帧)"
},
"Current scripts rely on other, it can not be used as the entrance.": {
zh: "当前脚本依赖其他文件,无法作为入口。"
},
"Curve Editor": {
zh: "曲线编辑器"
},
"Add Key": {
zh: "添加关键帧"
},
"Delete Key": {
zh: "删除关键帧"
},
"Remove Properties": {
zh: "删除属性"
},
"Reset View": {
zh: "重置显示范围"
},
"√ Auto": {
zh: "√ 自动"
},
Auto: {
zh: "自动"
},
"√ Free Smooth": {
zh: "√ 平滑"
},
"Free Smooth": {
zh: "平滑"
},
"√ Flat": {
zh: "√ 水平"
},
Flat: {
zh: "水平"
},
"√ Broken": {
zh: "√ 打断"
},
Broken: {
zh: "打断"
},
"√ Linear": {
zh: "√ 线性"
},
Linear: {
zh: "线性"
},
"√ Ping Pong": {
zh: "√ 反复"
},
"Ping Pong": {
zh: "反复"
},
"√ Loop": {
zh: "√ 循环"
},
"√ Clamp": {
zh: "√ 固定"
},
Clamp: {
zh: "固定"
},
"Save as New Curve": {
zh: "保存为新曲线"
},
"Delete Curve": {
zh: "删除曲线"
},
"Add Default Curves": {
zh: "添加默认曲线"
},
"Developer Mode": {
zh: "开发者模式"
},
Restore: {
zh: "恢复"
},
Reload: {
zh: "重新加载"
},
"Scene file changed": {
zh: "</br></br>该文件已变更。</br>是否需要重新加载?</br></br>如果重新加载,该场景未保存的改动将会丢失。",
en: "</br></br>This file has been modified outside.</br>Do you want to reload it?</br></br>Your unsaved changes in the scene will be lost if you reload it."
},
General: {
zh: "常规"
},
Keys: {
zh: "快捷键"
},
"Auto Refresh": {
zh: "自动刷新"
},
"Maximum History Scene": {
zh: "最大历史场景数量"
},
"Auto Save Interval": {
zh: "场景自动保存间隔"
},
"Open With System Editor": {
zh: "使用系统编辑器打开文件"
},
"Double Click": {
zh: "双击"
},
"Shift + Double Click": {
zh: "Shift + 双击"
},
"Current Scene is not {0}, can not revert.": {
zh: "当前编辑中的场景并非{0},不能执行还原操作"
},
"Revert Failed.": {
zh: "还原失败"
},
Calculate: {
zh: "计算"
},
"Asset is not loaded, please try later.": {
zh: "资源尚未加载完毕,请稍后再尝试。"
},
"Current node is not allowed to add this component.": {
zh: "当前节点无法添加此组件。"
},
"Please first stop to edit prafab.": {
zh: "请先退出编辑预制状态。"
},
"It is not allowed to edit prafab in running mode.": {
zh: "运行模式下无法编辑预制"
},
"Exception notification": {
en: "Error: {0}</br></br>Please open 'Developer Tools'->'Console' to see detail.",
zh: "发生报错:{0}</br></br>打开开发者工具的 Console 面板查看详细信息。"
},
"Load Order": {
zh: "加载顺序"
},
"Script Order Panel": {},
"My Computer": {
zh: "我的电脑"
},
Home: {
zh: "用户目录"
},
Favorites: {
zh: "收藏夹"
},
"Add to Favorites": {
zh: "添加到收藏夹"
},
"Remove from Favorites": {
zh: "从收藏夹删除"
},
"Add, remove and switch order for files or folders": {
zh: "对脚本文件或目录进行增加、删除和顺序切换"
},
Type: {
zh: "类型"
},
"Save And Reload": {
zh: "保存并刷新页面"
},
"Repack Texture Atlases": {
zh: "重新打包图集"
},
"Resource not found": {
zh: "资源已丢失"
},
"Dirty Rectangles": {
zh: "脏矩形"
},
"Show Dirty Rectangles": {
zh: "显示脏矩形区域"
},
"Publish failed: Invalid project.": {
zh: "发布失败:无效工程。"
},
"Publish failed: Scene list is empty, please edit setting by menu Project/Settings.": {
zh: "发布失败:场景列表为空,无法发布游戏,请通过菜单工程-设置进行编辑。"
},
"Publish failed: Invalid version, please edit setting by menu Project/Settings.": {
zh: "发布失败:版本号信息有误,期望[0-9]跟.组成,请在菜单设置中设置版本号。"
},
Mobile: {
zh: "移动设备"
},
Desktop: {
zh: "电脑"
},
"New Atlas Folder": {
zh: "创建图集目录"
},
"Enter a new atlas folder name:": {
en: "Enter a new atlas folder name:<br/><font color='#ff0000'>(The name will be suffixed with '@atlas')</font>",
zh: "请输入一个新的图集目录名:<br/><font color='#ff0000'>(图集目录名将被自动添加'@atlas'后缀)</font>"
},
"Server error: invalid directory. The target directory might has been removed.": {
zh: "服务器错误:invalid directory。目标文件夹可能不存在。"
},
Bullet: {
zh: "子弹"
},
fixedRotation: {
zh: "固定角度"
},
awake: {
zh: "激活"
},
gravityScale: {
zh: "重力倍数"
},
gravity: {
zh: "重力"
},
stepRate: {
zh: "调度频率"
},
useElapsedTime: {
zh: "使用帧时间"
},
maxSimulatePerFrame: {
zh: "每帧最多调用次数"
},
allowSleeping: {
zh: "允许睡眠"
},
debugDraw: {
zh: "调试窗口"
},
debugFlags: {
zh: "调试选项"
},
linearVelocity: {
zh: "速度"
},
linearDamping: {
zh: "阻尼"
},
angularVelocity: {
zh: "旋转速度"
},
angularDamping: {
zh: "旋转阻尼"
},
Fixture: {
zh: "材质"
},
density: {
zh: "密度"
},
friction: {
zh: "摩擦力"
},
restitution: {
zh: "恢复"
},
"Is Sensor": {
zh: "感应器"
},
actionCloseTip: {
en: "Make sure the changes you made in the action are saved. <br>Do you want to save?",
zh: "请先确保所有修改已保存,<br>确定保存吗?"
},
texturePackerSizeExceed: {
en: "Failed to pack atlas '{0}' due to size exceeded. If you want to increase the maximum texture size, please modify the limit value in Preference settings.",
zh: "图集'{0}'的大小超过预设限制,建议拆分图集(如果你确定仍然要打包出此规模的图集,请通过偏好设置面板修改大小限制)"
},
sampleAnimationLoopTimesExceed: {
en: "Sample dragon bones faild, please make sure your resource can play in editor first.",
zh: "采样动画失败,请先确保动画文件在编辑器中可以正常播放。"
},
decomposeAtlasFinish: {
en: "atlas decompose success, save to {0}.",
zh: "图集成功分解,保存路径:{0}。"
},
decomposeDirExists: {
en: "Decompose atlas faild, target directory {0} already exists.",
zh: "分解失败,目标目录{0}已存在。"
},
"Decompose Atlas": {
zh: "分解图集"
},
"Unique Name": {
en: "If uniqueName is set, the object can be found directly by calling qc.N(uniqueName) method.",
zh: "如果 uniqueName 被设置,可直接通过调用 qc.N(uniqueName) 方法取得本节点对象"
},
"Android Environment": {
zh: "安卓环境"
},
ASSET_ALL: {
en: "All",
zh: "所有"
},
ASSET_SCENE: {
en: "Scene",
zh: "场景"
},
ASSET_PREFAB: {
en: "Prefab",
zh: "预制"
},
ASSET_ATLAS: {
en: "Texture",
zh: "图片"
},
ASSET_TEXT: {
en: "Text",
zh: "文本"
},
ASSET_FONT: {
en: "Font",
zh: "字体"
},
ASSET_SOUND: {
en: "Sound",
zh: "音效"
},
ASSET_EXCEL: {
en: "Excel",
zh: "Excel"
},
ASSET_WEBFONT: {
en: "Webfont",
zh: "网页字体"
},
ASSET_ACTION: {
en: "Action",
zh: "动作"
},
ASSET_ACTIONMANAGER: {
en: "ActionManager",
zh: "动作管理"
},
ASSET_JS: {
en: "Script",
zh: "脚本"
},
"CSS Info": {
zh: "CSS信息"
},
"Publish to ...": {
zh: "发布..."
},
"Default Icon": {
zh: "默认图标"
},
"Scenes in Build": {
zh: "需要发布的场景"
},
"Bundle Id": {
zh: "Bundle Id"
},
"Mininum API Level": {
zh: "最低支持版本"
},
"Target Level": {
zh: "目标版本"
},
"Build Code": {
zh: "发布版本序号"
},
"Default Orientation": {
zh: "默认屏幕旋转"
},
"Allowed Orientations for Auto Rotation": {
zh: "允许旋转的方向"
},
"Build Apk": {
zh: "发布为APK文件"
},
"Portrait Upside Down": {
zh: "倒立竖屏"
},
"Landscape Right": {
zh: "右手横屏"
},
"Landscape Left": {
zh: "左手横屏"
},
"Splash Setting": {
zh: "闪屏设置"
},
"Splash Image": {
zh: "闪屏图片"
},
"Splash scaling": {
zh: "闪屏缩放设置"
},
"Keystore Setting": {
zh: "密钥设置"
},
"Create Keystore": {
zh: "创建密钥"
},
"Store File": {
zh: "密钥文件"
},
"Store Password": {
zh: "密码"
},
"Key Alias": {
zh: "别名"
},
Password: {
zh: "密码"
},
"Use Existing Keystore": {
zh: "使用存在的密钥"
},
"Create New Keystore": {
zh: "创建新的密钥"
},
"Center (only scale down)": {
zh: "居中显示(只缩小)"
},
"Scale to fit (letter boxed)": {
zh: "适应大小"
},
"Scale to fill (cropped)": {
zh: "铺满全屏"
},
"Enter path to keystore.": {
zh: "请输入密钥路径。"
},
"Enter keystore password.": {
zh: "请输入密钥密码。"
},
"Keystore password is too short - must be at least 6 characters.": {
zh: "密码最少6位字符。"
},
"Enter key alias.": {
zh: "请选择密钥别名。"
},
"Alias password is too short - must be at least 6 characters.": {
zh: "密钥别名密码最少6位字符。"
},
"Enter build version.": {
zh: "请输入版本号。"
},
"Enter publish path.": {
zh: "请输入发布路径。"
},
"Keystore passwords do not match.": {
zh: "密钥的密码不匹配。"
},
"Alias passwords do not match.": {
zh: "密钥别名的密码不匹配。"
},
"Key certificate validity is required.": {
zh: "密钥必须配置过期时间"
},
"At least one Certificate issuer field is required to be non-empty.": {
zh: "至少需要填写一项所有者信息"
},
"Enter two-letter country code.": {
zh: "请输入2个字符的国家代码"
},
"Add Timestamp:": {
zh: "添加时间戳:"
},
"Publish Path:": {
zh: "发布路径:"
},
"Build Ok": {
zh: "编译成功!",
en: "Build success!"
},
"Build Fail": {
zh: "编译失败!请查看控制台错误信息!",
en: "Build failed! Please see the error message in the console window."
},
"Init TypeScript ok.": {
zh: "初始化成功!"
}
};
var aa = qc.editor.Localize = function(a) {
a = a || "zh" === fa.browserLanguage ? "zh" : "en",
this.language = a,
this.values = qc.editor.Language;
var b = qc.editor.InspectorTips;
for (var d in b)
this.values[d] === c && (this.values[d] = b[d]);
b = qc.editor.CustomInspectorTips;
for (var d in b)
this.values[d] === c && (this.values[d] = b[d])
}
;
aa.prototype = {},
aa.prototype.constructor = aa,
aa.prototype._ = function(a) {
return this.values[a] && this.values[a][this.language] ? this.values[a][this.language] : a
}
;
var ba = qc.editor.SkinManager = function() {
var a = this;
fa.e.on(fa.e.SKIN_CHANGE, function(b) {
a.skin = b.newValue
})
}
;
ba.prototype = {},
ba.prototype.constructor = ba,
ba.prototype.registerProjectIcons = function() {
k.setImage("tree_folder", fa.assetPath + "tree_folder.png", 16, 13),
k.setImage("inspector_button.9", fa.assetSkinPath + "inspector_button.9.png"),
k.setImage("inspector_button_active.9", fa.assetSkinPath + "inspector_button_active.9.png"),
k.setImage("dialog.9", fa.assetSkinPath + "dialog.9.png"),
k.setImage("dialogCloseBackgroundImage", fa.assetSkinPath + "dialogCloseBackgroundImage.png", 44, 22),
k.setImage("dialogActiveCloseBackgroundImage", fa.assetSkinPath + "dialogActiveCloseBackgroundImage.png", 44, 22),
k.setImage("dialog_button.9", fa.assetSkinPath + "dialog_button.9.png"),
k.setImage("dialog_button_active.9", fa.assetSkinPath + "dialog_button_active.9.png"),
k.setImage("dialogClose", fa.assetSkinPath + "dialogClose.png", 14, 15),
k.setImage("dialogActiveClose", fa.assetSkinPath + "dialogActiveClose.png", 14, 15),
k.setImage("UnknowIcon", fa.assetPath + "UnknowIcon.png"),
k.setImage("folder", fa.assetPath + "folder.png"),
k.setImage("radioOnIcon", fa.assetSkinPath + "radioOnIcon.png", 13, 13),
k.setImage("radioOffIcon", fa.assetSkinPath + "radioOffIcon.png", 13, 13),
k.setImage("folder", fa.assetPath + "folder.png"),
k.setImage("treeExpand", fa.assetSkinPath + "expand.png", 9, 9),
k.setImage("treeCollapse", fa.assetSkinPath + "collapse.png", 9, 9)
}
,
ba.prototype.registerCodeEditorIcons = function() {
k.setImage("inspector_button.9", fa.assetSkinPath + "inspector_button.9.png"),
k.setImage("inspector_button_active.9", fa.assetSkinPath + "inspector_button_active.9.png")
}
,
ba.prototype.registerIcons = function() {
k.setImage("menu.9", fa.assetSkinPath + "menu.9.png"),
k.setImage("menu_active.9", fa.assetSkinPath + "menu_active.9.png"),
k.setImage("banner_float.9", fa.assetSkinPath + "banner_float.9.png"),
k.setImage("banner_button_active.9", fa.assetSkinPath + "banner_button_active.9.png"),
k.setImage("banner_button_active_left.9", fa.assetSkinPath + "banner_button_active_left.9.png"),
k.setImage("banner_button_active_right.9", fa.assetSkinPath + "banner_button_active_right.9.png"),
k.setImage("banner_creator_active.9", fa.assetSkinPath + "banner_creator_active.9.png"),
k.setImage("banner_resolution.9", fa.assetSkinPath + "banner_resolution.9.png"),
k.setImage("addproperty.9", fa.assetPath + "addproperty.9.png"),
k.setImage("addproperty_active.9", fa.assetPath + "addproperty_active.9.png"),
k.setImage("banner_collapse", fa.assetSkinPath + "banner_collapse.png", 9, 8),
k.setImage("banner_collapse_active", fa.assetSkinPath + "banner_collapse_active.png", 9, 8),
k.setImage("banner_expand", fa.assetSkinPath + "banner_expand.png", 9, 8),
k.setImage("banner_expand_active", fa.assetSkinPath + "banner_expand_active.png", 9, 8),
k.setImage("dialog.9", fa.assetSkinPath + "dialog.9.png"),
k.setImage("dialogCloseBackgroundImage", fa.assetSkinPath + "dialogCloseBackgroundImage.png", 44, 22),
k.setImage("dialogActiveCloseBackgroundImage", fa.assetSkinPath + "dialogActiveCloseBackgroundImage.png", 44, 22),
k.setImage("dialog_button.9", fa.assetSkinPath + "dialog_button.9.png"),
k.setImage("dialog_button_active.9", fa.assetSkinPath + "dialog_button_active.9.png"),
k.setImage("dialogClose", fa.assetSkinPath + "dialogClose.png", 14, 15),
k.setImage("dialogActiveClose", fa.assetSkinPath + "dialogActiveClose.png", 14, 15),
k.setImage("preview.9", fa.assetSkinPath + "preview.9.png"),
k.setImage("tab.9", fa.assetSkinPath + "tab.9.png"),
k.setImage("searchfield.9", fa.assetSkinPath + "searchfield.9.png"),
k.setImage("textfield_active.9", fa.assetSkinPath + "textfield_active.9.png"),
k.setImage("addcomponent_active.9", fa.assetSkinPath + "addcomponent_active.9.png"),
k.setImage("inspector_button.9", fa.assetSkinPath + "inspector_button.9.png"),
k.setImage("inspector_button_active.9", fa.assetSkinPath + "inspector_button_active.9.png"),
k.setImage("uncheckIcon", fa.assetSkinPath + "uncheckIcon.png", 10, 10),
k.setImage("checkIcon", fa.assetSkinPath + "checkIcon.png", 10, 10),
k.setImage("panel_title.9", fa.assetSkinPath + "panel_title.9.png"),
k.setImage("panel_title_text.9", fa.assetSkinPath + "panel_title_text.9.png"),
k.setImage("treeExpand", fa.assetSkinPath + "expand.png", 9, 9),
k.setImage("treeCollapse", fa.assetSkinPath + "collapse.png", 9, 9),
k.setImage("objectpicker", fa.assetSkinPath + "objectpicker.png", 14, 14),
k.setImage("objectpicker_active", fa.assetSkinPath + "objectpicker_active.png", 14, 14),
k.setImage("project_add", fa.assetSkinPath + "project_add.png", 11, 11),
k.setImage("project_add.9", fa.assetSkinPath + "project_add.9.png"),
k.setImage("pan", fa.assetSkinPath + "pan.png", 22, 22),
k.setImage("pan_active", fa.assetSkinPath + "pan_active.png", 22, 22),
k.setImage("pan_disable", fa.assetSkinPath + "pan_disable.png", 22, 22),
k.setImage("move", fa.assetSkinPath + "move.png", 22, 22),
k.setImage("move_active", fa.assetSkinPath + "move_active.png", 22, 22),
k.setImage("move_disable", fa.assetSkinPath + "move_disable.png", 22, 22),
k.setImage("pause", fa.assetSkinPath + "pause.png", 12, 16),
k.setImage("pause_active", fa.assetSkinPath + "pause_active.png", 12, 16),
k.setImage("play", fa.assetSkinPath + "play.png", 8, 16),
k.setImage("play_active", fa.assetSkinPath + "play_active.png", 8, 16),
k.setImage("rerun", fa.assetSkinPath + "rerun.png", 16, 17),
k.setImage("rerun_active", fa.assetSkinPath + "rerun_active.png", 16, 17),
k.setImage("step", fa.assetSkinPath + "step.png", 12, 16),
k.setImage("step_active", fa.assetSkinPath + "step_active.png", 12, 16),
k.setImage("scale", fa.assetSkinPath + "scale.png", 22, 22),
k.setImage("scale_active", fa.assetSkinPath + "scale_active.png", 22, 22),
k.setImage("scale_disable", fa.assetSkinPath + "scale_disable.png", 22, 22),
k.setImage("transform", fa.assetSkinPath + "transform.png", 22, 22),
k.setImage("transform_active", fa.assetSkinPath + "transform_active.png", 22, 22),
k.setImage("transform_disable", fa.assetSkinPath + "transform_disable.png", 22, 22),
k.setImage("fitContent", fa.assetSkinPath + "fitContent.png", 22, 22),
k.setImage("fitContent_active", fa.assetSkinPath + "fitContent_active.png", 22, 22),
k.setImage("fitContent_disable", fa.assetSkinPath + "fitContent_disable.png", 22, 22),
k.setImage("editInRun", fa.assetSkinPath + "editInRun.png", 22, 22),
k.setImage("editInRun_active", fa.assetSkinPath + "editInRun_active.png", 22, 22),
k.setImage("editInRun_disable", fa.assetSkinPath + "editInRun_disable.png", 22, 22),
k.setImage("grid", fa.assetSkinPath + "grid.png", 22, 22),
k.setImage("grid_active", fa.assetSkinPath + "grid_active.png", 22, 22),
k.setImage("grid_disable", fa.assetSkinPath + "grid_disable.png", 22, 22),
k.setImage("debug", fa.assetSkinPath + "debug.png", 22, 22),
k.setImage("debug_active", fa.assetSkinPath + "debug_active.png", 22, 22),
k.setImage("project_expand", fa.assetPath + "project_expand.png", 21, 21),
k.setImage("project_collapse", fa.assetPath + "project_collapse.png", 21, 21),
k.setImage("radioOnIcon", fa.assetSkinPath + "radioOnIcon.png", 13, 13),
k.setImage("radioOffIcon", fa.assetSkinPath + "radioOffIcon.png", 13, 13),
k.setImage("action_play", fa.assetPath + "action_play.png", 7, 10),
k.setImage("action_play_active", fa.assetPath + "action_play_active.png", 7, 10),
k.setImage("action_expand", fa.assetPath + "action_expand.png", 8, 8),
k.setImage("action_expand_active", fa.assetPath + "action_expand_active.png", 8, 8),
k.setImage("action_collapse", fa.assetPath + "action_collapse.png", 8, 2),
k.setImage("action_collapse_active", fa.assetPath + "action_collapse_active.png", 8, 2),
k.setImage("action_record", fa.assetPath + "action_record.png", 8, 8),
k.setImage("action_record_active", fa.assetPath + "action_record_active.png", 8, 8),
k.setImage("action_addframe", fa.assetPath + "action_addframe.png", 13, 9),
k.setImage("action_addframe_active", fa.assetPath + "action_addframe_active.png", 13, 9),
k.setImage("action_addevent", fa.assetPath + "action_addevent.png", 10, 11),
k.setImage("action_addevent_active", fa.assetPath + "action_addevent_active.png", 10, 11),
k.setImage("action_nextframe", fa.assetPath + "action_nextframe.png", 6, 9),
k.setImage("action_nextframe_active", fa.assetPath + "action_nextframe_active.png", 6, 9),
k.setImage("action_preframe", fa.assetPath + "action_preframe.png", 6, 9),
k.setImage("action_preframe_active", fa.assetPath + "action_preframe_active.png", 6, 9),
k.setImage("project", fa.assetSkinPath + "project.png", 15, 12),
k.setImage("hierarchy", fa.assetSkinPath + "hierarchy.png", 13, 11),
k.setImage("inspector", fa.assetSkinPath + "inspector.png", 15, 15),
k.setImage("hierarchy.tab.9", fa.assetPath + "hierarchy.tab.9.png", 20, 10),
k.setImage("inspector.tab.9", fa.assetPath + "inspector.tab.9.png", 20, 10),
k.setImage("project.tab.9", fa.assetPath + "project.tab.9.png", 20, 10),
k.setImage("delete", fa.assetPath + "delete.png", 12, 15),
k.setImage("delete_active", fa.assetPath + "delete_active.png", 12, 15),
k.setImage("lock", fa.assetPath + "lock.png", 11, 15),
k.setImage("unlock", fa.assetPath + "unlock.png", 14, 15),
k.setImage("refresh", fa.assetPath + "refresh.png", 14, 14),
k.setImage("refresh_active", fa.assetPath + "refresh_active.png", 14, 14),
k.setImage("tree_link_folder", fa.assetPath + "tree_link_folder.png", 16, 13),
k.setImage("tree_assets_folder", fa.assetPath + "tree_assets_folder.png", 16, 13),
k.setImage("tree_atlas_folder", fa.assetPath + "tree_atlas_folder.png", 16, 13),
k.setImage("tree_css_folder", fa.assetPath + "tree_css_folder.png", 16, 13),
k.setImage("tree_js_folder", fa.assetPath + "tree_js_folder.png", 16, 13),
k.setImage("tree_ts_folder", fa.assetPath + "tree_ts_folder.png", 16, 13),
k.setImage("tree_prefab_folder", fa.assetPath + "tree_prefab_folder.png", 16, 13),
k.setImage("tree_raw_folder", fa.assetPath + "tree_raw_folder.png", 16, 13),
k.setImage("tree_sprite_folder", fa.assetPath + "tree_sprite_folder.png", 16, 13),
k.setImage("tree_audio_folder", fa.assetPath + "tree_audio_folder.png", 16, 13),
k.setImage("tree_excel_folder", fa.assetPath + "tree_excel_folder.png", 16, 13),
k.setImage("tree_font_folder", fa.assetPath + "tree_font_folder.png", 16, 13),
k.setImage("tree_state_folder", fa.assetPath + "tree_state_folder.png", 16, 13),
k.setImage("tree_action_folder", fa.assetPath + "tree_action_folder.png", 16, 13),
k.setImage("tree_folder", fa.assetPath + "tree_folder.png", 16, 13),
k.setImage("folder", fa.assetPath + "folder.png"),
k.setImage("assets_folder", fa.assetPath + "assets_folder.png"),
k.setImage("atlas_folder", fa.assetPath + "atlas_folder.png"),
k.setImage("action_folder", fa.assetPath + "action_folder.png"),
k.setImage("audio_folder", fa.assetPath + "audio_folder.png"),
k.setImage("excel_folder", fa.assetPath + "excel_folder.png"),
k.setImage("font_folder", fa.assetPath + "font_folder.png"),
k.setImage("state_folder", fa.assetPath + "state_folder.png"),
k.setImage("css_folder", fa.assetPath + "css_folder.png"),
k.setImage("js_folder", fa.assetPath + "js_folder.png"),
k.setImage("ts_folder", fa.assetPath + "ts_folder.png"),
k.setImage("prefab_folder", fa.assetPath + "prefab_folder.png"),
k.setImage("raw_folder", fa.assetPath + "raw_folder.png"),
k.setImage("sprite_folder", fa.assetPath + "sprite_folder.png"),
k.setImage("link_folder", fa.assetPath + "link_folder.png"),
k.setImage("CssIcon", fa.assetPath + "CssIcon.png"),
k.setImage("JsIcon", fa.assetPath + "JsIcon.png"),
k.setImage("TsIcon", fa.assetPath + "TsIcon.png"),
k.setImage("ActionIcon", fa.assetPath + "ActionIcon.png"),
k.setImage("ActionManagerIcon", fa.assetPath + "ActionManagerIcon.png"),
k.setImage("JsonIcon", fa.assetPath + "JsonIcon.png"),
k.setImage("FontIcon", fa.assetPath + "FontIcon.png"),
k.setImage("SoundIcon", fa.assetPath + "SoundIcon.png"),
k.setImage("StateIcon", fa.assetPath + "StateIcon.png"),
k.setImage("UnknowIcon", fa.assetPath + "UnknowIcon.png"),
k.setImage("alert", fa.assetPath + "alert.png", 16, 16),
k.setImage("lost", fa.assetRootPath + "lost.png"),
k.setImage("inspector_rectTransform", fa.assetPath + "inspector_rectTransform.png", 22, 22),
k.setImage("inspector_button", fa.assetPath + "inspector_button.png", 22, 22),
k.setImage("inspector_image", fa.assetPath + "inspector_image.png", 22, 22),
k.setImage("inspector_toggle", fa.assetPath + "inspector_toggle.png", 22, 22),
k.setImage("inspector_scrollbar", fa.assetPath + "inspector_scrollbar.png", 22, 22),
k.setImage("inspector_scrollview", fa.assetPath + "inspector_scrollview.png", 22, 22),
k.setImage("inspector_progressbar", fa.assetPath + "inspector_progressbar.png", 22, 22),
k.setImage("inspector_node", fa.assetPath + "inspector_node.png", 22, 22),
k.setImage("inspector_text", fa.assetPath + "inspector_text.png", 22, 22),
k.setImage("inspector_dropdown", fa.assetPath + "inspector_dropdown.png", 22, 22),
k.setImage("inspector_sound", fa.assetPath + "inspector_sound.png", 22, 22),
k.setImage("inspector_sprite", fa.assetPath + "inspector_sprite.png", 22, 22),
k.setImage("inspector_slider", fa.assetPath + "inspector_slider.png", 22, 22),
k.setImage("inspector_inputfield", fa.assetPath + "inspector_inputfield.png", 22, 22),
k.setImage("inspector_particle", fa.assetPath + "inspector_particle.png", 22, 22),
k.setImage("inspector_dom", fa.assetPath + "inspector_dom.png", 22, 22),
k.setImage("inspector_tilemap", fa.assetPath + "inspector_tilemap.png", 22, 22),
k.setImage("inspector_title_tilemap", fa.assetPath + "inspector_title_tilemap.png", 15, 15),
k.setImage("inspector_title_tilelayer", fa.assetPath + "inspector_title_tilelayer.png", 15, 15)
}
,
ba.prototype.initTheme = function() {
qc.widget.List.prototype._indent = 16,
qc.widget.Tree.prototype._indent = 12,
qc.editor.ItemList.prototype._indent = 16,
qc.widget.Menu.prototype._topGap = 3,
qc.widget.Menu.prototype._bottomGap = 3,
qc.widget.Menu.prototype._gap = 15,
qc.widget.Menu.prototype._labelFont = "13px Arial",
qc.editor.ItemList.prototype._rowHeight = 18,
qc.widget.List.prototype._rowHeight = 18,
qc.widget.List.prototype._labelFont = "11px Arial",
qc.widget.Tree.prototype._rowHeight = 18,
qc.widget.Tree.prototype._labelFont = "11px Arial",
qc.widget.Tree.prototype._expandIcon = "treeExpand",
qc.widget.Tree.prototype._collapseIcon = "treeCollapse",
qc.widget.ContextMenu.prototype._rowHeight = 24,
qc.widget.ContextMenu.prototype._labelFont = "13px Arial",
qc.widget.ContextMenu.prototype._padding = [1, 1, 1, 1],
qc.widget.ContextMenu.prototype._leftGap = 8,
qc.widget.ContextMenu.prototype._rightGap = 8,
qc.widget.Tabs.prototype._tabHeight = 26,
qc.widget.Tabs.prototype._labelFont = "13px Arial",
qc.editor.Dialog.prototype._contentPadding = [20, 10, 10, 20],
qc.editor.Dialog.prototype._borderWidth = 0,
qc.editor.Dialog.prototype._titleHeight = 25,
qc.editor.Dialog.prototype._buttonGap = 5,
qc.editor.Dialog.prototype._buttonFont = "14px Arial",
qc.editor.Dialog.prototype._htmlFont = "16px Arial",
qc.widget.TextField.prototype._padding = [1, 2, 1, 2],
qc.widget.List.prototype._activable = !0,
qc.widget.List.prototype.getSelectBackground = function() {
return this === fa.activeView ? this._selectBackground : this._inactiveSelectBackground
}
,
qc.widget.List.prototype.getLabelColor = function(a) {
if (a === this.draggingData)
return "#fce486";
if (this.checkMode) {
if (this._focusData === a)
return this.labelSelectColor
} else if (this.isSelected(a))
return this.labelSelectColor;
return this.labelColor
}
,
qc.editor.ComponentsList.prototype.getSelectBackground = function() {
return this._selectBackground
}
,
qc.editor.ComponentsList.prototype.getLabelColor = function(a) {
return this.isSelected(a) ? this.labelSelectColor : this.labelColor
}
,
qc.widget.Tree.prototype._activable = !0,
qc.widget.Tree.prototype.getSelectBackground = qc.widget.List.prototype.getSelectBackground,
qc.widget.Tree.prototype.getLabelColor = qc.widget.List.prototype.getLabelColor,
qc.widget.graph.GraphView.prototype._activable = !0,
qc.widget.graph.GraphView.prototype.getLabelColor = function(a) {
return a === this.draggingData ? "#fce486" : a.s("label.visible") === !1 ? "rgba(0, 0, 0, 0)" : this.isSelected(a) ? this._labelSelectColor : this._labelColor
}
,
qc.widget.graph.GraphView.prototype.getLabelBackground = function(a) {
return this.isSelected(a) && a.s("label.visible") !== !1 && "list" !== this.layout ? this === fa.activeView ? this._selectBackground : this._inactiveSelectBackground : null
}
,
qc.widget.graph.GraphView.prototype.getLabel2Color = function(a) {
return a.s("label2.visible") === !1 ? "rgba(0, 0, 0, 0)" : this.isSelected(a) ? this._labelSelectColor : this._labelColor
}
,
qc.widget.graph.GraphView.prototype.getLabel2Background = function(a) {
return this.isSelected(a) && a.s("label2.visible") !== !1 ? this === fa.activeView ? this._selectBackground : this._inactiveSelectBackground : null
}
,
qc.widget.Button.prototype.getTextColor = function() {
var a = this
, b = a.state;
return "active" === b ? a.activeTextColor || a.textColor : this.textColor
}
,
qc.widget.ToggleButton.prototype.getTextColor = function() {
var a = this;
return a.selected ? a.selectedTextColor || a.textColor : a.textColor
}
,
qc.widget.Button.prototype.getStateIcon = function() {
var a = this
, b = a.state;
return a.disabled && this.disabledIcon ? this.disabledIcon : "active" === b ? this.activeIcon || this.icon : this.icon
}
,
qc.widget.ToggleButton.prototype.getStateIcon = function() {
var a = this
, b = a.selected;
return a.disabled && this.disabledIcon ? this.disabledIcon : b ? this.activeIcon || this.icon : this.icon
}
}
,
ba.prototype.overrideSizeMethod = function() {
qc.widget.Default.calculateClientWidth = function(a) {
return a.width
}
,
qc.widget.Default.calculateClientHeight = function(a) {
return a.height
}
,
qc.widget.TextField.prototype.calculateClientWidth = function() {
return this.width
}
,
qc.widget.TextField.prototype.calculateClientHeight = function() {
return this.height
}
,
qc.widget.ComboBox.prototype.calculateClientWidth = function() {
return this.width - 2
}
,
qc.widget.ComboBox.prototype.calculateClientHeight = function() {
return this.height - 2
}
}
,
b.defineProperties(ba.prototype, {
page: {
get: function() {
return this._page
},
set: function(a) {
this._page = a
}
},
skin: {
get: function() {
return this._skin
},
set: function(a) {
this._skin = a;
var b = this.skinMap[a + "_" + this.page];
b && b()
}
},
skinMap: {
value: {
Dark_Editor: f,
Light_Editor: i,
Dark_Project: d,
Light_Project: g,
Dark_CodeEditor: e,
Light_CodeEditor: h
}
}
});
var ca = qc.editor.Log = function() {
this.enableTrace = !0
}
;
ca.prototype = {},
ca.prototype.constructor = ca,
ca.prototype.trace = function() {
this.enableTrace && console.log(this.toContent(arguments))
}
,
ca.prototype.print = function() {
console.log(this.toContent(arguments))
}
,
ca.prototype.important = function() {
console.log("%c" + this.toContent(arguments), "color:green")
}
,
ca.prototype.error = function() {
console.log(this.toContent(arguments));
for (var a = 1; a < arguments.length; a++)
if (arguments[a] && arguments[a].stack)
return void console.error(arguments[a].stack);
console.trace()
}
,
ca.prototype.toContent = function(a) {
for (var b = a[0], c = 1; c < a.length; c++) {
var d = new RegExp("\\{" + (c - 1) + "\\}","g");
b = b.replace(d, a[c])
}
return b
}
;
var da = qc.editor.Event = function() {
this._emitter = new qc.widget.Emitter,
this.SELECT_COMPONENT = "selectComponent",
this.SELECT_IMAGE = "selectImage",
this.EDIT_MODE_CHANGE = "editModeChange",
this.GRID_VISIBLE_CHANGE = "gridVisible",
this.EDIT_IN_RUN_CHANGE = "editInRun",
this.PLAYING_CHANGE = "playingChange",
this.PROPERTY_CHANGE = "propertyChange",
this.DATA_MODEL_CHANGE = "dataModelChange",
this.ACTIVE_NODE_CHANGE = "activeNodeChange",
this.ORIENTATION_CHANGE = "orientationChange",
this.SKIN_CHANGE = "skinChange",
this.GAME_SIZE_CHANGE = "gameSizeChange",
this.GAME_CHANGE = "gameChange",
this.SCENE_LOADED = "sceneLoaded",
this.SCENE_INITED = "sceneInited",
this.HIDDEN_SCENE_INITED = "hiddenSceneInited",
this.HIDDEN_SCENE_LOADED = "hiddenSceneLoaded",
this.ACTIVE_VIEW_CHANGE = "activeViewChange",
this.ACTIVE_DIALOG_CHANGE = "activeDialogChange",
this.INSPECTOR_VIEW_CLEAR = "inspectorViewClear",
this.EXPLORE = "explore",
this.BG_RESOURCE_LOADED = "bgResourceLoaded",
this.SCENE_RESOURCE_LOADED = "sceneResourceLoaded",
this.JS_CHANGED = "jsChanged",
this.INSPECTOR_COMP_VALUE_CHANGE = "inspectorCompValueChange",
this.SCENE_SAVED = "sceneSaved",
this.BEFORE_PUBLISH = "beforePublish",
this.AFTER_PUBLISH = "afterPublish",
this.GAME_INIT_OK = "gameInitOK",
this.PREFAB_BROKEN = "prefabBroken",
this.HIGHLIGHT_DATA = "highlightData"
}
;
da.prototype = {},
da.prototype.constructor = da,
da.prototype.on = function(a, b, c, d) {
return this._emitter.on(a, b, c, d)
}
,
da.prototype.off = function(a, b, c) {
return this._emitter.off(a, b, c)
}
,
da.prototype.emit = function(a, b) {
return this._emitter.emit(a, b)
}
;
var ea = m("qc.editor.Global", null, function() {
this.e = new qc.editor.Event,
this._jsPath = this.getJsPath(),
this._imgScale = 1.5 > l ? "1x" : "2x",
this.assetPath = this._jsPath + "imgs/" + this._imgScale + "/",
this.assetRootPath = this._jsPath + "imgs/",
this._gamePlugin = {
postRender: function() {
fa.inspector.update(),
fa.scene.checkForUpdate()
},
destroy: function() {}
},
qc.widget.Default.onViewFocused = function(a) {
a._activable && (fa.activeView = a)
}
});
ea.prototype._windowDisabled = !1,
ea.prototype.getJsPath = function() {
var a = document.scripts;
a = a[a.length - 1].src;
var b = a.substring(0, a.lastIndexOf("/") + 1);
return b
}
,
ea.prototype._hackpp = function() {
PIXI.DisplayObjectContainer.prototype.updateTransform = function() {
if (this.displayObjectUpdateTransform(),
!this._cacheAsBitmap)
for (var a = 0, b = this.children.length; b > a; a++)
this.children[a].updateTransform()
}
,
Phaser.Camera.prototype.reset = function() {
this.target = null,
fa.workable && fa.scene.editable ? (fa.scene.translateX = 0,
fa.scene.translateY = 0) : (this.view.x = 0,
this.view.y = 0)
}
,
PIXI.Text.prototype.getBounds = function(a) {
this.dirty && (this.updateText(),
this.dirty = !1);
var b = this.game.world.worldTransform.a
, c = this._canvasDownScale
, d = this.worldTransform;
d.tx = d.tx || 0,
d.ty = d.ty || 0;
var e = d.a
, f = d.b
, g = d.c
, h = d.d
, i = c.x * b
, j = c.y * b;
d.a *= i,
d.b *= i,
d.c *= j,
d.d *= j;
var k = PIXI.Sprite.prototype.getBounds.call(this, a);
return d.a = e,
d.b = f,
d.c = g,
d.d = h,
k
}
}
,
ea.prototype.startRunning = function(a) {
if (!fa.playing)
if (a) {
var b = fa.config.editor.currScene;
b === a ? fa.playing = !0 : qc.editor.Operation.SAVE_CURR_SCENE(function() {
qc.editor.Operation.SWITCH_SCENE(fa.config.scene.entryScene, function() {
fa.sceneToRestore = b,
fa.playing = !0
})
})
} else
fa.playing = !0
}
,
ea.prototype.stopRunning = function() {
fa.playing && (fa.playing = !1,
fa.sceneToRestore && (qc.editor.Operation.SWITCH_SCENE(fa.sceneToRestore),
delete fa.sceneToRestore))
}
,
ea.prototype.shutdown = function() {
this.workable && (qc.widget.Default.hideToolTip(),
this.undo.reset(),
a.removeEventListener("mouseup", this.game.__onMouseUpGlobal, !0),
this.game.shutdown())
}
,
ea.prototype.checkReloadForJsChange = function() {
!fa.reloadSceneOnFocus || fa.playing || fa.prefabInfo ? !fa.reloadEditorOnFocus || fa.playing || fa.prefabInfo || (fa.workable && (fa.e.emit(fa.e.JS_CHANGED),
qc.editor.Operation.SAVE_CURR_SCENE(function() {
fa.silentRefresh = !0,
a.location.reload()
})),
delete fa.reloadEditorOnFocus) : (fa.workable && (fa.e.emit(fa.e.JS_CHANGED),
fa.preference.query("autoRefresh") !== !1 && qc.editor.Operation.SAVE_CURR_SCENE(function() {
fa.scene.reload()
})),
delete fa.reloadSceneOnFocus)
}
,
ea.prototype.saveEditingPrefab = function() {
fa.prefabInfo && qc.editor.Operation.SAVE_PREFAB(fa.prefabInfo.prefab, fa.prefabInfo.treeData.id)
}
,
ea.prototype.cancelEditingPrefab = function(a, b) {
if (fa.prefabInfo) {
var d = function() {
var a = fa.prefabInfo.visibleMap;
for (var d in a) {
var e = fa.dataModel.getDataById(d);
e && (e.node.visible = a[d])
}
var f = [];
fa.game.world.children.forEach(function(b) {
a[b.uuid] === c && f.push(b)
}),
f.forEach(function(a) {
a.destroyImmediately()
}),
r(fa.prefabInfo.saveDiv),
r(fa.prefabInfo.cancelDiv),
fa.runBanner.findViewById("play").disabled = !1,
fa.prefabInfo = null,
fa.undo.reset(),
Bb(),
b && b()
}
, e = fa.prefabInfo.json
, f = JSON.stringify(fa.game.serializer.buildBundle(fa.prefabInfo.prefab, {}));
e === f || a ? d() : Hb(fa._("Do you want to save the changes?"), fa._("Prompt"), [{
text: fa._("Save"),
key: "enter",
onClick: function() {
this.hide(),
qc.editor.Operation.SAVE_PREFAB(fa.prefabInfo.prefab, fa.prefabInfo.treeData.id),
d()
}
}, {
text: fa._("Don't Save"),
onClick: function() {
this.hide(),
d()
}
}, {
text: fa._("Cancel"),
key: "esc",
onClick: function() {
this.hide()
}
}])
}
}
,
ea.prototype.startEditingPrefab = function(a) {
if (a && fa.workable) {
if (fa.playing)
return void fa.notification.warn(fa._("It is not allowed to edit prafab in running mode."));
var b = fa.game.assets.find(a.resUUID);
if (!b)
return void fa.notification.warn(fa._("Asset is not loaded, please try later."));
if (b.meta.type === this.ASSET_TYPE.ASSET_PREFAB) {
if (b.hasUnloadedDependence(fa.game))
return void fa.notification.warn(fa._("Asset is not loaded, please try later."));
var c = function() {
var c = fa.game.add.clone(b)
, d = {};
fa.game.world.children.forEach(function(a) {
a !== c && (d[a.uuid] = a.visible,
a.visible = !1)
}),
fa.prefabInfo = {
prefab: c,
asset: b,
treeData: a,
visibleMap: d
},
fa.game.world.addChild(c),
fa.runBanner.findViewById("play").disabled = !0;
var e = fa.prefabInfo.saveDiv = fa.scene.createDiv()
, f = e.style;
f.bottom = "10px",
f.right = "70px",
f.width = "50px",
f.cursor = "pointer",
f.textAlign = "center",
e.innerHTML = "Save",
e.onclick = function() {
fa.saveEditingPrefab()
}
;
var g = fa.prefabInfo.cancelDiv = fa.scene.createDiv()
, f = g.style;
f.bottom = "10px",
f.right = "10px",
f.width = "50px",
f.cursor = "pointer",
f.textAlign = "center",
g.innerHTML = "Cancel",
g.onclick = function() {
fa.cancelEditingPrefab(null, function() {
fa.scene.fitContent(!0),
fa.checkReloadForJsChange()
})
}
,
fa.undo.reset(),
Bb(),
fa.scene.focusData(fa.dataModel.getDataById(c.uuid), {
finishFunc: function() {
fa.prefabInfo.json = JSON.stringify(fa.game.serializer.buildBundle(c, {}))
}
})
};
fa.prefabInfo ? fa.cancelEditingPrefab(null, c) : c()
}
}
}
,
b.defineProperties(ea.prototype, {
assetSkinPath: {
get: function() {
return this._jsPath + "imgs/" + this._imgScale + "/" + this.skin + "/"
}
},
activeView: {
get: function() {
return this._activeView
},
set: function(a) {
var b = this._activeView;
b && (b.iv(),
b.invalidateSelection && b.invalidateSelection()),
this._activeView = a,
a && (a.iv(),
a.invalidateSelection && a.invalidateSelection()),
this.e.emit(this.e.ACTIVE_VIEW_CHANGE, {
oldValue: b,
newValue: a
}),
a && this.activeDialog && (this.activeDialog.view.contains(a.view) || (this.activeDialog = null))
}
},
activeDialog: {
get: function() {
return this._activeDialog
},
set: function(a) {
var b = this._activeDialog;
b !== a && (this._activeDialog = a,
this.e.emit(this.e.ACTIVE_VIEW_CHANGE, {
oldValue: b,
newValue: a
}))
}
},
workable: {
get: function() {
return this.game && this.game.phaser.world && this.game.getWindow()
}
},
editMode: {
get: function() {
return this._editMode
},
set: function(a) {
var b = this._editMode;
b !== a && (this._editMode = a,
this.e.emit(this.e.EDIT_MODE_CHANGE, {
oldValue: b,
newValue: a
}),
fa.storage.set("editMode", a))
}
},
projectPath: {
get: function() {
return this._projectPath
},
set: function(a) {
this._projectPath = a
}
},
windowFocused: {
get: function() {
return this._windowFocused
},
set: function(a) {
this._windowFocused = a
}
},
gridVisible: {
get: function() {
return this._gridVisible
},
set: function(a) {
var b = this._gridVisible;
b !== a && (this._gridVisible = a,
this.e.emit(this.e.GRID_VISIBLE_CHANGE, {
oldValue: b,
newValue: a
}),
fa.storage.set("gridVisible", a))
}
},
editInRun: {
get: function() {
return this._editInRun
},
set: function(a) {
var b = this._editInRun;
b !== a && (this._editInRun = a,
this.e.emit(this.e.EDIT_IN_RUN_CHANGE, {
oldValue: b,
newValue: a
}))
}
},
playing: {
get: function() {
return this._playing
},
set: function(a) {
var b = this._playing;
if (b !== a) {
if (fa.prefabInfo)
return void fa.notification.warn(fa._("Please first stop to edit prafab."));
fa.editInRun = !1,
this._playing = a,
this.e.emit(this.e.PLAYING_CHANGE, {
oldValue: b,
newValue: a
}),
this.shutdown()
}
}
},
orientation: {
get: function() {
return this._orientation
},
set: function(a) {
var b = this._orientation;
b !== a && (this._orientation = a,
this.e.emit(this.e.ORIENTATION_CHANGE, {
oldValue: b,
newValue: a
}))
}
},
windowDisabled: {
get: function() {
return this._windowDisabled
},
set: function(a) {
this._windowDisabled !== a && fa.mainContainer && (this._windowDisabled = a,
a ? (fa.mainContainer.setDisabled(!0, fa.assetPath + "loading.gif"),
fa.mainContainer.disabledBackground = "#333333",
fa.mainContainer.requestFocus(),
fa.mainContainer._disabledDiv.addEventListener("dblclick", function() {
fa.windowDisabled = !1
})) : (fa.mainContainer.setDisabled(!1),
fa.hierarchy.requestFocus()))
}
},
skin: {
get: function() {
return this._skin
},
set: function(a) {
var b = this._skin;
b !== a && (this._skin = a,
this.e.emit(this.e.SKIN_CHANGE, {
oldValue: b,
newValue: a
}))
}
},
gameSize: {
get: function() {
return this._gameSize
},
set: function(a) {
var b = this._gameSize;
this._gameSize = a,
this.e.emit(this.e.GAME_SIZE_CHANGE, {
oldValue: b,
newValue: a
})
}
},
highlightData: {
get: function() {
return this._highlightData
},
set: function(a) {
var b = this._highlightData;
b !== a && (this._highlightData = a,
this.e.emit(this.e.HIGHLIGHT_DATA, {
oldValue: b,
newValue: a
}))
}
},
dataModel: {
get: function() {
return this._dataModel
},
set: function(a) {
var b = this._dataModel;
this._dataModel = a,
this.e.emit(this.e.DATA_MODEL_CHANGE, {
oldValue: b,
newValue: a
})
}
},
game: {
get: function() {
return this._game
},
set: function(b) {
var c = this._game;
c && (c.plugins.remove(this._gamePlugin),
a.removeEventListener("mouseup", c.__onMouseUpGlobal, !0));
var d = b.getWindow();
a.Phaser = d.Phaser,
a.PIXI = d.PIXI;
for (var e in d.qc)
a.qc[e] = d.qc[e];
fa.inspector._nodesMap = [[qc.UIImage, qc.editor.ImagePanel], [qc.Button, qc.editor.ButtonPanel], [qc.UIText, qc.editor.UITextPanel], [qc.Toggle, qc.editor.TogglePanel], [qc.ScrollView, qc.editor.ScrollViewPanel], [qc.ScrollBar, qc.editor.ScrollBarPanel], [qc.Sound, qc.editor.SoundPanel], [qc.ProgressBar, qc.editor.ProgressBarPanel], [qc.Slider, qc.editor.SliderPanel], [qc.Sprite, qc.editor.SpritePanel], [qc.InputField, qc.editor.InputFieldPanel], [qc.Tilemap, qc.editor.TilemapPanel], [qc.TileLayer, qc.editor.TileLayerPanel], [qc.ObjectLayer, qc.editor.ObjectLayerPanel], [qc.Dom, qc.editor.DomPanel], [qc.Graphics, qc.editor.GraphicsPanel], [qc.Dropdown, qc.editor.DropdownPanel]],
this._hackpp(),
this._game = b,
b.canvas.tabIndex = -1,
b.plugins.add(this._gamePlugin),
b.__onMouseUpGlobal = b.input.mouse._onMouseUpGlobal,
a.addEventListener("mouseup", b.input.mouse._onMouseUpGlobal, !0),
this.gameDebugger && this.gameDebugger.destroy(),
this.gameDebugger = new qc.editor.GameDebugger(b),
this.dataModel = new qc.editor.GameModel(b),
this.e.emit(this.e.GAME_CHANGE, {
oldValue: c,
newValue: b
}),
d.__iframePointDown || (d.__iframePointDown = function(a) {
Yb(a.target) || (qc.widget.Default.closePopup(),
b.canvas.focus())
}
,
d.addEventListener("mousedown", d.__iframePointDown, !0),
d.addEventListener("touchstart", d.__iframePointDown, !0)),
d.__iframeContextMenu || (d.__iframeContextMenu = function(a) {
Yb(a.target) || a.preventDefault()
}
,
d.addEventListener("contextmenu", d.__iframeContextMenu, !0)),
d.__iframeKeydown || (d.__iframeKeydown = function(a) {
Yb(a.target) || (E(a) ? a.preventDefault() : P(a) && a.preventDefault())
}
,
d.addEventListener("keydown", d.__iframeKeydown, !1)),
fa.e.emit(fa.e.GAME_INIT_OK)
}
}
});
var fa = a.G = new ea
, ga = qc.editor.Clipboard = function() {
this.data = null,
this.type = ""
}
;
ga.prototype = {},
ga.prototype.constructor = ga;
var ha = function() {
var b = function(a) {
a.preventDefault()
};
a.addEventListener("dragenter", b, !1),
a.addEventListener("dragexit", b, !1),
a.addEventListener("dragover", b, !1),
a.addEventListener("drop", b, !1)
};
ha.prototype = {},
ha.prototype.constructor = ha,
b.defineProperties(ha.prototype, {
tip: {
get: function() {
if (!this._tip) {
this._tip = p();
var a = this.tip.style;
a.whiteSpace = "nowrap",
a.color = "white",
a.background = "rgba(0,0,0,0.5)",
a.font = k.labelFont,
a.padding = "6px",
a.borderRadius = "4px",
a.position = "absolute"
}
return this._tip
}
}
}),
ha.prototype.isDragging = function() {
var a = this.tip;
return a && a.parentNode ? !0 : void 0
}
,
ha.prototype.showTip = function(a, b) {
this.tip.innerHTML = a,
this.tip.parentNode !== document.body && document.body.appendChild(this.tip);
var c = C(b);
this.tip.style.left = c.x + 15 + "px",
this.tip.style.top = c.y + "px"
}
,
ha.prototype.hideTip = function() {
r(this.tip)
}
,
ha.prototype.clearDropView = function(a, b) {
this._dropView && (this._dropView.handleCrossDrag(a, "exit", b),
this._dropView = null)
}
,
ha.prototype.crossDrag = function(a, b) {
var c = this._dropView
, d = this._findDropView(a);
c !== d ? (c && c.handleCrossDrag(a, "exit", b),
d && d.handleCrossDrag(a, "enter", b)) : d && d.handleCrossDrag(a, "over", b),
this._dropView = d
}
,
ha.prototype.crossDrop = function(a, b) {
this._dropView && (this._dropView.handleCrossDrag(a, "drop", b),
this._dropView = null)
}
,
ha.prototype.crossCancel = function(a, b) {
this._dropView && (this._dropView.handleCrossDrag(a, "cancel", b),
this._dropView = null)
}
,
ha.prototype._findDropView = function(a) {
for (var b = Vb(a); b && !b._dropView; )
b = b.parentNode;
return b ? b._dropView : null
}
;
var ia = qc.editor.Storage = function(a) {
this.key = a + "_editor",
this.restore()
}
;
ia.prototype = {},
ia.prototype.constructor = ia,
ia.prototype.restore = function() {
try {
var b = a.localStorage.getItem(this.key);
this._data = b ? JSON.parse(b) : {},
b = a.localStorage.getItem("www.qiciengine.com"),
this._share = b ? JSON.parse(b) : {}
} catch (c) {}
}
,
ia.prototype.save = function() {
var b = JSON.stringify(this._data);
try {
a.localStorage.setItem(this.key, b)
} catch (c) {}
b = JSON.stringify(this._share);
try {
a.localStorage.setItem("www.qiciengine.com", b)
} catch (c) {}
}
,
ia.prototype.set = function(a, b) {
this._data[a] = b,
this.save()
}
,
ia.prototype.setShare = function(a, b) {
this._share[a] = b,
this.save()
}
,
ia.prototype.del = function(a) {
this._data[a] && delete this._data[a],
this.save()
}
,
ia.prototype.delShare = function(a) {
this._share[a] && delete this._share[a],
this.save()
}
,
ia.prototype.get = function(a) {
return this._data[a]
}
,
ia.prototype.getShare = function(a) {
return this._share[a]
}
;
var ja = function() {
var a = this;
a._emitter = new qc.widget.Emitter
};
ja.prototype = {},
ja.prototype.constructor = ja,
ja.prototype.onRecieveData = function(a) {
var b = this;
b.emit(a.command, a.data)
}
,
ja.prototype.sendData = function(a, b, c) {
try {
qc.editor.Operation.SERVICE_PIPE_COMMAND(a, b, c)
} catch (d) {
console.log(d)
}
}
,
ja.prototype.on = function(a, b, c, d) {
var e = this;
e._emitter.on(a, b, c, d)
}
,
ja.prototype.off = function(a, b, c) {
var d = this;
d._emitter.off(a, b, c)
}
,
ja.prototype.emit = function(a, b) {
var c = this;
try {
c._emitter.emit(a, b)
} catch (d) {
console.log(d)
}
}
,
qc.servicePipe = new ja;
var ka = m("qc.editor.ContextMenu", qc.widget.ContextMenu, function gf(a) {
var b = this;
gf["super"].constructor.call(b, a),
b._bindingHide = function() {
b.close()
}
});
ka.prototype.registerCloseEvent = function(a) {
ka["super"].registerCloseEvent.call(this, a),
fa.e.on(fa.e.JS_CHANGED, this._bindingHide)
}
,
ka.prototype.unregisterCloseEvent = function(a) {
ka["super"].unregisterCloseEvent.call(this, a),
fa.e.off(fa.e.JS_CHANGED, this._bindingHide)
}
;
var la = m("qc.editor.ItemNodeUI", qc.widget.graph.NodeUI, function hf(a, b) {
var c = this;
hf["super"].constructor.call(c, a, b)
});
la.prototype.drawBody = function(a) {
var b = this
, c = b.data
, d = b.gv
, e = c._position
, f = c._anchor
, g = c._rotation
, h = c.width
, i = c.height
, j = c._scale
, l = j.x
, m = j.y
, n = {
x: -h * f.x,
y: -i * f.y,
width: h,
height: i
};
n.x += e.x,
n.y += e.y;
var o = g || 1 !== l || 1 !== m;
o && (a.save(),
k.gTranslate(a, e.x, e.y),
k.gRotate(a, g),
a.scale(l, m),
k.gTranslate(a, -e.x, -e.y)),
"list" === d.layout && d.isSelected(c) && (a.beginPath(),
a.fillStyle = d === fa.activeView ? d._selectBackground : d._inactiveSelectBackground,
a.rect(0, n.y, d.viewRect.width, n.height),
a.fill()),
o && a.restore(),
la["super"].drawBody.call(b, a)
}
;
var ma = m("qc.editor.ItemNode", qc.widget.graph.Node, function jf(a) {
var b = this;
jf["super"].constructor.call(b, a),
b.s("select.width", 0),
b.s("pixel.perfect", !1),
b.anchor = {
x: 0,
y: 0
}
}, {
_wrapImage: {
width: {
func: function(a) {
return a._width || 48
}
},
height: {
func: function(a) {
return a._height || 48
}
},
clip: !0,
comps: {
func: function(a) {
return a.getImageComps()
}
}
}
}, {}, {
uiClass: {
get: function() {
return la
}
},
image: {
set: function(a) {
qc.editor.ItemNode.setSuperProperty(this, "image", a)
},
get: function() {
return this._wrapImage
}
}
});
ma.prototype.getImageComps = function() {
return [{
type: "image",
stretch: null,
name: {
func: function(a, b) {
var c = a._canvas;
if (c)
return c;
var d = k.getImage(a._image);
if (d && "[object HTMLImageElement]" === d.toString() && null != a.a("clipX")) {
var e = a.width
, f = a.height;
"list" === b.layout && (e = f,
f = f),
c = a._canvas = document.createElement("canvas"),
t(c, e, f);
var g, h = s(c, 0, 0, 1), i = (a.a("clipX"),
a.a("clipY"),
a.a("clipWidth")), j = a.a("clipHeight");
(i > e || j > f) && (g = Math.min(e / i, f / j),
i *= g,
j *= g);
var l = Math.round((e - i) / 2)
, m = Math.round((f - j) / 2);
return h.drawImage(d, a.a("clipX"), a.a("clipY"), a.a("clipWidth"), a.a("clipHeight"), l, m, i, j),
h.restore(),
c
}
return d
}
},
rect: {
func: function(a, b) {
var c, d = b._indent;
return "tile" === b.layout ? b._itemImageRect : c = [b.getListIndent(a), 1, d, b._rowHeight - 2]
}
},
shadow: {
func: function(a, b) {
return b.isSelected(a)
}
},
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowBlur: 6
}]
}
,
ma.prototype._imageRelativeProperties = {
"a:clipX": !0,
"a:clipY": !0,
"a:clipWidth": !0,
"a:clipHeight": !0,
image: !0,
width: !0,
height: !0
},
ma.prototype.onPropertyChange = function(a) {
ma["super"].onPropertyChange.call(this, a);
var b = this;
b._imageRelativeProperties[a.property] && (b._canvas = null)
}
;
var na = m("qc.editor.ItemList", qc.widget.graph.GraphView, function kf(a) {
var b = this;
kf["super"].constructor.call(b);
var c = b.dataModel;
b.autoMakeVisible = !0,
c.indexAdjustable = !1,
b.on("viewChange", function(a) {
b._doLayoutFlag && ("beginValidate" === a.kind ? b.doLayout() : "endValidate" === a.kind && (b.translate(0, 0),
b._doLayoutFlag = !1))
}),
b.editable = !1,
c.on("dataModelChange", function() {
b._doLayoutFlag = !0
}),
b.on("propertyChange", function(a) {
b._doLayoutProperties[a.property] && (b._doLayoutFlag = !0),
("itemWidth" === a.property || "itemHeight" === a.property) && b.calcItemImageRect()
}),
b.calcItemImageRect(),
k.initObject(b, a),
b.movableFunc = function() {
return !1
}
}, {
_layout: "tile",
_itemWidth: 48,
_itemHeight: 48,
_itemGap: 16
}, {
properties: ["layout", "itemWidth", "itemHeight", "itemGap"]
});
na.prototype._doLayoutProperties = {
width: !0,
height: !0,
itemWidth: !0,
itemHeight: !0,
layout: !0,
itemGap: !0,
visibleFunc: !0
},
na.prototype.calcItemImageRect = function() {
var a = this;
"tile" === a.layout && (a._itemImageRect = [4, 4, a.itemWidth - 8, a.itemHeight - 8])
}
,
na.prototype.adjustTranslateX = function() {
return 0
}
,
na.prototype.adjustTranslateY = function(a) {
if (0 > a) {
var b = this.contentRect
, c = this.viewRect
, d = this.itemGap;
if ("tile" === this.layout && b.height + d <= c.height || "list" === this.layout && b.height <= c.height)
return 0;
var e = c.height;
return "tile" === this.layout && (e -= d),
-a > b.height - e ? -b.height + e : a
}
return 0
}
,
na.prototype.setZoomImpl = function() {}
,
na.prototype.handleScroll = function(a, b) {
this.translate(0, b * (k.isFirefox ? 40 : 1), !1),
k.preventDefault(a),
a.stopPropagation()
}
,
na.prototype.getListLabelIndent = function() {
var a = this
, b = a._indent;
return 2 * b
}
,
na.prototype.getListIndent = function() {
var a = this
, b = a._indent;
return b
}
,
na.prototype.calcRightGap = function() {
return this.itemGap
}
,
na.prototype.doLayout = function() {
var a, b = this, c = b.layout, d = b.dataModel, e = [], f = b.itemWidth, g = b.itemHeight, h = b.itemGap, i = b.clientWidth;
if (d.datas.forEach(function(a) {
b.isVisible(a) && e.push(a)
}),
"list" === c) {
g = b._rowHeight;
for (var j = 0; j < e.length; j++) {
a = e[j];
var k = b.getListLabelIndent(a);
a.width = i,
a.height = g,
a.s("label.position", 16),
a.s("label.offset.x", k),
a.s("label.offset.y", 0),
a.s("label.max", null),
a.x = 0,
a.y = g * j
}
} else if ("tile" === c) {
var l = 0
, m = 0
, n = 0
, o = f + h
, p = g + h + 16;
l += h,
m += h;
for (var j = 0; j < e.length; j++)
a = e[j],
a.width = f,
a.height = g,
a.s("label.position", 31),
a.s("label.offset.y", 1),
a.s("label.offset.x", 0),
a.s("label.max", f),
a.x = l,
a.y = m,
(n + 2) * o + b.calcRightGap() > i ? (l = h,
j !== e.length - 1 && (m += p),
n = 0) : (l += o,
n++)
}
}
,
b.defineProperty(na.prototype, "scrollRect", {
get: function() {
var a = this
, b = a._viewRect
, c = k.unionRect(a.contentRect, b);
return c.height += c.y,
c.y = 0,
c
}
});
var oa = m("qc.editor.EditorTree", qc.widget.Tree, function(a) {
oa["super"].constructor.call(this, a),
this.editable = !0,
this.dragToIndexEnabled = !0,
this.clearSelectionOnBackgroundClicked = !0,
this._lastClickTime = (new Date).getTime(),
this.addTopPainter(this.drawDNDState),
this.view._dropView = this
});
b.defineProperties(oa.prototype, {
editable: {
get: function() {
return this._editable
},
set: function(a) {
this._editable = a
}
},
topRowOrderSelection: {
get: function() {
var a = this.selectionModel.topSelection
, b = {}
, c = [];
return a.forEach(function(a) {
b[a.uuid] = a
}),
this.validateImpl(),
this.rowDatas.forEach(function(a) {
b[a.uuid] && c.push(a)
}),
c
}
}
}),
oa.prototype._clearDragInfo = function() {
fa.dragAndDrop.hideTip(),
this._dragInfo && (this._dragInfo = null,
this.iv())
}
,
oa.prototype._endDrag = function() {}
,
oa.prototype._endCrossDrag = function() {}
,
oa.prototype.drawDNDState = function(a) {
var b;
if (this._dragInfo && this._dragInfo.inView ? b = this._dragInfo : this._crossDragInfo && (b = this._crossDragInfo),
b && null != b.type && null != b.rowIndex) {
var c = this.clientWidth
, d = this.rowHeight
, e = b.rowIndex
, f = b.type;
a.beginPath(),
a.rect(0, e * d, c, d),
a.fillStyle = "rgba(0, 0, 0, 0.3)",
a.fill(),
"up" === f ? (a.beginPath(),
a.moveTo(0, e * d),
a.lineTo(c, e * d)) : "down" === f ? (a.beginPath(),
a.moveTo(0, (e + 1) * d),
a.lineTo(c, (e + 1) * d)) : "parent" === f && (a.beginPath(),
k.drawShape(a, "roundRect", {
x: 1,
y: e * d,
width: c - 2,
height: d
})),
a.lineWidth = 2,
a.strokeStyle = "#507aea",
a.stroke()
}
}
,
oa.prototype._dragging = function(a, b) {
var c = this.rowHeight
, d = this.lp(a)
, e = d.y / c
, f = Math.floor(e);
if (f > this.rowDatas.length - 1)
b.rowIndex = this.rowDatas.length - 1,
b.type = "down";
else {
b.rowIndex = f;
var g = d.y - f * c;
b.type = .25 * c > g ? "up" : g > .75 * c ? "down" : "parent"
}
this.dragToIndexEnabled || (b.type = "parent"),
this.autoScroll(a),
this.iv()
}
,
oa.prototype.handleDragAndDrop = function(a, b) {
if ("prepare" === b)
return void this._clearDragInfo();
if ("begin" === b) {
var c = this.draggingData.name;
if (this.isSelected(this.draggingData)) {
var d = this.selection.length;
c += d > 1 ? " (+" + d + ") " : ""
}
this._dragInfo = {
tip: c,
view: this
}
}
var e = this._dragInfo;
if (e) {
if ("begin" === b || "between" === b) {
var f = this.view.contains(Vb(a));
return f ? (e.inView = !0,
this._dragging(a, e),
fa.dragAndDrop.clearDropView(a, e)) : (e.inView && this.iv(),
e.inView = !1,
fa.dragAndDrop.crossDrag(a, e)),
void fa.dragAndDrop.showTip(e.tip, a)
}
return "end" === b ? (e.inView ? this._endDrag(a, e) : fa.dragAndDrop.crossDrop(a, e),
void this._clearDragInfo()) : "cancel" === b ? (e.inView || fa.dragAndDrop.crossCancel(a, e),
void this._clearDragInfo()) : void 0
}
}
,
oa.prototype.handleCrossDrag = function(a, b, c) {
return "exit" === b || "cancel" === b ? (this._crossDragInfo = null,
void this.iv()) : "enter" === b || "over" === b ? (this._crossDragInfo || (this._crossDragInfo = {}),
void this._dragging(a, this._crossDragInfo)) : "drop" === b ? (this._endCrossDrag(a, c),
this._crossDragInfo = null,
void this.iv()) : void 0
}
,
oa.prototype.handleDataDoubleSelect = function(a, b) {
var c = this;
if (c.editable) {
if (c._pendingEditing)
return void (c._pendingEditing = "cancel");
if (!L(a)) {
var d = c.getLevel(b);
d++,
c.getIcon(b) && d++,
c.lp(a).x > d * c.indent && (c._pendingEditing = !0,
setTimeout(function() {
c._pendingEditing && (k.popup || "cancel" === c._pendingEditing || !c.isSelected(b) || c !== fa.activeView || b.isProjectDir || c.beginEditing(b),
delete c._pendingEditing)
}, 700))
}
}
}
,
oa.prototype.beginEditing = function(a) {
var b = this;
if (b === fa.hierarchy && b.drawRow === qc.widget.List.prototype.drawRow) {
var c = 0
, d = b.rowHeight
, e = b.getRowIndex(a) * d + b.translateY
, f = b.width - c
, g = new qc.widget.TextField
, h = g.getInput()
, i = a.name;
b._currentEditor = g,
b.view.appendChild(g.view),
n(g, c, e, f, d)
} else {
var j = b.getLevel(a);
j++,
b.getIcon(a) && j++;
var c = j * b.indent + 1
, d = b.rowHeight
, e = b.getRowIndex(a) * d + this.translateY
, f = b.width - c
, g = new qc.widget.TextField
, h = g.getInput()
, i = a.name;
b === fa.fileTree && (g.maskRe = /[^\s\\/'"?\.]/),
b._currentEditor = g,
b.view.appendChild(g.view),
n(g, c, e, f, d)
}
h.style.font = this.getLabelFont(a),
h.onblur = function() {
b.endEditing()
}
,
h.onkeydown = function(a) {
G(a) ? b.endEditing() : F(a) && b.cancelEditing()
}
,
g._data = a,
g.value = null == i ? "" : i,
h.focus(),
U(h.select, h)
}
,
oa.prototype.rename = function(a, b) {
a.name = b
}
,
oa.prototype.endEditing = function() {
var a = this._currentEditor;
a && (this.rename(a._data, a.value),
delete this._currentEditor,
r(a.view),
this.iv())
}
,
oa.prototype.cancelEditing = function() {
var a = this._currentEditor;
a && (delete this._currentEditor,
r(a.view),
this.iv())
}
;
var pa = m("qc.editor.DraggableButtonInteractor", b, function(a) {
var b = this;
b._draggableButton = a,
b.addListeners()
}, {
clear: function(a) {
var b = this
, c = b.view;
"dnd" !== b._state || b._dragCancel || c.handleDragAndDrop(a, "end"),
b._state = b._clientPoint = b._dragCancel = null
},
handle_mousedown: function(a) {
this.handle_touchstart(a)
},
handle_touchstart: function(a) {
var b = this
, c = b.view;
b.clear(a),
Y(a),
c.requestFocus(),
b._clientPoint = B(a),
N(a) && (c.handleDragAndDrop && c.handleDragAndDrop(a, "prepare"),
c.state = "active",
z(b, a))
},
handleWindowMouseMove: function(a) {
this.handleWindowTouchMove(a)
},
handleWindowTouchMove: function(a) {
var b = this
, c = b.view
, d = b._state
, e = b._clientPoint
, f = B(a);
if (d)
"dnd" !== d || b._dragCancel || c.handleDragAndDrop(a, "between");
else {
var g = y(f, e);
if (2 > g)
return;
this._dragCancel || (b._state = "dnd",
c.handleDragAndDrop(a, "begin"))
}
},
handle_mouseenter: function() {
var a = this._draggableButton;
k.isDragging() || (a.state = "hover")
},
handle_mouseleave: function() {
var a = this._draggableButton;
a.state = "normal"
},
handleWindowMouseUp: function(a) {
this.handleWindowTouchEnd(a)
},
handleWindowTouchEnd: function(a) {
var b = this
, c = b._draggableButton;
c.state = c.view.contains(a.target) ? "hover" : "normal",
c.view.contains(a.target) && !c._dragInfo && (c.validate(),
c.emit("click", a)),
b.clear(a)
},
handle_keydown: function(a) {
var b = this
, c = b.view;
F(a) && ("dnd" !== b._state || b._dragCancel || (c.handleDragAndDrop(a, "cancel"),
b._dragCancel = !0))
}
}, {
interactor: !0
}, {
view: {
get: function() {
return this._draggableButton
}
}
})
, qa = m("qc.editor.DraggableButton", qc.widget.Button, function(a) {
var b = this;
qc.widget.Button["super"].constructor.call(b, a),
b._interactor = new pa(b)
});
qa.prototype.handleDragAndDrop = function(a, b) {
if ("prepare" === b)
return void this._clearDragInfo();
"begin" === b && (this._dragInfo = {
view: this,
tip: this.id.replace("Create", "")
});
var c = this._dragInfo;
if (c)
return "begin" === b || "between" === b ? (fa.dragAndDrop.crossDrag(a, c),
void fa.dragAndDrop.showTip(c.tip, a)) : "end" === b ? (fa.dragAndDrop.crossDrop(a, c),
void this._clearDragInfo()) : "cancel" === b ? (fa.dragAndDrop.crossCancel(a, c),
void this._clearDragInfo()) : void 0
}
,
qa.prototype._clearDragInfo = function() {
fa.dragAndDrop.hideTip(),
this._dragInfo = null
}
;
var ra = (m("qc.editor.Button", qc.widget.Button, function lf(a) {
var b = this;
lf["super"].constructor.call(b, a)
}),
m("qc.editor.InspectorButton", qc.editor.Button, function mf(a) {
var b = this;
mf["super"].constructor.call(b, a)
}),
m("qc.editor.ToggleButton", qc.widget.ToggleButton, function nf(a) {
var b = this;
nf["super"].constructor.call(b, a),
b.on("propertyChange", function(a) {
"selected" === a.property && b.onValueChanged && b.onValueChanged(b.formattedValue)
})
}));
ra.prototype.formatValue = function() {
return !!this.selected
}
,
b.defineProperties(ra.prototype, {
formattedValue: {
get: function() {
return this.formatValue()
}
},
onValueChanged: {
get: function() {
return this._onValueChanged
},
set: function(a) {
this.setPropertyValue("onValueChanged", a)
}
}
});
var sa = m("qc.editor.ButtonGroup", qc.widget.ButtonGroup, function of(a) {
var b = this;
of["super"].constructor.call(b, a),
b.scrollBarMode = "off",
b.on("propertyChange", function(a) {
"value" === a.property && b.onValueChanged && b.onValueChanged(b.formattedValue)
}),
b.eachable = !1
});
sa.prototype.formatValue = function(a) {
return a
}
,
b.defineProperties(sa.prototype, {
onValueChanged: {
get: function() {
return this._onValueChanged
},
set: function(a) {
this.setPropertyValue("onValueChanged", a)
}
},
formattedValue: {
get: function() {
return this.formatValue(this.value)
}
}
});
var ta = m("qc.editor.CheckBox", qc.widget.CheckBox, function pf() {
var a = this;
pf["super"].constructor.call(a),
a.on("propertyChange", function(b) {
"selected" === b.property && a.onValueChanged && a.onValueChanged(a.formattedValue)
}),
a.align = "left"
});
ta.prototype.formatValue = function() {
return !!this.selected
}
,
b.defineProperties(ta.prototype, {
formattedValue: {
get: function() {
return this.formatValue()
}
},
onValueChanged: {
get: function() {
return this._onValueChanged
},
set: function(a) {
this.setPropertyValue("onValueChanged", a)
}
}
});
var ua = m("qc.editor.ColorChooserDropDown", qc.widget.ColorChooserDropDown, function(a) {
ua["super"].constructor.call(this, a)
});
ua.prototype.createDialog = function() {
var a = this
, b = new qc.editor.Dialog;
return b.contentPadding = [2, 4, 3, 4],
b.on("show", function() {
a.master.emit("onDialogShow")
}),
b.on("close", function() {
a.master.emit("onDialogClose")
}),
b
}
;
var va = m("qc.editor.ColorPicker", qc.widget.ComboBox, function qf(a) {
var b = this;
a || (a = {}),
null == a["dropDown.colorChooser.alphaEnabled"] && (a["dropDown.colorChooser.alphaEnabled"] = !0),
qf["super"].constructor.call(b, a),
b.dropDown = "qc.editor.ColorChooserDropDown",
b._bindingClose = b.close.bind(b),
b.on("propertyChange", function(a) {
"value" === a.property && b.onValueChanged && b.onValueChanged(b.formattedValue)
}),
b.on("onDialogShow", function() {
b._showValue = b.value
}),
b.on("onDialogClose", function() {
if (b.onEndEdit) {
var a = b.value !== b._showValue;
b.onEndEdit(a, b.value)
}
})
});
va.prototype._instant = !0,
va.prototype.registerCloseEvent = function(a) {
var b = this;
va["super"].registerCloseEvent.call(b, a),
fa.e.on(fa.e.JS_CHANGED, b._bindingClose)
}
,
va.prototype.unregisterCloseEvent = function(a) {
var b = this;
va["super"].unregisterCloseEvent.call(b, a),
fa.e.off(fa.e.JS_CHANGED, b._bindingClose)
}
,
va.prototype.hasFocus = function() {
var a = document.activeElement
, b = this.view;
return b.contains(a) ? !0 : this.isOpen() ? !0 : void 0
}
,
va.prototype.formatValue = function(a) {
return a ? new qc.Color([a.r, a.g, a.b, a.a / 255]) : void 0
}
,
b.defineProperties(va.prototype, {
onValueChanged: {
get: function() {
return this._onValueChanged
},
set: function(a) {
this.setPropertyValue("onValueChanged", a)
}
},
formattedValue: {
get: function() {
return this.formatValue(this.value)
}
},
value: {
set: function(a) {
var b;
a instanceof qc.Color ? (a = a || new qc.Color(16777215),
b = {
r: a.rgb[0],
g: a.rgb[1],
b: a.rgb[2]
},
b.a = a.alpha,
a = a.toNumber(!0)) : null != a && "object" == typeof a && null != a.r && null != a.g && null != a.b && null != a.a && (b = {
r: a.r,
g: a.g,
b: a.b,
a: a.a
},
b.a = b.a / 255),
"number" == typeof a && this._componentConfig["colorChooser.alphaEnabled"] === !1 && (a = 4278190080 | a,
b && (b.a = 1));
var c = this._value;
b && c ? b.r === c.r && b.g === c.g && b.b === c.b && Math.round(255 * b.a) === c.a || va.setSuperProperty(this, "value", a) : b != c && va.setSuperProperty(this, "value", a)
},
get: function() {
return va.getSuperProperty(this, "value")
}
}
});
var wa = m("qc.editor.DropDownList", qc.widget.DropDownList, function rf(a) {
var b = this;
rf["super"].constructor.call(b, a),
b._bindingHandleExpand = b.handleExpand.bind(b),
b._bindingHandleCollapse = b.handleCollapse.bind(b),
b._bindingHandleListKeyPress = b.handleListKeyPress.bind(b),
b._bindingHandleListKeyDown = b.handleListKeyDown.bind(b),
b._bindingListFilterPainter = b.listFilterPainter.bind(b),
b._bindingCollapse = b.collapse.bind(b),
b.on("expand", b._bindingHandleExpand),
b.on("collapse", b._bindingHandleCollapse),
b.on("propertyChange", function(a) {
"value" === a.property && b.onValueChanged && b.onValueChanged(b.formattedValue)
})
});
wa.prototype.hasFocus = function() {
var a = document.activeElement
, b = this.view;
return b.contains(a) ? !0 : this.isExpanded() ? !0 : void 0
}
,
wa.prototype.registerCloseEvent = function(a) {
var b = this;
wa["super"].registerCloseEvent.call(b, a),
fa.e.on(fa.e.JS_CHANGED, b._bindingCollapse)
}
,
wa.prototype.unregisterCloseEvent = function(a) {
var b = this;
wa["super"].unregisterCloseEvent.call(b, a),
fa.e.off(fa.e.JS_CHANGED, b._bindingCollapse)
}
,
wa.prototype.handleExpand = function(a) {
var b = this
, c = a.list;
c.addEventListener("keypress", b._bindingHandleListKeyPress),
c.addEventListener("keydown", b._bindingHandleListKeyDown),
c.addTopPainter(b._bindingListFilterPainter),
b._filterStr = ""
}
,
wa.prototype.handleCollapse = function(a) {
var b = this
, c = a.list;
c.removeEventListener("keypress", b._bindingHandleListKeyPress),
c.removeEventListener("keydown", b._bindingHandleListKeyDown),
c.removeTopPainter(b._bindingListFilterPainter),
b._filterStr = ""
}
,
wa.prototype.handleListKeyDown = function(a) {
var b = this
, c = b._list
, d = b._filterStr || "";
k.isDelete(a) ? d = d.substr(0, d.length - 1) : k.isEsc(a) && ("" === d ? b.collapse() : d = ""),
b._filterStr = d,
c.visibleFunc = function(a) {
return a.name.toLowerCase().indexOf(d.toLowerCase()) >= 0
}
,
a.stopPropagation(),
k.preventDefault(a)
}
,
wa.prototype.handleListKeyPress = function(a) {
var b = this
, c = b._list
, d = b._filterStr || "";
d += String.fromCharCode(a.charCode),
b._filterStr = d,
c.visibleFunc = function(a) {
return a.name.toLowerCase().indexOf(d.toLowerCase()) >= 0
}
,
a.stopPropagation(),
k.preventDefault(a)
}
,
wa.prototype.listFilterPainter = function(a) {
var b = this
, c = b._list
, d = c.translateY
, e = b._filterStr;
if (e) {
e = "S: " + e;
var f = k.getTextSize(k.labelFont, e)
, g = c.clientWidth;
a.beginPath(),
a.rect(g - f.width, -d, f.width, c.rowHeight),
a.fillStyle = b._dropDownBackground,
a.fill(),
k.drawText(a, e, k.labelFont, b._filterColor, g - f.width, -d, f.width, c.rowHeight, "right", "top")
}
}
,
wa.prototype.formatValue = function(a) {
return a
}
,
wa.prototype._drawIcon = function(a) {
var b = this
, c = b.getStateIcon()
, d = b.clientHeight
, e = b.clientWidth
, f = d
, g = d
, h = e - f
, i = 0;
k.drawImage(a, c, null, h, i, f, g, null, b)
}
,
wa.prototype._icon = {
width: {
func: function(a, b) {
return b.height
}
},
height: {
func: function(a, b) {
return b.height
}
},
comps: [{
type: "triangle",
background: {
func: function(a, b) {
return b.iconForeColor
}
},
rect: [.28, .25, .44, .22],
relative: !0
}, {
type: "triangle",
background: {
func: function(a, b) {
return b.iconForeColor
}
},
rect: [.28, .58, .44, .22],
rotation: Math.PI,
relative: !0
}]
},
b.defineProperties(wa.prototype, {
iconForeColor: {
get: function() {
return this._iconForeColor
},
set: function(a) {
this.setPropertyValue("iconForeColor", a)
}
},
onValueChanged: {
get: function() {
return this._onValueChanged
},
set: function(a) {
this.setPropertyValue("onValueChanged", a)
}
},
formattedValue: {
get: function() {
return this.formatValue(this.value)
}
}
});
var xa = m("qc.editor.MultiDropDownList", qc.editor.DropDownList, function sf(a) {
var b = this;
sf["super"].constructor.call(b, a),
b.selectionMode = "multiple"
});
xa.prototype.getLabel = function(a) {
if (k.isArray(a)) {
var b = "";
if (a.length < 4)
for (var c = 0; c < a.length; c++) {
var d = a[c]
, e = this._labelMap[d];
b += c === a.length - 1 ? e : e + ","
}
else
b = "Mixed...";
return b
}
return ""
}
,
xa.prototype._setValue = function(a) {
var b = this;
if ("Nothing" === a)
b.value = [];
else if ("Everything" === a) {
var c = b.items;
a = [];
for (var d = 2; d < c.length; d++) {
var e = c[d];
e && a.push(k.isString(e) ? e : e.value)
}
b.value = a
} else
xa["super"]._setValue.call(this, a)
}
,
b.defineProperties(xa.prototype, {
items: {
set: function(a) {
a || (a = []);
var b = a[0];
k.isString(b) ? (k.addArray(a, "Everything", 0),
k.addArray(a, "Nothing", 0)) : (k.addArray(a, {
label: "Everything",
value: "Everything"
}, 0),
k.addArray(a, {
label: "Nothing",
value: "Nothing"
}, 0)),
xa.setSuperProperty(this, "items", a)
},
get: function() {
return xa.getSuperProperty(this, "items")
}
}
});
var ya = m(null, b, function(a) {
var b = this;
b._text = a,
b.addListeners()
}, {
clear: function() {},
handle_mousedown: function(a) {
this.handle_touchstart(a)
},
handle_touchstart: function(a) {
Y(a)
},
handle_mouseup: function(a) {
this.handle_touchend(a)
},
handle_touchend: function() {},
handleWindowMouseMove: function(a) {
this.handleWindowTouchMove(a)
},
handleWindowTouchMove: function() {},
handleWindowMouseUp: function(a) {
this.handleWindowTouchEnd(a)
},
handleWindowTouchEnd: function() {}
}, {
interactor: !0
}, {
view: {
get: function() {
return this._text
}
}
})
, za = m("qc.editor.Text", b, function(a) {
var b = this
, c = b._view = k.createDiv();
c.style.setProperty("-webkit-user-select", "none", null),
c.style.setProperty("user-select", "none", null),
c.style.whiteSpace = "nowrap",
c.style.overflow = "hidden",
b.cursor = "default",
new ya(b),
k.initObject(b, a)
}, {
_preferredSizeProperties: ["text", "padding", "textFont"],
_padding: [0, 0, 0, 0],
_align: "left",
_textColor: k.Color.labelColor,
_textFont: k.labelFont
}, {
view: !0,
emitter: !0,
toolTip: !0,
properties: ["text", "align", "textColor", "textFont", "background", "padding"]
});
b.defineProperty(za.prototype, "cursor", {
get: function() {
return this._view.style.cursor
},
set: function(a) {
this._view.style.cursor = a
}
}),
b.defineProperty(za.prototype, "textSize", {
get: function() {
var a = this
, b = a.text;
return b ? k.getTextSize(a.textFont, b) : {
width: 0,
height: 0
}
}
}),
b.defineProperty(za.prototype, "toolTip", {
get: function() {
return this._toolTip
},
set: function(a) {
this.setPropertyValue("toolTip", a),
a ? this.enableToolTip() : this.disableToolTip()
}
}),
za.prototype.addEventListener = function(a, b, c) {
this._view.addEventListener(a, b, c)
}
,
za.prototype.removeEventListener = function(a, b, c) {
this._view.removeEventListener(a, b, c)
}
,
za.prototype.onPropertyChange = function(a) {
var b = this
, c = a.property;
("text" === c || "textFont" === c) && (b._textSize = b.textSize),
b.checkChildPreferredSizeChange(c),
b.iv()
}
,
za.prototype.getToolTipAt = function() {
return this.toolTip
}
,
za.prototype.getPreferredSize = function() {
var a = this
, b = a._preferredSize || a._calcdPreferredSize;
if (!b) {
var c = a._textSize || a.textSize
, d = a.padding;
c = {
width: c.width,
height: c.height
},
k.isArray(d) ? (c.width += d[1] + d[3],
c.height += d[0] + d[2]) : (c.width += 2 * d,
c.height += 2 * d),
c.width = Math.round(c.width),
c.height = Math.round(c.height),
b = a._calcdPreferredSize = c
}
return b
}
,
za.prototype.validateImpl = function() {
var a = this
, b = a._view
, c = a.background
, d = a.text
, e = a.textColor
, f = a.textFont
, g = a.padding
, h = a.align;
b.innerHTML = d || "",
null != e && (b.style.color = e),
null != f && (b.style.font = f),
null != h && (b.style.textAlign = h),
null != c && (b.style.background = c),
null != g && (b.style.padding = k.isArray(g) ? g[0] + "px " + g[1] + "px " + g[2] + "px " + g[3] + "px" : g + "px"),
b.style.lineHeight = a.height + "px"
}
;
var Aa = m("qc.editor.Label", qc.widget.Label, function tf(a) {
var b = this;
tf["super"].constructor.call(b, a),
b.align = "left"
});
b.defineProperties(Aa.prototype, {
style: {
get: function() {
return this.view.style
}
}
});
var Ba = m("qc.editor.StringInput", qc.widget.TextField, function uf(a) {
var b = this;
b._autoSelect = !0,
uf["super"].constructor.call(b, a),
b.on("propertyChange", function(a) {
"value" === a.property && b.onValueChanged && b.onValueChanged(b.formattedValue)
});
var c = b.getInput();
c.addEventListener("mousedown", function() {
b.autoSelect && !c.contains(document.activeElement) && setTimeout(function() {
c.select()
}, 30)
}),
c.onfocus = function() {
b._focusValue = b.formattedValue
}
,
c.onblur = function() {
var a = b.formattedValue !== b._focusValue;
b.onEndEdit && b.onEndEdit(a)
}
});
Ba.prototype.formatValue = function(a) {
return a
}
,
b.defineProperties(Ba.prototype, {
onValueChanged: {
get: function() {
return this._onValueChanged
},
set: function(a) {
this.setPropertyValue("onValueChanged", a)
}
},
formattedValue: {
get: function() {
return this.formatValue(this.value)
}
},
autoSelect: {
get: function() {
return this._autoSelect
},
set: function(a) {
this.setPropertyValue("autoSelect", a)
}
}
});
var Ca = m("qc.editor.ObjectList", qc.editor.ItemList, function vf() {
var a = this;
vf["super"].constructor.call(a),
a.addBottomPainter(a.drawFollowersBackground.bind(a))
});
Ca.prototype.getListIndent = function(a) {
var b = this
, c = b._indent;
return a.master ? 2 * c : c
}
,
Ca.prototype.getListLabelIndent = function(a) {
var b = this
, c = b._indent;
return a.master ? 3 * c : 2 * c
}
,
Ca.prototype.calcRightGap = function() {
var a = this.itemWidth
, b = this.itemGap;
return Math.max(b, a / 48 * 16 - a / 48 * 5)
}
,
Ca.prototype.isOnExpandIcon = function(a, b) {
if (b) {
var c = this
, d = c.lp(a);
if ("tile" === c.layout) {
var e = c.getDataUI(b)
, f = e.nodeInfo
, g = f.expandIconRect;
if (g && v(g, d))
return !0
} else {
var h = b.rect;
if (h.width = c._indent,
h.height = c._rowHeight,
b.followers && v(h, d))
return !0
}
}
}
,
Ca.prototype.drawFollowersBackground = function(a) {
var b = this
, c = b.dataModel
, d = c.datas;
if ("list" !== b.layout)
for (var e = 0; e < d.length; e++) {
var f = d[e]
, g = f.followers;
if (g && g.length > 0 && f.expand)
for (var h = 0; h < g.length; h++) {
var i = g[h]
, j = i.rect;
j.x -= 8,
j.width += 16,
a.beginPath(),
a.fillStyle = "#445356";
var l = b.itemWidth / 48 * 8;
0 === h && 1 === g.length ? k.drawRoundRect(a, j.x, j.y, j.width, j.height, l, l, l, l) : 0 === h ? k.drawRoundRect(a, j.x, j.y, j.width, j.height, l, 0, l, 0) : h === g.length - 1 ? k.drawRoundRect(a, j.x, j.y, j.width, j.height, 0, l, 0, l) : a.rect(j.x, j.y, j.width, j.height),
a.fill()
}
}
}
,
Ca.prototype.onDataClick = function(a, b) {
var c = this.isOnExpandIcon(b, a);
c && (a.expand = !a.expand,
this.redraw())
}
,
Ca.prototype.addAtlasFrame = function(a, c) {
if (!cc(c)) {
var d;
d = "__builtin_resource__" === c.key ? c.img : fa.project.getImageURLByAtlas(c);
var e;
c.json.SubTexture ? (e = {},
c.json.SubTexture.forEach(function(a) {
e[a.name] = {
frame: {
x: a.x,
y: a.y,
w: a.width,
h: a.height
}
}
})) : e = c.json.frames;
var f = b.keys(e).sort();
f.forEach(function(b) {
var f = e[b].frame
, g = new a["class"];
g.name = b,
g.image = d,
g.a("clipX", f.x),
g.a("clipY", f.y),
g.a("clipWidth", f.w),
g.a("clipHeight", f.h),
g.a("asset", c.uuid),
g.a("url", c.url),
g.a("frame", b),
a.addFollower(g)
})
}
}
,
Ca.prototype.blink = function(a) {
var b = this;
if (b._anim && (b._anim.finishFunc = function() {
b._blinkData.s("blink.background", null),
b._anim = null,
b._blinkData = null
}
,
b._anim.stop()),
a) {
b._blinkData = a;
var c = 0
, d = function() {
4 > c ? (c++,
b._anim = W({
duration: 400,
finishFunc: d,
action: e
})) : (a.s("blink.background", null),
b._anim = null,
b._blinkData = null)
}
, e = function(b) {
c % 2 === 0 && (b = 1 - b),
a.s("blink.background", "rgba(255, 255, 0, " + b + ")")
};
d()
}
}
,
Ca.prototype.clearHighlight = function() {
var a = this
, b = a.dataModel;
b.datas.forEach(function(a) {
a.s("blink.background", null)
})
}
;
var Da = m("qc.editor.ObjectNode", qc.editor.ItemNode, function wf(a) {
var b = this;
wf["super"].constructor.call(b, a)
}, {}, {
properties: ["expand", "followers"]
}, {
uiClass: {
get: function() {
return Ea
}
}
});
Da.prototype.getImageComps = function() {
var a = this
, b = Da["super"].getImageComps.call(a);
return b.splice(0, 0, {
type: "image",
stretch: null,
rect: {
func: function(a, b) {
var c = b._indent
, d = b._rowHeight;
return [0, 1, c, d - 2]
}
},
name: {
func: function(a, b) {
return "list" === b.layout && a.followers ? a.expand ? "treeExpand" : "treeCollapse" : void 0
}
}
}),
b.splice(1, 0, {
type: "rect",
rect: [17, 1, 1],
relative: !0,
background: "#484848",
borderColor: "#507aea",
borderWidth: 2,
visible: {
func: function(a) {
return a.a("focused") === !0
}
}
}),
b.push({
type: "border",
rect: [17, 1, 1],
relative: !0,
borderColor: "#507aea",
borderWidth: 2,
visible: {
func: function(a) {
return a.a("focused") === !0
}
}
}),
b
}
,
Da.prototype.addToDataModel = function(a, b) {
var c = this
, d = c.uuid;
if (a._dataMap[d])
throw "Data already in this DataModel";
null != c.id && (a._idMap[c.id] = c),
a._dataMap[d] = c,
a._datas.splice(b, 0, c),
c._setDataModel(a),
a.onAdd(c),
a.emit("dataModelChange", {
kind: "add",
data: c
})
}
,
Da.prototype.addFollower = function(a) {
var b = this
, c = b.followers || [];
c.indexOf(a) < 0 && (c = c.slice(0),
c.push(a),
b.followers = c)
}
,
Da.prototype.removeFollower = function(a) {
var b = this
, c = b.followers || [];
c.indexOf(a) >= 0 && (c = c.slice(0),
k.removeArray(c, a),
b.followers = c)
}
,
Da.prototype.onPropertyChange = function(a) {
Da["super"].onPropertyChange.call(this, a);
var b = this;
if ("expand" === a.property) {
var c = b.expand
, d = b.followers
, e = b.dataModel;
if (d)
for (var f = e.datas.indexOf(b), g = 0; g < d.length; g++) {
var h = d[g];
c ? h.addToDataModel(e, f + g + 1) : e.remove(h)
}
} else if ("followers" === a.property) {
var i = a.oldValue
, j = a.newValue;
i && i.forEach(function(a) {
delete a.master
}),
j && j.forEach(function(a) {
a.master = b
})
}
}
;
var Ea = m("qc.editor.ObjectNodeUI", qc.widget.graph.NodeUI, function xf(a, b) {
var c = this;
xf["super"].constructor.call(c, a, b)
});
Ea.prototype.blinkBackground = {
width: {
func: function(a) {
return a._width
}
},
height: {
func: function(a) {
return a._height
}
},
comps: [{
type: "roundRect",
rect: [17, 1, 1],
relative: !0,
background: {
func: function(a) {
return a.s("blink.background")
}
}
}]
},
Ea.prototype.prepare = function() {
var a = this
, b = a.data
, c = a.gv
, d = b.followers;
if (Ea["super"].prepare.call(a),
"tile" === c.layout && d && d.length > 0) {
var e = b.rect
, f = c.itemWidth / 48 * 16
, g = c.itemHeight / 48 * 16
, h = {};
h.x = e.x + e.width - c.itemWidth / 48 * 5,
h.y = e.y + e.height / 2 - g / 2,
h.width = f,
h.height = g,
a.addRect(h),
a.nodeInfo.expandIconRect = h
}
}
,
Ea.prototype.drawBody = function(a) {
var b = this
, c = b.data
, d = b.gv
, e = b.nodeInfo
, f = e.expandIconRect
, g = c._position
, h = c._anchor
, i = c._rotation
, j = c.width
, l = c.height
, m = c._scale
, n = m.x
, o = m.y
, p = {
x: -j * h.x,
y: -l * h.y,
width: j,
height: l
};
p.x += g.x,
p.y += g.y;
var q = i || 1 !== n || 1 !== o;
if (q && (a.save(),
k.gTranslate(a, g.x, g.y),
k.gRotate(a, i),
a.scale(n, o),
k.gTranslate(a, -g.x, -g.y)),
"list" === d.layout && d.isSelected(c) && (a.beginPath(),
a.fillStyle = d === fa.activeView ? d._selectBackground : d._inactiveSelectBackground,
a.rect(0, p.y, d.viewRect.width, p.height),
a.fill()),
c.s("blink.background") && (a.beginPath(),
k.drawImage(a, b.blinkBackground, "fill", p.x, p.y, p.width, p.height, c, b.gv)),
q && a.restore(),
Ea["super"].drawBody.call(b, a),
f && "list" !== d.layout) {
var r = "project_expand";
c.expand && (r = "project_collapse"),
k.drawImage(a, r, "uniform", f.x, f.y, f.width, f.height, c, d)
}
}
;
var Fa = m("qc.editor.ObjectSelectPane", qc.widget.Container, function yf(a) {
var b = this;
yf["super"].constructor.call(b, a);
var c = b.layout = new qc.widget.layout.BorderLayout(b)
, d = b._searchInput = new qc.editor.StringInput
, e = new qc.widget.Container
, f = b._assetsList = new qc.editor.ObjectList
, g = b._descLabel = new qc.widget.Label({
align: "left"
})
, h = b._slider = new qc.widget.Slider;
g.background = "rgb(49, 52, 57)",
g.textColor = "rgb(136, 191, 201)",
g.textFont = "12px Arial",
d.input.style.backgroundImage = 'url("' + fa.assetPath + 'magnifying-glass.png")',
d.input.style.backgroundRepeat = "no-repeat",
d.input.style.backgroundSize = "12px 12px",
d.input.style.backgroundPosition = "2px 50%",
d.padding = [2, 0, 2, 22],
d.onValueChanged = b.filterList.bind(b),
c.splitterSize = 0,
e.layout = new qc.widget.layout.BorderLayout(e),
e.layout.splitterSize = 0,
e.scrollBarMode = "off",
e.setItems([{
region: "center",
element: g
}, {
region: "right",
element: h,
width: 70
}]),
b.setItems([{
region: "center",
element: f
}, {
region: "top",
height: 22,
element: d
}, {
region: "bottom",
element: e,
height: 22
}]),
b._initSlider(),
b._initList(),
f.selectionModel.on("selectionChange", function() {
var a = f.selection[0];
b._descLabel.text = a ? a.a("url") || "" : ""
})
});
Fa.prototype._initList = function() {
var a = this
, b = a._assetsList
, c = a.objectType;
b.onDataDoubleClick = a.onAssetNodeDoubleClick.bind(a);
var d = new Da({
name: "None",
image: null,
isNoneNode: !0
});
if (b.dataModel.add(d),
"node" === c)
return void fa.project.exploreTree(function(a) {
if (fa.prefabInfo && a.isDescendantOf(fa.prefabInfo.prefab) || !fa.prefabInfo) {
var c = new Da;
c.image = "UnknowIcon",
c.name = a.name,
c.a("asset", a);
for (var d, e = a, f = e.name; (d = e.parent) && d !== fa.game.world; )
f = d.name + "/" + f,
e = d;
c.a("url", f),
c.id = a.uuid,
b.dataModel.add(c)
}
});
var e, f;
switch (c) {
case "bitmapFont":
e = fa.ASSET_TYPE.ASSET_FONT;
break;
case "font":
e = fa.ASSET_TYPE.ASSET_WEBFONT,
f = "FontIcon";
break;
case "allFont":
e = [fa.ASSET_TYPE.ASSET_FONT, fa.ASSET_TYPE.ASSET_WEBFONT],
f = "FontIcon";
break;
case "sound":
e = fa.ASSET_TYPE.ASSET_SOUND,
f = "SoundIcon";
break;
case "textAsset":
e = fa.ASSET_TYPE.ASSET_TEXT,
f = "FontIcon";
break;
case "js":
e = fa.ASSET_TYPE.ASSET_JS,
f = "JsIcon";
break;
case "prefab":
e = fa.ASSET_TYPE.ASSET_PREFAB,
f = "UnknowIcon";
break;
case "excelAsset":
e = fa.ASSET_TYPE.ASSET_EXCEL;
break;
case "action":
e = fa.ASSET_TYPE.ASSET_ACTION,
f = "ActionIcon";
break;
case "actionManager":
e = fa.ASSET_TYPE.ASSET_ACTIONMANAGER,
f = "ActionManagerIcon";
break;
case "animator":
e = [fa.ASSET_TYPE.ASSET_ACTION, fa.ASSET_TYPE.ASSET_ACTIONMANAGER];
break;
default:
e = fa.ASSET_TYPE.ASSET_ATLAS;
var g = new Da
, h = fa.game.assets.find("__builtin_resource__");
g.image = h.img,
g.name = "builtin",
g.a("asset", h.uuid),
g.a("url", "builtin resource"),
g.a("frame", 0),
b.addAtlasFrame(g, h),
g.id = h.url,
b.dataModel.add(g)
}
var i;
if (k.isArray(e) ? (i = [],
e.forEach(function(a) {
i = i.concat(fa.project.findByType(a))
})) : i = fa.project.findByType(e),
i && i.length)
for (var j = 0, l = i.length; l > j; j++) {
var h = i[j]
, g = new Da;
f ? g.image = f : e === fa.ASSET_TYPE.ASSET_ATLAS || e === fa.ASSET_TYPE.ASSET_FONT ? g.image = fa.project.getImageURLByAtlas(h) : h.meta && h.meta.type === fa.ASSET_TYPE.ASSET_ACTION ? g.image = "ActionIcon" : h.meta && h.meta.type === fa.ASSET_TYPE.ASSET_ACTIONMANAGER && (g.image = "ActionManagerIcon"),
g.name = Mb(h.url),
g.a("asset", h.uuid),
g.a("url", h.url),
g.a("frame", 0),
h.meta && h.meta.type === fa.ASSET_TYPE.ASSET_ATLAS && b.addAtlasFrame(g, h),
g.id = h.url,
b.dataModel.add(g)
}
}
,
Fa.prototype.blinkObject = function(a) {
if (a) {
var b = this._assetsList
, c = a.fileList || a.hierarchy
, d = b.dataModel.getDataById(k.isString(c) ? c : c[0]);
if (d) {
if (k.isArray(c) && d.followers) {
for (var e, f = d.followers, g = 0; g < f.length; g++) {
var h = f[g];
if (h.name == c[1]) {
e = h;
break
}
}
e && (d.expand = !0,
b.validate(),
d = e)
}
U(function() {
b.makeVisible(d),
b.selectionModel.selection = d,
b.blink(d)
})
}
}
}
,
Fa.prototype.onAssetNodeDoubleClick = function(a, b) {
this._assetsList.isOnExpandIcon(b, a) || this.onSelectAssetNode(a)
}
,
Fa.prototype.filterList = function() {
var a = this
, b = a._searchInput
, c = a._assetsList
, d = b.value;
c.visibleFunc = d ? function(a) {
return a.name && a.name.indexOf(d) >= 0 ? !0 : void 0
}
: null
}
,
Fa.prototype._initSlider = function() {
var a = this
, b = a._slider
, c = a._assetsList;
b.disableToolTip(),
b.onValueChange = function(a) {
16 >= a ? 1 === a ? c.layout = "list" : b.value = 1 : (c.layout = "tile",
c.itemWidth = c.itemHeight = 40 + (.5 * a - 8))
}
,
b.value = 1
}
,
b.defineProperties(Fa.prototype, {
objectType: {
get: function() {
return this._onValueChanged
},
set: function(a) {
this.setPropertyValue("onValueChanged", a)
}
}
});
var Ga = m("qc.editor.ObjectInput", qc.widget.Container, function zf(a) {
var b = this;
zf["super"].constructor.call(b, a);
var c = b._errorIcon = document.createElement("img");
c.src = fa.assetPath + "error.png";
var d = b.layout = new qc.widget.layout.BorderLayout(b)
, e = b._objectInput = new qc.editor.StringInput
, f = b._picker = new qc.widget.Button({
icon: "objectpicker",
activeIcon: "objectpicker_active",
background: null,
hoverBackground: null,
activeBackground: null,
borderWidth: 0
});
d.splitterSize = 0,
b.setItems([{
region: "center",
element: e
}, {
region: "right",
width: 20,
element: f
}]),
a && null != a.autoSelect || (b._autoSelect = !1),
e.view._dropView = e;
var g = e.getInput();
g.addEventListener("keydown", function(a) {
a.preventDefault()
}),
g.style.cursor = "default",
e.addEventListener("click", function() {
var a = b.associatedViewAndData
, c = Tb(a);
c === !1 && (b.lost = !0)
}),
b._bindingHandleDocumentMousedown = b.handleDocumentMousedown.bind(b),
f.addEventListener("mousedown", function() {
f.iv()
}),
f.addEventListener("click", b.handlePickerClick.bind(b)),
b.eachable = !1
});
Ga.prototype.hasFocus = function() {
var a = document.activeElement
, b = this.view;
return !(!b.contains(a) && !this._dialog)
}
,
Ga.prototype.resetNinePatchImage = function() {
this._objectInput.background = "rgb(64, 69, 73)"
}
,
Ga.prototype.handlePickerClick = function() {
var a = this
, b = a._dialog;
if (!b) {
b = a._dialog = new qc.editor.Dialog,
b.on("close", function() {
a.removeDialog()
}),
b.title = fa._("Select Object");
var c = new Fa({
objectType: a.objectType
});
c.blinkObject(a.associatedViewAndData),
c.onSelectAssetNode = function(c) {
b.hide();
var d = a.objectType;
if ("prefab" === d || "texture" === d || "allFont" === d || "sound" === d || "font" === d || "textAsset" === d || "node" === d || "bitmapFont" === d || "excelAsset" === d || "action" === d || "actionManager" === d || "animator" === d)
if (c.isNoneNode)
"texture" === d ? a.setTextureObjectValue(null, !0) : "font" !== d && "bitmapFont" !== d && "allFont" !== d && a.setObjectValue(null, !0);
else if ("node" === d) {
var e = c.a("asset");
if (!(e instanceof qc.Node))
return;
a.setObjectValue(e, !0)
} else {
var f = fa.game.assets.findByUUID(c.a("asset"))
, g = function(b, c) {
"texture" === d ? a.setTextureObjectValue(new qc.Texture(b,c), !0) : a.setObjectValue(b, !0)
};
f ? g(f, c.a("frame")) : fa.game.assets.load(c.a("asset"), c.a("url"), function(a) {
g(a, c.a("frame"))
})
}
}
,
b.content = c,
b.contentPadding = [2, 4, 2, 4];
var d = Wb(700, 500);
b.width = d.width,
b.height = d.height
}
b.isInDOM() ? b.hide() : (b.show(),
c._searchInput.input.focus(),
document.addEventListener("mousedown", a._bindingHandleDocumentMousedown))
}
,
Ga.prototype.blink = function() {
var a = this;
a._anim && (a._anim.finishFunc = function() {
a._objectInput.background = "rgb(64, 69, 73)",
a.background = null,
a._anim = null
}
,
a._anim.stop());
var b = 0
, c = function() {
4 > b ? (b++,
a._anim = W({
duration: 400,
finishFunc: c,
action: d
})) : (a._objectInput.background = "rgb(64, 69, 73)",
a.background = null,
a._anim = null)
}
, d = function(c) {
b % 2 === 0 && (c = 1 - c),
a.background = "rgba(255, 255, 0, " + c + ")"
};
a._objectInput.ninePatchImage = null,
a._objectInput.background = "rgba(0,0,0,0)",
c()
}
,
Ga.prototype.setTextureObjectValue = function(a, b) {
var c, d = this, e = d._objectInput, f = d.target, g = d.targetField, h = d.arrIndex, i = !1;
if (null != h)
c = ec(f, g) || [],
!a || a instanceof qc.Texture || (a = a[h]),
a && c[h] ? i = a.atlas === c[h].atlas && a.frame === c[h].frame : a || c[h] || (i = !0),
c[h] = a;
else {
c = a;
var j = ec(f, g);
j && c && j.atlas === c.atlas && j.frame === c.frame ? i = !0 : j || c || (i = !0)
}
b && !i && fc(f, g, c);
var k = "Empty(Texture)";
a ? (k = a.atlas.url,
e.value = cc(a) || f instanceof qc.Sprite ? k : a.frame + "@" + k) : e.value = k,
d.initAssociatedViewAndData(k),
i || d.handleValueChange(k)
}
,
Ga.prototype.setObjectValue = function(a, b) {
var c, d = this, e = d.objectType, f = d._objectInput, g = d.target, h = d.targetField, i = d.arrIndex, j = !1;
if (null != i)
c = g[h] || [],
j = c[i] == a,
c[i] = a;
else {
c = a;
var l = g[h];
l === c && (j = !0)
}
if ("font" === e) {
b && !j && (g[h] = c);
var m;
m = a ? a.url : "Empty(Font)",
f.value = m,
d.initAssociatedViewAndData(m),
j || d.handleValueChange(m)
}
if ("bitmapFont" === e) {
b && !j && (g[h] = c);
var m;
m = a ? a.url : "Empty(BitmapFont)",
f.value = m,
d.initAssociatedViewAndData(m),
j || d.handleValueChange(m)
} else if ("allFont" === e) {
b && !j && (g[h] = c);
var m;
m = a ? a.url : "Empty(Font)",
f.value = m,
d.initAssociatedViewAndData(m),
j || d.handleValueChange(m)
} else if ("sound" === e) {
b && !j && (g[h] = c);
var m;
m = a ? a.url : "Empty(Sound)",
f.value = m,
"Empty(Sound)" === m ? d.initAssociatedViewAndData(m) : m && d.initAssociatedViewAndData(m.lastIndexOf(".bin") === m.length - 4 ? m : m + ".bin"),
j || d.handleValueChange(m)
} else if ("textAsset" === e) {
b && !j && (g[h] = c);
var m;
m = a ? a.url : "Empty(TextAsset)",
f.value = m,
d.initAssociatedViewAndData(m),
j || d.handleValueChange(m)
} else if ("excelAsset" === e) {
b && !j && (g[h] = c);
var m;
m = a ? a.url : "Empty(ExcelAsset)",
f.value = m,
d.initAssociatedViewAndData(m),
j || d.handleValueChange(m)
} else if ("prefab" === e) {
b && !j && (g[h] = c);
var m;
m = a ? k.isString(a) ? a : a.url : "Empty(Prefab)",
f.value = m,
d.initAssociatedViewAndData(m),
j || d.handleValueChange(m)
} else if ("action" === e) {
b && !j && (g[h] = c);
var m;
m = a ? k.isString(a) ? a : a.url : "Empty(Action)",
f.value = m,
d.initAssociatedViewAndData(m),
j || d.handleValueChange(m)
} else if ("actionManager" === e) {
b && !j && (g[h] = c);
var m;
m = a ? k.isString(a) ? a : a.url : "Empty(ActionManager)",
f.value = m,
d.initAssociatedViewAndData(m),
j || d.handleValueChange(m)
} else if ("animator" === e) {
b && !j && (g[h] = c);
var m;
m = a ? k.isString(a) ? a : a.url : "Empty(Animator)",
f.value = m,
d.initAssociatedViewAndData(m),
j || d.handleValueChange(m)
} else if ("node" === e) {
b && !j && (g[h] = c);
var n;
n = a ? a.name : "Empty(Node)",
f.value = n,
d.initAssociatedViewAndData(a),
j || d.handleValueChange(n)
}
}
,
Ga.prototype.initAssociatedViewAndData = function(a) {
var b = this
, c = b.objectType
, d = b.target;
if ("texture" === c)
if (a && "Empty(Texture)" !== a) {
var e = d[b.targetField];
Array.isArray(e) && null != b.arrIndex && (e = e[b.arrIndex]),
b.associatedViewAndData = cc(e) ? {
fileTree: a.substring(0, a.lastIndexOf("/")),
fileList: a
} : {
fileTree: a.substring(0, a.lastIndexOf("/")),
fileList: [a, e.frame]
}
} else
b.associatedViewAndData = null;
else
"font" === c ? b.associatedViewAndData = a && "Empty(Font)" !== a ? {
fileTree: a.substring(0, a.lastIndexOf("/")),
fileList: a
} : null : "bitmapFont" === c ? b.associatedViewAndData = a && "Empty(BitmapFont)" !== a ? {
fileTree: a.substring(0, a.lastIndexOf("/")),
fileList: a
} : null : "allFont" === c ? b.associatedViewAndData = a && "Empty(Font)" !== a ? {
fileTree: a.substring(0, a.lastIndexOf("/")),
fileList: a
} : null : "sound" === c ? b.associatedViewAndData = a && "Empty(Sound)" !== a ? {
fileTree: a.substring(0, a.lastIndexOf("/")),
fileList: a
} : null : "textAsset" === c ? b.associatedViewAndData = a && "Empty(TextAsset)" !== a ? {
fileTree: a.substring(0, a.lastIndexOf("/")),
fileList: a
} : null : "excelAsset" === c ? a && "Empty(ExcelAsset)" !== a && (b.associatedViewAndData = {
fileTree: a.substring(0, a.lastIndexOf("/")),
fileList: a
}) : "node" === c ? b.associatedViewAndData = a ? {
hierarchy: a.uuid
} : null : "prefab" === c ? b.associatedViewAndData = a && "Empty(Prefab)" !== a ? {
fileTree: a.substring(0, a.lastIndexOf("/")),
fileList: a
} : null : "action" === c ? b.associatedViewAndData = a && "Empty(Action)" !== a ? {
fileTree: a.substring(0, a.lastIndexOf("/")),
fileList: a
} : null : "actionManager" === c ? b.associatedViewAndData = a && "Empty(ActionManager)" !== a ? {
fileTree: a.substring(0, a.lastIndexOf("/")),
fileList: a
} : null : "animator" === c && (b.associatedViewAndData = a && "Empty(Animator)" !== a ? {
fileTree: a.substring(0, a.lastIndexOf("/")),
fileList: a
} : null);
var f = b.associatedViewAndData;
if (b.lost = !1,
f)
for (var g in f) {
var h = f[g];
if (null == h) {
b.lost = !0;
break
}
var i = fa.mainContainer.findViewById(g)
, j = k.isString(h) ? h : h[0];
if ("__builtin_resource__" !== j) {
var l;
if (l = "fileList" === g ? fa.project.findByUUID(j) : i.dataModel.getDataById(j),
!l) {
b.lost = !0;
break
}
}
}
}
,
Ga.prototype.handleDocumentMousedown = function(a) {
var b = this
, c = b._dialog
, d = a.target;
c.view.contains(d) || b._picker.view.contains(d) || c.hide()
}
,
Ga.prototype.removeDialog = function() {
delete this._dialog,
document.removeEventListener("mousedown", this._bindingHandleDocumentMousedown)
}
,
Ga.prototype.handleValueChange = function(a) {
var b = this;
b.onValueChanged && b.onValueChanged(a);
var c = {
property: "value",
oldValue: null,
newValue: a,
source: b
};
b.emit("propertyChange", c)
}
,
b.defineProperties(Ga.prototype, {
objectInput: {
get: function() {
return this._objectInput
}
},
lost: {
get: function() {
return this._lost
},
set: function(a) {
this.setPropertyValue("lost", a);
var b = this._interactionDiv
, c = this._errorIcon;
a ? b.contains(c) || (c.style.position = "absolute",
c.style.width = "18px",
c.style.height = "18px",
c.style.right = "20px",
b.appendChild(c)) : b.contains(c) && b.removeChild(c)
}
},
arrIndex: {
get: function() {
return this._arrIndex
},
set: function(a) {
this.setPropertyValue("arrIndex", a)
}
},
target: {
get: function() {
return this._target
},
set: function(a) {
this.setPropertyValue("target", a)
}
},
targetField: {
get: function() {
return this._targetField
},
set: function(a) {
this.setPropertyValue("targetField", a)
}
},
value: {
get: function() {
return this._objectInput.value
},
set: function(a) {
this._objectInput.value = a
}
},
formattedValue: {
get: function() {
return this.value
}
},
objectType: {
get: function() {
return this._objectType
},
set: function(a) {
this.setPropertyValue("objectType", a)
}
},
onValueChanged: {
get: function() {
return this._onValueChanged
},
set: function(a) {
this.setPropertyValue("onValueChanged", a)
}
},
associatedViewAndData: {
get: function() {
return this._associatedViewAndData
},
set: function(a) {
this.setPropertyValue("associatedViewAndData", a)
}
}
});
var Ha = m("qc.editor.NumberInput", qc.editor.StringInput, function Af(a) {
var b = this;
Af["super"].constructor.call(b, a),
b.maskRe = /[\-\d\.]/;
var c = b.input;
c.addEventListener("change", function() {
b.value = b.finalValue
})
});
Ha.prototype.formatValue = function(a) {
var b = this.precision;
return parseFloat(null == b ? a : parseFloat(a).toFixed(b))
}
,
Ha.prototype.epc = function(a, b, c) {
var d = this
, e = d.min
, f = d.max
, g = !0;
if ("value" === a && (null != e || null != f)) {
var h = this.formatValue(c);
isNaN(h) || (null != e && e > h && (g = !1),
null != f && h > f && (g = !1))
}
g && Ha["super"].epc.call(d, a, b, c)
}
,
Ha.prototype._precision = 3,
b.defineProperties(Ha.prototype, {
finalValue: {
get: function() {
var a = this
, b = a.formatValue(a.input.value)
, c = a.min
, d = a.max;
return isNaN(b) || (null != c && c > b && (b = c),
null != d && b > d && (b = d)),
b
}
},
max: {
get: function() {
return this._max
},
set: function(a) {
this.setPropertyValue("max", a)
}
},
min: {
get: function() {
return this._min
},
set: function(a) {
this.setPropertyValue("min", a)
}
},
precision: {
get: function() {
return this._precision
},
set: function(a) {
this.setPropertyValue("precision", a)
}
},
value: {
get: function() {
return this._value
},
set: function(a) {
var b = this;
if (b.input !== document.activeElement)
if (null == a)
;
else {
a = b.formatValue(a);
var c = b.min
, d = b.max;
isNaN(a) || (null != c && c > a && (a = c),
null != d && a > d && (a = d))
}
b.setPropertyValue("value", a)
}
}
});
var Ia = m("qc.editor.IntInput", qc.editor.NumberInput, function Bf(a) {
var b = this;
Bf["super"].constructor.call(b, a)
});
Ia.prototype._precision = 0,
Ia.prototype._maskRe = /[\-\d]/;
var Ja = m("qc.editor.AngleInput", qc.editor.NumberInput, function Cf(a) {
var b = this;
Cf["super"].constructor.call(b, a)
});
Ja.prototype.toGameValue = function() {
var a = this
, b = a.formattedValue;
return b / 180 * Math.PI
}
,
Ja.prototype.toCompValue = function(a) {
return a / Math.PI * 180
}
;
var Ka = m("qc.editor.SliderInput", qc.widget.Container, function Df(a) {
var b = this;
Df["super"].constructor.call(b),
a && (b.bind = a.bind,
delete a.bind),
b.scrollBarMode = "off",
b.eachable = !1;
var c = b.layout = new qc.widget.layout.BorderLayout(b)
, d = b._slider = new qc.widget.Slider(a)
, e = b._input = new qc.editor.NumberInput;
e.value = d.value,
c.bottomViewExpanded = !1,
c.splitterSize = 0,
d.disableToolTip(),
null == d.min && (d.min = 0),
b.setItems([{
region: "center",
element: d
}, {
region: "right",
width: 50,
element: e
}]),
e.input.addEventListener("blur", function() {
e._updating || (e.value = d.value)
}),
d.on("propertyChange", function(a) {
var c = a.property;
d._updating = !0,
"value" === c && (b.epc("value", a.oldValue, a.newValue),
b.onValueChanged && b.onValueChanged(b.value),
e._updating || (e.value = a.newValue)),
d._updating = !1
}),
e.on("propertyChange", function(a) {
var b = a.property;
e._updating = !0;
var c = parseFloat(a.newValue);
"value" !== b || d._updating || isNaN(c) || (d.value = c),
e._updating = !1
})
});
b.defineProperties(Ka.prototype, {
min: {
get: function() {
return this._slider.min
},
set: function(a) {
this._slider.min = a
}
},
max: {
get: function() {
return this._slider.max
},
set: function(a) {
this._slider.max = a
}
},
step: {
get: function() {
return this._slider.step
},
set: function(a) {
this._slider.step = a
}
},
value: {
get: function() {
return this._slider.value
},
set: function(a) {
this._slider.value = a
}
},
formattedValue: {
get: function() {
return this.value
}
},
onValueChanged: {
get: function() {
return this._onValueChanged
},
set: function(a) {
this.setPropertyValue("onValueChanged", a)
}
}
});
var La = m("qc.editor.TextArea", qc.widget.TextArea, function Ef(a) {
var b = this;
Ef["super"].constructor.call(b, a),
b.on("propertyChange", function(a) {
"value" === a.property && b.onValueChanged && b.onValueChanged(b.value)
}),
b.padding = [1, 0, 1, 0];
var c = b.getInput();
c.addEventListener("focus", function() {
c.select()
})
});
La.prototype.formatValue = function(a) {
return a
}
,
b.defineProperties(La.prototype, {
onValueChanged: {
get: function() {
return this._onValueChanged
},
set: function(a) {
this.setPropertyValue("onValueChanged", a)
}
},
formattedValue: {
get: function() {
return this.formatValue(this.value)
}
}
});
var Ma = m("qc.editor.TextAreaContainer", qc.widget.Container, function Ff(a) {
var b = this;
Ff["super"].constructor.call(b),
b.scrollBarMode = "off",
b.eachable = !1;
var c = b.layout = new qc.widget.layout.TableLayout(b)
, d = b._textArea = new qc.editor.TextArea(a)
, e = b._popupButton = new qc.editor.Button({
text: fa._("Edit"),
padding: [2, 6, 2, 6]
});
e.background = "rgb(80, 122, 134)",
e.gradientColor = null,
e.hoverBackground = "rgb(80, 122, 134)",
e.hoverGradientColor = null,
e.activeBackground = "rgb(62, 68, 72)",
e.activeGradientColor = null,
e.borderColor = "rgba(0, 0, 0, 0)",
e.textColor = "rgb(224, 223, 224)",
c.cellPadding = 0,
c.bottomViewExpanded = !1,
c.splitterSize = 0,
b.setItems([{
height: .1,
widths: [.1, 42],
cells: [{
element: d
}, {
align: "center",
vAlign: "middle",
element: e,
fill: "none"
}]
}]),
d.onValueChanged = function(a) {
b.onValueChanged && b.onValueChanged(a)
}
,
d.on("propertyChange", function(a) {
b.emit("propertyChange", a)
}),
b._bindingHandleDocumentMousedown = b.handleDocumentMousedown.bind(b),
e.on("click", this.showPopupDialog.bind(this))
});
Ma.prototype.formatValue = function(a) {
return a
}
,
Ma.prototype.showPopupDialog = function() {
var a = this
, b = a._dialog;
if (!b) {
var b = a._dialog = new qc.editor.Dialog;
b.on("close", function() {
a.removeDialog()
});
var c = new qc.editor.TextArea;
b.position = "center",
b.buttons = [{
text: fa._("OK"),
onClick: function() {
b.hide(),
a.value = c.value,
a.emit("valueChangedFromPopup")
}
}, {
text: fa._("Cancel"),
onClick: function() {
b.hide()
}
}],
b.title = fa._("Edit Text"),
b.contentPadding = [5, 5, 5, 5];
var d = Wb(800, 600);
b.width = d.width,
b.height = d.height,
b.content = c,
c.value = a._textArea.value
}
b.isInDOM() ? b.hide() : (b.show(),
c.input.focus(),
document.addEventListener("mousedown", a._bindingHandleDocumentMousedown))
}
,
Ma.prototype.handleDocumentMousedown = function(a) {
var b = this
, c = b._dialog
, d = a.target;
c.view.contains(d) || b._popupButton.view.contains(d) || c.hide()
}
,
Ma.prototype.removeDialog = function() {
delete this._dialog,
document.removeEventListener("mousedown", this._bindingHandleDocumentMousedown)
}
,
b.defineProperties(Ma.prototype, {
value: {
get: function() {
return this._textArea.value
},
set: function(a) {
this._textArea.value = a
}
},
onValueChanged: {
get: function() {
return this._onValueChanged
},
set: function(a) {
this.setPropertyValue("onValueChanged", a)
}
},
formattedValue: {
get: function() {
return this.formatValue(this.value)
}
}
});
var Na = m("qc.editor.CodePane", b, function() {
var a = this;
a.initView(!1)
}, {}, {
view: !0,
emitter: !0
});
Na.prototype.onPropertyChange = function(a) {
var b = this
, c = b._editor
, d = a.property;
"value" === d && !b._editorToValue && c && (b._valueToEditor = !0,
c.setValue(a.newValue),
b._valueToEditor = !1)
}
,
Na.prototype._initEditor = function() {
var a = this
, b = a.value
, c = a._interactionDiv
, d = a._editor = CodeMirror(c, {
lineNumbers: !0,
foldGutter: !0,
theme: "material",
continueComments: {
continueLineComment: !1
},
autoCloseBrackets: !0,
matchBrackets: !0,
indentUnit: 4,
keyMap: "sublime",
lint: !0,
mode: {
name: a.mode || "javascript"
},
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter", "CodeMirror-lint-markers"]
});
d.setSize("100%", "100%"),
d.setValue(b || ""),
d.on("change", function() {
a._valueToEditor || (a._editorToValue = !0,
a.value = d.getValue(),
a._editorToValue = !1)
})
}
,
Na.prototype.validateImpl = function() {
var a = this
, b = a._editor;
b || a._initEditor()
}
,
b.defineProperties(Na.prototype, {
value: {
get: function() {
return this._value
},
set: function(a) {
try {
var b = JSON.parse(a)
, c = JSON.stringify(b, null, 4);
a = c
} catch (d) {}
this.setPropertyValue("value", a)
}
},
mode: {
get: function() {
return this._mode
},
set: function(a) {
this.setPropertyValue("mode", a)
}
},
editor: {
get: function() {
return this._editor
}
}
});
var Oa = m("qc.widget.CodeViewer", qc.widget.Container, function Gf() {
Gf["super"].constructor.call(this),
this.eachable = !1
});
Oa.prototype.validateImpl = function() {
var a = this;
Oa["super"].validateImpl.call(this),
a.view.style.background = "rgb(51, 51, 51)"
}
;
var Pa = m("qc.editor.PanelInteractor", qc.widget.PanelInteractor, function Hf(a) {
var b = this;
Hf["super"].constructor.call(b, a)
});
Pa.prototype.handle_touchstart = function(a) {
var b = this;
Pa["super"].handle_touchstart.call(b, a);
var c = b._toolIndex
, d = b._panel;
if (null == c && d.titleVisible) {
var e = B(a)
, f = d._interactionDiv.getBoundingClientRect()
, g = e.x - f.left
, h = e.y - f.top
, i = d.width
, j = d.titleHeight;
h >= 0 && j >= h && g >= 0 && i >= g && (b._clientPoint = e,
b._titleActive = !0,
z(b, a))
}
}
,
Pa.prototype.handle_touchend = function(a) {
var b = this;
Pa["super"].handle_touchend.call(b, a);
var c = b._titleActive
, d = b._panel
, e = b._clientPoint
, f = B(a);
if (c && y(e, f) < 2) {
var g = d._state;
d.state = "collapse" === g ? "normal" : "collapse"
}
}
,
Pa.prototype.handleWindowTouchEnd = function(a) {
{
var b = this;
b._panel
}
Pa["super"].handleWindowTouchEnd.call(b, a),
b._titleActive && (b._clientPoint = null,
b._titleActive = !1)
}
,
Pa.prototype._calcToolIndex = function(a) {
var b = this
, c = b._panel;
a = k.checkTouch(a);
var d = c._interactionDiv.getBoundingClientRect()
, e = a.clientX - d.left
, f = a.clientY - d.top
, g = c.titleHeight
, h = c.checkable
, i = c.removable
, j = c.refreshable
, l = c.lockable;
if (c.titleVisible) {
if (f >= 4 && 4 + g - 8 >= f && 2 + g - 8 > e && e > 2)
return 0;
if (h) {
var m = c._checkIconRect;
if (m && v(m, {
x: e,
y: f
}))
return 1
}
var n = d.width;
if (l) {
var o = {
x: n -= 24,
y: 4,
width: g - 8,
height: g - 8
};
if (v(o, {
x: e,
y: f
}))
return 4
}
if (i) {
var p = {
x: n -= 24,
y: 4,
width: g - 8,
height: g - 8
};
if (v(p, {
x: e,
y: f
}))
return 2
}
if (j) {
var q = {
x: n -= 24,
y: 4,
width: g - 8,
height: g - 8
};
if (v(q, {
x: e,
y: f
}))
return 3
}
}
}
;
var Qa = m("qc.editor.Panel", qc.widget.Panel, function(a) {
var b = this;
qc.widget.Panel["super"].constructor.call(b),
b.layout = null,
b._interactor = new Pa(b),
b.target = a;
var c = new qc.widget.Container;
c.layout = new qc.widget.layout.VBoxLayout(c),
c.layout.padding = 0,
c.layout.gap = 0,
c.scrollBarMode = "off",
b.content = c,
b.scrollBarModel = "off",
b.paint(),
delete b._invalidateFlag,
c.setItems(b._getContainerViews()),
b.initChildrenListener(),
b.initCompValueChangeListener(),
b.on("propertyChange", function(a) {
"checked" === a.property && (a.newValue ? (b.emit("enable", {
source: b
}),
b.onEnable && b.onEnable()) : (b.emit("disable", {
source: b
}),
b.onDisable && b.onDisable()))
})
});
Qa.prototype.indent = 30,
Qa.prototype.divideColor = 14935011,
Qa.prototype._checkable = !0,
Qa.prototype._removable = !0,
Qa.prototype._refreshable = !1,
Qa.prototype._titleHeight = 24,
Qa.prototype._contentPadding = [2, 0, 0, 0],
Qa.prototype._titleBackground = "rgb(194, 194, 194)",
Qa.prototype._activeTitleBackground = "rgb(155, 155, 155)",
Qa.prototype._getContainerViews = function() {
var a = _.containers
, b = [];
if (a)
for (var c = 0; c < a.length; c++) {
var d = new qc.widget.Container;
d.layout = new qc.widget.layout.TableLayout(d),
d.layout.cellPadding = 2,
d.layout.padding = [0, 6, 0, 0],
d.layout.rowHeight = 24,
d.scrollBarMode = "off",
d.setItems(a[c]),
b.push(d)
}
return b
}
,
Qa.prototype.removeSelf = function() {
var a = this;
Eb(fa._("Sure to remove this component?"), fa._("Warning"), function() {
var b = a.parent;
b.emit("remove", {
source: a
}),
a.target.destroy(),
b.inspect(b.target)
}, null, {
icon: "alert"
})
}
,
Qa.prototype.handleToolClick = function(a, b) {
var c = this;
if (0 === a) {
var d = this.state;
c.state = "collapse" !== d ? "collapse" : "normal"
} else
1 === a ? (c.checked = !this.checked,
fa.inspector.propertyView.emit("checkChanged", {
source: c
})) : 2 === a ? (c.emit("remove", {
source: c
}),
c.onRemove && c.onRemove()) : 3 === a ? c.repaint() : 4 === a && (c.target.__lock = !c.target.__lock);
c.emit("toolClick", {
tool: a,
event: b
})
}
,
Qa.prototype.drawTitleBackground = function(a, b, c, d, e) {
var f, g = this, h = this._interactor, i = g.titleNinePatchImage, j = g.titleNinePatchBorder || [], l = g.titleTextNinePatchImage, m = g.titleTextNinePatchBorder || [], n = h._titleActive;
if (i)
k.drawNinePatchImage(a, i, b, c, d, e, j[0], j[1], j[2], j[3]),
l && k.drawNinePatchImage(a, l, b + e - 6, c + 2, d, e - 4, m[0], m[1], m[2], m[3]);
else {
f = n ? g._activeTitleBackground : g._titleBackground,
a.beginPath();
var o = {
x: b,
y: c,
width: d,
height: e
};
a.fillStyle = f,
a.rect(o.x, o.y, o.width, o.height),
a.fill()
}
}
,
Qa.prototype.drawTitle = function(a, b, c, d, e) {
var f = this;
f.drawTitleBackground(a, b, c, d, e);
var g = f.icon
, h = f.title
, i = f.titleFont
, j = f.titleColor
, l = f.checkable
, m = f.checked
, n = f.removable
, o = f.refreshable
, p = f._interactor
, q = f.lockable;
a.beginPath(),
a.rect(b, c, d, 1),
a.fillStyle = f._titleLineColor,
a.fill(),
a.beginPath(),
b += 2,
this.drawTool(a, "collapse", b, 4, e - 8, e - 8),
b += e - 8,
g && (k.drawImage(a, g, null, b += 2, 4, e - 8, e - 8),
b += e - 8),
l ? (f._checkIconRect = {
x: b + 2,
y: 4,
width: e - 8,
height: e - 8
},
k.drawImage(a, m ? "checkIcon" : "uncheckIcon", null, b += 2, 4, e - 8, e - 8),
b += e - 8) : f._checkIconRect = null,
h && k.drawText(a, h, i, j, b, 0, 0, e);
var r = d;
if (q && k.drawImage(a, f.target.__lock ? "lock" : "unlock", null, r -= 24, 4, e - 8, e - 8),
n) {
var s = "delete"
, t = p._mouseState;
"active" === t && (s = "delete_active"),
k.drawImage(a, s, null, r -= 24, 4, e - 8, e - 8)
}
o && k.drawImage(a, "refresh", null, r -= 24, 4, e - 8, e - 8)
}
,
Qa.prototype.drawTool = function(a, b, c, d, e, f) {
var g = this.state;
"collapse" === b && ("collapse" === g ? k.drawImage(a, "treeCollapse", null, c, d, e, f) : k.drawImage(a, "treeExpand", null, c, d, e, f))
}
,
Qa.prototype.validate = function() {
var a = this;
Qa["super"].validate.call(a);
var b = a._disabledDiv;
if (b) {
var c = a._titleHeight
, d = a.clientWidth
, e = a.clientHeight;
k.layout(b, 0, c, d, e - c)
}
}
,
Qa.prototype.paint = function() {}
,
Qa.prototype.repaint = function(a) {
var b = this
, c = function() {
b.content.setItems(null),
b.paint(),
b.content.setItems(b._getContainerViews()),
b.initChildrenListener(),
b.initCompValueChangeListener()
};
a ? c() : b._invalidateFlag || (b._invalidateFlag = !0,
U(function() {
b._invalidateFlag && (delete b._invalidateFlag,
c())
}))
}
,
Qa.prototype.initCompValueChangeListener = function() {
var a = this;
a.eachChildren(function(b) {
b instanceof qc.editor.Label || b instanceof qc.editor.Text || b.on && b.on("propertyChange", function(c) {
fa.inspector && !fa.inspector._updating && (b instanceof qc.widget.ToggleButton ? "selected" === c.property && fa.inspector.propertyView.emit(fa.e.INSPECTOR_COMP_VALUE_CHANGE, {
node: a.target,
field: b.bind
}) : "value" === c.property && fa.inspector.propertyView.emit(fa.e.INSPECTOR_COMP_VALUE_CHANGE, {
node: a.target,
field: b.bind
}))
})
})
}
,
Qa.prototype.initChildrenListener = function() {
var a = this;
a.eachChildren(function(b) {
b instanceof qc.editor.Label || b instanceof qc.editor.Text ? b["for"] && !b.disabled && (b.cursor = "ew-resize") : b.bind && (b.on("propertyChange", a.onChildPropertyChange.bind(a, b)),
b instanceof Ba && (b.input.addEventListener("focus", a.onInputFocus.bind(a, b)),
b.input.addEventListener("blur", a.onInputBlur.bind(a, b))))
})
}
,
Qa.prototype.onChildPropertyChange = function(a, b) {
var c = this;
if (!fa.inspector._updating && ("value" === b.property || "selected" === b.property)) {
var d;
if (d = a.toGameValue ? a.toGameValue() : a.formattedValue,
a.syncToGame)
a.syncToGame(d);
else if (a instanceof Ga)
;
else if (a instanceof Ha && isNaN(d))
;
else {
var e = c.target;
a.bindTarget && (e = a.bindTarget),
fc(e, a.bind, d),
a.onPropertyChanged && b.oldValue !== b.newValue && a.onPropertyChanged()
}
}
}
,
Qa.prototype.createInputUndoFunc = function(a, b, c) {
return function() {
fc(a, b, c)
}
}
,
Qa.prototype.onInputFocus = function(a) {
var b = this
, c = b.target;
a.bindTarget && (c = a.bindTarget);
var d = ec(c, a.bind);
a._undoValue = d;
var e = b.createInputUndoFunc;
a._undo = e(c, a.bind, d)
}
,
Qa.prototype.onInputBlur = function(a) {
var b = this;
if (a._undo) {
var c = b.target;
a.bindTarget && (c = a.bindTarget);
var d = ec(c, a.bind);
if (d !== a._undoValue) {
var e = b.createInputUndoFunc
, f = e(c, a.bind, d);
fa.undo.add(a._undo, f)
}
delete a._undo,
delete a._undoValue
}
}
,
Qa.prototype.updateChildrenValue = function() {
var a = this;
this.eachChildren(function(b) {
if (b.bind) {
var c = a.target;
b.bindTarget && (c = b.bindTarget);
var d = !1;
if (d = b.hasFocus ? b.hasFocus() : b.view.contains(document.activeElement),
c && !d)
if (b instanceof Ga) {
var e = b.bind;
if ("texture" === b.objectType) {
var f, g;
e.indexOf("/") > 0 ? (f = e.substring(0, e.indexOf("/")),
g = e.substring(e.indexOf("/") + 1)) : f = e,
g ? b.setTextureObjectValue(ec(c, f), ec(c, g)) : b.setTextureObjectValue(ec(c, f))
} else
b.setObjectValue(ec(c, e))
} else {
var h = ec(c, b.bind);
b.syncToComp ? b.syncToComp(h) : b instanceof qc.widget.ToggleButton && !(b.parent instanceof qc.widget.ButtonGroup) ? b.selected = h : b.value = b.toCompValue ? b.toCompValue(h) : h
}
}
})
}
,
Qa.prototype.eachChildren = function(a, b) {
var c = this
, d = (b || c).children;
if (d)
for (var e = 0; e < d.length; e++) {
var f = d[e];
if (f.eachable !== !1) {
var g = c.eachChildren(a, f);
if (g)
return g
}
if (a(f))
return f
}
}
,
Qa.prototype.disableTitle = function() {
var a = this;
U(function() {
var b = a._disabledTitleDiv = p()
, c = a._titleHeight
, d = a.clientWidth;
b.style.background = k.Color.disabledBackground,
a.view.appendChild(b),
k.layout(b, 0, 0, d - (a.lockable ? 28 : 0), c)
})
}
,
Qa.prototype.enableTitle = function() {
var a = this
, b = a._disabledTitleDiv;
b && b.parentNode && a.view.removeChild(b),
delete a._disabledTitleDiv
}
,
b.defineProperties(Qa.prototype, {
target: {
get: function() {
return this._target
},
set: function(a) {
this._target = a
}
},
checked: {
get: function() {
return this._checked
},
set: function(a) {
this.setPropertyValue("checked", a)
}
},
checkable: {
get: function() {
return this._checkable
},
set: function(a) {
this.setPropertyValue("checkable", a)
}
},
removable: {
get: function() {
return this._removable
},
set: function(a) {
this.setPropertyValue("removable", a)
}
},
lockable: {
get: function() {
return this._lockable
},
set: function(a) {
this.setPropertyValue("lockable", a)
}
},
refreshable: {
get: function() {
return this._refreshable
},
set: function(a) {
this.setPropertyValue("refreshable", a)
}
}
});
var Ra = m("qc.editor.Dialog", qc.widget.Dialog, function(b) {
var c = this;
c._initLayout(b),
c.view.addEventListener("mousedown", function() {
fa.activeDialog = c
}, !0),
c._interactor = new Sa(c),
c.on("show", function() {
a.dialogCounter || (a.dialogCounter = 0),
a.dialogCounter++,
c.handleShow(),
fa.activeDialog = c
}),
c.on("close", function() {
a.dialogCounter && a.dialogCounter--,
c.handleClose(),
fa.activeDialog = null
}),
c._bindingHide = c.hide.bind(c)
}, {
_buttonPadding: [2, 8, 2, 8]
}, {
properties: ["closeBackgroundImage", "activeCloseBackgroundImage", "activeCloseIcon", "buttonNinePatchImage", "buttonNinePatchBorder", "buttonActiveNinePatchImage", "buttonActiveNinePatchBorder", "buttonFont", "buttonColor", "buttonPadding"]
});
Ra.prototype.handleUndo = function() {}
,
Ra.prototype.handleRedo = function() {}
,
Ra.prototype.handleShow = function() {
fa.windowFocused && fa.e.on(fa.e.JS_CHANGED, this._bindingHide)
}
,
Ra.prototype.handleClose = function() {
fa.e.off(fa.e.JS_CHANGED, this._bindingHide)
}
,
Ra.prototype._createButton = function(a) {
var b = this
, c = new qc.widget.Button(a);
return c.ninePatchImage = b.buttonNinePatchImage,
c.ninePatchBorder = b.buttonNinePatchBorder,
c.hoverNinePatchImage = b.buttonNinePatchImage,
c.hoverNinePatchBorder = b.buttonNinePatchBorder,
c.activeNinePatchImage = b.buttonActiveNinePatchImage,
c.activeNinePatchBorder = b.buttonActiveNinePatchBorder,
c.padding = b.buttonPadding,
c.textFont = b.buttonFont,
c.textColor = b.buttonColor,
c.borderWidth = 0,
c
}
,
Ra.prototype.handleToolMouseDown = function() {
var b = this;
b._toolActive = !0,
b.iv();
var c = function() {
b._toolActive && (b._toolActive = !1,
b.iv())
};
a.addEventListener("mouseup", c),
a.addEventListener("touchend", c)
}
,
Ra.prototype.drawTool = function(a, b, c, d, e, f, g) {
if ("close" === b) {
var h = this
, i = h.closeBackgroundImage
, j = h.activeCloseBackgroundImage
, l = h.activeCloseIcon;
d = h.width - 46,
e = 4,
k.drawImage(a, h._toolActive ? j : i, null, d, e, 44, 22),
k.drawImage(a, h._toolActive ? l : this._closeIcon, null, d + 16, e, f, 21)
} else
Ra["super"].drawTool.call(this, a, b, c, d, e, f, g)
}
,
Ra.prototype.validateImpl = function() {
{
var a = this;
a._container.layout.bottomView.children
}
Ra["super"].validateImpl.call(a)
}
;
var Sa = m("qc.editor.DialogInteractor", "qc.widget.DialogInteractor", function(a) {
var b = this;
Sa["super"].constructor.call(b, a)
}, {
_calcToolIndex: function(a) {
var b = this
, c = b._panel
, d = c.tools;
if (d && d.indexOf("close") >= 0) {
a = k.checkTouch(a);
var e = c._interactionDiv.getBoundingClientRect()
, f = a.clientX - e.left
, g = a.clientY - e.top
, h = c.titleHeight
, i = {
x: e.width - 43,
y: 4,
width: 43,
height: h
};
if (k.containsPoint(i, {
x: f,
y: g
}))
return 0
}
}
})
, Ta = m("qc.editor.Painter", b, function() {
var a = this;
a.initView(!1, !0),
new qc.editor.PainterInteractor(a)
}, {
_borderWidth: 0
}, {
view: !0,
emitter: !0,
painter: !0
});
b.defineProperties(Ta.prototype, {
background: {
get: function() {
return this._background
},
set: function(a) {
this.setPropertyValue("background", a)
}
},
borderColor: {
get: function() {
return this._borderColor
},
set: function(a) {
this.setPropertyValue("borderColor", a)
}
},
borderWidth: {
get: function() {
return this._borderWidth
},
set: function(a) {
this.setPropertyValue("borderWidth", a)
}
}
}),
Ta.prototype.onPropertyChange = function() {
this.iv()
}
,
Ta.prototype.drawBackground = function(a) {
var b = this
, c = b.background;
c && (a.beginPath(),
a.rect(0, 0, b.width, b.height),
a.fillStyle = c,
a.fill())
}
,
Ta.prototype.drawBorder = function() {
var a, b = this, c = b.borderWidth;
a = c ? c + "px solid " + b.borderColor : "",
b.view.style.border = a
}
,
Ta.prototype.validateImpl = function() {
this.drawBorder();
var a = this
, b = a._canvas
, c = a.clientWidth
, d = a.clientHeight;
t(b, c, d);
var e = s(b, 0, 0, 1);
a.drawBackground(e),
a.drawBottomPainters(e),
a.drawTopPainters(e)
}
,
Ta.prototype.calculateClientWidth = function() {
var a = this.borderWidth
, b = this.width;
return a ? b - 2 * a : b
}
,
Ta.prototype.calculateClientHeight = function() {
var a = this.borderWidth
, b = this.height;
return a ? b - 2 * a : b
}
,
m("qc.editor.PainterInteractor", b, function(a) {
this._painter = a,
this.addListeners()
}, {
handle_mousewheel: function(a) {
Y(a)
},
handle_DOMMouseScroll: function(a) {
Y(a)
}
}, {
interactor: !0
}, {
view: {
get: function() {
return this._painter
}
}
});
var Ua = m("qc.editor.ProgressBar", Ta, function If() {
If["super"].constructor.call(this),
this.addTopPainter(this.drawImpl)
}, {
_percent: 0,
_backgroundColor: "rgb(232, 232, 232)",
_foregroundColor: "rgb(6, 172, 48)",
_textFont: "12px Arial",
_textColor: "black"
}, {
properties: ["foregroundColor", "backgroundColor", "percent", "text", "textFont", "textColor"]
});
Ua.prototype.drawImpl = function(a) {
var b = this
, c = b.clientWidth
, d = b.clientHeight
, e = b.percent
, f = b.text
, g = b.textFont
, h = b.textColor
, i = b.foregroundColor
, j = b.backgroundColor;
a.beginPath(),
a.fillStyle = j,
a.rect(0, 0, c, d - 20),
a.fill(),
a.beginPath(),
a.fillStyle = i,
a.rect(0, 0, e / 100 * c, d - 20),
a.fill(),
a.beginPath(),
k.drawText(a, f, g, h, 0, d - 20, c, 20, "left")
}
;
var Va = (m("qc.editor.ProgressDialog", Ra, function Jf() {
Jf["super"].constructor.call(this);
var a = new qc.widget.Container
, b = this.progressBar = new Ua;
b.preferredSize = {
height: 50
},
a.scrollbarMode = "off",
a.layout = new qc.widget.layout.TableLayout(a),
a.setItems([{
height: .1,
widths: [.1],
cells: [{
fill: "horizontal",
vAlign: "middle",
element: b
}]
}]),
a.background = "rgb(44, 53, 74)",
this.contentPadding = [10, 10, 10, 10],
this.content = a
}),
m("qc.editor.Divider", Ta, function Kf() {
var a = this;
Kf["super"].constructor.call(a),
a.view.style.background = "rgba(0, 0, 0, 0)",
a.view.style.border = "0px",
a.color = 14935011,
a.size = 1
}));
b.defineProperties(Va.prototype, {
color: {
get: function() {
return this._color
},
set: function(a) {
this.setPropertyValue("color", a)
}
},
size: {
get: function() {
return this._size
},
set: function(a) {
this.setPropertyValue("size", a)
}
}
}),
Va.prototype.validateImpl = function() {
var a = this
, b = a._canvas
, c = a.clientWidth
, d = a.clientHeight
, e = a.size;
t(b, c, d);
var f = s(b, 0, 0, 1);
f.beginPath(),
f.rect(0, (d - e) / 2, c, e),
f.fillStyle = this.color,
f.fill()
}
,
Va.prototype.calculateClientWidth = function() {
return this.width
}
,
Va.prototype.calculateClientHeight = function() {
return this.height
}
,
k.Vector.gameCurveShape = function(a, b, c, d, e) {
if (c && c.curve) {
var f = c.curve.func(d, e);
if (f && 0 !== f.keys.length) {
for (var g = f.keys, h = g[0].time, i = g[g.length - 1].time, j = g[0].value, k = g[0].value, l = 1 / b.width, m = h; (m += l) < i; ) {
var n = f.evaluate(m);
j = Math.min(j, n),
k = Math.max(k, n)
}
var n = f.evaluate(i);
j = Math.min(j, n),
k = Math.max(k, n),
3e-8 > k - j && (k = j);
var o = 1
, p = 1
, q = b.height / (k === j ? Math.abs(k) < 1 ? 2 : 2 * Math.abs(k) : k - j)
, r = b.width / (i === h ? 1 : i - h)
, s = b.height * (k === j ? .5 : (k - 0) / (k - j))
, t = -h * r
, u = function(a) {
return t + a * r + o
}
, v = function(a) {
return s - a * q + p
};
a.lineWidth = 1,
s >= 0 && s <= b.height && (a.strokeStyle = "rgb(0, 0, 0)",
a.beginPath(),
a.moveTo(0, s),
a.lineTo(b.width, s),
a.stroke(),
a.closePath()),
a.strokeStyle = "rgb(0, 255, 0)",
a.beginPath();
var m = h;
for (a.moveTo(u(m), v(f.evaluate(m))); (m += 1 / r) <= i; ) {
var w = f.evaluate(m);
w = Math.min(k, Math.max(j, w)),
a.lineTo(u(m), v(w))
}
a.lineTo(u(i), v(f.evaluate(i))),
a.stroke(),
a.closePath()
}
}
}
;
var Wa = {
width: 60,
height: 60,
comps: [{
type: "rect",
rect: [0, 0, 60, 60],
background: {
func: function(a, b) {
return b._imageBackground
}
}
}, {
type: "gameCurveShape",
rect: [1, 1, 58, 58],
curve: {
func: function(a, b) {
return b && b.bezierCurve || null
}
}
}, {
type: "border",
rect: [0, 0, 60, 60],
borderWidth: 1,
borderColor: {
func: function(a, b) {
return b._imageBorderColor
}
}
}]
}
, Xa = m("qc.editor.CurveButton", qc.widget.Button, function Lf(a) {
var b = this;
Lf["super"].constructor.call(b, a),
b.on("click", b.handleClick, b),
b._bindingHandleDocumentMousedown = b.handleDocumentMousedown.bind(b);
var c = "rgba(0, 0, 0, 0)";
b.background = c,
b.gradientColor = c,
b.hoverBackground = c,
b.hoverGradientColor = c,
b.activeBackground = c,
b.activeGradientColor = c,
b.preferredSize = {
width: 60,
height: 60
},
b.iconWidth = 60,
b.iconHeight = 60,
b.borderWidth = 0
});
b.defineProperties(Xa.prototype, {
icon: {
get: function() {
return Wa
}
},
bezierCurve: {
get: function() {
return this._bezierCurve
},
set: function(a) {
this.setPropertyValue("bezierCurve", a)
}
}
}),
Xa.prototype.handleClick = function() {
var b = this
, c = b._curvePainterDialog
, d = b._curvePainter
, e = b._curveList;
if (!c) {
c = b._curvePainterDialog = new qc.editor.Dialog,
c.on("close", function() {
b.removeDialog(),
b.onEndEditCurve && b.onEndEditCurve()
}),
d = b._curvePainter = new $a,
e = b._curveList = a.liyk = new Ya,
e.painter = d,
d.fromActionEditor = b.fromActionEditor,
d.isAngle = b.isAngle,
d.rangeY = b.rangeY;
var f = new qc.widget.Container;
f.layout = new qc.widget.layout.BorderLayout(f),
f.layout.centerView = d,
f.layout.bottomView = e,
f.layout.splitterSize = 0,
f.layout.bottomHeight = 70,
c.title = fa._("Curve Editor"),
c.contentPadding = [2, 4, 2, 4],
c.content = f,
c.handleUndo = d.undo.bind(d),
c.handleRedo = d.redo.bind(d),
d.on("propertyChange", b.handleCurvePainterPropertyChange, b)
}
if (c.isInDOM())
b.removeDialog();
else {
var g = b.bezierCurve;
if (b.isAngle) {
g = new qc.BezierCurve;
for (var h = 0; h < b.bezierCurve._keys.length; h++) {
var i = b.bezierCurve._keys[h]
, j = i.value / Math.PI * 180
, k = g.addKey(i.time, j, i.inTangent / Math.PI * 180, i.outTangent / Math.PI * 180);
g._keys[k].type = i.type
}
}
d.bezierCurve = g;
var l = Wb(610, 530);
c.width = l.width,
c.height = l.height,
c.show(),
d.adjustCurve(),
document.addEventListener("mousedown", b._bindingHandleDocumentMousedown)
}
}
,
Xa.prototype.handleCurvePainterPropertyChange = function() {
var a = this;
a.iv()
}
,
Xa.prototype.handleDocumentMousedown = function(a) {
var b = this
, c = b._curvePainterDialog
, d = b._curvePainter
, e = b._curveList
, f = a.target;
c.view.contains(f) || b.view.contains(f) || d._contextMenu.view.contains(f) || e._contextMenu.view.contains(f) || b.removeDialog()
}
,
Xa.prototype.removeDialog = function() {
var a = this._curvePainterDialog
, b = this._curvePainter;
b._contextMenu.dispose(),
this._curveList._contextMenu.dispose(),
b.off("propertyChange", this.handleCurvePainterPropertyChange, this),
a.hide(),
delete this._curvePainterDialog,
delete this._curvePainter,
delete this._curveList,
document.removeEventListener("mousedown", this._bindingHandleDocumentMousedown),
this.emit("close")
}
,
Xa.prototype.calculateClientWidth = function() {
return this.width
}
,
Xa.prototype.calculateClientHeight = function() {
return this.height
}
;
var Ya = (m("qc.editor.CurveNode", qc.editor.ItemNode, function Mf(a) {
var b = this;
Mf["super"].constructor.call(b, a),
b.image = {
width: 60,
height: 60,
comps: [{
type: "rect",
rect: [0, 0, 60, 60],
background: {
func: function() {
return "rgb(30, 30, 30)"
}
}
}, {
type: "gameCurveShape",
rect: [1, 1, 58, 58],
curve: {
func: function() {
return b.curve
}
}
}, {
type: "border",
rect: [0, 0, 60, 60],
borderWidth: 1,
borderColor: {
func: function() {
return "rgb(10, 10, 10)"
}
}
}]
}
}),
m("qc.editor.CurveList", qc.editor.ItemList, function Nf() {
var a = this;
Nf["super"].constructor.call(a),
a.pannable = !1,
a._initMenu(),
a.itemWidth = 60,
a.itemHeight = 60,
a.itemGap = 5,
a.loadCurve()
}));
Ya.prototype._initMenu = function() {
var a = this
, b = new qc.editor.ContextMenu([{
label: fa._("Save as New Curve"),
disabled: function() {
return !a.painter || !a.painter.bezierCurve
},
action: function() {
var b = new qc.editor.CurveNode;
b.curve = a.painter.bezierCurve.clone(),
a.addCurveNode(b),
a.saveCurve()
}
}, {
label: fa._("Delete Curve"),
disabled: function() {
return 0 === a.selection.length
},
action: function() {
a.handleDelete(),
a.saveCurve()
}
}, {
label: fa._("Add Default Curves"),
action: function() {
a.addDefaultCurve(),
a.saveCurve()
}
}]);
a._contextMenu = b,
b.addTo(a)
}
,
Ya.prototype.saveCurve = function() {
for (var a = this, b = a.dataModel.datas, c = [], d = 0; d < b.length; d++)
b[d] && b[d].curve && c.push(b[d].curve.toJson());
fa.config.editor.curveTemplate = c,
qc.editor.Operation.UPDATE_EDITOR_SETTINGS(fa.config.editor)
}
,
Ya.prototype.loadCurve = function() {
var a = this;
if (fa.config.editor.curveTemplate) {
for (var b = fa.config.editor.curveTemplate, c = 0; c < b.length; c++)
if (b[c]) {
var d = new qc.BezierCurve;
d.fromJson(b[c]);
var e = new qc.editor.CurveNode;
e.curve = d,
a.addCurveNode(e)
}
} else
a.addDefaultCurve()
}
,
Ya.prototype.handleDelete = function() {
var a = this
, b = a.selection.slice(0);
b.forEach(function(b) {
a.dataModel.remove(b)
})
}
,
Ya.prototype.onDataClick = function(a) {
var b = this.painter.bezierCurve;
b._keys = a.curve.clone().keys,
this.painter.recordHistory(),
this.painter.epc("bezierCurve", 0, 1)
}
,
Ya.prototype.onDataDoubleClick = function() {}
,
Ya.prototype.addCurveNode = function(a) {
this.dataModel.add(a)
}
,
Ya.prototype.addDefaultCurve = function() {
var a = new qc.BezierCurve(new qc.Keyframe(0,0,0,0),new qc.Keyframe(1,0,0,0))
, b = new qc.editor.CurveNode;
b.curve = a,
this.addCurveNode(b);
var a = new qc.BezierCurve(new qc.Keyframe(0,0,1,1),new qc.Keyframe(1,1,1,1))
, b = new qc.editor.CurveNode;
b.curve = a,
this.addCurveNode(b),
a = new qc.BezierCurve(new qc.Keyframe(0,0,.5,.5),new qc.Keyframe(1,1,2,2)),
b = new qc.editor.CurveNode,
b.curve = a,
this.addCurveNode(b),
a = new qc.BezierCurve(new qc.Keyframe(0,0,2,2),new qc.Keyframe(1,1,.5,.5)),
b = new qc.editor.CurveNode,
b.curve = a,
this.addCurveNode(b),
a = new qc.BezierCurve(new qc.Keyframe(0,0,1,1),new qc.Keyframe(1,0,1,1)),
b = new qc.editor.CurveNode,
b.curve = a,
this.addCurveNode(b),
a = new qc.BezierCurve(new qc.Keyframe(0,0,0,0),new qc.Keyframe(1,1,0,0)),
b = new qc.editor.CurveNode,
b.curve = a,
this.addCurveNode(b)
}
;
var Za = m("qc.editor.CurvePainterInteractor", b, function(a) {
var b = this;
b._painter = a,
b.addListeners(),
b._handleDocumentMouseDown = function(b) {
var c = a._contextMenu;
c && c.view && !c.view.contains(b.target) && c.hide()
}
}, {
handle_mousedown: function(a) {
0 === a.button && this.handle_touchstart(a)
},
handle_touchstart: function(a) {
Y(a),
z(this, a);
var b = this
, c = b._painter
, d = c.lp(a);
b.onTouchStart(d, a)
},
handle_mouseup: function(a) {
this.handle_touchend(a)
},
handle_touchend: function(a) {
Y(a),
this.onTouchEnd()
},
handleWindowMouseMove: function(a) {
this.handleWindowTouchMove(a)
},
handleWindowTouchMove: function(a) {
this.onTouchMove(this._painter.lp(a))
},
handleWindowMouseUp: function(a) {
this.handleWindowTouchEnd(a)
},
handleWindowTouchEnd: function(a) {
Y(a),
this.onTouchEnd()
},
handle_contextmenu: function(a) {
Y(a),
this.showContextMenu(this._painter.lp(a), a)
},
handle_mousewheel: function(a) {
this.handleScroll(a, (a.wheelDeltaX || 0) / 40, a.wheelDelta / 40)
},
handle_DOMMouseScroll: function(a) {
this.handleScroll(a, 0, -a.detail)
},
handleScroll: function(a, b, c) {
this.view;
Y(a),
this.onZoom(this._painter.lp(a), b, c)
}
}, {
interactor: !0
}, {
view: {
get: function() {
return this._painter
}
}
});
Za.KEY_HITAREA = 36,
Za.LINE_HITAREA = 4,
Za.prototype.showContextMenu = function(a, b) {
for (var c = this, d = c._painter, e = d._contextMenu, f = d.bezierCurve, g = f.keys, h = -1, i = 0; i < g.length; ++i) {
var j = d.xPos(g[i].time)
, k = d.yPos(g[i].value);
if (Math.pow(a.x - j, 2) * Math.pow(a.y - k, 2) <= Za.KEY_HITAREA) {
h = i;
break
}
}
if (0 > h) {
var k = d.yPos(f.evaluate(d.xPrecisionValue(a.x)));
if (Math.abs(k - a.y) <= Za.LINE_HITAREA)
return;
e.items = [{
label: fa._("Add Key"),
action: function() {
var b = d.xPrecisionValue(a.x)
, e = f.evaluateDerivative(b);
f.addKey(b, f.evaluate(b), e, e),
d.recordHistory(),
c._repaintPainter(),
d.fromActionEditor && c.syncActionEditor()
}
}, {
label: fa._("Reset View"),
action: function() {
d.adjustCurve(255)
}
}]
} else {
var l = g[h];
e.items = [{
label: fa._("Delete Key"),
action: function() {
var a = f._downKey === f.keys[h];
f.removeKey(h),
a && (f._downKey = null),
d.recordHistory(),
c._repaintPainter(),
d.fromActionEditor && c.syncActionEditor()
}
}, {
label: fa._(l.type === qc.Keyframe.AUTO ? "√ Auto" : "Auto"),
action: function() {
l.type = qc.Keyframe.AUTO,
f.makeKeyframeAuto(h),
d.recordHistory(),
c._repaintPainter(),
d.fromActionEditor && c.syncActionEditor()
}
}, {
label: fa._(l.type === qc.Keyframe.FREE_SMOOTH || l.outTangent === l.inTangent ? "√ Free Smooth" : "Free Smooth"),
action: function() {
l.type = qc.Keyframe.FREE_SMOOTH,
f.makeKeyframeSmooth(h),
d.recordHistory(),
c._repaintPainter(),
d.fromActionEditor && c.syncActionEditor()
}
}, {
label: fa._(l.type === qc.Keyframe.FLAT || l.outTangent === l.inTangent && 0 === l.inTangent ? "√ Flat" : "Flat"),
action: function() {
l.type = qc.Keyframe.FLAT,
f.makeKeyframeFlat(h),
d.recordHistory(),
c._repaintPainter(),
d.fromActionEditor && c.syncActionEditor()
}
}, {
label: fa._(l.type === qc.Keyframe.BROKEN ? "√ Broken" : "Broken"),
action: function() {
l.type = qc.Keyframe.BROKEN,
c._repaintPainter(),
d.fromActionEditor && c.syncActionEditor()
}
}, {
label: fa._(l.type === qc.Keyframe.LINEAR ? "√ Linear" : "Linear"),
action: function() {
l.type = qc.Keyframe.LINEAR,
f.makeKeyframeLinear(h),
d.recordHistory(),
c._repaintPainter(),
d.fromActionEditor && c.syncActionEditor()
}
}]
}
document.addEventListener("mousedown", c._handleDocumentMouseDown),
e.on("hide", function() {
document.removeEventListener("mousedown", c._handleDocumentMouseDown)
}),
e.show(b.pageX, b.pageY)
}
,
Za.prototype.showWrapContextMenu = function(a, b, c) {
var d = this
, e = d._painter
, f = e._contextMenu
, g = e.bezierCurve
, h = c ? g.preWrapMode : g.postWrapMode;
f.items = [{
label: fa._(h === qc.BezierCurve.WRAP_PINGPONG ? "√ Ping Pong" : "Ping Pong"),
action: function() {
c ? g.preWrapMode = qc.BezierCurve.WRAP_PINGPONG : g.postWrapMode = qc.BezierCurve.WRAP_PINGPONG,
e.recordHistory(),
d._repaintPainter()
}
}, {
label: fa._(h === qc.BezierCurve.WRAP_LOOP ? "√ Loop" : "Loop"),
action: function() {
c ? g.preWrapMode = qc.BezierCurve.WRAP_LOOP : g.postWrapMode = qc.BezierCurve.WRAP_LOOP,
e.recordHistory(),
d._repaintPainter()
}
}, {
label: fa._(h === qc.BezierCurve.WRAP_CLAMP ? "√ Clamp" : "Clamp"),
action: function() {
c ? g.preWrapMode = qc.BezierCurve.WRAP_CLAMP : g.postWrapMode = qc.BezierCurve.WRAP_CLAMP,
e.recordHistory(),
d._repaintPainter()
}
}],
document.addEventListener("mousedown", d._handleDocumentMouseDown),
f.on("hide", function() {
document.removeEventListener("mousedown", d._handleDocumentMouseDown)
}),
setTimeout(function() {
f.show(b.pageX, b.pageY)
}, 20)
}
,
Za.prototype.onTouchStart = function(a, b) {
var c = this
, d = c._painter
, e = d.bezierCurve
, f = e.keys
, g = (new Date).valueOf();
(!c._lastClickTime || c._lastClickTime + 300 < g) && (c._clickCount = 0),
c._clickCount = 1 + (c._clickCount || 0),
c._lastClickTime = g;
for (var h = 0; h < f.length; ++h) {
var i = d.xPos(f[h].time)
, j = d.yPos(f[h].value);
if (Math.pow(a.x - i, 2) + Math.pow(a.y - j, 2) <= Za.KEY_HITAREA)
return c._editorTarget = {
type: 0,
idx: h,
offX: a.x - i,
offY: a.y - j
},
c._downKey = f[h],
void c._repaintPainter()
}
for (var h = 0; h < f.length; h++) {
if (0 !== h) {
var k = Math.atan(f[h].inTangent);
k = Math.atan2(Math.sin(k) * d.zoomY, Math.cos(k) * d.zoomX);
var l = d.controlLength * Math.cos(k)
, m = d.controlLength * Math.sin(k)
, i = d.xPos(f[h].time) - l
, j = d.yPos(f[h].value) + m;
if (Math.pow(a.x - i, 2) + Math.pow(a.y - j, 2) <= Za.KEY_HITAREA)
return c._editorTarget = {
type: 1,
idx: h,
offX: a.x - i,
offY: a.y - j
},
void c._repaintPainter()
}
if (h !== f.length - 1) {
var k = Math.atan(f[h].outTangent);
k = Math.atan2(Math.sin(k) * d.zoomY, Math.cos(k) * d.zoomX);
var l = d.controlLength * Math.cos(k)
, m = d.controlLength * Math.sin(k)
, i = d.xPos(f[h].time) + l
, j = d.yPos(f[h].value) - m;
if (Math.pow(a.x - i, 2) + Math.pow(a.y - j, 2) <= Za.KEY_HITAREA)
return c._editorTarget = {
type: 2,
idx: h,
offX: a.x - i,
offY: a.y - j
},
void c._repaintPainter()
}
}
var j = d.yPos(e.evaluate(d.xPrecisionValue(a.x)));
if (Math.abs(j - a.y) <= Za.LINE_HITAREA) {
if (c._clickCount > 1) {
var n = d.xPrecisionValue(a.x)
, o = e.evaluateDerivative(n)
, p = e.addKey(n, e.evaluate(n), o, o);
c._repaintPainter(),
d.fromActionEditor && c.syncActionEditor(),
c._clickCount = 0,
c._downKey = e.keys[p]
} else
c._editorTarget = {
type: 3,
preX: a.x,
preY: a.y
};
return void c._repaintPainter()
}
var q = function(a, b) {
return b.x >= a.x && b.y >= a.y && b.x <= a.x + a.width && b.y <= a.y + a.height
}
, r = d.drawInfo;
if (r)
if (q({
x: r.hScrollSlider.x - 1.5 * r.scrollSize,
y: r.hScrollSlider.y,
width: r.hScrollSlider.width + 3 * r.scrollSize,
height: r.scrollSize
}, a)) {
if (c._clickCount > 1)
return void d.adjustCurve(1);
c._editorTarget = a.x < r.hScrollSlider.x - .5 * r.scrollSize ? {
type: 5,
preX: a.x,
preY: a.y,
axis: "x",
dir: -1
} : a.x < r.hScrollSlider.x + r.hScrollSlider.width + .5 * r.scrollSize ? {
type: 4,
preX: a.x,
preY: a.y,
axis: "x"
} : {
type: 5,
preX: a.x,
preY: a.y,
axis: "x",
dir: 1
}
} else if (q({
x: r.vScrollSlider.x,
y: r.vScrollSlider.y - 1.5 * r.scrollSize,
width: r.scrollSize,
height: r.vScrollSlider.height + 3 * r.scrollSize
}, a)) {
if (c._clickCount > 1)
return void d.adjustCurve(2);
c._editorTarget = a.y < r.vScrollSlider.y - .5 * r.scrollSize ? {
type: 5,
preX: a.x,
preY: a.y,
axis: "y",
dir: -1
} : a.y < r.vScrollSlider.y + r.vScrollSlider.height + .5 * r.scrollSize ? {
type: 4,
preX: a.x,
preY: a.y,
axis: "y"
} : {
type: 5,
preX: a.x,
preY: a.y,
axis: "y",
dir: 1
}
}
var s = d.wrapDrawInfo;
s && (q(s[0], a) ? c.showWrapContextMenu(a, b, !0) : q(s[1], a) && c.showWrapContextMenu(a, b, !1)),
!c._editorTarget && q({
x: 0,
y: 0,
width: r.vScrollSlider.x - 5,
height: r.hScrollSlider.y - 5
}, a) && (c._editorTarget = {
type: 9,
preX: a.x,
preY: a.y
})
}
,
Za.prototype._repaintPainter = function() {
this._painter.epc("bezierCurve", 0, 1)
}
,
Za.prototype.onTouchEnd = function() {
this._editorTarget = null,
this._curveChanged && (this._painter.recordHistory(),
this._curveChanged = !1),
this._repaintPainter()
}
,
Za.prototype.getMovingKey = function() {
var a = this
, b = a._painter
, c = a._editorTarget;
if (c) {
var d = b.bezierCurve
, e = d.keys;
return 0 === c.type ? [e[c.idx]] : 3 === c.type ? e : []
}
}
,
Za.prototype.onTouchMove = function(a) {
var b = this
, c = b._painter
, d = b._editorTarget;
if (d) {
var e = c.bezierCurve
, f = e.keys
, g = c.rangeY || {}
, h = g.min
, i = g.max
, j = c.xPrecisionValue(a.x)
, k = c.xPrecisionValue(a.y);
if (c.fromActionEditor && 0 > j && (j = 0),
3 === d.type) {
for (var l = j - c.xPrecisionValue(d.preX), m = c.xPrecisionValue(d.preY) - k, n = 0; n < f.length; ++n)
f[n].time += l,
f[n].value += m,
"number" == typeof h && f[n].value < h && (f[n].value = h),
"number" == typeof i && f[n].value > i && (f[n].value = i),
c.fromActionEditor && 0 > j && f[n].time < 0 && (f[n].time = 0);
return d.preX = a.x,
d.preY = a.y,
b._curveChanged = !0,
b._repaintPainter(),
void (c.fromActionEditor && b.syncActionEditor())
}
if (0 === d.type) {
var o = f[d.idx];
e.removeKey(d.idx),
o.time = c.xPrecisionValue(a.x - d.offX),
o.value = c.yPrecisionValue(a.y - d.offY),
"number" == typeof h && o.value < h && (o.value = h),
"number" == typeof i && o.value > i && (o.value = i),
c.fromActionEditor && o.time < 0 && (o.time = 0),
d.idx = e.addKey(o);
for (var n = -1; ++n < f.length; )
f[n].type === qc.Keyframe.AUTO && e.makeKeyframeAuto(n);
return b._curveChanged = !0,
b._repaintPainter(),
void (c.fromActionEditor && b.syncActionEditor())
}
if (1 === d.type) {
var o = f[d.idx];
if (o.type === qc.Keyframe.AUTO || o.type === qc.Keyframe.FLAT)
return;
var p = c.xPrecisionValue(a.x - d.offX)
, q = c.yPrecisionValue(a.y - d.offY)
, r = Math.atan2(o.value - q, o.time - p);
return r = r < -Math.PI / 2 ? -Math.PI / 2 : r,
r = r > Math.PI / 2 ? Math.PI / 2 : r,
o.inTangent = Math.tan(r),
o.type === qc.Keyframe.FREE_SMOOTH && (o.outTangent = o.inTangent),
b._curveChanged = !0,
b._repaintPainter(),
void (c.fromActionEditor && b.syncActionEditor())
}
if (2 === d.type) {
var o = f[d.idx];
if (o.type === qc.Keyframe.AUTO || o.type === qc.Keyframe.FLAT)
return;
var p = c.xPrecisionValue(a.x - d.offX)
, q = c.yPrecisionValue(a.y - d.offY)
, r = Math.atan2(q - o.value, p - o.time);
return r = r < -Math.PI / 2 ? -Math.PI / 2 : r,
r = r > Math.PI / 2 ? Math.PI / 2 : r,
o.outTangent = Math.tan(r),
o.type === qc.Keyframe.FREE_SMOOTH && (o.inTangent = o.outTangent),
b._curveChanged = !0,
b._repaintPainter(),
void (c.fromActionEditor && b.syncActionEditor())
}
if (4 === d.type) {
var s = c.drawInfo
, t = d.axis
, u = 0;
if ("x" === t && (u = s.hScrollBounds.width - s.hScrollSlider.width) > 0) {
var v = s.hScrollSlider.x - s.hScrollBounds.x + (a.x - d.preX);
v = 0 > v ? 0 : v > u ? u : v;
var w = v - s.hScrollSlider.x + s.hScrollBounds.x;
0 !== w && (c.offX += w * (s.bounds.width - s.showRect.width) / u)
} else if ("y" === t && (u = s.vScrollBounds.height - s.vScrollSlider.height) > 0) {
var v = s.vScrollSlider.y - s.vScrollBounds.y + (a.y - d.preY);
v = 0 > v ? 0 : v > u ? u : v;
var w = v - s.vScrollSlider.y + s.vScrollBounds.y;
0 !== w && (c.offY += w * (s.bounds.height - s.showRect.height) / u)
}
return d.preX = a.x,
d.preY = a.y,
void b._repaintPainter()
}
if (5 === d.type) {
var s = c.drawInfo
, t = d.axis;
return "x" === t ? c.changeHScrollInfo(d.dir < 0 ? a.x - d.preX : 0, d.dir > 0 ? a.x - d.preX : 0) : c.changeVScrollInfo(d.dir < 0 ? a.y - d.preY : 0, d.dir > 0 ? a.y - d.preY : 0),
d.preX = a.x,
d.preY = a.y,
void b._repaintPainter()
}
return 9 === d.type ? (c.offX -= a.x - d.preX,
c.offY -= a.y - d.preY,
d.preX = a.x,
d.preY = a.y,
void b._repaintPainter()) : void 0
}
}
,
Za.prototype.onZoom = function(a, b, c) {
var d = this
, e = d._painter
, f = {
x: e.xPrecisionValue(a.x),
y: e.yPrecisionValue(a.y)
};
c > 0 ? (e.zoomX *= 1.05,
e.zoomY *= 1.05) : 0 > c && (e.zoomX /= 1.05,
e.zoomY /= 1.05),
e.offX = e.paddingLeft + e.zeroX + f.x * e.zoomX - a.x,
e.offY = e.paddingTop + e.zeroY - f.y * e.zoomY - a.y,
d._repaintPainter()
}
,
Za.prototype.syncActionEditor = function() {
if (fa.actionEditor && fa.actionEditor.action) {
var a = fa.actionEditor.inspector.propOb
, b = fa.actionEditor.inspector.attrib;
if (this._painter.isAngle) {
a.propMap[b].curve._keys = [];
for (var c = 0; c < this._painter.bezierCurve._keys.length; c++) {
var d = this._painter.bezierCurve._keys[c]
, e = d.value / 180 * Math.PI
, f = a.propMap[b].curve.addKey(d.time, e, d.inTangent / 180 * Math.PI, d.outTangent / 180 * Math.PI);
a.propMap[b].curve._keys[f].type = d.type
}
}
if (a) {
var g = a.path + ":" + a.propertyId + "~" + b;
fa.actionEditor.timeLine.gvFrame.redrawAttrib(g, a, b)
}
fa.actionEditor.action.getDuration(!0)
}
}
;
var $a = m("qc.editor.CurvePainter", qc.editor.Painter, function Of(a) {
var b = this;
b._contextMenu = new qc.editor.ContextMenu,
Of["super"].constructor.call(b, a),
b.addBottomPainter(b.draw.bind(b)),
b.interactor = new qc.editor.CurvePainterInteractor(b),
b.paddingTop = 20,
b.paddingBottom = 35,
b.paddingLeft = 50,
b.paddingRight = 65,
b.background = null,
b.scrollSize = 10,
b.maxZoom = 1e4,
b._history = [],
b._currIndex = -1
});
b.defineProperties($a.prototype, {
bezierCurve: {
get: function() {
return this._bezierCurve
},
set: function(a) {
this.setPropertyValue("bezierCurve", a),
this.recordHistory()
}
},
curveShowRect: {
get: function() {
return {
x: this.paddingLeft,
y: this.paddingTop,
width: (this.clientWidth || this.getPreferredSize().width) - this.paddingLeft - this.paddingRight,
height: (this.clientHeight || this.getPreferredSize().height) - this.paddingTop - this.paddingBottom
}
}
},
zeroX: {
get: function() {
return isNaN(this._zeroX) ? 0 : this._zeroX
},
set: function(a) {
this._zeroX = a
}
},
zeroY: {
get: function() {
return isNaN(this._zeroY) ? this.curveShowRect.height : this._zeroY
},
set: function(a) {
this._zeroY = a
}
},
zoomX: {
get: function() {
var a = isNaN(this._zoomX) ? this.curveShowRect.width : this._zoomX;
return a
},
set: function(a) {
isNaN(a) || a === 1 / 0 || a === -(1 / 0) || 0 > a || (this._zoomX = a)
}
},
zoomY: {
get: function() {
var a = isNaN(this._zoomY) ? this.curveShowRect.height : this._zoomY;
return a
},
set: function(a) {
isNaN(a) || a === 1 / 0 || a === -(1 / 0) || 0 > a || (this._zoomY = a)
}
},
offX: {
get: function() {
return isNaN(this._offX) ? 0 : this._offX
},
set: function(a) {
this._offX = a
}
},
offY: {
get: function() {
return isNaN(this._offY) ? 0 : this._offY
},
set: function(a) {
this._offY = a
}
},
controlLength: {
get: function() {
return isNaN(this._controlLength) ? 50 : this._controlLength
},
set: function(a) {
this._controlLength = a
}
},
drawInfo: {
get: function() {
return this._drawInfo
}
},
wrapDrawInfo: {
get: function() {
return this._wrapDrawInfo
}
},
horScrollBounds: {
get: function() {
var a = 5;
return {
x: a + 1.5 * this.scrollSize,
y: (this.clientHeight || this.getPreferredSize().height) - a - this.scrollSize,
width: Math.max(this.scrollSize, (this.clientWidth || this.getPreferredSize().width) - 2 * a - 4 * this.scrollSize),
height: this.scrollSize
}
}
},
verScrollBounds: {
get: function() {
var a = 5;
return {
x: (this.clientWidth || this.getPreferredSize().width) - a - this.scrollSize,
y: a + 1.5 * this.scrollSize,
width: this.scrollSize,
height: Math.max((this.clientHeight || this.getPreferredSize().height) - 2 * a - 4 * this.scrollSize, this.scrollSize)
}
}
}
}),
$a.prototype.recordHistory = function() {
var a = this;
a._history.splice(++a._currIndex, a._history.length - a._currIndex, a.bezierCurve.clone()),
a._history.length > 1e3 && (a._history.shift(),
--a._currIndex)
}
,
$a.prototype.undo = function() {
var a = this;
a._currIndex > 0 && (a.bezierCurve.keys = a._history[--a._currIndex].clone().keys,
a.epc("bezierCurve", 0, 1))
}
,
$a.prototype.redo = function() {
var a = this;
a._currIndex < a._history.length - 1 && (a.bezierCurve.keys = a._history[++a._currIndex].clone().keys,
a.epc("bezierCurve", 0, 1))
}
,
$a.prototype._stepCalc = function(a) {
if (a === 1 / 0)
return 100;
a = Math.abs(a);
for (var b = 0; a > 10; )
a /= 10,
b++;
for (; 1 > a; )
a = 10 * a,
b--;
return Math.pow(10, b)
}
,
$a.prototype.getMinStepX = function() {
return this.fromActionEditor ? 1 : this._stepCalc(20 / this.zoomX)
}
,
$a.prototype.getMinStepY = function() {
return this._stepCalc(10 / this.zoomY)
}
,
$a.prototype.getPrecisionX = function() {
if (this.fromActionEditor)
return 1;
var a = this
, b = a.curveShowRect
, c = 2 * Math.abs((a.xValue(b.x + b.width) - a.xValue(b.x)) / b.width)
, d = this.fromActionEditor ? 1 : a._stepCalc(c)
, e = c / d;
return e > 5 ? 10 * d : e > 2 ? 5 * d : 2 * d
}
,
$a.prototype.getPrecisionY = function() {
var a = this
, b = a.curveShowRect
, c = 2 * Math.abs((a.yValue(b.y + b.height) - a.yValue(b.y)) / b.height)
, d = a._stepCalc(c)
, e = c / d;
return 2 > e ? d : 5 > e ? 2 * d : 5 * d
}
,
$a.prototype.xPos = function(a) {
var b = this
, c = b.paddingLeft + b.zeroX + a * b.zoomX - b.offX;
return c
}
,
$a.prototype.yPos = function(a) {
var b = this
, c = b.paddingTop + b.zeroY - a * b.zoomY - b.offY;
return c
}
,
$a.prototype.xValue = function(a) {
var b = this;
return (a - b.zeroX - b.paddingLeft + b.offX) / b.zoomX
}
,
$a.prototype.yValue = function(a) {
var b = this;
return (b.paddingTop + b.zeroY - b.offY - a) / b.zoomY
}
,
$a.prototype.xPrecisionValue = function(a) {
var b = this
, c = b.getPrecisionX()
, d = (a - b.zeroX - b.paddingLeft + b.offX) / b.zoomX;
return Math.round(Math.round(d / c) * c * 1e4) / 1e4
}
,
$a.prototype.yPrecisionValue = function(a) {
var b = this
, c = b.getPrecisionY()
, d = (b.paddingTop + b.zeroY - b.offY - a) / b.zoomY;
return Math.round(Math.round(d / c) * c * 1e4) / 1e4
}
,
$a.prototype.draw = function(a) {
var b = this
, c = b.bezierCurve;
c && (this.drawGrid(a),
this.drawWrapCurve(a, c),
this.drawCurve(a, c, b.zoomX, b.zoomY, b.xPos.bind(b), b.yPos.bind(b), b.xValue.bind(b), b.yValue.bind(b)),
this.drawControl(a, c, b.controlLength, b.zoomX, b.zoomY, b.xPos.bind(b), b.yPos.bind(b), b.xValue.bind(b), b.yValue.bind(b)),
this.drawCurveInfo(a, c),
this.drawScroll(a))
}
,
$a.prototype.drawGrid = function(a) {
var b = this.getMinStepX()
, c = this.getMinStepY()
, d = this.xValue(0)
, e = this.yValue(0)
, f = this.xValue(this.clientWidth || this.getPreferredSize().width)
, g = this.yValue(this.clientHeight || this.getPreferredSize().height);
d = Math.floor(d / b) * b,
e = Math.floor(e / c) * c,
f = Math.ceil(f / b) * b,
g = Math.ceil(g / c) * c,
a.strokeStyle = "rgba(117, 117, 117, 0.3)",
a.lineWidth = .3,
a.beginPath();
for (var h = e; h >= g; h -= c)
5 === Math.abs(Math.round(h / c % 10)) && (a.moveTo(this.xPos(d), this.yPos(h)),
a.lineTo(this.xPos(f), this.yPos(h)));
for (var i = d; f >= i; i += b)
5 === Math.abs(Math.round(i / b % 10)) && (a.moveTo(this.xPos(i), this.yPos(e)),
a.lineTo(this.xPos(i), this.yPos(g)));
a.stroke(),
a.closePath(),
a.strokeStyle = "rgba(117, 117, 117, 0.5)",
a.lineWidth = 1,
a.beginPath();
for (var h = e; h >= g; h -= c)
0 === Math.abs(Math.round(h / c) % 10) && (a.moveTo(this.xPos(d), this.yPos(h)),
a.lineTo(this.xPos(f), this.yPos(h)));
for (var i = d; f >= i; i += b)
0 === Math.abs(Math.round(i / b) % 10) && (a.moveTo(this.xPos(i), this.yPos(e)),
a.lineTo(this.xPos(i), this.yPos(g)));
a.stroke(),
a.closePath(),
a.font = "12px",
a.fillStyle = "rgba(117, 117, 117, 0.8)";
var j = Math.ceil(25 / (c * this.zoomY * 5))
, k = Math.ceil(50 / (b * this.zoomX * 5));
j = 5 * (1 === j ? j : 2 * Math.ceil(j / 2)),
k = 5 * (1 === k ? k : 2 * Math.ceil(k / 2)),
a.textAlign = "left",
a.textBaseline = "bottom";
for (var h = e; h >= g; h -= c)
0 === Math.abs(Math.round(h / c) % j) && a.fillText(Math.round(1e4 * h) / 1e4, 5, this.yPos(h));
for (var i = d; f >= i; i += b)
0 === Math.abs(Math.round(i / b) % k) && a.fillText(Math.round(1e4 * i) / 1e4, this.xPos(i), (this.clientHeight || this.getPreferredSize().height) - 25)
}
,
$a.prototype.drawWrapCurve = function(a, b) {
if (0 !== b.keys.length) {
var c = 0
, d = this.xValue(c)
, e = b.evaluate(d)
, f = b.totalTime;
for (a.strokeStyle = "rgb(175, 175, 175)",
a.lineWidth = 1,
a.beginPath(),
a.moveTo(this.xPos(d), this.yPos(e)); ++c <= this.clientWidth; ) {
var g = this.xValue(c)
, h = (g - b.startTime) % f;
h = 0 > h ? h + f : h;
var i = (d - b.startTime) % f;
i = 0 > i ? i + f : i,
i > h && (d = b.startTime + Math.floor((g - b.startTime) / f) * f,
e = b.evaluate(d, !0),
a.lineTo(this.xPos(d), this.yPos(e))),
d = g,
e = b.evaluate(d, !0),
a.lineTo(this.xPos(d), this.yPos(e))
}
a.stroke(),
a.closePath()
}
}
,
$a.prototype.drawCurve = function(a, b, c, d, e, f) {
this._curveField = null;
var g = 1 / c
, h = b.keys;
if (!(h.length <= 0)) {
var i = this.interactor && this.interactor._editorTarget
, j = h[0].time
, k = h[h.length - 1].time
, l = j
, m = h[0].value
, n = j
, o = h[0].value;
a.strokeStyle = i && 3 === i.type ? "rgb(121, 255, 121)" : "rgb(0, 200, 0)",
a.lineWidth = 1,
a.beginPath(),
a.moveTo(e(j), f(q));
for (var p = j; k > p; p += g) {
var q = b.evaluate(p);
a.lineTo(e(p), f(q)),
l = Math.min(p, l),
n = Math.max(p, n),
m = Math.min(q, m),
o = Math.max(q, o)
}
var q = h[h.length - 1].value;
l = Math.min(k, l),
n = Math.max(k, n),
m = Math.min(q, m),
o = Math.max(q, o),
a.lineTo(e(k), f(q)),
a.stroke(),
a.closePath(),
a.fillStyle = "rgb(0, 255, 0)",
a.lineWidth = 1,
a.beginPath();
for (var r = 0; r < h.length; r++)
a.moveTo(e(h[r].time), f(h[r].value)),
a.arc(e(h[r].time), f(h[r].value), 2, 0, 2 * Math.PI);
return a.fill(),
a.closePath(),
this.fromActionEditor && fa.scene.iv(),
this._curveField = [l, n, m, o],
this._curveField
}
}
,
$a.prototype.drawControl = function(a, b, c, d, e, f, g) {
for (var h = b.keys, i = this.interactor && this.interactor._downKey, j = this.interactor && this.interactor._editorTarget, k = j && j.type >= 0 && j.type <= 2 ? j.idx : -1, l = j ? j.type : -1, m = 0; m < h.length; m++)
i && i === h[m] && (a.fillStyle = k === m ? "rgba(230, 230, 230, 1)" : "rgba(212, 212, 212, 0.8)",
a.lineWidth = 1,
a.beginPath(),
a.moveTo(f(h[m].time), g(h[m].value)),
a.arc(f(h[m].time), g(h[m].value), 2.5, 0, 2 * Math.PI),
a.fill(),
a.closePath());
for (var m = 0; m < h.length; m++)
if (i && i === h[m] && h[m].type !== qc.Keyframe.AUTO) {
if (a.strokeStyle = k === m && 1 === l ? "rgba(230, 230, 230, 1)" : "rgba(212, 212, 212, 0.8)",
a.lineWidth = 1,
a.beginPath(),
0 !== m) {
a.moveTo(f(h[m].time), g(h[m].value));
var n = Math.atan(h[m].inTangent);
n = Math.atan2(Math.sin(n) * e, Math.cos(n) * d);
var o = c * Math.cos(n)
, p = c * Math.sin(n);
a.lineTo(f(h[m].time) - o, g(h[m].value) + p),
a.arc(f(h[m].time) - o, g(h[m].value) + p, 1.5, 0, 2 * Math.PI)
}
if (a.stroke(),
a.closePath(),
a.strokeStyle = k === m && 2 === l ? "rgba(230, 230, 230, 1)" : "rgba(212, 212, 212, 0.8)",
a.beginPath(),
m !== h.length - 1) {
a.moveTo(f(h[m].time), g(h[m].value));
var n = Math.atan(h[m].outTangent);
n = Math.atan2(Math.sin(n) * e, Math.cos(n) * d);
var o = c * Math.cos(n)
, p = c * Math.sin(n);
a.lineTo(f(h[m].time) + o, g(h[m].value) - p),
a.arc(f(h[m].time) + o, g(h[m].value) - p, 1.5, 0, 2 * Math.PI)
}
a.stroke(),
a.closePath()
}
}
,
$a.prototype.drawCurveInfo = function(a, b) {
var c = this
, d = c.interactor && c.interactor.getMovingKey();
if (a.fillStyle = "rgba(212, 212, 212, 0.8)",
a.font = "24px",
d)
for (var e = d.length; e--; ) {
var f = d[e];
a.textAlign = "center",
a.textBaseline = "bottom",
a.fillText("(" + f.time + "," + f.value + ")", this.xPos(f.time), this.yPos(f.value))
}
var g = b.keys;
if (g.length > 0) {
var h = ["Clamp", "Loop", "PingPong"];
a.textAlign = "right",
a.textBaseline = "top",
a.fillText(h[b.preWrapMode], this.xPos(g[0].time), this.yPos(g[0].value));
var i = a.measureText(h[b.preWrapMode]);
a.textAlign = "left",
a.fillText(h[b.postWrapMode], this.xPos(g[g.length - 1].time), this.yPos(g[g.length - 1].value));
var j = a.measureText(h[b.postWrapMode]);
this._wrapDrawInfo = [{
x: this.xPos(g[0].time) - i.width,
y: this.yPos(g[0].value),
width: i.width,
height: 24
}, {
x: this.xPos(g[g.length - 1].time),
y: this.yPos(g[g.length - 1].value),
width: j.width,
height: 24
}]
} else
this._wrapDrawInfo = null
}
,
$a.prototype.drawScroll = function(a) {
var b = this
, c = this._curveField;
if (c) {
var d = this.scrollSize
, e = b.curveShowRect
, f = b.horScrollBounds
, g = b.verScrollBounds
, h = {
x: Math.min(e.x, this.xPos(c[0])),
y: Math.min(e.y, this.yPos(c[3])),
width: Math.max(e.x + e.width, this.xPos(c[1])) - Math.min(e.x, this.xPos(c[0])),
height: Math.max(e.y + e.height, this.yPos(c[2])) - Math.min(e.y, this.yPos(c[3]))
}
, i = {
width: f.width * e.width / h.width,
height: f.height,
x: f.x,
y: f.y
};
if (h.x !== e.x && h.width > e.width && i.width < f.width) {
var j = (e.x - h.x) * (f.width - i.width) / (h.width - e.width);
i.x += Math.max(j, 0)
}
var k = {
width: g.width,
height: g.height * e.height / h.height,
x: g.x,
y: g.y
};
if (h.y !== e.y && h.height > e.height && k.height < g.height) {
var l = (e.y - h.y) * (g.height - k.height) / (h.height - e.height);
k.y += Math.max(l, 0)
}
a.fillStyle = "rgb(29, 28, 29)",
a.fillRect(i.x - .5 * d, i.y, i.width + d, i.height),
a.fillRect(k.x, k.y - .5 * d, k.width, k.height + d),
a.fillStyle = "rgb(61, 61, 61)",
a.lineWidth = 1,
a.beginPath(),
a.moveTo(i.x - d, i.y + d / 2),
a.arc(i.x - d, i.y + d / 2, d / 2, 0, 2 * Math.PI),
a.rect(i.x - d, i.y, d / 2, d),
a.moveTo(i.x + i.width + d, i.y + d / 2),
a.arc(i.x + i.width + d, i.y + d / 2, d / 2, 0, 2 * Math.PI),
a.rect(i.x + i.width + .5 * d, i.y, d / 2, d),
a.moveTo(k.x + d / 2, k.y - d),
a.arc(k.x + d / 2, k.y - d, d / 2, 0, 2 * Math.PI),
a.rect(k.x, k.y - d, d, d / 2),
a.moveTo(k.x + d / 2, k.y + k.height + d),
a.arc(k.x + d / 2, k.y + k.height + d, d / 2, 0, 2 * Math.PI),
a.rect(k.x, k.y + k.height + .5 * d, d, d / 2),
a.fill(),
a.closePath(),
a.strokeStyle = "rgb(15, 15, 15)",
a.lineWidth = 1,
a.beginPath(),
a.moveTo(i.x - d, i.y),
a.lineTo(i.x + i.width + d, i.y),
a.moveTo(i.x - d, i.y + d),
a.lineTo(i.x + i.width + d, i.y + d),
a.moveTo(i.x - d, i.y + d),
a.arc(i.x - d, i.y + d / 2, d / 2, .5 * Math.PI, 1.5 * Math.PI),
a.moveTo(i.x + i.width + d, i.y),
a.arc(i.x + i.width + d, i.y + d / 2, d / 2, -.5 * Math.PI, .5 * Math.PI),
a.moveTo(k.x, k.y - d),
a.lineTo(k.x, k.y + k.height + d),
a.moveTo(k.x + d, k.y - d),
a.lineTo(k.x + d, k.y + k.height + d),
a.moveTo(k.x, k.y - d),
a.arc(k.x + d / 2, k.y - d, d / 2, Math.PI, 2 * Math.PI),
a.moveTo(k.x + d, k.y + k.height + d),
a.arc(k.x + d / 2, k.y + k.height + d, d / 2, 0, Math.PI),
a.stroke(),
a.closePath(),
this._drawInfo = {
showRect: e,
bounds: h,
vScrollBounds: g,
hScrollBounds: f,
vScrollSlider: k,
hScrollSlider: i,
scrollSize: d
}
}
}
,
$a.prototype.changeScroll = function(a, b, c, d, e, f) {
if (0 !== e) {
if (0 > e && d.start <= c.start)
return;
if (e > 0 && b.start > a.start)
b.start = Math.max(b.start - e, a.start),
b.len = b.end - b.start;
else {
if (d.start += e,
d.start = Math.max(d.start, c.start),
d.start = Math.min(d.start, d.end),
d.start === d.end)
return;
var g = d.start - c.start
, h = c.end - d.end
, i = c.len - g - h
, j = b.start
, k = b.end;
j = a.start - a.len * g / i,
b.end >= a.end && (k = a.end + a.len * h / i),
b.start = j,
b.end = k,
b.len = b.end - b.start
}
} else if (0 !== f) {
if (f > 0 && d.end >= c.end)
return;
if (0 > f && b.end < a.end)
b.end = Math.min(b.end - f, a.end),
b.len = b.end - b.start;
else {
if (d.end += f,
d.end = Math.min(d.end, c.end),
d.end = Math.max(d.end, d.start),
d.end === d.start)
return;
var g = d.start - c.start
, h = c.end - d.end
, i = c.len - g - h
, j = b.start
, k = b.end;
k = a.end + a.len * h / i,
b.start < a.start && (j = a.start - a.len * g / i),
b.start = j,
b.end = k,
b.len = b.end - b.start
}
}
return b
}
,
$a.prototype.changeHScrollInfo = function(a, b) {
var c = this
, d = this._curveField;
if (d) {
var e = c.curveShowRect
, f = c.horScrollBounds
, g = c.drawInfo.hScrollSlider
, h = {
start: e.x,
end: e.x + e.width,
len: e.width
}
, i = {
start: f.x,
end: f.x + f.width,
len: f.width
}
, j = {
start: g.x,
end: g.x + g.width,
len: g.width
}
, k = {
start: this.xPos(d[0]),
end: this.xPos(d[1]),
len: this.xPos(d[1]) - this.xPos(d[0])
};
if (0 !== k.len && (this.changeScroll(h, k, i, j, a, b),
0 !== k.len)) {
var l = k.end - k.start;
this.zoomX = 3e-9 > l ? .1 / Math.abs(d[1] - d[0]) : (k.end - k.start) / Math.abs(d[1] - d[0]),
this.offX = this.paddingLeft + this.zeroX + d[0] * this.zoomX - k.start
}
}
}
,
$a.prototype.changeVScrollInfo = function(a, b) {
var c = this
, d = this._curveField;
if (d) {
var e = c.curveShowRect
, f = c.verScrollBounds
, g = c.drawInfo.vScrollSlider
, h = {
start: e.y,
end: e.y + e.height,
len: e.height
}
, i = {
start: f.y,
end: f.y + f.height,
len: f.height
}
, j = {
start: g.y,
end: g.y + g.height,
len: g.height
}
, k = {
start: this.yPos(d[3]),
end: this.yPos(d[2]),
len: this.yPos(d[2]) - this.yPos(d[3])
};
if (0 !== k.len && (this.changeScroll(h, k, i, j, a, b),
0 !== k.len)) {
var l = k.end - k.start;
this.zoomY = 3e-9 > l ? .1 / Math.abs(d[2] - d[3]) : (k.end - k.start) / Math.abs(d[2] - d[3]),
this.offY = this.paddingTop + this.zeroY - d[3] * this.zoomY - k.start
}
}
}
,
$a.prototype.adjustCurve = function(a) {
var b = this
, d = b.bezierCurve;
if (a = a == c ? 255 : a,
d) {
var e = d.keys;
if (0 !== e.length) {
for (var f = e[0].time, g = e[e.length - 1].time, h = b.curveShowRect, i = e[0].value, j = e[0].value, k = 1 / h.width, l = f; (l += k) < g; ) {
var m = d.evaluate(l);
i = Math.min(i, m),
j = Math.max(j, m)
}
var m = d.evaluate(g);
i = Math.min(i, m),
j = Math.max(j, m),
0 !== (1 & a) && (b.zoomX = h.width / (3e-9 > g - f ? 1 : g - f),
b.offX = b.paddingLeft + b.zeroX + f * b.zoomX - b.paddingLeft),
0 !== (2 & a) && (b.zoomY = h.height / (3e-9 > j - i ? 1 : j - i),
b.offY = b.paddingTop + b.zeroY - j * b.zoomY - b.paddingTop),
b.iv()
}
}
}
,
$a.prototype.onPropertyChange = function() {
this.iv()
}
,
$a.prototype.drawBorder = function() {}
,
$a.prototype.getPreferredSize = function() {
return {
width: 600,
height: 400
}
}
,
$a.prototype.calculateClientWidth = function() {
return this.width
}
,
$a.prototype.calculateClientHeight = function() {
return this.height
}
;
var _a = m(null, b, function(a) {
var b = this;
b._list = a,
b.addListeners()
}, {
clear: function() {},
handle_mousedown: function(a) {
this.handle_touchstart(a)
},
handle_touchstart: function(a) {
var b = this
, c = b.view
, d = c.lp(a)
, e = c.getDataAt(a);
if (e) {
var f = c.width - c.rowHeight - 8;
d.x >= f && d.x <= f + c.rowHeight - 8 ? c.removable && c.dataModel.remove(e) : c.emit("clickData", e)
} else
c.focusData = null
},
handle_mouseup: function(a) {
this.handle_touchend(a)
},
handle_touchend: function() {}
}, {
interactor: !0
}, {
view: {
get: function() {
return this._list
}
}
})
, ab = m("qc.editor.InspectorList", qc.widget.List, function Pf(a) {
var b = this;
Pf["super"].constructor.call(b),
k.initObject(b, a),
new _a(b),
b.addTopPainter(b.drawDNDState),
b.addBottomPainter(b.drawBackground.bind(b));
var c = b.validateImpl;
b.validateImpl = function() {
b.view.style.border = "1px solid " + b._borderColor,
c.call(b)
}
;
var d = b.drawRow;
b.drawRow = function(a, c, e, f, g, h) {
if (d.call(b, a, c, e, f, g, h),
b.removable) {
a.beginPath(),
a.strokeStyle = "black";
var i = {
width: h,
height: h,
comps: [{
type: "shape",
points: [0, 0, h, h],
segments: [1, 2],
borderWidth: 2,
borderColor: b.labelColor
}, {
type: "shape",
points: [0, h, h, 0],
segments: [1, 2],
borderWidth: 2,
borderColor: b.labelColor
}]
};
k.drawImage(a, i, null, g - h - 8, f + 4, h - 8, h - 8)
}
}
});
ab.prototype.drawBackground = function(a) {
var b = this
, c = b.clientWidth
, d = b.clientHeight;
a.beginPath(),
a.rect(0, -b.translateY, c, d),
a.fillStyle = b._background,
a.fill()
}
,
ab.prototype.drawDNDState = function(a) {
if (this.dragInfo) {
var b = this.clientWidth
, c = this.rowHeight
, d = this.dragInfo.rowIndex
, e = this.dragInfo.type;
d >= 0 && (a.beginPath(),
"up" === e ? (a.moveTo(0, d * c),
a.lineTo(b, d * c)) : "down" === e && (a.moveTo(0, (d + 1) * c),
a.lineTo(b, (d + 1) * c)),
a.strokeStyle = "#507aea",
a.lineWidth = 2,
a.stroke())
}
}
,
ab.prototype._clearDragInfo = function() {
fa.dragAndDrop.hideTip(),
this.dragInfo && (this.dragInfo = null,
this.iv())
}
,
ab.prototype._dragging = function(a) {
var b = this.dragInfo;
if (b) {
var c = this.rowHeight
, d = this.lp(a)
, e = d.y / c
, f = Math.floor(e);
if (f > this.rowDatas.length - 1)
b.rowIndex = this.rowDatas.length - 1,
b.type = "down";
else {
b.rowIndex = f;
var g = d.y - f * c;
.3 * c > g ? b.type = "up" : g > .7 * c && (b.type = "down")
}
this.autoScroll(a),
this.iv()
}
}
,
ab.prototype._endDrag = function() {
var a = this.dragInfo;
if (a) {
var b = a.rowIndex
, c = a.sourceData;
if (!c)
return void this._clearDragInfo();
this.dataModel.moveTo(c, b),
this._clearDragInfo()
}
}
,
ab.prototype.handleDragAndDrop = function(a, b) {
if (this._draggable) {
if ("prepare" === b || "cancel" === b)
return void this._clearDragInfo();
if ("begin" === b || "between" === b) {
if ("begin" === b) {
var c = this.draggingData;
c && (this.focusData = c,
this.dragInfo = {
sourceData: c
})
}
this._dragging(a),
fa.dragAndDrop.showTip(this.dragInfo.sourceData.name, a)
} else
"end" === b && this._endDrag(a)
}
}
,
b.defineProperties(ab.prototype, {
draggable: {
get: function() {
return this._draggable
},
set: function(a) {
this.setPropertyValue("draggable", a)
}
},
removable: {
get: function() {
return this._removable
},
set: function(a) {
this.setPropertyValue("removable", a)
}
},
checkable: {
get: function() {
return "check" === this.checkMode
},
set: function(a) {
this.checkMode = a ? "check" : null
}
}
}),
ab.prototype.calculateClientWidth = function() {
return this.width - 2
}
,
ab.prototype.calculateClientHeight = function() {
return this.height - 2
}
;
var bb = m("qc.editor.Explorer", qc.widget.Container, function Qf(a) {
var b = this;
Qf["super"].constructor.call(b, a);
var c = b.layout = new qc.widget.layout.BorderLayout(b);
c.leftToggleVisible = !1,
c.bottomToggleVisible = !1,
c.leftResizable = !1,
c.bottomResizable = !1,
c.splitterColor = "rgb(143, 156, 178)",
c.splitterSize = 1;
var d = b._favoriteTree = new qc.widget.Tree;
d.enableToolTip();
var e = new qc.widget.Data;
e.name = fa._("Favorites"),
e.isTitle = !0,
d.dataModel.add(e),
d.onDataClick = function(a) {
b.handleTreeDataClick(a)
}
;
var f = fa.storage.getShare("favoriteFolders");
if (!f) {
var g = fa.userHome;
"win32" === fa.platform && (g = g.replace(/\\/gi, "//"));
var h = "win32" === fa.platform ? "//" : "/";
f = "win32" === fa.platform || "darwin" === fa.platform ? [{
name: "Desktop",
path: g + h + "Desktop"
}, {
name: "Documents",
path: g + h + "Documents"
}, {
name: "Downloads",
path: g + h + "Downloads"
}] : [];
try {
fa.storage.setShare("favoriteFolders", f)
} catch (i) {}
}
f.forEach(function(a) {
var b = new qc.widget.Data;
b.name = a.name,
b.parent = e,
b.toolTip = a.path,
b.a("path", a.path),
d.dataModel.add(b)
});
var j = new qc.widget.Data;
j.name = fa._("My Computer"),
j.a("path", ""),
j.isTitle = !0,
d.dataModel.add(j);
var k = function(a, b) {
var c = new qc.widget.Data;
c.name = b || a,
c.a("path", a),
a && (c.toolTip = a),
c.parent = j,
j.dataModel.add(c)
};
"win32" === fa.platform ? (k(fa.userHome.replace(/\\/gi, "//"), fa._("Home")),
qc.editor.Operation.LIST_DIR("", function(a) {
a && a.sub && a.sub.forEach(function(a) {
k(a)
})
})) : (k("", "/"),
k(fa.userHome, fa._("Home")),
"darwin" === fa.platform && qc.editor.Operation.LIST_DIR("/Volumes", function(a) {
a && a.sub && a.sub.forEach(function(b) {
"Macintosh HD" !== b && k(a.path + "/" + b, b)
})
})),
d.expandAll();
var l = new qc.widget.Slider({
min: 1,
max: 100
});
l.preferredSize = {
width: 70,
height: 26
};
var m = b._fileList = new qc.editor.ItemList
, n = new qc.widget.Container;
n.layout = new qc.widget.layout.TableLayout(n),
n.setItems([{
height: "100+0.1",
widths: [.1],
cells: [{
element: m
}]
}, {
height: 26,
cells: [{
element: l,
align: "right",
vAlign: "middle",
fill: "none"
}]
}]),
m.onDataDoubleClick = function(a) {
a.isFile || b.inflateDir(a.a("path"))
}
,
m.onBackgroundDoubleClick = function() {
var a = b.getParentPath(m.currPath);
b.inflateDir(a)
}
,
l.onValueChange = function(a) {
16 >= a ? 1 === a ? m.layout = "list" : l.value = 1 : (m.layout = "tile",
m.itemWidth = m.itemHeight = 40 + Math.round(.5 * a - 8));
try {
fa.storage.setShare("explorerSliderValue", a)
} catch (b) {}
}
,
m.selectionModel.on("selectionChange", function() {
var a = m.selectionModel.lastData;
r.value = a ? a.a("path") : m.currPath,
r.value || "win32" === fa.platform || (r.value = "/")
});
try {
var o = fa.storage.getShare("explorerSliderValue");
l.value = o ? 1 * o : 32
} catch (i) {
l.value = 32
}
l.disableToolTip();
var p = new qc.widget.Container;
p.layout = new qc.widget.layout.TableLayout(p);
var q = new Aa({
text: fa._("Path") + ":"
})
, r = b._txtPath = new Ba
, s = new qc.editor.InspectorButton({
text: fa._("OK")
})
, t = new qc.editor.InspectorButton({
text: fa._("Cancel")
});
p.setItems([{
height: 30,
widths: [100, .1, 60, 60],
cells: [{
element: q
}, {
element: r
}, {
element: s
}, {
element: t
}]
}]),
s.on("click", function() {
b.emit("clickOk", b._txtPath.value)
}),
t.on("click", function() {
b.emit("clickCancel", b._txtPath.value)
}),
b.setItems([{
region: "left",
element: d,
width: 190
}, {
region: "center",
element: n
}, {
region: "bottom",
element: p
}]);
var u = new qc.widget.ContextMenu;
u.items = [{
label: fa._("Add to Favorites"),
action: function() {
var a = m.selectionModel.lastData
, b = a.a("path")
, c = new qc.widget.Data;
c.name = a.name,
c.parent = e,
c.toolTip = b,
c.a("path", b),
d.dataModel.add(c);
var f = [];
e.children && e.children.forEach(function(a) {
f.push({
name: a.name,
path: a.a("path")
})
});
try {
fa.storage.setShare("favoriteFolders", f)
} catch (g) {}
}
}],
u.visibleFunc = function() {
return m.selectionModel.lastData ? !0 : void 0
}
,
u.addTo(m),
u = new qc.widget.ContextMenu,
u.items = [{
label: fa._("Remove from Favorites"),
action: function() {
var a = d.selectionModel.selection.slice(0);
a.forEach(function(a) {
d.dataModel.remove(a)
});
var b = [];
e.children && e.children.forEach(function(a) {
b.push({
name: a.name,
path: a.a("path")
})
});
try {
fa.storage.setShare("favoriteFolders", b)
} catch (c) {}
}
}],
u.visibleFunc = function() {
var a = d.selectionModel.lastData;
return a && a.parent === e ? !0 : void 0
}
,
u.addTo(d);
var v = fa.projectPath || fa._defaultProjectPath;
v ? ("win32" === fa.platform ? (v.lastIndexOf("\\") === v.length - 1 && (v = v.substring(0, v.length - 1)),
v = v.replace(/\\/g, "//")) : v.lastIndexOf("/") === v.length - 1 && (v = v.substring(0, v.length - 1)),
b.inflateDir(v)) : b.inflateDir("")
});
bb.prototype.getParentPath = function(a) {
return a ? (a = a.substring(0, a.lastIndexOf("/")),
a.lastIndexOf("/") === a.length - 1 && (a = a.substring(0, a.lastIndexOf("/"))),
a) : void 0
}
,
bb.prototype.handleTreeDataClick = function(a) {
var b = this
, c = a.a("path");
null != c && b.inflateDir(c)
}
,
b.defineProperty(bb.prototype, "showFiles", {
get: function() {
return this._showFiles
},
set: function(a) {
this.setPropertyValue("showFiles", a)
}
}),
bb.prototype.inflateDir = function(a) {
var b = this
, c = b._fileList;
c.currPath = a,
b._txtPath.value = a || ("win32" !== fa.platform ? "/" : ""),
qc.editor.Operation.LIST_DIR({
dir: a,
showFiles: b.showFiles
}, function(d) {
if (c.dataModel.clear(),
a) {
var e = new qc.editor.ItemNode;
e.image = "folder",
e.name = "..",
e.a("path", b.getParentPath(a)),
c.dataModel.add(e)
}
if ("invalid directory" === d)
fa.notification.error(fa._("Server error: invalid directory. The target directory might has been removed."));
else if (d && d.sub) {
var f = 0;
d.sub.forEach(function(b) {
var e = new qc.editor.ItemNode;
e.image = "folder",
d.isFile[f] && (e.image = "UnknowIcon",
e.isFile = !0),
e.name = b,
a ? e.a("path", d.path + "/" + b) : e.a("path", d.path + b),
e.hasChildren = d.hasChildren[f],
c.dataModel.add(e),
f++
})
}
})
}
;
var cb = m("qc.editor.TextureSelector", b, function() {
var a = this;
a.initView(!1, !0),
a.addEventListener("click", a.handleClick.bind(a))
}, {}, {
view: !0,
emitter: !0,
painter: !0
});
b.defineProperties(cb.prototype, {
texture: {
get: function() {
return this._texture
},
set: function(a) {
var b = a === this._texture;
this.setPropertyValue("texture", a);
var c = "Empty(Texture)";
a && (c = a.atlas.url),
this.initAssociatedViewAndData(c),
b || this.handleValueChange(c)
}
},
value: {
get: function() {
return this._texture ? {
asset: this._texture.atlas.uuid,
url: this._texture.atlas.url,
frame: this._texture.frame
} : null
},
set: function(a) {
if (!a)
return void (this.texture = null);
var b = fa.game.assets.findByUUID(a.asset);
b ? this.texture = new qc.Texture(b,a.frame) : fa.game.assets.load(a.asset, a.url, function(b) {
this.texture = new qc.Texture(b,a.frame)
})
}
}
}),
cb.prototype.onPropertyChange = function() {
this.iv()
}
,
cb.prototype.validateImpl = function() {
var a = this
, b = a._canvas
, c = a.clientWidth
, d = a.clientHeight
, e = Math.min(c, d);
t(b, c, d);
var f = s(b, 0, 0, 1)
, g = (c - e) / 2
, h = (d - e) / 2;
c = d = e,
a.drawBackground(f, g, h, c, d),
a.drawTexture(f, g, h, c, d),
a.drawSelect(f, g, h, c, d)
}
,
cb.prototype.drawBackground = function(a, b, c, d, e) {
a.beginPath(),
a.fillStyle = "rgb(53,53,53)",
a.rect(b, c, d, e),
a.fill(),
a.strokeStyle = "rgb(23,23,23)",
a.rect(b, c, d, e),
a.stroke()
}
,
cb.prototype.drawTexture = function(a, b, c, d, e) {
var f = this
, g = f.texture;
if (g) {
var h;
h = "string" == typeof g.frame ? g.atlas.frames[Math.max(0, g.atlas.frameNames.indexOf(g.frame))] : g.atlas.frames[g.frame];
var i = Math.min(d / h.width, e / h.height);
h && a.drawImage(g.atlas.img, h.x, h.y, h.width, h.height, b + (d - i * h.width) / 2, c + (e - i * h.height) / 2, h.width * i, h.height * i)
} else
a.fillStyle = "rgb(220, 220, 220)",
a.font = "12px serif",
a.textAlign = "center",
a.textBaseline = "middle",
a.fillText("None", b + d / 2, c + 13),
a.font = "10px serif",
a.fillText("(Texture)", b + d / 2, c + 24)
}
,
cb.prototype.drawSelect = function(a, b, c, d, e) {
a.beginPath(),
a.fillStyle = "rgb(73,73,73)",
a.rect(b + d - 40, c + e - 15, 40, 15),
a.fill(),
a.beginPath(),
a.fillStyle = "rgb(23,23,23)",
a.rect(b + d - 40, c + e - 15, 40, 15),
a.stroke(),
a.font = "11px serif",
a.fillStyle = "rgb(220, 220, 220)",
a.textAlign = "center",
a.textBaseline = "middle",
a.fillText("select", b + d - 20, c + e - 7)
}
,
cb.prototype.handleClick = function(a) {
var b = this
, c = b.clientWidth
, d = b.clientHeight
, e = Math.min(c, d)
, f = (c - e) / 2
, g = (d - e) / 2;
c = d = e;
var h = a.target.getBoundingClientRect()
, i = a.clientX - h.left
, j = a.clientY - h.top;
i > f + c - 40 && f + c > i && j > g + d - 15 && g + d > j && b.showObjectSelect()
}
,
cb.prototype.showObjectSelect = function() {
var a = this
, b = a._dialog;
if (!b) {
b = a._dialog = new qc.editor.Dialog,
b.on("close", function() {
a.removeDialog()
}),
b.title = fa._("Select Texture");
var c = new Fa({
objectType: "texture"
});
c.blinkObject(a.associatedViewAndData),
c.onSelectAssetNode = function(c) {
if (b.hide(),
c.isNoneNode)
a.texture = null;
else {
var d = fa.game.assets.findByUUID(c.a("asset"))
, e = function(b, c) {
a.texture = new qc.Texture(b,c)
};
d ? e(d, c.a("frame")) : fa.game.assets.load(c.a("asset"), c.a("url"), function(a) {
e(a, c.a("frame"))
})
}
}
,
b.content = c,
b.contentPadding = [2, 4, 2, 4];
var d = Wb(700, 500);
b.width = d.width,
b.height = d.height
}
b.isInDOM() ? b.hide() : (b.show(),
c._searchInput.input.focus())
}
,
cb.prototype.removeDialog = function() {
delete this._dialog
}
,
cb.prototype.initAssociatedViewAndData = function(a) {
var b = this;
if (a && "Empty(Texture)" !== a) {
var c = b.texture;
b.associatedViewAndData = cc(c) ? {
fileTree: a.substring(0, a.lastIndexOf("/")),
fileList: a
} : {
fileTree: a.substring(0, a.lastIndexOf("/")),
fileList: [a, c.frame]
}
} else
b.associatedViewAndData = null
}
,
cb.prototype.handleValueChange = function(a) {
var b = this;
b.onValueChanged && b.onValueChanged(a),
b.onEndEdit && b.onEndEdit(!0);
var c = {
property: "value",
oldValue: null,
newValue: a,
source: b
};
b.emit("propertyChange", c)
}
;
var db = m("qc.editor.PathSelector", qc.widget.Container, function Rf(a) {
var b = this;
Rf["super"].constructor.call(b, a);
var c = b.layout = new qc.widget.layout.BorderLayout(b)
, d = b._pathInput = new qc.editor.StringInput(a)
, e = b._browserBtn = new qc.editor.InspectorButton({
text: "..."
});
c.splitterSize = 0,
b.setItems([{
region: "center",
element: d
}, {
region: "right",
width: 20,
element: e
}]),
a && null != a.autoSelect || (b._autoSelect = !1),
e.addEventListener("click", b.handleBrowserClick.bind(b)),
d.onEndEdit = function() {
b.handleValueChange(d.value)
}
});
b.defineProperties(db.prototype, {
path: {
get: function() {
return this._pathInput.value
},
set: function(a) {
a !== this.path && (this._pathInput.value = a)
}
}
}),
db.prototype.handleBrowserClick = function() {
var a = this
, b = (a.path,
new bb({
showFiles: a.showFiles
}))
, c = new Ra;
c.modal = !0,
c.title = fa._("Selector Path"),
c.content = b,
c.contentPadding = [2, 4, 2, 4];
var d = a._pathInput.value;
d && d.length > 0 && b.inflateDir(d);
var e = Wb(800, 500);
c.width = e.width,
c.height = e.height,
c.show(),
b.on("clickOk", function(b) {
a.path = b,
a.handleValueChange(b),
c.hide()
}),
b.on("clickCancel", function() {
c.hide()
})
}
,
db.prototype.handleValueChange = function(a) {
var b = this;
b.onValueChanged && b.onValueChanged(a),
b.onEndEdit && b.onEndEdit(!0);
var c = {
property: "value",
oldValue: null,
newValue: a,
source: b
};
b.emit("propertyChange", c)
}
;
var eb = m("qc.editor.ResolutionSettings", qc.widget.Container, function Sf(a) {
var b = this;
Sf["super"].constructor.call(b, a);
var c = b.layout = new qc.widget.layout.BorderLayout(b);
c.bottomToggleVisible = !1,
c.bottomResizable = !1,
c.splitterColor = "rgb(143, 156, 178)",
c.splitterSize = 1;
var d, e = new qc.widget.List;
fa.rightBanner.findViewById("gameSize").items.forEach(function(a) {
a.size && (d = new qc.widget.Data,
d.name = a.label,
d.width = a.size.width,
d.height = a.size.height,
e.dataModel.add(d))
});
var f;
e.selectionModel.on("selectionChange", function() {
f = e.selectionModel.lastData,
f && (i.value = f.name,
k.value = f.width,
m.value = f.height)
});
var g = new qc.widget.Container;
g.layout = new qc.widget.layout.TableLayout(g);
var h = new Aa({
text: fa._("Name") + ":"
})
, i = new Ba
, j = new Aa({
text: fa._("Width") + ":"
})
, k = new Ia
, l = new Aa({
text: fa._("Height") + ":"
})
, m = new Ia;
i.onValueChanged = function() {
f && (f.name = i.value)
}
,
k.onValueChanged = function() {
f && (f.width = k.value)
}
,
m.onValueChanged = function() {
f && (f.height = m.value)
}
;
var n = new qc.editor.InspectorButton({
text: fa._("Add")
})
, o = new qc.editor.InspectorButton({
text: fa._("Remove")
})
, p = new qc.editor.InspectorButton({
text: fa._("Reset")
})
, q = new qc.editor.InspectorButton({
text: fa._("Apply")
});
g.setItems([{
height: 30,
widths: [50, .1, 60, 60, 60, 60],
cells: [{
element: h
}, {
element: i
}, {
element: j
}, {
element: k
}, {
element: l
}, {
element: m
}]
}, {
height: 30,
cells: [{}, {}, {
element: n
}, {
element: o
}, {
element: p
}, {
element: q
}]
}]),
n.on("click", function() {
var a = new qc.widget.Data;
a.name = "New (800x1280)",
a.width = 800,
a.height = 1280,
e.dataModel.add(a),
e.selectionModel.selection = a
}),
o.on("click", function() {
e.removeSelection()
}),
p.on("click", function() {
e.dataModel.clear();
var a;
td.forEach(function(b) {
b.size && (a = new qc.widget.Data,
a.name = b.label,
a.width = b.size.width,
a.height = b.size.height,
e.dataModel.add(a))
}),
e.selectionModel.selection = a
}),
q.on("click", function() {
var a = fa.rightBanner.findViewById("gameSize")
, c = [{
label: "Free Aspect",
value: "Free Aspect"
}];
e.dataModel.forEach(function(a) {
c.push({
label: a.name,
value: a.name,
size: {
width: a.width,
height: a.height
}
})
}),
a.items = c,
a.value = "Free Aspect",
fa.storage.set("resolutions", c),
b.onApply && b.onApply()
}),
b.setItems([{
region: "center",
element: e
}, {
region: "bottom",
element: g
}]),
e.dataModel.selectionModel.selection = d
})
, fb = m("qc.editor.ProjectActionPane", qc.widget.Container, function Tf(a) {
var b = this;
Tf["super"].constructor.call(b, a),
b.layout = new qc.widget.layout.VBoxLayout(b),
b.layout.padding = 10,
b.layout.gap = 0,
b.initUI()
});
fb.prototype.initUI = function() {
var a = function(a) {
var b = new qc.widget.ToggleButton;
return b.text = a,
b.borderWidth = 0,
b.textFont = "20px Arial",
b.preferredSize = {
height: 30
},
b.textColor = "#caccd8",
b.align = "left",
b.background = null,
b.gradientColor = null,
b.activeBackground = "#3e4b6b",
b.activeGradientColor = null,
b.hoverBackground = "rgb(72, 72, 72)",
b.hoverGradientColor = null,
b
}
, b = this
, c = a(fa._("Recent Projects"))
, d = a(fa._("New Project"))
, e = a(fa._("Open Project"))
, f = new qc.widget.Radios;
c.on("propertyChange", b.handleRecentProjectButtonSelect.bind(b)),
d.on("propertyChange", b.handleNewProjectButtonSelect.bind(b)),
e.on("propertyChange", b.handleOpenFolderButtonSelect.bind(b)),
f.add(c),
f.add(d),
f.add(e),
b.setItems([c, d, e]),
U(function() {
c.selected = !0
})
}
,
fb.prototype.handleRecentProjectButtonSelect = function(a) {
if ("selected" === a.property && a.newValue) {
var b = new hb;
qc.editor.Operation.RECENT_OPEN(function(a) {
if (a)
for (var c = 0; c < a.length; c++)
b.add(a[c])
}),
fa.mainLayout.centerView = b
}
}
,
fb.prototype.handleNewProjectButtonSelect = function(b) {
if ("selected" === b.property && b.newValue) {
var c = new gb;
fa.mainLayout.centerView = c,
c.on("create", function(b) {
var c = b.path;
c ? qc.editor.Operation.CREATE_PROJECT(c, function(b, d) {
b ? qc.editor.Operation.OPEN_PROJECT(c, function(b) {
b ? (fa.storage.set("switchProject", "1"),
a.location.href = "./index.html") : fa.notification.error(fa._("Open project failed."))
}) : fa.notification.error(fa._("Create project failed.") + " Reason:" + d)
}) : fa.notification.error(fa._("Please choose a folder to create the project"))
})
}
}
,
fb.prototype.handleOpenFolderButtonSelect = function(a) {
if ("selected" === a.property && a.newValue) {
var b = new ib;
fa.mainLayout.centerView = b
}
}
,
b.defineProperties(fb.prototype, {});
var gb = m("qc.editor.CreateProjectPane", qc.widget.Container, function Uf(a) {
var b = this;
Uf["super"].constructor.call(b, a),
b.layout = new qc.widget.layout.TableLayout(b),
b.initUI()
});
gb.prototype.initUI = function() {
var a = this
, b = [{
height: 50,
widths: [a.labelWidth || 140, "40+0.1", 50],
cells: [{
colspan: 3,
elementConfig: {
type: "label",
textColor: "#caccd8",
textFont: "28px Arial",
text: fa._("Create a new project")
}
}]
}, {
cells: [{
elementConfig: {
type: "label",
textColor: "#caccd8",
align: "left",
textFont: "13px Arial",
text: fa._("Project Folder")
}
}, {
elementConfig: {
type: "textfield",
font: "13px Arial",
id: "projectDirectory"
}
}, {
elementConfig: {
type: "button",
id: "picker",
ninePatchImage: "inspector_button.9",
ninePatchBorder: [10, 10, 10, 10],
hoverNinePatchImage: "inspector_button.9",
hoverNinePatchBorder: [10, 10, 10, 10],
activeNinePatchImage: "inspector_button_active.9",
activeNinePatchBorder: [10, 10, 10, 10],
textColor: "#caccd8",
borderWidth: 0,
textFont: "13px Arial",
text: "..."
}
}]
}, {
cells: []
}, {
cells: [{
fill: "none",
align: "right",
colspan: 3,
elementConfig: {
type: "button",
id: "create",
ninePatchImage: "inspector_button.9",
ninePatchBorder: [10, 10, 10, 10],
hoverNinePatchImage: "inspector_button.9",
hoverNinePatchBorder: [10, 10, 10, 10],
activeNinePatchImage: "inspector_button_active.9",
activeNinePatchBorder: [10, 10, 10, 10],
textColor: "#caccd8",
preferredSize: {
width: 100,
height: 40
},
borderWidth: 0,
textFont: "13px Arial",
text: fa._("Create")
}
}]
}];
k.inflate(b, a);
var c = a.findViewById("picker");
c.on("click", function() {
var b = new bb
, c = new Ra;
c.modal = !0,
c.title = fa._("Choose Folder"),
c.content = b,
c.contentPadding = [2, 4, 2, 4];
var d = Wb(800, 500);
c.width = d.width,
c.height = d.height,
c.show(),
b.on("clickOk", function(b) {
a.findViewById("projectDirectory").value = b,
c.hide()
}),
b.on("clickCancel", function() {
c.hide()
})
});
var d = a.findViewById("create");
d.on("click", function() {
var b = a.findViewById("projectDirectory").value;
a.emit("create", {
path: b
})
})
}
,
b.defineProperties(gb.prototype, {});
var hb = m("qc.editor.RecentProjectPane", qc.widget.Container, function Vf(a) {
var b = this;
Vf["super"].constructor.call(b, a),
b.layout = new qc.widget.layout.TableLayout(b),
b.layout.padding = 10,
b.initUI()
});
hb.prototype.add = function(a) {
var b = this
, c = b._list
, d = new qc.widget.Data;
d.name = a,
c.dataModel.add(d)
}
,
hb.prototype.initUI = function() {
var b = this
, c = b._list = new qc.widget.List
, d = new qc.widget.Label({
text: fa._("Search:"),
textColor: "#caccd8",
align: "left"
})
, e = b._txtSearch = new qc.editor.StringInput
, f = new qc.widget.Label({
text: fa._("Recent Opened Projects"),
textFont: "28px Arial",
textColor: "#caccd8"
});
c.rowHeight = 30,
c.view.addEventListener("click", function(a) {
var b = c.lp(a)
, d = c.getDataAt(a)
, e = c.width;
b.x > e - 30 && qc.editor.Operation.REMOVE_RECENT_OPEN(d.name, function(a) {
a.operRet && (c.dataModel.remove(d),
fa.notification.info(fa._("Project has been removed successfully.")))
})
}),
c.view.addEventListener("dblclick", function(b) {
var d = c.lp(b)
, e = c.getDataAt(b)
, f = c.width;
d.x > f - 30 || qc.editor.Operation.OPEN_PROJECT(e.name, function(b) {
b ? (fa.storage.set("switchProject", "1"),
a.location.href = "./index.html") : fa.notification.error(fa._("Open project failed."))
})
});
var g = c.drawRow
, h = {
width: 20,
height: 20,
comps: [{
type: "shape",
points: [0, 0, 20, 20],
segments: [1, 2],
background: null,
borderWidth: 2,
borderColor: "red"
}, {
type: "shape",
points: [0, 20, 20, 0],
segments: [1, 2],
background: null,
borderWidth: 2,
borderColor: "red"
}]
};
c.view.style.background = "rgb(65, 65, 65)",
c.view.style.border = "1px solid rgb(32, 32, 32)",
c.calculateClientWidth = function() {
return this.width - 2
}
,
c.calculateClientHeight = function() {
return this.height - 2
}
,
c.drawRowBackground = function(a, b, d, e, f, g) {
c.isSelected(b) ? k.fillRect(a, d, e, f, g, c.getSelectBackground(b)) : c._hoverData === b && k.fillRect(a, d, e, f, g, "rgb(72, 72, 72)")
}
,
c.addEventListener("mousemove", function(a) {
var b = c.getDataAt(a);
b !== c._hoverData && c.iv(),
c._hoverData = b
}),
c.drawRow = function(a, b, d, e, f, i) {
g.call(c, a, b, d, e, f, i),
b === c._hoverData && k.drawImage(a, h, "centerUniform", f - 30, e + 7, 16, 16, b, c)
}
,
e.onValueChanged = function(a) {
c.visibleFunc = a ? function(b) {
return b.name.indexOf(a) >= 0 ? !0 : void 0
}
: null
}
,
b.setItems([{
height: 50,
widths: [140, .1],
cells: [{
colspan: 2,
element: f
}]
}, {
cells: [{
element: d
}, {
element: e
}]
}, {
height: .1,
cells: [{
colspan: 2,
element: c
}]
}])
}
,
b.defineProperties(hb.prototype, {});
var ib = m("qc.editor.OpenProjectPane", qc.widget.Container, function Wf(a) {
var b = this;
Wf["super"].constructor.call(b, a),
b.layout = new qc.widget.layout.TableLayout(b),
b.initUI()
});
ib.prototype.initUI = function() {
var b = this
, c = [{
height: 50,
widths: [140, "40+0.1", 50],
cells: [{
colspan: 3,
elementConfig: {
type: "label",
textColor: "#caccd8",
textFont: "28px Arial",
text: fa._("Open Project")
}
}]
}, {
cells: [{
elementConfig: {
type: "label",
textColor: "#caccd8",
align: "left",
textFont: "13px Arial",
text: fa._("Project Folder")
}
}, {
elementConfig: {
type: "textfield",
font: "13px Arial",
id: "projectDirectory"
}
}, {
elementConfig: {
type: "button",
id: "picker",
ninePatchImage: "inspector_button.9",
ninePatchBorder: [10, 10, 10, 10],
hoverNinePatchImage: "inspector_button.9",
hoverNinePatchBorder: [10, 10, 10, 10],
activeNinePatchImage: "inspector_button_active.9",
activeNinePatchBorder: [10, 10, 10, 10],
textColor: "#caccd8",
textFont: "13px Arial",
borderWidth: 0,
text: "..."
}
}]
}, {
cells: []
}, {
cells: [{
fill: "none",
align: "right",
colspan: 3,
elementConfig: {
type: "button",
id: "open",
ninePatchImage: "inspector_button.9",
ninePatchBorder: [10, 10, 10, 10],
hoverNinePatchImage: "inspector_button.9",
hoverNinePatchBorder: [10, 10, 10, 10],
activeNinePatchImage: "inspector_button_active.9",
activeNinePatchBorder: [10, 10, 10, 10],
textColor: "#caccd8",
preferredSize: {
width: 100,
height: 40
},
borderWidth: 0,
textFont: "13px Arial",
text: fa._("Open")
}
}]
}];
k.inflate(c, b);
var d = b.findViewById("picker");
d.on("click", function() {
var a = new bb
, c = new Ra;
c.modal = !0,
c.title = fa._("Choose Folder"),
c.content = a,
c.contentPadding = [2, 4, 2, 4];
var d = Wb(800, 500);
c.width = d.width,
c.height = d.height,
c.show(),
a.on("clickOk", function(a) {
b.findViewById("projectDirectory").value = a,
c.hide()
}),
a.on("clickCancel", function() {
c.hide()
})
});
var e = b.findViewById("open");
e.on("click", function() {
var c = b.findViewById("projectDirectory").value;
c && qc.editor.Operation.OPEN_PROJECT(c, function(b) {
b ? (fa.storage.set("switchProject", "1"),
a.location.href = "./index.html") : fa.notification.error(fa._("Open project failed."))
})
})
}
,
b.defineProperties(ib.prototype, {});
var jb = m("qc.editor.FolderChooser", b, function(a) {
var b = this;
jb["super"].constructor.call(b, a)
});
jb.prototype.openFolderChooser = function() {
var a = this
, b = new Ra;
b.contentPadding = [2, 4, 2, 4];
var c = new qc.widget.Tree;
b.title = fa._("Double click to choose the folder");
var d = Wb(700, 500);
b.width = d.width,
b.height = d.height,
b.content = c,
b.modal = !0,
c.onDataDoubleClick = function() {
b.hide();
var d = c.selectionModel.selection[0];
d && a.onFolderChoosed && a.onFolderChoosed(d.path),
b.hide()
}
,
c.loader = {
load: function(b) {
a.inflateDir(b.path, c, b)
},
isLoaded: function(a) {
return a.hasChildren ? a.isLoaded : !0
}
},
a.inflateDir("", c),
b.show()
}
,
jb.prototype.inflateDir = function(a, b, c) {
var d = this;
c && (c.isLoaded = !0),
qc.editor.Operation.LIST_DIR(a, function(a) {
var e = 0;
a.sub.forEach(function(f) {
var g = new qc.widget.Data;
g.icon = "tree_folder",
g.name = f,
g.path = c ? a.path + "/" + f : a.path + f,
g.hasChildren = a.hasChildren[e],
c && (g.parent = c),
b.dataModel.add(g),
e++;
var h = fa.projectPath || fa._defaultProjectPath;
if (h) {
var i, j;
"win32" === fa.platform ? (i = g.path.split("//"),
j = h.split("\\")) : (i = g.path.split("/"),
j = h.split("/"));
for (var k = !0, l = 0; l < i.length; l++)
if (i[l] !== j[l]) {
k = !1;
break
}
k && U(i.length === j.length - 1 ? function() {
b.selectionModel.selection = g,
b.expand(g)
}
: function() {
d.inflateDir(g.path, b, g)
}
)
}
})
})
}
,
b.defineProperties(jb.prototype, {});
var kb = m("qc.editor.ProjectBuildSettings", qc.widget.Container, function Xf(a) {
var b = this;
Xf["super"].constructor.call(b, a);
var c = b.layout = new qc.widget.layout.BorderLayout(b);
c.topToggleVisible = !1,
c.topResizable = !1,
c.splitterColor = "rgb(143, 156, 178)",
c.splitterSize = 1,
b.getSetting();
var d = b._buildProjectSetting()
, e = new qc.widget.Tabs;
e._tabNinePatchImage = "banner_run.9",
e.setItems([{
name: "Browsers",
element: b._buildBrowsersSetting()
}, {
name: "Android",
element: b._buildAndroidSetting()
}, {
name: "IOS",
element: b._buildIOSSetting()
}]);
var f = fa.preference.query("selectedBuildType") || "Browsers";
e.select(f),
e.tabModel.selectionModel.on("selectionChange", function() {
fa.preference.set("selectedBuildType", e.currentTab.name)
}),
b.setItems([{
region: "top",
element: d
}, {
region: "center",
element: e
}]),
fa.projectBuildSettings = b
});
kb.prototype.getSetting = function() {
var a = this;
a._projectSetting = fa.config.project,
a.listAndroidKeyAlias(),
mb(a._projectSetting, "publish.android", lb(a._projectSetting, "publish.android") || "build/android"),
mb(a._projectSetting, "publish.ios", lb(a._projectSetting, "publish.ios") || "build/ios"),
mb(a._projectSetting, "publish.browsers", lb(a._projectSetting, "publish.browsers") || "build/browsers"),
qc.editor.Operation.QUERY_EDITORSERVICE_SETTING(["androidEnvironment"], function(b) {
b.operRet === !0 && (a._androidEnv = b.androidEnvironment || {},
a._repaintPanel(a.androidExtendSettingPanel))
})
}
,
kb.prototype.saveSetting = function(a) {
var b = this;
a !== b._androidEnv ? qc.editor.Operation.UPDATE_PROJECT_SETTINGS(fa.config.project) : b._androidEnv && qc.editor.Operation.SAVE_EDITORSERVICE_SETTING({
androidEnvironment: b._androidEnv
}, function(a) {
a.operRet === !0 && (b._androidEnv = a.valid.androidEnvironment || {},
b._repaintPanel(b.androidExtendSettingPanel))
})
}
,
kb.prototype._paintPanel = function(a, b) {
var c = this;
a.setItems(null),
a._paintImpl = b,
b.call(c, a),
a.setItems(qc.editor.Panel.prototype._getContainerViews.call(a))
}
,
kb.prototype._repaintPanel = function(a, b) {
var c = this;
b ? c._paintPanel(a, a._paintImpl) : c._invalidateFlag || (c._invalidateFlag = !0,
U(function() {
c._invalidateFlag && (delete c._invalidateFlag,
c._paintPanel(a, a._paintImpl))
}))
}
,
kb.prototype._buildProjectSetting = function() {
var a = this
, b = new qc.widget.Container
, c = (b.layout = new qc.widget.layout.TableLayout(b),
new qc.widget.Container);
c.layout = new qc.widget.layout.VBoxLayout(c),
c.layout.padding = [7, 10, 0, 0],
c.layout.gap = 7,
c.scrollBarMode = "on",
a._paintPanel(c, a.normalSettingPaint);
var d = new qc.widget.Container;
return d.layout = new qc.widget.layout.VBoxLayout(d),
d.layout.padding = [7, 10, 0, 0],
d.layout.gap = 7,
d.scrollBarMode = "on",
a._paintPanel(d, a.scenesSettingPaint),
b.setItems([{
height: "140+1",
widths: ["100+0.5", "100+0.5"],
cells: [{
element: c
}, {
element: d
}]
}]),
b
}
,
kb.prototype._buildBrowsersSetting = function() {
var a = this
, b = new qc.widget.Container
, c = (b.layout = new qc.widget.layout.TableLayout(b),
new qc.widget.Container);
c.layout = new qc.widget.layout.VBoxLayout(c),
c.layout.padding = [7, 10, 0, 0],
c.layout.gap = 7,
c.scrollBarMode = "on",
a._paintPanel(c, a.paintBrowsersNormal);
var d = new qc.widget.Container;
d.layout = new qc.widget.layout.VBoxLayout(d),
d.layout.padding = [7, 10, 0, 0],
d.layout.gap = 7,
d.scrollBarMode = "on",
a._paintPanel(d, a.paintBrowsersExtend);
var e = new qc.widget.Container;
return e.layout = new qc.widget.layout.VBoxLayout(e),
e.layout.padding = [3, 7, 0, 0],
e.layout.gap = 7,
e.background = "rgb(67, 67, 67)",
a._paintPanel(e, a.paintButtonPanel.bind(this, "browsers")),
b.setItems([{
height: "30+0.9",
widths: ["100+0.5", "100+0.5"],
cells: [{
element: c
}, {
element: d
}]
}, {
height: "50+0",
cells: [{
element: e,
colspan: 2
}]
}]),
b
}
,
kb.prototype._buildAndroidSetting = function() {
var a = this
, b = new qc.widget.Container
, c = (b.layout = new qc.widget.layout.TableLayout(b),
new qc.widget.Container);
c.layout = new qc.widget.layout.VBoxLayout(c),
c.layout.padding = [7, 10, 0, 0],
c.layout.gap = 7,
c.scrollBarMode = "on",
a._paintPanel(c, a.paintAndroidNormal);
var d = new qc.widget.Container;
a.androidExtendSettingPanel = d,
d.layout = new qc.widget.layout.VBoxLayout(d),
d.layout.padding = [7, 10, 0, 0],
d.layout.gap = 7,
d.scrollBarMode = "on",
a._paintPanel(d, a.paintAndroidExtend);
var e = new qc.widget.Container;
return e.layout = new qc.widget.layout.VBoxLayout(e),
e.layout.padding = [3, 7, 0, 0],
e.layout.gap = 7,
e.background = "rgb(67, 67, 67)",
a._paintPanel(e, a.paintButtonPanel.bind(this, "android")),
b.setItems([{
height: "30+1",
widths: ["100+0.5", "100+0.5"],
cells: [{
element: c
}, {
element: d
}]
}, {
height: "50+0",
cells: [{
element: e,
colspan: 2
}]
}]),
b
}
,
kb.prototype._buildIOSSetting = function() {
var a = this
, b = new qc.widget.Container
, c = (b.layout = new qc.widget.layout.TableLayout(b),
new qc.widget.Container);
c.layout = new qc.widget.layout.VBoxLayout(c),
c.layout.padding = [7, 10, 0, 0],
c.layout.gap = 7,
c.scrollBarMode = "on",
a._paintPanel(c, a.paintIOSNormal);
var d = new qc.widget.Container;
d.layout = new qc.widget.layout.VBoxLayout(d),
d.layout.padding = [7, 10, 0, 0],
d.layout.gap = 7,
d.scrollBarMode = "on",
a._paintPanel(d, a.paintIOSExtend);
var e = new qc.widget.Container;
return e.layout = new qc.widget.layout.VBoxLayout(e),
e.layout.padding = [3, 7, 0, 0],
e.layout.gap = 7,
e.background = "rgb(67, 67, 67)",
a._paintPanel(e, a.paintButtonPanel.bind(this, "ios")),
b.setItems([{
height: "30+1",
widths: ["100+0.5", "100+0.5"],
cells: [{
element: c
}, {
element: d
}]
}, {
height: "50+0",
cells: [{
element: e,
colspan: 2
}]
}]),
b
}
,
kb.prototype.paintButtonPanel = function(a) {
_.columnWidths = ["110+0", "110+0.9", "45+0"];
var b = this
, c = null
, d = null
, e = null;
_.line([_.text(fa._("Publish Path:")), d = _.pathSelector({}, {}, {}), c = _.button(fa._("Build"))]),
d.onValueChanged = b._bindTarget(null, d, "path", b._projectSetting, "publish." + a),
c.on("click", function() {
b.build(a)
}),
_.line([_.text(fa._("Add Timestamp:")), e = _.checkBox({}, {})]),
e.onValueChanged = b._bindTarget(null, e, "selected", b._projectSetting, "publish." + a + "_timestamp", !0)
}
;
var lb = function(a, b) {
for (var c = b.split("."), d = -1, e = c.length, f = a; f && ++d < e; )
f = f[c[d]];
return f
}
, mb = function(a, b, c) {
for (var d = b.split("."), e = -1, f = d.length - 1, g = a; ++e < f; )
g = g[d[e]] || (g[d[e]] = {});
g[d[e]] = c
};
kb.prototype._bindTarget = function(a, b, c, d, e, f, g) {
var h = this
, i = lb(d, e);
return null == i && i != f && (i = f,
mb(d, e, i),
h.saveSetting(d)),
mb(b, c, i),
function() {
mb(d, e, lb(b, c)),
h.saveSetting(d),
g && a && h._repaintPanel(a)
}
}
,
kb.prototype.normalSettingPaint = function(a) {
_.columnWidths = ["110+0.1", "60+0.5"];
var b, c, d, e = this;
_.line([_.text(fa._("Game Name")), b = _.stringInput({}, {})]),
b.onEndEdit = e._bindTarget(a, b, "value", e._projectSetting, "gameName"),
_.line([_.text(fa._("Version")), c = _.stringInput({}, {})]),
c.onEndEdit = e._bindTarget(a, c, "value", e._projectSetting, "buildVersion"),
c.maskRe = /[\d\.]/,
_.line([_.text(fa._("Default Icon")), d = _.textureSelector({
preferredsize: {
width: 80,
height: 80
}
}, {})], 80),
d.onEndEdit = e._bindTarget(a, d, "value", e._projectSetting, "icon")
}
,
kb.prototype.scenesSettingPaint = function() {
_.columnWidths = ["110+0.1", "60+0.5"];
_.line([_.text(fa._("Scenes in Build"))]);
var a = fa.sceneList = new qc.editor.InspectorList({
checkable: !0,
draggable: !0
});
_.line([_.comp(a, null, {
colspan: 2
})], 100);
for (var b = [], c = fa.project.findByType(fa.ASSET_TYPE.ASSET_SCENE, "name"), d = 0; d < c.length; d++)
fa.fileTree.dataModel.getDataById(c[d]) && b.push(c[d].replace(".bin", ""));
var e = fa.config.scene.scene
, f = [];
for (var d in e) {
var g = e[d];
if (!(b.indexOf(g) < 0 || "scene_editor" === g)) {
var h = new qc.widget.Data;
h.name = g,
f.push(h),
a.dataModel.add(h)
}
}
a.selectionModel.selection = f;
for (var d in b) {
var g = b[d];
if (!(e.indexOf(g) >= 0 || "scene_editor" === g)) {
var h = new qc.widget.Data;
h.name = g,
a.dataModel.add(h)
}
}
a.selectionModel.on("selectionChange", function() {
var b = a.dataModel.roots
, c = [];
for (var d in b)
a.isSelected(b[d]) && c.push(b[d].name);
qc.editor.Operation.UPDATE_SCENE_SETTINGS(c)
}),
a.dataModel.on("hierarchyChange", function() {
var b = a.dataModel.roots
, c = [];
for (var d in b)
a.isSelected(b[d]) && c.push(b[d].name);
qc.editor.Operation.UPDATE_SCENE_SETTINGS(c)
})
}
,
kb.prototype.paintBrowsersNormal = function(a) {
var b, c, d, e, f, g, h = this;
_.columnWidths = ["30+0", "70+0.08", "60+0.5"];
var i = _.titleLine(fa._("Frame Rate"), !1);
i.add(_.line([_.empty(), _.text(fa._("Mobile")), b = _.intInput({}, {})])),
b.onEndEdit = h._bindTarget(a, b, "value", h._projectSetting, "frameRate.mobile"),
i.add(_.line([_.empty(), _.text(fa._("Desktop")), c = _.intInput({}, {})])),
c.onEndEdit = h._bindTarget(a, c, "value", h._projectSetting, "frameRate.desktop"),
_.columnWidths = ["110+0.1", "60+0.5"],
_.line([_.text(fa._("Renderer")), d = _.dropDownList({
items: [{
value: "Auto",
label: fa._("Auto")
}, {
value: "Canvas",
label: "Canvas"
}]
})]),
d.onEndEdit = h._bindTarget(a, d, "value", h._projectSetting, "renderer"),
_.line([_.text(fa._("Developer Mode")), e = _.checkBox({
selected: fa.config.project.developerMode
})]),
e.onValueChanged = h._bindTarget(a, e, "selected", h._projectSetting, "developerMode"),
_.line([_.text(fa._("Dirty Rectangles")), f = _.checkBox({
selected: fa.config.project.dirtyRectangles
})]),
f.onValueChanged = h._bindTarget(a, f, "selected", h._projectSetting, "dirtyRectangles"),
_.line([_.text(fa._("Show Dirty Rectangles")), g = _.checkBox({
selected: fa.config.project.dirtyRectanglesShow
})]),
g.onValueChanged = h._bindTarget(a, g, "selected", h._projectSetting, "dirtyRectanglesShow")
}
,
kb.prototype.paintBrowsersExtend = function() {}
;
var nb = function() {
return [{
value: 14,
label: "Android 4.0"
}, {
value: 15,
label: "Android 4.0.3"
}, {
value: 16,
label: "Android 4.1"
}, {
value: 17,
label: "Android 4.2"
}, {
value: 18,
label: "Android 4.3"
}, {
value: 19,
label: "Android 4.4"
}, {
value: 20,
label: "Android 4.4W"
}, {
value: 21,
label: "Android 5.0"
}, {
value: 22,
label: "Android 5.1"
}, {
value: 23,
label: "Android 6.0"
}]
};
kb.prototype.paintAndroidNormal = function(a) {
_.columnWidths = ["110+0.1", "60+0.5"];
var b, c, d, e, f, g, h, i, j, k, l, m = this;
_.line([_.text(fa._("Bundle Id")), b = _.stringInput({}, {})]),
b.maskRe = /[a-zA-z0-9\.]/,
b.onEndEdit = m._bindTarget(a, b, "value", m._projectSetting, "android.bundleId"),
_.line([_.text(fa._("Mininum API Level")), c = _.dropDownList({
items: nb()
})]),
c.onValueChanged = m._bindTarget(a, c, "value", m._projectSetting, "android.minTarget", 16),
_.line([_.text(fa._("Target Level")), d = _.dropDownList({
items: nb()
})]),
d.onValueChanged = m._bindTarget(a, d, "value", m._projectSetting, "android.target", 16),
_.line([_.text(fa._("Build Code")), e = _.intInput()]),
e.maskRe = /[0-9]/,
e.onEndEdit = m._bindTarget(a, e, "value", m._projectSetting, "android.buildCode", 0),
_.line([_.text(fa._("Frame Rate")), f = _.intInput()]),
f.maskRe = /[0-9]/,
f.onEndEdit = m._bindTarget(a, f, "value", m._projectSetting, "android.frameRate", 30),
_.line([_.text(fa._("Renderer")), g = _.dropDownList({
items: [{
value: "Auto",
label: fa._("Auto")
}, {
value: "Canvas",
label: "Canvas"
}]
})]),
g.onValueChanged = m._bindTarget(a, g, "value", m._projectSetting, "android.renderer", "Canvas"),
_.line([_.text(fa._("Default Orientation")), k = _.dropDownList({
items: [{
label: "Auto Rotation",
value: 0
}, {
label: "Portrait",
value: 1
}, {
label: "Portrait Upside Down",
value: 2
}, {
label: "Landscape Right",
value: 3
}, {
label: "Landscape Left",
value: 4
}]
})]),
k.onValueChanged = m._bindTarget(a, k, "value", m._projectSetting, "android.defaultOrientation", 0, !0);
var n;
if (_.columnWidths = ["30+0", "110+0.1", "60+0.5"],
!k.value) {
n = _.titleLine(fa._("Allowed Orientations for Auto Rotation"));
var o, p = [];
n.add(_.line([_.empty(), _.text(fa._("Portrait")), o = _.checkBox()])),
p.push(o);
var q = m._bindTarget(a, o, "selected", m._projectSetting, "android.autoOrientation.portrait");
o.onValueChanged = function() {
q(),
m._updateRotationCheckboxes(p)
}
,
n.add(_.line([_.empty(), _.text(fa._("Portrait Upside Down")), o = _.checkBox()])),
p.push(o);
var r = m._bindTarget(a, o, "selected", m._projectSetting, "android.autoOrientation.portraitUpsideDown");
o.onValueChanged = function() {
r(),
m._updateRotationCheckboxes(p)
}
,
n.add(_.line([_.empty(), _.text(fa._("Landscape Right")), o = _.checkBox()])),
p.push(o);
var s = m._bindTarget(a, o, "selected", m._projectSetting, "android.autoOrientation.landscapeRight");
o.onValueChanged = function() {
s(),
m._updateRotationCheckboxes(p)
}
,
n.add(_.line([_.empty(), _.text(fa._("Landscape Left")), o = _.checkBox()])),
p.push(o);
var t = m._bindTarget(a, o, "selected", m._projectSetting, "android.autoOrientation.landscapeLeft");
o.onValueChanged = function() {
t(),
m._updateRotationCheckboxes(p)
}
}
_.columnWidths = ["110+0.1", "60+0.5"],
_.line([_.text(fa._("Developer Mode")), h = _.checkBox({
selected: fa.config.project.developerMode
})]),
h.onValueChanged = m._bindTarget(a, h, "selected", m._projectSetting, "android.developerMode"),
_.line([_.text(fa._("Dirty Rectangles")), i = _.checkBox({
selected: fa.config.project.dirtyRectangles
})]),
i.onValueChanged = m._bindTarget(a, i, "selected", m._projectSetting, "android.dirtyRectangles"),
_.line([_.text(fa._("Show Dirty Rectangles")), j = _.checkBox({
selected: fa.config.project.dirtyRectanglesShow
})]),
j.onValueChanged = m._bindTarget(a, j, "selected", m._projectSetting, "android.dirtyRectanglesShow"),
_.line([_.text(fa._("Build Apk")), l = _.checkBox({
selected: fa.config.project.dirtyRectanglesShow
})]),
l.onValueChanged = m._bindTarget(a, l, "selected", m._projectSetting, "android.makeApk")
}
,
kb.prototype.paintAndroidExtend = function(a) {
var b, c = this;
_.columnWidths = ["30+0", "80+0.08", "60+0.5", "30+0"];
var d;
b = _.titleLine(fa._("Keystore Setting")),
b.add(_.line([_.empty(), _.text(fa._("Keystore Setting")), d = _.dropDownList({
items: [{
label: fa._("Use Existing Keystore"),
value: 0
}, {
label: fa._("Create New Keystore"),
value: 1
}]
}, {
colspan: 2
})])),
d.onValueChanged = c._bindTarget(a, d, "value", c, "_createKeystore", 0, !0),
b.add(_.line([_.empty(), _.text(fa._("Store File")), d = _.pathSelector({
showFiles: !0
}, {
colspan: 2
})]));
var e = c._bindTarget(a, d, "path", c._projectSetting, "android.keystoreFile");
d.onValueChanged = function() {
e(),
c.listAndroidKeyAlias()
}
,
b.add(_.line([_.empty(), _.text(fa._("Store Password")), d = _.stringInput(null, {
colspan: 2
})])),
d.input.type = "password";
var f = c._bindTarget(a, d, "value", c._projectSetting, "android.keystorePassword");
if (d.onEndEdit = function() {
f(),
c.listAndroidKeyAlias()
}
,
c._createKeystore) {
var g;
b.add(_.line([_.empty(), _.text(fa._("Confirm password")), g = _.stringInput(null, {
colspan: 2
})])),
g.input.type = "password",
b.add(_.line([_.empty(), d = _.button("Create Keystore")])),
d.on("click", function() {
var a = lb(c._projectSetting, "android.keystoreFile")
, b = lb(c._projectSetting, "android.keystorePassword")
, d = g.value;
return !a || a.length < 1 ? void fa.notification.warn(fa._("Enter path to keystore.")) : !b || b.length < 1 ? void fa.notification.warn(fa._("Enter keystore password")) : b.length < 6 ? void fa.notification.warn(fa._("Keystore password is too short - must be at least 6 characters")) : b !== d ? void fa.notification.warn(fa._("Keystore passwords do not match.")) : void c.showKeyCreation(!1, a, b)
})
}
var h;
b.add(_.line([_.empty(), _.text(fa._("Key Alias")), d = _.dropDownList({
items: c.currAliasNames || []
}), h = _.label(null, {
icon: "project_add"
})])),
d.onValueChanged = c._bindTarget(a, d, "value", c._projectSetting, "android.keyAlias"),
h.addEventListener("click", function() {
var a = lb(c._projectSetting, "android.keystoreFile")
, b = lb(c._projectSetting, "android.keystorePassword");
return !a || a.length < 1 ? void fa.notification.warn(fa._("Enter path to keystore.")) : !b || b.length < 1 ? void fa.notification.warn(fa._("Enter keystore password")) : b.length < 6 ? void fa.notification.warn(fa._("Keystore password is too short - must be at least 6 characters")) : void c.showKeyCreation(!0, a, b)
}),
b.add(_.line([_.empty(), _.text(fa._("Password")), d = _.stringInput(null, {
colspan: 2
})])),
d.input.type = "password",
d.onEndEdit = c._bindTarget(a, d, "value", c._projectSetting, "android.keyAliasPassword"),
c._androidEnv && (b = _.titleLine(fa._("Android Environment")),
b.add(_.line([_.empty(), _.text("JDK"), d = _.pathSelector({}, {})])),
d.onValueChanged = c._bindTarget(a, d, "path", c._androidEnv, "jdkPath"),
b.add(_.line([_.empty(), _.text("SDK"), d = _.pathSelector({}, {})])),
d.onValueChanged = c._bindTarget(a, d, "path", c._androidEnv, "sdkPath"),
b.add(_.line([_.empty(), _.text("NDK"), d = _.pathSelector({}, {})])),
d.onValueChanged = c._bindTarget(a, d, "path", c._androidEnv, "ndkPath"))
}
;
var ob = function() {
return [{
value: "8.0",
label: "8.0"
}, {
value: "8.1",
label: "8.1"
}, {
value: "8.2",
label: "8.2"
}, {
value: "8.3",
label: "8.3"
}, {
value: "8.4",
label: "8.4"
}, {
value: "9.0",
label: "9.0"
}, {
value: "9.1",
label: "9.1"
}, {
value: "9.2",
label: "9.2"
}, {
value: "9.3",
label: "9.3"
}]
};
kb.prototype.paintIOSNormal = function(a) {
_.columnWidths = ["110+0.1", "60+0.5"];
var b, c = this;
_.line([_.text(fa._("Bundle Id")), b = _.stringInput({}, {})]),
b.maskRe = /[a-zA-z0-9\.]/,
b.onEndEdit = c._bindTarget(a, b, "value", c._projectSetting, "ios.bundleId"),
_.line([_.text(fa._("Deployment Target")), b = _.dropDownList({
items: ob()
})]),
b.onValueChanged = c._bindTarget(a, b, "value", c._projectSetting, "ios.target", "8.0"),
_.line([_.text(fa._("Build Code")), b = _.intInput()]),
b.maskRe = /[0-9]/,
b.onEndEdit = c._bindTarget(a, b, "value", c._projectSetting, "ios.buildCode", 0),
_.line([_.text(fa._("Frame Rate")), b = _.intInput()]),
b.maskRe = /[0-9]/,
b.onEndEdit = c._bindTarget(a, b, "value", c._projectSetting, "ios.frameRate", 30),
_.line([_.text(fa._("Renderer")), b = _.dropDownList({
items: [{
value: "Auto",
label: fa._("Auto")
}, {
value: "Canvas",
label: "Canvas"
}]
})]),
b.onValueChanged = c._bindTarget(a, b, "value", c._projectSetting, "ios.renderer", "Auto"),
_.line([_.text(fa._("Default Orientation")), b = _.dropDownList({
items: [{
label: "Auto Rotation",
value: 0
}, {
label: "Portrait",
value: 1
}, {
label: "Portrait Upside Down",
value: 2
}, {
label: "Landscape Right",
value: 3
}, {
label: "Landscape Left",
value: 4
}]
})]),
b.onValueChanged = c._bindTarget(a, b, "value", c._projectSetting, "ios.defaultOrientation", 0, !0);
var d, e = [];
if (_.columnWidths = ["30+0", "110+0.1", "60+0.5"],
!b.value) {
var f;
d = _.titleLine(fa._("Allowed Orientations for Auto Rotation")),
d.add(_.line([_.empty(), _.text(fa._("Portrait")), f = _.checkBox()])),
e.push(f);
var g = c._bindTarget(a, f, "selected", c._projectSetting, "ios.autoOrientation.portrait");
f.onValueChanged = function() {
g(),
c._updateRotationCheckboxes(e)
}
,
d.add(_.line([_.empty(), _.text(fa._("Portrait Upside Down")), f = _.checkBox()])),
e.push(f);
var h = c._bindTarget(a, f, "selected", c._projectSetting, "ios.autoOrientation.portraitUpsideDown");
f.onValueChanged = function() {
h(),
c._updateRotationCheckboxes(e)
}
,
d.add(_.line([_.empty(), _.text(fa._("Landscape Right")), f = _.checkBox()])),
e.push(f);
var i = c._bindTarget(a, f, "selected", c._projectSetting, "ios.autoOrientation.landscapeRight");
f.onValueChanged = function() {
i(),
c._updateRotationCheckboxes(e)
}
,
d.add(_.line([_.empty(), _.text(fa._("Landscape Left")), f = _.checkBox()])),
e.push(f);
var j = c._bindTarget(a, f, "selected", c._projectSetting, "ios.autoOrientation.landscapeLeft");
f.onValueChanged = function() {
j(),
c._updateRotationCheckboxes(e)
}
}
_.columnWidths = ["110+0.1", "60+0.5"],
_.line([_.text(fa._("Developer Mode")), b = _.checkBox({
selected: fa.config.project.developerMode
})]),
b.onValueChanged = c._bindTarget(a, b, "selected", c._projectSetting, "ios.developerMode"),
_.line([_.text(fa._("Dirty Rectangles")), b = _.checkBox({
selected: fa.config.project.dirtyRectangles
})]),
b.onValueChanged = c._bindTarget(a, b, "selected", c._projectSetting, "ios.dirtyRectangles"),
_.line([_.text(fa._("Show Dirty Rectangles")), b = _.checkBox({
selected: fa.config.project.dirtyRectanglesShow
})]),
b.onValueChanged = c._bindTarget(a, b, "selected", c._projectSetting, "ios.dirtyRectanglesShow")
}
,
kb.prototype.paintIOSExtend = function(a) {
var b, c = this;
_.columnWidths = ["30+0", "80+0.08", "60+0.5"];
var d;
b = _.titleLine(fa._("Splash Setting")),
b.add(_.line([_.empty(), _.text(fa._("Splash Image")), d = _.textureSelector({
preferredsize: {
width: 80,
height: 80
}
}, {})], 80)),
d.onEndEdit = c._bindTarget(a, d, "value", c._projectSetting, "ios.splashImage"),
b.add(_.line([_.empty(), _.text(fa._("Splash scaling")), d = _.dropDownList({
items: [{
label: fa._("Center (only scale down)"),
value: 0
}, {
label: fa._("Scale to fit (letter boxed)"),
value: 1
}, {
label: fa._("Scale to fill (cropped)"),
value: 2
}]
})])),
d.onValueChanged = c._bindTarget(a, d, "value", c._projectSetting, "ios.splashScaling", 2)
}
,
kb.prototype.showKeyCreation = function(a, b, c) {
var d = new tb({
addAlias: a,
filePath: b,
keystorePassword: c
})
, e = new Ra;
e.modal = !0,
e.title = fa._("Key Creation"),
e.content = d,
e.contentPadding = [2, 4, 2, 4],
d.dialog = e;
var f = Wb(500, 290);
e.width = f.width,
e.height = f.height,
e.show(),
d.onApply = function() {
e.hide()
}
}
,
kb.prototype.listAndroidKeyAlias = function() {
var a = this
, b = lb(a._projectSetting, "android.keystoreFile")
, c = lb(a._projectSetting, "android.keystorePassword");
b && 0 !== b.length && c && 0 !== c.length && qc.editor.Operation.LIST_ANDROID_KEY_ALIAS(b, c)
}
,
kb.prototype.handleListAndroidKeyAliasResult = function(a) {
var b = this;
if (b.currAliasNames = [],
a.errCode)
return void console.log(a.errMsg);
for (var c = a.aliasName.length; c--; )
b.currAliasNames.push({
value: a.aliasName[c],
label: a.aliasName[c]
});
b.androidExtendSettingPanel && b._repaintPanel(b.androidExtendSettingPanel)
}
,
kb.prototype.build = function(a) {
var b = this
, c = lb(b._projectSetting, "publish." + a);
if (!c || 0 === c.length)
return void fa.notification.warn(fa._("Enter publish path."));
var d = lb(b._projectSetting, "icon");
if (b._checkBaseSetting()) {
var e = null
, f = function(b) {
fa.e.emit(fa.e.BEFOR_PUBLISH),
qc.editor.Operation.PUBLISH(function() {
fa.e.emit(fa.e.AFTER_PUBLISH)
}, {
platform: a,
iconList: b,
splash: e
})
};
switch (a.toLowerCase()) {
case "browsers":
if (!b._checkBrowsersSetting())
return;
d ? b._buildImage(d.asset, d.url, d.frame, pb, 1, f) : f();
break;
case "android":
if (!b._checkAndroidSetting())
return;
d ? b._buildImage(d.asset, d.url, d.frame, qb, 1, f) : f();
break;
case "ios":
if (!b._checkIOSSetting())
return;
var g = lb(b._projectSetting, "ios.splashImage")
, h = lb(b._projectSetting, "ios.splashScaling");
g ? b._buildImage(g.asset, g.url, g.frame, sb, h, function(a) {
e = a,
d ? b._buildImage(d.asset, d.url, d.frame, rb, 1, f) : f()
}) : d ? b._buildImage(d.asset, d.url, d.frame, rb, 1, f) : f()
}
}
}
,
kb.prototype._checkBaseSetting = function() {
var a = this
, b = lb(a._projectSetting, "buildVersion");
return b && 0 !== b.length ? !0 : (fa.notification.warn(fa._("Enter build version.")),
!1)
}
,
kb.prototype._checkBrowsersSetting = function() {
return !0
}
,
kb.prototype._checkAndroidSetting = function() {
var a = this
, b = lb(a._projectSetting, "android.keystoreFile")
, c = lb(a._projectSetting, "android.keystorePassword")
, d = lb(a._projectSetting, "android.keyAlias")
, e = lb(a._projectSetting, "android.keyAliasPassword")
, f = lb(a._androidEnv, "jdkPath")
, g = lb(a._androidEnv, "sdkPath");
return !b || b.length < 1 ? void fa.notification.warn(fa._("Enter path to keystore.")) : !c || c.length < 1 ? void fa.notification.warn(fa._("Enter keystore password.")) : c.length < 6 ? void fa.notification.warn(fa._("Keystore password is too short - must be at least 6 characters.")) : !d || d.length < 1 ? void fa.notification.warn(fa._("Enter key alias.")) : !e || e.length < 6 ? void fa.notification.warn(fa._("Alias password is too short - must be at least 6 characters.")) : !f || f.length < 1 ? void fa.notification.warn(fa._("Enter JDK path.")) : !g || g.length < 1 ? void fa.notification.warn(fa._("Enter Android SDK path.")) : !0
}
,
kb.prototype._checkIOSSetting = function() {
return qc.widget.Default.isMac ? !0 : void fa.notification.warn(fa._("Packaging as iOS App only supported in Mac OSX."))
}
;
var pb = [{
width: 152,
height: 152
}]
, qb = [{
width: 192,
height: 192
}, {
width: 144,
height: 144
}, {
width: 96,
height: 96
}, {
width: 72,
height: 72
}, {
width: 48,
height: 48
}, {
width: 36,
height: 36
}]
, rb = [{
width: 180,
height: 180
}, {
width: 152,
height: 152
}, {
width: 144,
height: 144
}, {
width: 120,
height: 120
}, {
width: 114,
height: 114
}, {
width: 76,
height: 76
}, {
width: 72,
height: 72
}, {
width: 57,
height: 57
}]
, sb = [{
width: 320,
height: 480,
rotation: 0
}, {
width: 640,
height: 960,
rotation: 0
}, {
width: 640,
height: 1136,
rotation: 0
}, {
width: 750,
height: 1334,
rotation: 0
}, {
width: 768,
height: 1024,
rotation: 0
}, {
width: 1536,
height: 2048,
rotation: 0
}, {
width: 1242,
height: 2208,
rotation: 0
}, {
width: 1024,
height: 768,
rotation: 90
}, {
width: 2048,
height: 1536,
rotation: 90
}, {
width: 2208,
height: 1242,
rotation: 90
}];
kb.prototype._buildImage = function(a, b, c, d, e, f) {
var g = fa.game.assets.findByUUID(a);
if (g) {
var h = this._makeTextureImage(new qc.Texture(g,c), d, e);
f && f(h)
} else
fa.game.assets.load(a, b, function(a) {
var b = this._makeTextureImage(new qc.Texture(a,c), d, e);
f && f(b)
})
}
,
kb.prototype._makeTextureImage = function(a, b, c) {
var d, e = [];
d = "string" == typeof a.frame ? a.atlas.frames[Math.max(0, a.atlas.frameNames.indexOf(a.frame))] : a.atlas.frames[a.frame],
b && 0 !== b.length || (b = [{
width: d.width,
height: d.height
}]);
for (var f = this._iconCanvas || (this._iconCanvas = document.createElement("canvas")), g = f.getContext("2d"), h = -1; ++h < b.length; ) {
var i = b[h];
g.save(),
f.width = i.width,
f.height = i.height,
g.clearRect(0, 0, i.width, i.height);
var j = i.width
, k = i.height;
if (g.translate(i.width / 2, i.height / 2),
i.rotation && (g.rotate(Math.PI / 2),
j = i.height,
k = i.width),
2 === c)
g.drawImage(a.atlas.img, d.x, d.y, d.width, d.height, -j / 2, -k / 2, j, k);
else {
var l = Math.min(j / d.width, k / d.height);
c || (l = Math.max(1, l)),
g.drawImage(a.atlas.img, d.x, d.y, d.width, d.height, -l * d.width / 2, -l * d.height / 2, d.width * l, d.height * l)
}
e.push(f.toDataURL()),
g.restore()
}
return f.width = f.height = 0,
e
}
,
kb.prototype._updateRotationCheckboxes = function(a) {
var b = !1;
for (var c in a)
if (a[c].selected) {
b = !0;
break
}
b || (a[0].selected = !0)
}
;
var tb = m("qc.editor.AndroidKeyCreation", qc.widget.Container, function Yf(a) {
var b = this;
Yf["super"].constructor.call(b, a),
b.filePath = a.filePath,
b.keystorePassword = a.keystorePassword,
b.addAlias = !!a.addAlias,
b.alias = {},
b.issuer = {};
var c = b.layout = new qc.widget.layout.BorderLayout(b);
c.topToggleVisible = !1,
c.topResizable = !1,
c.splitterColor = "rgb(143, 156, 178)",
c.splitterSize = 1,
b.setItems([{
region: "top",
element: b._buildAliasSetting()
}, {
region: "center",
element: b._buildInfoSetting()
}]),
fa.androidKeyCreation = b
});
tb.prototype._paintPanel = function(a, b) {
var c = this;
a.setItems(null),
a._paintImpl = b,
b.call(c, a),
a.setItems(qc.editor.Panel.prototype._getContainerViews.call(a))
}
,
tb.prototype._repaintPanel = function(a, b) {
var c = this;
b ? c._paintPanel(a, a._paintImpl) : c._invalidateFlag || (c._invalidateFlag = !0,
U(function() {
c._invalidateFlag && (delete c._invalidateFlag,
c._paintPanel(a, a._paintImpl))
}))
}
;
var lb = function(a, b) {
for (var c = b.split("."), d = -1, e = c.length, f = a; f && ++d < e; )
f = f[c[d]];
return f
}
, mb = function(a, b, c) {
for (var d = b.split("."), e = -1, f = d.length - 1, g = a; ++e < f; )
g = g[d[e]] || (g[d[e]] = {});
g[d[e]] = c
};
tb.prototype._bindTarget = function(a, b, c, d, e, f, g) {
var h = this
, i = lb(d, e);
return i || (i = f,
mb(d, e, i)),
mb(b, c, i),
function() {
mb(d, e, lb(b, c) || f),
g && h._repaintPanel(a)
}
}
,
tb.prototype._buildAliasSetting = function() {
var a = this
, b = new qc.widget.Container;
return b.layout = new qc.widget.layout.VBoxLayout(b),
b.layout.padding = [7, 10, 0, 0],
b.layout.gap = 7,
b.scrollBarMode = "on",
a._paintPanel(b, a.paintAliasSetting),
b
}
,
tb.prototype._buildInfoSetting = function() {
var a = this
, b = new qc.widget.Container;
return b.layout = new qc.widget.layout.VBoxLayout(b),
b.layout.padding = [7, 10, 0, 0],
b.layout.gap = 7,
b.scrollBarMode = "on",
a._paintPanel(b, a.paintIssuerSetting),
b
}
,
tb.prototype.paintAliasSetting = function(a) {
var b = this
, c = null;
_.columnWidths = ["130+0.1", "60+0.7"],
_.line([_.text(fa._("Alias:")), c = _.stringInput({}, {})]),
c.onEndEdit = b._bindTarget(a, c, "value", b.alias, "alias"),
_.line([_.text(fa._("Password:")), c = _.stringInput({}, {})]),
c.input.type = "password",
c.onEndEdit = b._bindTarget(a, c, "value", b.alias, "password"),
_.line([_.text(fa._("Confirm:")), c = _.stringInput({}, {})]),
c.input.type = "password",
c.onEndEdit = b._bindTarget(a, c, "value", b.alias, "confirm"),
_.line([_.text(fa._("Validity (years):")), c = _.intInput({}, {})]),
c.onEndEdit = b._bindTarget(a, c, "value", b.alias, "validity", 10)
}
,
tb.prototype.paintIssuerSetting = function(a) {
var b = this
, c = null;
_.columnWidths = ["130+0.1", "60+0.7"],
_.line([_.text(fa._("Fist and Last Name:")), c = _.stringInput({}, {})]),
c.onEndEdit = b._bindTarget(a, c, "value", b.issuer, "name"),
_.line([_.text(fa._("Organizational Unit:")), c = _.stringInput({}, {})]),
c.onEndEdit = b._bindTarget(a, c, "value", b.issuer, "orgUnit"),
_.line([_.text(fa._("Organization:")), c = _.stringInput({}, {})]),
c.onEndEdit = b._bindTarget(a, c, "value", b.issuer, "org"),
_.line([_.text(fa._("City or Locality:")), c = _.stringInput({}, {})]),
c.onEndEdit = b._bindTarget(a, c, "value", b.issuer, "city"),
_.line([_.text(fa._("State or Province:")), c = _.stringInput({}, {})]),
c.onEndEdit = b._bindTarget(a, c, "value", b.issuer, "state"),
_.line([_.text(fa._("County Code (XX):")), c = _.stringInput({}, {})]),
c.onEndEdit = b._bindTarget(a, c, "value", b.issuer, "code"),
_.columnWidths = ["100+0.7", "60+0", "30+0.1"],
_.line([_.empty(), c = _.button(fa._("Create")), _.empty()]),
c.on("click", function() {
b.createKey()
})
}
,
tb.prototype.isNullOrEmpty = function(a) {
return !a || a.length < 0
}
,
tb.prototype.createKey = function() {
var a = this;
return a.isNullOrEmpty(a.alias.alias) ? void $b(fa._("Enter key alias.")) : a.isNullOrEmpty(a.alias.password) ? void $b(fa._("Enter key password.")) : a.alias.password.length < 6 ? void $b(fa._("Alias password is too short - must be at least 6 characters.")) : a.alias.password !== a.alias.confirm ? void $b(fa._("Alias password do not match.")) : a.alias.validity ? a.isNullOrEmpty(a.issuer.name) && a.isNullOrEmpty(a.issuer.orgUnit) && a.isNullOrEmpty(a.issuer.org) && a.isNullOrEmpty(a.issuer.city) && a.isNullOrEmpty(a.issuer.state) && a.isNullOrEmpty(a.issuer.code) ? void $b(fa._("At least one Certificate issuer field is required to be non-empty.")) : a.issuer.code && 2 !== a.issuer.code.length ? void $b(fa._("Enter two-letter country code.")) : (qc.editor.Operation.CREATE_ANDROID_KEYSTORE(a.addAlias, a.filePath, a.keystorePassword, a.alias.alias, a.alias.password, a.alias.validity, a.issuer),
a.defaultHide = a.hide,
void (a.dialog.disabled = !0)) : void $b(fa._("Key certificate validity is required."))
}
,
tb.prototype.handleCreateResult = function(a) {
var b = this;
b.dialog.disabled = !1,
0 === a.errCode ? (b.dialog.hide(),
qc.editor.Operation.LIST_ANDROID_KEY_ALIAS(b.filePath, b.keystorePassword)) : ($b(a.errMsg),
console.log(a.errMsg))
}
;
var ub = m("qc.editor.LayoutSettings", b, function() {
var b = this
, c = b.canvas = q();
t(c, 35, 25),
c.style.top = "1px",
c.style.right = "4px",
c.style.background = "black",
c.style.cursor = "pointer",
c.style.border = "solid #7C89A4 1px",
c.style.zIndex = 2,
fa.mainContainer.view.appendChild(c),
b._expanded = !1,
b.redraw(),
a.addEventListener("keydown", function(a) {
F(a) && b.setExpanded(!1)
}, !1),
a.addEventListener("click", function(a) {
if (a.target === c)
if (b._expanded)
b.setExpanded(!1, b._focusType);
else {
if (fa.playing)
return void fa.notification.warn(fa._("Quit running mode first"));
if (fa.prefabInfo)
return void fa.notification.warn(fa._("Stop editing prefab first"));
b.setExpanded(!0)
}
else
b.setExpanded(!1)
}, !1),
c.addEventListener("mousedown", function(a) {
a.preventDefault()
}),
b._rects = {},
b._focusType,
c.addEventListener("mousemove", function(a) {
if (b._expanded) {
var d = c.getBoundingClientRect()
, e = {
x: a.clientX - d.left,
y: a.clientY - d.top
};
for (var f in b._rects)
if (v(b._rects[f], e) && b._focusType !== f)
return b._focusType = parseInt(f),
void b.redraw()
}
})
});
ub.prototype.setExpanded = function(a, b) {
var c = this;
if (a !== c._expanded && !c._animating) {
var d = c.canvas;
c._expanded = a,
c._animating = !0,
c._focusType = null;
var e = 360
, f = 180;
W(a ? {
duration: 100,
finishFunc: function() {
c._animating = !1
},
action: function(a) {
t(d, 50 + (e - 50) * a, 25 + (f - 25) * a),
c.redraw()
}
} : {
duration: 100,
finishFunc: function() {
c._animating = !1,
b && qc.editor.Operation.SAVE_CURR_SCENE(function() {
fa.mainContainer.layoutType = b,
c.redraw()
})
},
action: function(a) {
t(d, e + (50 - e) * a, f + (25 - f) * a),
c.redraw()
}
})
}
}
,
ub.BACKGROUNDS = {
S: "#274E83",
H: "#40425E",
P: "#47535B",
I: "#2D2D31"
},
ub.prototype.drawRect = function(a, b, c, d, e, f) {
a.beginPath(),
a.rect(c + 1, d + 1, e - 2, f - 2),
a.fillStyle = ub.BACKGROUNDS[b],
a.fill(),
S(a, b, null, "white", c, d, e, f, "center")
}
,
ub.prototype.redraw = function() {
var b = this
, c = b.canvas
, d = a.devicePixelRatio
, e = c.width
, f = c.height
, g = c.getContext("2d");
if (g.clearRect(0, 0, e, f),
g.save(),
b._expanded) {
var h = f / 230
, i = function(a, c, e) {
g.translate(c * h, e * h),
g.scale(h, h),
b._focusType === a && (g.beginPath(),
g.rect(-2, -2, 144, 104),
g.fillStyle = "white",
g.fill()),
a === fa.mainContainer.layoutType && (g.beginPath(),
g.rect(-2, -2, 144, 104),
g.lineWidth = 2,
g.strokeStyle = "#FDC60A",
g.stroke()),
b["drawLayout" + a](g),
g.scale(1 / h, 1 / h),
g.translate(-c * h, -e * h),
b._rects[a] = {
x: c * h / d,
y: e * h / d,
width: 140 * h / d,
height: 100 * h / d
}
};
i(2, 10, 10),
i(4, 160, 10),
i(5, 310, 10),
i(1, 10, 120),
i(3, 160, 120),
i(6, 310, 120)
} else {
var h = f / 100;
g.translate((e - 140 * h) / 2, 0),
g.scale(h, h),
b["drawLayout" + fa.mainContainer.layoutType](g)
}
g.restore()
}
,
ub.prototype.drawLayout1 = function(a) {
this.drawRect(a, "S", 0, 0, 60, 60),
this.drawRect(a, "H", 60, 0, 40, 60),
this.drawRect(a, "I", 100, 0, 40, 100),
this.drawRect(a, "P", 0, 60, 100, 40)
}
,
ub.prototype.drawLayout2 = function(a) {
this.drawRect(a, "S", 0, 0, 50, 100),
this.drawRect(a, "H", 50, 0, 30, 100),
this.drawRect(a, "P", 80, 0, 30, 100),
this.drawRect(a, "I", 110, 0, 30, 100)
}
,
ub.prototype.drawLayout3 = function(a) {
this.drawRect(a, "H", 0, 0, 40, 60),
this.drawRect(a, "S", 40, 0, 60, 60),
this.drawRect(a, "I", 100, 0, 40, 100),
this.drawRect(a, "P", 0, 60, 100, 40)
}
,
ub.prototype.drawLayout4 = function(a) {
this.drawRect(a, "P", 0, 0, 30, 100),
this.drawRect(a, "H", 30, 0, 30, 100),
this.drawRect(a, "S", 60, 0, 50, 100),
this.drawRect(a, "I", 110, 0, 30, 100)
}
,
ub.prototype.drawLayout5 = function(a) {
this.drawRect(a, "P", 0, 0, 30, 100),
this.drawRect(a, "S", 30, 0, 50, 100),
this.drawRect(a, "H", 80, 0, 30, 100),
this.drawRect(a, "I", 110, 0, 30, 100)
}
,
ub.prototype.drawLayout6 = function(a) {
this.drawRect(a, "I", 0, 0, 40, 100),
this.drawRect(a, "H", 40, 0, 40, 60),
this.drawRect(a, "S", 80, 0, 60, 60),
this.drawRect(a, "P", 40, 60, 100, 40)
}
;
var vb = m("qc.editor.LayoutContainer", qc.widget.Container, function Zf(a) {
var b = this;
Zf["super"].constructor.call(b, a),
b.layout = new qc.widget.layout.SplitLayout(b),
b.layoutType = fa.storage.get("layoutType")
});
vb.TOP_MENU = 1,
vb.TOP_LEFT = 2,
vb.TOP_RUN = 3,
vb.TOP_MIDDLE = 4,
vb.TOP_RIGHT = 5,
vb.SCENE = 6,
vb.SCENE_Banner = 6.1,
vb.SCENE_SCENE = 6.2,
vb.HIERARCHY = 7,
vb.PROJECT = 8,
vb.INSPECTOR = 9,
vb.DIALOG = 10,
b.defineProperties(vb.prototype, {
layoutType: {
get: function() {
return this._layoutType
},
set: function(a) {
var b = this
, c = b.layout;
if (b["_createMainContainer" + a] || (a = 1),
b._layoutType !== a) {
fa.windowDisabled = !0,
fa.shutdown(),
c.orientation = "v",
c.position = 30,
c.minSize = 10,
c.splitterSize = 1,
c.draggable = !1,
c.positionType = "absoluteLeft";
var d = b.getRegionContainer("1")
, e = b.getRegionContainer("2")
, f = b.getRegionContainer("3")
, g = b.getRegionContainer("4")
, h = b.getRegionContainer("5")
, i = b.getRegionContainer("6")
, j = b.getRegionContainer("7")
, k = b.getRegionContainer("8")
, l = b.getRegionContainer("9")
, m = new qc.widget.Container;
m.layout = new qc.widget.layout.TableLayout(m),
m.layout.cellPadding = 0,
m.scrollBarModel = "off",
m.setItems([{
height: .1,
widths: [248, 160, .1, 240],
cells: [{
element: e
}, {
element: f
}, {
element: g
}, {
element: h
}]
}]);
var n = b["_createMainContainer" + a](i, j, k, l)
, o = new qc.widget.Container;
o.layout = new qc.widget.layout.SplitLayout(o),
o.layout.orientation = "v",
o.layout.position = 34,
o.layout.minSize = 10,
o.layout.splitterSize = 0,
o.layout.positionType = "absoluteLeft",
o.setItems([m, n]),
c.resetItems([d, n]),
b._layoutType = a
}
}
}
}),
vb.prototype.getRegionContainer = function(a) {
var b = this
, c = b["_container" + a];
return c || (c = new qc.widget.Container,
c.scrollBarMode = "off",
(a == vb.HIERARCHY || a == vb.INSPECTOR) && (c.layout.padding = [2, 0, 0, 0],
c.background = a == vb.HIERARCHY ? "rgb(66, 71, 73)" : "rgb(77, 82, 85)"),
b["_container" + a] = c),
c
}
,
vb.prototype.add = function(a, b, c) {
var d = this
, e = d["_container" + b];
if (c && !c.isChildOf(e)) {
c.id = a;
var f = e.children;
if (f && 0 !== f.length) {
var g = f[0];
if (g instanceof qc.widget.Tabs) {
var h = d._createTab(c);
g.tabModel.add(h),
g.select(h)
} else {
var i = new qc.widget.Tabs
, j = d._createTab(g)
, h = d._createTab(c);
i.tabModel.add(j),
i.tabModel.add(h),
i.select(h),
e.setItems(i)
}
} else if (null == c.title)
e.setItems(c);
else {
var i = new qc.widget.Tabs
, h = d._createTab(c);
i.tabModel.add(h),
i.select(h),
e.setItems(i)
}
}
}
,
vb.prototype.find = function(a) {
return this.findViewById(a)
}
,
vb.prototype.remove = function(a) {
var b = this;
if ("string" == typeof a && (a = b.find(a)),
a) {
for (var c, d = 1; 8 >= d; d++) {
var e = b["_container" + d];
if (a.isChildOf(e)) {
c = d;
break
}
}
c && b._removeImpl(a, c)
}
}
,
vb.prototype._removeImpl = function(a, b) {
var c = this
, d = c["_container" + b]
, e = d.children;
if (e && e.length > 0) {
var f = e[0];
if (f instanceof qc.widget.Tabs)
for (var g = f.tabModel._roots, h = 0; h < g.length; h++) {
var i = g[h];
if (i.element === a) {
f.remove(h),
0 === f.tabModel.length && d.setItems(null);
break
}
}
else
a === f && d.setItems(null)
}
}
,
vb.prototype._findComp = function(a, b) {
var c = a.children[0];
if (c instanceof b)
return c;
if (c instanceof qc.widget.Tabs)
for (var d = c.tabModel.datas, e = 0; e < d.length; e++) {
var f = d[e];
if (f.element instanceof b)
return f.element
}
}
,
vb.prototype.serialize = function() {
for (var a = this, b = [], c = 6; 9 >= c; c++) {
var d = a.getRegionContainer(c)
, e = {
regionId: c,
position: d.parent.layout.position
};
if (c === vb.PROJECT) {
var f = a._findComp(d, qc.editor.Project);
e.leftWidth = f.layout.leftWidth
} else if (c === vb.INSPECTOR) {
var g = a._findComp(d, qc.editor.Inspector);
e.bottomHeight = g.layout.bottomHeight
}
b.push(e)
}
return JSON.stringify(b)
}
,
vb.prototype.deserialize = function(a) {
var b = this;
k.isString(a) && (a = JSON.parse(a)),
a.forEach(function(a) {
var c = b.getRegionContainer(a.regionId);
if (c.parent.layout.position = a.position,
a.regionId === vb.PROJECT && null != a.leftWidth) {
var d = b._findComp(c, qc.editor.Project);
d.layout.leftWidth = a.leftWidth
} else if (a.regionId === vb.INSPECTOR && null != a.bottomHeight) {
var e = b._findComp(c, qc.editor.Inspector);
e.layout.bottomHeight = a.bottomHeight
}
})
}
,
vb.prototype._createTab = function(a) {
var b = new qc.widget.Tab;
return b.name = a.title,
b.icon = a.icon,
b.element = a,
b
}
,
vb.prototype._createMainContainer1 = function(a, b, c, d) {
var e = new qc.widget.Container;
e.layout = new qc.widget.layout.SplitLayout(e),
e.layout.position = 260,
e.layout.positionType = "absoluteRight",
e.setItems([a, b]);
var f = new qc.widget.Container;
f.layout = new qc.widget.layout.SplitLayout(f),
f.layout.orientation = "v",
f.layout.position = .65,
f.setItems([e, c]);
var g = new qc.widget.Container;
return g.layout = new qc.widget.layout.SplitLayout(g),
g.layout.position = 280,
g.layout.positionType = "absoluteRight",
g.setItems([f, d]),
g
}
,
vb.prototype._createMainContainer2 = function(a, b, c, d) {
var e = new qc.widget.Container;
e.layout = new qc.widget.layout.SplitLayout(e),
e.layout.position = .36,
e.setItems([b, c]);
var f = new qc.widget.Container;
f.layout = new qc.widget.layout.SplitLayout(f),
f.setItems([a, e]);
var g = new qc.widget.Container;
return g.layout = new qc.widget.layout.SplitLayout(g),
g.layout.position = 280,
g.layout.positionType = "absoluteRight",
g.setItems([f, d]),
g
}
,
vb.prototype._createMainContainer3 = function(a, b, c, d) {
var e = new qc.widget.Container;
e.layout = new qc.widget.layout.SplitLayout(e),
e.layout.position = 260,
e.layout.positionType = "absoluteLeft",
e.setItems([b, a]);
var f = new qc.widget.Container;
f.layout = new qc.widget.layout.SplitLayout(f),
f.layout.orientation = "v",
f.layout.position = .65,
f.setItems([e, c]);
var g = new qc.widget.Container;
return g.layout = new qc.widget.layout.SplitLayout(g),
g.layout.position = 280,
g.layout.positionType = "absoluteRight",
g.setItems([f, d]),
g
}
,
vb.prototype._createMainContainer4 = function(a, b, c, d) {
var e = new qc.widget.Container;
e.layout = new qc.widget.layout.SplitLayout(e),
e.layout.position = .36,
e.setItems([b, a]);
var f = new qc.widget.Container;
f.layout = new qc.widget.layout.SplitLayout(f),
f.setItems([c, e]);
var g = new qc.widget.Container;
return g.layout = new qc.widget.layout.SplitLayout(g),
g.layout.position = 280,
g.layout.positionType = "absoluteRight",
g.setItems([f, d]),
g
}
,
vb.prototype._createMainContainer5 = function(a, b, c, d) {
var e = new qc.widget.Container;
e.layout = new qc.widget.layout.SplitLayout(e),
e.layout.position = .64,
e.setItems([a, b]);
var f = new qc.widget.Container;
f.layout = new qc.widget.layout.SplitLayout(f),
f.setItems([c, e]);
var g = new qc.widget.Container;
return g.layout = new qc.widget.layout.SplitLayout(g),
g.layout.position = 280,
g.layout.positionType = "absoluteRight",
g.setItems([f, d]),
g
}
,
vb.prototype._createMainContainer6 = function(a, b, c, d) {
var e = new qc.widget.Container;
e.layout = new qc.widget.layout.SplitLayout(e),
e.layout.position = 260,
e.layout.positionType = "absoluteLeft",
e.setItems([b, a]);
var f = new qc.widget.Container;
f.layout = new qc.widget.layout.SplitLayout(f),
f.layout.orientation = "v",
f.layout.position = .65,
f.setItems([e, c]);
var g = new qc.widget.Container;
return g.layout = new qc.widget.layout.SplitLayout(g),
g.layout.position = 280,
g.layout.positionType = "absoluteLeft",
g.setItems([d, f]),
g
}
;
var wb = function(a, b, c) {
return a instanceof qc.Node ? a === a.game.world ? !1 : !b && a._bone ? !1 : !c && a instanceof qc.UIRoot ? !1 : !0 : !1
}
, xb = function(a) {
return !(!a || a instanceof qc.UIText || a instanceof qc.Sprite || a._bone)
}
, yb = function() {
var a = fa.hierarchy.activeNode;
return a && xb(a) ? a : fa.dataModel.getDataById(fa.prefabInfo.prefab.uuid).node
}
, zb = function(a) {
if (fa.prefabInfo)
return yb();
var b = fa.hierarchy.activeNode;
if (xb(b))
return b;
if (!a)
return fa.game.world;
if (b)
for (; b != fa.game.world && !(b instanceof qc.UIRoot); )
b = b.parent;
if (b instanceof qc.UIRoot)
return b;
for (var c = fa.dataModel.datas, d = 0; d < c.length; d++)
if (b = c[d].node,
b instanceof qc.UIRoot)
return b;
return new qc.UIRoot(fa.game)
}
, Ab = function() {
fa.playing ? fa.scene.reload() : qc.editor.Operation.SAVE_CURR_SCENE(function() {
fa.scene.reload()
})
}
, Bb = function() {
var a;
if (fa.prefabInfo)
a = fa.prefabInfo.treeData.name;
else {
var b = fa.config.editor.currScene;
a = b ? b.substr(Math.max(0, b.lastIndexOf("/")) + 1) : ""
}
a += "|" + fa.config.project.gameName + "|" + fa.projectPath,
document.title = a
}
, Cb = function() {
fa.workable && null != fa.config.project.backgroundColor && (fa.game.stage.backgroundColor = new qc.Color(fa.config.project.backgroundColor))
}
, Db = function() {
var a = fa.config.project.fixedGameSize;
fa.rightBanner.findViewById("gameSize").disabled = a.enabled && a.width > 0 && a.height > 0
}
, Eb = function(a, b, c, d, e) {
Hb(a, b, [{
text: fa._("OK"),
key: "enter",
onClick: function() {
this.hide(),
c && c()
}
}, {
text: fa._("Cancel"),
key: "esc",
onClick: function() {
this.hide(),
d && d()
}
}], e)
}
, Fb = function(a, b, c, d, e) {
var f = new qc.widget.Container;
f.layout.content = a,
f.layout.htmlFont = "13px Arial",
f.layout.htmlColor = "#caccd8";
var g = f.getPreferredSize(280)
, h = new qc.widget.TextField;
h.value = b,
h.preferredSize = {
width: 50,
height: 20
};
var i = new qc.editor.Dialog;
i.title = fa._("Prompt"),
i.width = 300,
i.height = 110 + g.height,
i.contentPadding = [10, 10, 10, 10],
i.modal = !0,
i._container.layout.bottomView.layout.padding = [0, 0, 0, 0];
var j = new qc.widget.Container;
if (j.layout = new qc.widget.layout.TableLayout(j),
j.layout.padding = 0,
j.layout.cellPadding = 0,
j.scrollbarMode = "off",
j.setItems([{
height: g.height,
widths: [.1],
cells: [{
fill: "fill",
element: f
}]
}, {
height: .1,
cells: [{
fill: "h",
vAlign: "middle",
element: h
}]
}]),
i.content = j,
i.tools = [],
i.buttons = [{
text: fa._("OK"),
onClick: function() {
i.hide(),
c && c(h.value)
}
}, {
text: fa._("Cancel"),
onClick: function() {
i.hide(),
d && d()
}
}],
h.input.addEventListener("keydown", function(a) {
G(a) ? (i.hide(),
c && c(h.value)) : F(a) && (i.hide(),
d && d())
}, !1),
e)
for (var k in e)
i[k] = e[k];
i.show(),
h.input.focus()
}
, Gb = function(a) {
var b = function() {
return this.hide(),
fa.playing ? void fa.notification.warn(fa._("Quit running mode first")) : fa.prefabInfo ? void fa.notification.warn(fa._("Stop editing prefab first")) : void (fa.config.editor.currScene && "Assets/scene/unsavedScene" != fa.config.editor.currScene ? (qc.editor.Operation.SAVE_SCENE(fa.config.editor.currScene),
a()) : Fb(fa._("Enter the new scene name"), "", function(b) {
if (b) {
var c = "Assets/scene/" + b;
fa.config.editor.currScene = c,
qc.editor.Operation.SAVE_SCENE(c),
qc.editor.Operation.UPDATE_EDITOR_SETTINGS(fa.config.editor);
var d = fa.config.scene.scene;
d.push(c),
qc.editor.Operation.UPDATE_SCENE_SETTINGS(d),
Bb(),
a()
} else
a()
}, function() {
a()
}))
};
fa.sceneManager.unsaved || fa.sceneManager.dirty ? Hb(fa._("Do you want to save the scene?"), fa._("Prompt"), [{
text: fa._("Save"),
key: "enter",
onClick: b
}, {
text: fa._("Don't Save"),
onClick: function() {
this.hide(),
a()
}
}, {
text: fa._("Cancel"),
key: "esc",
onClick: function() {
this.hide()
}
}]) : a()
}
, Hb = function(a, b, c, d) {
var e = new qc.editor.Dialog({
title: b,
content: a,
buttons: c,
modal: !0,
width: 300,
tools: [],
dialogContentPadding: [0, 0, 10, 0]
});
if (d)
for (var f in d)
e[f] = d[f];
e.show();
var g, h;
return c && c.forEach(function(a) {
"enter" === a.key ? g = a : "esc" === a.key && (h = a)
}),
e.view.addEventListener("keydown", function(a) {
G(a) && g ? g.onClick.call(e) : F(a) && h && h.onClick.call(e)
}, !1),
e.requestFocus(),
e
}
, Ib = function(a) {
var b = a.rect
, c = b.width || 1e-5
, d = b.height || 1e-5;
return [a.toGlobal({
x: b.x,
y: b.y
}), a.toGlobal({
x: b.x + c,
y: b.y
}), a.toGlobal({
x: b.x + c,
y: b.y + d
}), a.toGlobal({
x: b.x,
y: b.y + d
})]
}
, Jb = function(a, b) {
if (!wb(a))
return !1;
var c = a.rect
, d = Ib(a)
, e = d[0]
, f = d[1]
, g = d[2]
, h = d[3];
return v(b, e) || v(b, f) || v(b, g) || v(b, h) || w(e, f, b) || w(f, g, b) || w(g, h, b) || w(h, e, b) ? !0 : (e = a.toLocal({
x: b.x,
y: b.y
}),
f = a.toLocal({
x: b.x + b.width,
y: b.y
}),
g = a.toLocal({
x: b.x + b.width,
y: b.y + b.height
}),
h = a.toLocal({
x: b.x,
y: b.y + b.height
}),
v(c, e) || v(c, f) || v(c, g) || v(c, h) || w(e, f, c) || w(f, g, c) || w(g, h, c) || w(h, e, c) ? !0 : !1)
}
, Kb = function(a, b, c) {
var d = a.x
, e = a.y
, f = b.x
, g = b.y
, h = c.x
, i = c.y
, j = {}
, k = f - d
, l = g - e
, m = Math.sqrt(k * k + l * l)
, n = k / m
, o = l / m
, p = (-d + h) * n + (-e + i) * o;
return 0 >= p ? (j.x = d,
j.y = e) : p >= m ? (j.x = f,
j.y = g) : (j.x = d + p * n,
j.y = e + p * o),
k = h - j.x,
l = i - j.y,
j.z = Math.sqrt(k * k + l * l),
j
}
, Lb = function(a) {
var b, c = new Uint8Array(a);
try {
b = String.fromCharCode.apply(null, c)
} catch (d) {
b = "";
for (var e = 0; e < c.length; e++)
b += String.fromCharCode(c[e])
}
return b
}
, Mb = function(a) {
var b = a.lastIndexOf("/")
, c = a.lastIndexOf("\\");
return a.slice(Math.max(b, c) + 1)
}
, Nb = function(a) {
var b = a.lastIndexOf("/")
, c = a.lastIndexOf("\\");
return a.slice(0, Math.max(b, c))
}
, Ob = function(a) {
var b = a.lastIndexOf(".");
return a.slice(b).toLowerCase()
}
, Pb = function(a, b, c) {
var d = a.x
, e = a.y
, f = b.x
, g = b.y
, h = c.x
, i = c.y
, j = {}
, k = f - d
, l = g - e
, m = Math.sqrt(k * k + l * l)
, n = k / m
, o = l / m
, p = (-d + h) * n + (-e + i) * o;
return j.x = d + p * n,
j.y = e + p * o,
k = h - j.x,
l = i - j.y,
j.z = Math.sqrt(k * k + l * l),
j
}
, Qb = function(a, b, c) {
var d = {
x: a.x - b.x,
y: a.y - b.y
};
if (c) {
var e = Math.sqrt(d.x * d.x + d.y * d.y);
d.x /= e,
d.y /= e
}
return d
}
, Rb = function(a) {
return null == a ? a : parseFloat(a.toFixed(3))
}
, Sb = function(a, b, c) {
for (var d = a.length / 2, e = !1, f = -1, g = d - 1; ++f < d; g = f) {
var h = a[2 * f]
, i = a[2 * f + 1]
, j = a[2 * g]
, k = a[2 * g + 1];
(c >= i && k > c || c >= k && i > c) && (j - h) * (c - i) / (k - i) + h > b && (e = !e)
}
return e
}
, Tb = function(a) {
if (!a || !a.fileList || "__builtin_resource__" !== a.fileList[0])
for (var b in a) {
var c = a[b];
if (null != c) {
var d = fa.mainContainer.findViewById(b)
, e = k.isString(c) ? c : c[0]
, f = d.dataModel.getDataById(e);
if (!f)
return fa.notification.error(fa._("Resource not found")),
!1;
if ("fileTree" === b && (d.selectionModel.selection = f),
"fileList" === b && k.isArray(c) && f.followers) {
for (var g, h = f.followers, i = 0; i < h.length; i++) {
var j = h[i];
if (j.name == c[1]) {
g = j;
break
}
}
g && (f.expand = !0,
fa.fileList.validate(),
f = g)
}
"fileList" === b ? U(function() {
d.makeVisible(f),
d.blink(f)
}) : (d.makeVisible(f),
d.blink(f))
}
}
}
, Ub = function(a) {
a.strokeStyle = "rgba(0,0,0,0.15)",
a.lineWidth = 2,
a.stroke(),
a.strokeStyle = "white",
a.lineWidth = 1,
a.stroke()
}
, Vb = function(a) {
if (k.isMouseEvent(a) || !document.elementFromPoint)
return a.target;
var b = C(a);
return document.elementFromPoint(b.x, b.y)
}
, Wb = function(a, b) {
var c = k.getWindowInfo()
, d = c.width
, e = c.height;
if (a > d || b > e) {
var f = Math.min(d / a, e / b);
a *= f,
b *= f
}
return {
width: a,
height: b
}
}
, Xb = function(a, b, c) {
return b > a ? b : a > c ? c : a
}
, Yb = function(a) {
if (!a)
return !1;
var b = a.tagName;
return "INPUT" === b || "TEXTAREA" === b || "SELECT" === b
}
, Zb = function(a) {
var b = arguments;
return b.length <= 1 ? a : a.replace(/\{(\d+)\}/g, function(a, c) {
return b[parseInt(c) + 1]
})
}
, $b = function(b) {
var c = Zb(fa._("Exception notification"), b);
fa.notification ? fa.notification.error(c) : a.alert(c)
}
, _b = function(a) {
a = a.replace(/\\/g, "/");
for (var b = /\/\//; a.match(b); )
a = a.replace(b, "/");
return a
}
, ac = function(a, b) {
if (fa.actionEditorCache = fa.actionEditorCache || {},
fa.actionEditor) {
if (a) {
var c = fa.game.assets.find(a);
fa.actionEditor.onActionChanged(c)
}
} else {
var d = new qc.editor.Dialog
, e = fa.actionEditor = new qc.editor.animation.ActionEditor
, f = e.propertyTree;
f.resetDataModel(),
d.width = 1024,
d.height = 500,
d.contentPadding = [2, 4, 2, 4],
d.content = e,
d.title = fa._("Action Editor"),
d._closeNinePatchImage = "menu_active.9",
d._closeNinePatchBorder = [10, 10, 10, 10],
d.handleToolClick = function() {
Hb(fa._("actionCloseTip"), fa._("Prompt"), [{
text: fa._("OK"),
key: "enter",
onClick: function() {
this.hide(),
d.hide(),
fa.actionEditor.action && qc.editor.Operation.SAVE_ACTION(fa.actionEditor.action, fa.actionEditor.action.key),
e.destroy(),
fa.actionEditor = null
}
}, {
text: fa._("Cancel"),
key: "esc",
onClick: function() {
this.hide(),
d.hide(),
e.destroy(),
fa.actionEditor = null
}
}])
}
;
var g = qc.widget.Default.getWindowInfo()
, h = g.height - d.height - 50;
if (100 > h && (h = 100),
d.x = g.width / 2 - d.width / 2,
d.y = h,
d.show(),
a) {
var c = fa.game.assets.find(a);
e.onActionChanged(c, b)
}
}
}
, bc = function(a, b) {
fa.actionManagers = fa.actionManagers || [];
var c = new qc.editor.Dialog
, d = new qc.editor.animation.ActionManager;
fa.actionManagers.push(d),
c.width = 1024,
c.height = 500,
c.contentPadding = [2, 4, 2, 4],
c.content = d,
c.title = fa._("Action Manager"),
c._closeNinePatchImage = "menu_active.9",
c._closeNinePatchBorder = [10, 10, 10, 10],
c.handleToolClick = function() {
Hb(fa._("actionCloseTip"), fa._("Confirm"), [{
text: fa._("OK"),
key: "enter",
onClick: function() {
this.hide(),
c.hide(),
d.actionManager && qc.editor.Operation.SAVE_ACTION(d.actionManager, d.actionManager.key),
d.destroy()
}
}, {
text: fa._("Cancel"),
key: "esc",
onClick: function() {
this.hide(),
c.hide(),
d.destroy();
var a = fa.actionManagers.indexOf(d);
a >= 0 && fa.actionManagers.splice(a, 1)
}
}])
}
;
var e = qc.widget.Default.getWindowInfo()
, f = e.height - c.height - 50;
if (100 > f && (f = 100),
c.x = e.width / 2 - c.width / 2,
c.y = f,
c.show(),
a) {
var g = fa.game.assets.find(a);
d.onFileChanged(g, b)
}
}
, cc = function(a) {
return a ? ("qc.Texture" === a["class"] && (a = a.atlas),
a ? !a.json || 0 === b.keys(a.json).length : !0) : !0
}
, dc = function() {
fa.workable && (fa.game.dirtyRectangle.enable = !!fa.config.project.dirtyRectangles,
fa.game.dirtyRectangle.showDirtyRegion = !!fa.config.project.dirtyRectanglesShow)
}
, ec = function(a, b) {
for (var d = b.split("."), e = /(\w+)\[(\d+)\]/, f = a, g = b, h = a, i = 0; i < d.length; i++) {
var j;
if ((j = e.exec(d[i])) ? (f = h[j[1]],
g = parseInt(j[2])) : (f = h,
g = d[i]),
null == f)
return null;
if (h = f[g],
h === c)
return ""
}
return f[g]
}
, fc = function(a, b, d, e) {
for (var f = b.split("."), g = /(\w+)\[(\d+)\]/, h = a, i = b, j = a, k = 0; k < f.length; k++) {
if (j === c)
return;
var l;
(l = g.exec(f[k])) ? (h = j[l[1]],
i = parseInt(l[2])) : (h = j,
i = f[k]),
j = h[i],
e && j === c && (h[i] = {},
j = h[i])
}
h[i] = d
}
, gc = function(a) {
return a instanceof MouseEvent || 0 === a.type.indexOf("mouse")
}
, hc = function(a) {
if (!gc(a)) {
var b = a.touches[0];
if (b)
return b;
if (b = a.changedTouches,
b && b[0])
return b[0]
}
return a
}
, ic = m("qc.editor.GameModel", qc.widget.DataModel, function(a) {
var b = this;
b.game = a,
ic["super"].constructor.call(b),
b._addNode(a.world),
b.selectionModel.selectableFunc = function(b) {
return b.node !== a.world
}
,
a.world.onModelChange.add(this.handleWorldModelChange, b)
});
b.defineProperties(ic.prototype, {
lastEditableNode: {
get: function() {
for (var a = this.selectionModel.selection, b = a.length - 1; b >= 0; b--) {
var c = a[b].node;
if (wb(c))
return c
}
return null
}
}
}),
ic.prototype.handleWorldModelChange = function(a) {
var b = a.type
, c = a.target
, d = c.parent
, e = this.getDataById(c.uuid);
if (fa.game && !fa.game.serializer.isRestoring && (fa.sceneManager.dirty = !0),
fa.actionEditor && fa.actionEditor.propertyTree.redrawTree(),
e) {
if ("name" === b)
e.name = e.node.name;
else if ("destroy" === b)
c === this.game.world ? e.children.slice().forEach(this.remove, this) : this.remove(e);
else if ("removeChildren" === b)
e.children.slice().forEach(this.remove, this);
else if ("parent" === b)
if (d) {
var f = this.getDataById(d.uuid);
e.parent !== f && (e.parent = f),
this.moveTo(e, d.getChildIndex(c))
} else
this.remove(e)
} else
"parent" === b && this._addNode(c)
}
,
ic.prototype._createData = function(a) {
var b = new qc.widget.Data;
return b.node = a,
b.id = a.uuid,
b.cache = {},
b.name = a.name,
b
}
,
ic.prototype._addNode = function(a) {
if (a.phaser.stage) {
var b = this._createData(a)
, c = a.parent;
if (c instanceof qc.Node) {
var d = c.getChildIndex(a);
this.getDataById(c.uuid).addChild(b, d)
}
this.add(b),
a.children.forEach(this._addNode, this)
}
}
,
ic.prototype.getTopEditableSelection = function(a, b, c) {
var d = []
, e = this.selectionModel.selection;
if (a) {
e = e.slice();
for (var f = e.length - 1; f >= 0; f--)
a.isDescendantOf(e[f].node) && e.splice(f, 1)
}
var g = {};
return e.forEach(function(a) {
g[a.uuid] = !0
}),
e.forEach(function(a) {
if (wb(a.node, b, c)) {
for (var e = a.parent; e && wb(e.node, b, c); ) {
if (g[e.uuid]) {
a = null;
break
}
e = e.parent
}
a && d.push(a)
}
}, this),
d
}
,
ic.prototype.hasLockedSelection = function() {
for (var a = this.selectionModel.selection, b = 0; b < a.length; b++)
if (a[b].node.__lock)
return !0;
return !1
}
,
ic.prototype.moveSelection = function(a, b) {
this.getTopEditableSelection().forEach(function(c) {
var d = c.node
, e = d.getWorldPosition();
e.x += a,
e.y += b,
e = d.parent.toLocal(e),
d.x = e.x,
d.y = e.y,
fa.scene.emit("position", {
node: d,
x: d.x,
y: d.y
})
}),
fa.sceneManager.dirty = !0
}
,
ic.prototype.createRenameUndoFunc = function(a) {
var b = this
, c = a.name;
return function() {
b.getDataById(a.uuid) && (a.name = c)
}
}
,
ic.prototype.createMoveUndoFunc = function(a, b) {
var c = this;
if (b) {
var d = a.x
, e = a.y;
return function() {
c.getDataById(a.uuid) && (a.x = d,
a.y = e)
}
}
var f = c.getTopEditableSelection()
, g = []
, h = [];
return f.forEach(function(a) {
var b = a.node;
h.push(b),
g.push({
x: b.x,
y: b.y
})
}),
function() {
for (var a = 0; a < h.length; a++) {
var b = h[a];
c.getDataById(b.uuid) && (b.x = g[a].x,
b.y = g[a].y)
}
}
}
,
ic.prototype.createScaleUndoFunc = function(a, b) {
var c = this;
if (b) {
var d = a.scaleX
, e = a.scaleY;
return function() {
c.getDataById(a.uuid) && (a.scaleX = d,
a.scaleY = e)
}
}
var f = c.getTopEditableSelection(a)
, g = []
, h = [];
return f.forEach(function(a) {
var b = a.node;
h.push(b),
g.push({
scaleX: b.scaleX,
scaleY: b.scaleY
})
}),
function() {
for (var a = 0; a < h.length; a++) {
var b = h[a];
c.getDataById(b.uuid) && (b.scaleX = g[a].scaleX,
b.scaleY = g[a].scaleY)
}
}
}
,
ic.prototype.createRotationUndoFunc = function(a, b) {
var c = this;
if (b) {
var d = a.rotation;
return function() {
c.getDataById(a.uuid) && (a.rotation = d)
}
}
var e = []
, f = []
, g = c.getTopEditableSelection(a);
return g.forEach(function(a) {
var b = a.node;
f.push(b),
e.push(b.rotation)
}),
function() {
for (var a = 0; a < f.length; a++) {
var b = f[a];
c.getDataById(b.uuid) && (b.rotation = e[a])
}
}
}
,
ic.prototype.createPivotUndoFunc = function(a) {
var b = this
, c = {
pivotX: a.pivotX,
pivotY: a.pivotY,
x: a.x,
y: a.y
};
return function() {
b.getDataById(a.uuid) && (a.pivotX = c.pivotX,
a.pivotY = c.pivotY,
a.x = c.x,
a.y = c.y)
}
}
,
ic.prototype.createResizeUndoFunc = function(a) {
var b = this
, c = {
x: a.x,
y: a.y,
width: a.width,
height: a.height
};
return function() {
b.getDataById(a.uuid) && (a.x = c.x,
a.y = c.y,
a.width = c.width,
a.height = c.height)
}
}
,
ic.prototype.createAnchorUndoFunc = function(a) {
var b = this
, c = {
minX: a.minAnchor.x,
minY: a.minAnchor.y,
maxX: a.maxAnchor.x,
maxY: a.maxAnchor.y,
pivotX: a.pivotX,
pivotY: a.pivotY,
anchoredX: a.anchoredX,
anchoredY: a.anchoredY,
left: a.left,
right: a.right,
top: a.top,
bottom: a.bottom,
width: a.width,
height: a.height
};
return function() {
b.getDataById(a.uuid) && (a._minAnchor = new qc.Point(c.minX,c.minY),
a._maxAnchor = new qc.Point(c.maxX,c.maxY),
a.phaser.anchor = new qc.Point(c.pivotX,c.pivotY),
a._anchoredX = c.anchoredX,
a._anchoredY = c.anchoredY,
a._minAnchor.x < a._maxAnchor.x ? (a._left = c.left,
a._right = c.right) : a.setWidth(c.width),
a._minAnchor.y < a._maxAnchor.y ? (a._top = c.top,
a._bottom = c.bottom) : a.setHeight(c.height),
a.relayout())
}
}
,
ic.prototype.createParentUndoFunc = function(a) {
var b = this
, c = b.createParentInfo(a);
return function() {
b.restoreParentInfo(c)
}
}
,
ic.prototype.createParentInfo = function(a) {
return {
node: a,
x: a.x,
y: a.y,
rotation: a.rotation,
scaleX: a.scaleX,
scaleY: a.scaleY,
parent: a.parent,
index: a.parent.getChildIndex(a)
}
}
,
ic.prototype.restoreParentInfo = function(a) {
var b = a.node
, c = a.parent
, d = a.index;
this.getDataById(b.uuid) && this.getDataById(c.uuid) && (b.switchParent(c),
d >= 0 && d <= c.children.length && c.setChildIndex(b, d),
b.x = a.x,
b.y = a.y,
b.rotation = a.rotation,
b.scaleX = a.scaleX,
b.scaleY = a.scaleY,
b._calcAnchoredX(),
b._calcAnchoredY(),
b._calcMargin())
}
,
ic.prototype.deleteDatasForUndo = function(a) {
if (a && 0 !== a.length) {
fa.sceneManager.dirty = !0,
fa.undo.clearRedo();
var b = this
, c = []
, d = []
, e = []
, f = a.length
, g = [];
a.forEach(function(a) {
var b = a.node;
c.push(b),
d.push(b.parent),
e.push(b.parent.getChildIndex(b)),
g.push(b.visible),
b.visible && (b.visible = !1),
b.parent = null
});
var h = function() {
for (var a = f - 1; a >= 0; a--) {
var h = c[a]
, i = d[a]
, j = e[a];
b.getDataById(i.uuid) && (h._destroy || (j > i.children.length ? (console.log(h.name + "原先位置:" + j + ",当前插入到:" + i.children.length),
i.addChild(h)) : i.addChildAt(h, j),
h.visible = g[a]))
}
}
, i = function() {
for (var a = 0; f > a; a++) {
var b = c[a];
b._destroy || (b.visible = !1,
b.parent = null)
}
}
, j = function() {
for (var a = f - 1; a >= 0; a--) {
var b = c[a];
b.parent || b._destroy || (console.log("销毁节点:" + b.name),
b.destroyImmediately())
}
};
fa.undo.add(h, i, j)
}
}
,
ic.prototype.addNodeForUndo = function(a) {
this.addDatasForUndo([this.getDataById(a.uuid)])
}
,
ic.prototype.addDatasForUndo = function(a) {
if (a && 0 !== a.length) {
fa.sceneManager.dirty = !0;
var b = this
, c = []
, d = []
, e = []
, f = a.length;
a.forEach(function(a) {
var b = a.node;
c.push(b),
d.push(b.parent),
e.push(b.parent.getChildIndex(b))
});
var g = function() {
for (var a = f - 1; a >= 0; a--) {
var b = c[a];
b._destroy || (b.parent = null)
}
}
, h = function() {
for (var a = 0; f > a; a++) {
var g = c[a]
, h = d[a]
, i = e[a];
b.getDataById(h.uuid) && (g._destroy || (i > h.children.length ? (console.log(g.name + "原先位置:" + i + ",当前插入到:" + h.children.length),
h.addChild(g)) : h.addChildAt(g, i)))
}
}
, i = function() {
for (var a = f - 1; a >= 0; a--) {
var b = c[a];
b.parent || b._destroy || (console.log("销毁节点:" + b.name),
b.destroyImmediately())
}
};
fa.undo.add(g, h, i)
}
}
;
var jc = qc.editor.GameDebugger = function(a) {
var b = this;
b.game = a,
b.dataModel = new qc.widget.DataModel,
b._colorIndex = 0;
var d = b.tickData = {};
d.lastStart = 0,
d.start = 0,
d.ms = 0;
var e = a.phaser
, f = e.update;
e.update = function() {
if (fa.scene.debugEnabled) {
var a = X()
, g = d.start
, h = a - g
, i = Math.round(1e3 / h)
, j = f.apply(this, arguments);
if (!j)
return;
b.dataModel.forEach(function(a) {
a.hasValue && (a.newValue ? (a.a("value", a.newValue),
a.a("label", a.newValue.toFixed(1))) : (a.a("value", 0),
a.a("label", "0.0")),
a.newValue = 0)
}),
d.lastStart = g,
d.start = a,
d.fps = i,
d.interval = h;
var k = e.renderer.renderSession.drawCount
, l = X() - a;
d.ms = l,
d.lastUpdate ? a - d.lastUpdate >= 1e3 ? (d.averageFps = (d.sumFps / d.count).toFixed(1),
d.averageMs = (d.sumMs / d.count).toFixed(1),
d.sumFps = i,
d.sumMs = l,
d.count = 1,
d.lastUpdate = a) : (d.sumFps += i,
d.sumMs += l,
d.count++) : (d.averageFps = i.toFixed(1),
d.averageMs = l.toFixed(1),
d.sumFps = i,
d.sumMs = l,
d.count = 1,
d.lastUpdate = a),
b.debugDiv.innerHTML = "fps:" + d.averageFps + "<br>ms:" + d.averageMs + "<br>dc:" + (k === c ? "(N/A)" : k) + "<br>n:" + fa.dataModel.length,
b._debugDialog && b._debugDialog.visible && b.statistics.updateFrame(d)
} else
f.apply(this, arguments)
}
,
b._createData("preUpdate"),
b._wrap("physics", "preUpdate"),
b._wrap("state", "preUpdate"),
b._wrap("plugins", "preUpdate"),
b._wrap("stage", "preUpdate"),
b._createData("update"),
b._wrap("state", "update"),
b._wrap("stage", "update"),
b._wrap("tweens", "update"),
b._wrap("sound", "update"),
b._wrap("input", "update"),
b._wrap("physics", "update"),
b._wrap("plugins", "update"),
b._createData("postUpdate"),
b._wrap("stage", "postUpdate"),
b._wrap("plugins", "postUpdate"),
b._createData("preRender"),
b._wrap("state", "preRender"),
b._createData("render"),
b._wrap("renderer", "render"),
b._wrap("plugins", "render"),
b._wrap("state", "render"),
b._createData("postRender"),
b._wrap("plugins", "postRender")
}
;
jc.prototype._colors = ["#058DC7", "#50B432", "#ED561B", "#DDDF00", "#24CBE5", "#64E572", "#FF9655", "#FFF263", "#6AF9C4", "#2b908f", "#90ee7e", "#f45b5b", "#7798BF", "#aaeeee", "#ff0066", "#eeaaee", "#55BF3B", "#DF5353", "#7798BF", "#aaeeee"],
jc.prototype._createData = function(a, b) {
var c = new qc.widget.Data;
return c.name = a,
c.id = b || a,
this.dataModel.add(c),
c
}
,
jc.prototype._wrap = function(a, b) {
var c = this
, d = c._createData(a, a + "." + b);
d.parent = c.dataModel.getDataById(b),
d.a("value", 0),
d.a("label", "0.0"),
d.hasValue = !0,
d.color = this._colors[this._colorIndex++],
d.icon = "rect-color";
var e = c.game.phaser[a]
, f = e[b];
e[b] = function() {
if (c._debugDialog && c._debugDialog.visible) {
var a = X();
f.apply(e, arguments),
d.newValue = X() - a
} else
f.apply(e, arguments)
}
}
,
jc.prototype.destroy = function() {
this._debugDiv && r(this._debugDiv),
this._debugDialog && this._debugDialog.hide()
}
,
b.defineProperties(jc.prototype, {
debugDiv: {
get: function() {
var a = this;
if (!a._debugDiv) {
var b = a._debugDiv = fa.scene.createDiv()
, c = b.style;
c.top = "10px",
c.right = "10px",
c.width = "50px",
c.cursor = "pointer",
b.onclick = function() {
a.debugDialog.visible ? a.debugDialog.hide() : a.debugDialog.show()
}
}
return a._debugDiv
}
},
debugDialog: {
get: function() {
if (!this._debugDialog) {
var a = this.tree = new qc.widget.Tree(this.dataModel);
a.getLabel = function(a) {
return a.hasValue ? a.a("label") + " - " + a.name : a.name
}
,
a.expandAll();
var b = this.statistics = new kc(this.dataModel)
, c = new qc.widget.Container;
c.layout = new qc.widget.layout.SplitLayout(c),
c.layout.orientation = "v",
c.layout.position = .7,
c.setItems([a, b]);
var d = this._debugDialog = new qc.editor.Dialog;
d.title = "Performance Statistics",
d.width = 260,
d.height = 300,
d.content = c,
d.contentPadding = [2, 4, 2, 4]
}
return this._debugDialog
}
}
}),
k.setImage("rect-color", {
width: 10,
height: 10,
comps: [{
type: "rect",
rect: [0, 0, 10, 10],
background: {
func: function(a) {
return a.color
}
}
}]
});
var kc = m(null, b, function(a) {
this.dataModel = a,
this.initView(!1, !0),
this._bufferCanvas = q(),
this._div30 = this._createDiv("&nbsp;33ms (30fps)"),
this._div60 = this._createDiv("&nbsp;16ms (60fps)"),
this.iv()
}, {}, {
properties: ["maxValue", "frameWidth"],
view: !0,
emitter: !0
});
kc.prototype._maxValue = 50,
kc.prototype._frameWidth = 1,
kc.prototype._lastWidth = -1,
kc.prototype._lastHeight = -1,
kc.prototype._lastMaxValue = -1,
kc.prototype._lastFrameWidth = -1,
kc.prototype.onPropertyChange = function() {
this.iv()
}
,
kc.prototype._createDiv = function(a) {
var b = p(!1, this.view)
, c = b.style;
return c.position = "absolute",
c.color = "rgba(200, 200, 200, 0.6)",
c.background = "rgba(200, 200, 200, 0.7)",
c.font = k.labelFont,
c.left = "0px",
c.height = "1px",
c.cursor = "default",
b.innerHTML = a,
b
}
,
kc.prototype.validateImpl = function() {
var a = this.clientWidth
, b = this.clientHeight;
if (a !== this._lastWidth || b !== this._lastHeight || this.maxValue !== this._lastMaxValue || this.frameWidth !== this._lastFrameWidth) {
this._lastWidth = a,
this._lastHeight = b,
this._lastMaxValue = this.maxValue,
this._lastFrameWidth = this.frameWidth,
this._unit = b / this.maxValue,
t(this._canvas, a, b),
t(this._bufferCanvas, a - this.frameWidth, b),
s(this._canvas, 0, 0, 1, {
x: 0,
y: 0,
width: a,
height: b
}).restore();
var c = Math.round(33 * this._unit)
, d = Math.round(16 * this._unit)
, e = this._div30.style;
e.top = b - c + "px",
e.width = a + "px",
e = this._div60.style,
e.top = b - d + "px",
e.width = a + "px"
}
}
,
kc.prototype.updateFrame = function(a) {
var b = this
, c = b._lastWidth
, d = b._lastHeight
, e = b.frameWidth
, f = c - e
, g = b._canvas
, h = b._bufferCanvas;
s(h, 0, 0, 1, {
x: 0,
y: 0,
width: f,
height: d
}).restore();
var i = s(h, 0, 0, 1);
i.drawImage(g, e, 0, f, d, 0, 0, f, d),
i.restore(),
i = s(g, 0, 0, 1, {
x: 0,
y: 0,
width: c,
height: d
}),
i.drawImage(h, 0, 0);
var j = d;
b.dataModel.forEach(function(a) {
var c = a.color;
if (c) {
var d = a.a("value");
if (d > 0) {
var g = b._unit * d;
i.beginPath(),
i.fillStyle = c,
i.fillRect(f, j - g, e, g),
j -= g
}
}
}),
i.beginPath(),
i.fillStyle = "rgb(0,255,0)",
i.fillRect(f, d - b._unit * a.interval, e, 1),
i.restore()
}
;
var lc = qc.editor.Undo = function() {
this.reset()
}
;
lc.prototype = {},
lc.prototype.constructor = lc,
lc.prototype._limit = 30,
lc.prototype._checkLimit = function() {
for (; this.length > 0 && this.length > this.limit; ) {
var a = this._events.splice(0, 1)[0];
a.destroy && a.destroy(),
this._position >= 0 && this._position--
}
}
,
lc.prototype.reset = function() {
if (this._events)
for (var a = 0; a < this._events.length; a++) {
var b = this._events[a];
b.destroy && b.destroy()
}
this._events = [],
this._position = -1
}
,
lc.prototype.canUndo = function() {
return this._position >= 0
}
,
lc.prototype.canRedo = function() {
return this._position < this.length - 1
}
,
lc.prototype.undo = function() {
if (fa.activeDialog)
return void fa.activeDialog.handleUndo();
if (this.canUndo()) {
var a = this._events[this._position--];
this._isUndoRedoing = !0,
a.undo(),
this._isUndoRedoing = !1
}
}
,
lc.prototype.redo = function() {
if (fa.activeDialog)
return void fa.activeDialog.handleRedo();
if (this.canRedo()) {
var a = this._events[++this._position];
this._isUndoRedoing = !0,
a.redo(),
this._isUndoRedoing = !1
}
}
,
lc.prototype.clearRedo = function() {
for (; this.canRedo(); ) {
var a = this._events.splice(this.length - 1, 1)[0];
a.destroy && a.destroy()
}
this._position = this.length - 1
}
,
lc.prototype.add = function(a, b, c) {
this._isUndoRedoing || (this.clearRedo(),
this._events.push({
undo: a,
redo: b,
destroy: c
}),
this._position = this.length - 1,
this._checkLimit())
}
,
b.defineProperties(lc.prototype, {
position: {
get: function() {
return this._position
}
},
length: {
get: function() {
return this._events.length
}
},
limit: {
get: function() {
return this._limit
},
set: function(a) {
this._limit = a,
this._checkLimit()
}
}
});
var mc = qc.editor.Extend = function() {
this._menus = {},
this._inspectors = {}
}
;
mc.prototype = {},
mc.prototype.constructor = mc,
mc.prototype.menu = function(a, b) {
this._menus[a] = b
}
,
mc.prototype.deleteMenu = function(a) {
delete this._menus[a],
fa.menu.deleteItem(a)
}
,
mc.prototype.inspector = function(a, b) {
this._inspectors[a] = b
}
,
mc.prototype.findInspector = function(a) {
return this._inspectors[a]
}
,
mc.prototype.findActionInspector = function(a, b, c) {
var d = a + b + c
, e = this._inspectors[d];
return e || (d = a + b,
e = this._inspectors[d],
e || (d = a,
e = this._inspectors[d])),
e
}
,
mc.prototype.init = function() {
for (var a in this._menus)
fa.menu.addItem(a, this._menus[a])
}
,
fa.extend = new qc.editor.Extend;
var nc = qc.editor.TexturePacker = function() {
this.canvas = document.createElement("canvas")
}
;
nc.prototype = {},
nc.prototype.constructor = nc,
nc.prototype.pack = function(a, b, c, d) {
var e, f, g = this, h = b.length, i = new Array(h);
if (!/^\w*$/.test(a))
return fa.log.trace("atlas name 不合法,期望字母跟数字组成。"),
!1;
for (g.option = c || {},
g.option.border = g.option.border || 1,
g.option.maxSize = g.option.maxSize || 16777215,
g.option.pot && (g.option.maxSize = this.nextPowerOfTwo(g.option.maxSize + 1) / 2),
f = 0; h > f; f++) {
if (e = b[f],
!e || !e.img || !e.img.complete)
return fa.log.trace("frame {0} 无效,无法进行打包", b[f]),
!1;
i[f] = {
w: e.img.width + g.option.border + 2,
h: e.img.height + g.option.border + 2,
frame: e
}
}
for (i.sort(g.sortBySize),
g.fit(i),
f = 0; h > f; f++)
if (e = i[f],
!e.fit)
return fa.log.trace("frame {0} 无法被塞入,打包失败", e.frame.url),
fa.notification.error(fa.log.toContent([fa._("texturePackerSizeExceed"), a])),
!1;
g.snapAndSave(a, i, d)
}
,
nc.prototype.packAll = function(a) {
var d = this
, e = {}
, f = 0
, g = 0;
a || (a = fa.fileTree.dataModel._roots[0]),
fa.project.exploreTree(function(a) {
if (!(a.id.indexOf("@atlas") < 0) && a.assetType === fa.ASSET_TYPE.ASSET_ATLAS) {
var b = a.id;
e[b] = {
url: b
}
}
}, a);
var h = function() {
var a, f, g, h = {};
fa.notification.info(fa._("Images downloaded, Start to pack atlas."));
for (var i in e)
g = e[i],
a = i.match(/([^\\\/]*)@atlas/),
!a || a.length < 2 || (f = a[1],
h[f] || (h[f] = []),
h[f].push(g));
for (var i in e)
fa.hiddenGame.assets.unload("tp@" + i, i);
var j = b.keys(h)
, k = 0
, l = fa.preference.query("texturePackerPOT")
, m = fa.preference.query("texturePackerBorder")
, n = fa.preference.query("texturePackerMaxSize");
l = l == c ? !0 : !!l,
m = m == c ? 1 : m,
n = n == c ? 2048 : n;
var o = function() {
var a = j[k];
d.pack(a, h[a], {
pot: l,
border: m,
maxSize: n
}, function() {
return k++,
k >= j.length ? void fa.notification.info(fa._("All atlases has been packed.")) : void o()
})
};
o()
};
g = b.keys(e).length;
for (var i in e)
!function(a) {
fa.hiddenGame.assets.load("tp@" + a, a, function(b) {
e[a] = b,
++f >= g && h()
}, !0)
}(i);
fa.notification.info(fa._("Start to download images, count: ") + g)
}
,
nc.prototype.snapAndSave = function(a, b, c) {
var d = this
, e = d.canvas
, f = d.option.border
, g = d.root.w - f
, h = d.root.h - f;
d.option.pot && (g = d.nextPowerOfTwo(g),
h = d.nextPowerOfTwo(h)),
e.setAttribute("width", g),
e.setAttribute("height", h);
var i, j, k, l, m = e.getContext("2d"), n = {
frames: {},
meta: {
app: "QCEngine",
version: "1.0",
image: a,
format: "RGBA8888",
size: {
w: g,
h: h
},
scale: "1"
}
}, o = b.length, p = n.frames;
for (i = 0; o > i; i++)
j = b[i],
k = j.w - f - 2,
l = j.h - f - 2,
m.drawImage(j.frame.img, 0, 0, k, 1, j.fit.x + 1, j.fit.y, k, 1),
m.drawImage(j.frame.img, 0, l - 1, k, 1, j.fit.x + 1, j.fit.y + l + 1, k, 1),
m.drawImage(j.frame.img, 0, 0, 1, l, j.fit.x, j.fit.y + 1, 1, l),
m.drawImage(j.frame.img, k - 1, 0, 1, l, j.fit.x + k + 1, j.fit.y + 1, 1, l),
m.drawImage(j.frame.img, j.fit.x + 1, j.fit.y + 1, k, l),
p[Mb(fa.project.getImageURLByAtlas(j.frame))] = {
frame: {
x: j.fit.x + 1,
y: j.fit.y + 1,
w: k,
h: l
},
rotated: !1,
trimmed: !1,
spriteSourceSize: {
x: 0,
y: 0,
w: k,
h: l
},
sourceSize: {
w: k,
h: l
}
};
var q = e.toDataURL();
qc.editor.Operation.SAVE_ATLAS(a, q, n, c),
m.clearRect(0, 0, g, h),
e.setAttribute("width", 1),
e.setAttribute("height", 1)
}
,
nc.prototype.sortBySize = function(a, b) {
var c, d = Math.max(a.w, a.h), e = Math.max(b.w, b.h);
if (c = e - d)
return c;
var f = Math.min(a.w, a.h)
, g = Math.min(b.w, b.h);
return (c = g - f) ? c : (c = b.h - a.h,
c ? c : b.w - a.w)
}
,
nc.prototype.fit = function(a) {
var b, c, d = a.length, e = d > 0 ? a[0].w : 0, f = d > 0 ? a[0].h : 0;
this.root = {
x: 0,
y: 0,
w: e,
h: f
};
for (var g = 0; d > g; g++)
c = a[g],
c.fit = (b = this.findNode(this.root, c.w, c.h)) ? this.spliteNode(b, c.w, c.h) : this.growNode(c.w, c.h)
}
,
nc.prototype.findNode = function(a, b, c) {
if (!a.used)
return b <= a.w && c <= a.h ? a : null;
var d = a.right
, e = a.down
, f = this.findNode(d, b, c) || this.findNode(e, b, c);
if (f)
return f;
if (!d.used && !e.used && d.x + d.w === e.x + e.w && d.y + d.h === e.y) {
var g = d.h
, h = e.w;
if (d.h = d.h + e.h,
e.w = e.w - d.w,
f = this.findNode(d, b, c) || this.findNode(e, b, c))
return f;
d.h = g,
e.w = h
}
}
,
nc.prototype.spliteNode = function(a, b, c) {
return a.used = !0,
a.down = {
x: a.x,
y: a.y + c,
w: a.w,
h: a.h - c
},
a.right = {
x: a.x + b,
y: a.y,
w: a.w - b,
h: c
},
a
}
,
nc.prototype.nextPowerOfTwo = function(a) {
return a--,
a |= a >> 1,
a |= a >> 2,
a |= a >> 4,
a |= a >> 8,
a |= a >> 16,
a++,
a
}
,
nc.prototype.growNode = function(a, b) {
var c, d, e = this, f = e.root.h, g = e.root.w, h = e.option.maxSize, i = f >= b && h >= a + g, j = g >= a && h >= b + f;
if (e.option.pot) {
var k = e.option.border
, l = e.nextPowerOfTwo(g) + k
, m = e.nextPowerOfTwo(f) + k
, n = g + a
, o = f + b;
c = i && (l === m && (f >= n || o > m && l >= n) || l > m && l >= n && l - g >= m - f || m > l && (o > m || l - g >= m - f)),
d = j && (l === m && (g >= o || n > l && m >= o) || l > m && (n > l || m - f >= l - g) || m > l && m >= o && m - f >= l - g)
} else
c = i && f >= g + a,
d = j && g >= f + b;
return c ? e.growRight(a, b) : d ? e.growDown(a, b) : i ? e.growRight(a, b) : j ? e.growDown(a, b) : void 0
}
,
nc.prototype.growRight = function(a, b) {
var c = this;
c.root = {
used: !0,
x: 0,
y: 0,
w: c.root.w + a,
h: c.root.h,
down: c.root,
right: {
x: c.root.w,
y: 0,
w: a,
h: c.root.h
}
};
var d;
return (d = c.findNode(c.root, a, b)) ? c.spliteNode(d, a, b) : null
}
,
nc.prototype.growDown = function(a, b) {
var c = this;
c.root = {
used: !0,
x: 0,
y: 0,
w: c.root.w,
h: c.root.h + b,
down: {
x: 0,
y: c.root.h,
w: c.root.w,
h: b
},
right: c.root
};
var d;
return (d = c.findNode(c.root, a, b)) ? c.spliteNode(d, a, b) : null
}
,
nc.prototype.decomposeAtlas = function(a, b) {
var c, d, e, f;
if ("qc.Atlas" === a["class"])
c = a;
else {
var g = fa.project.findByName(a);
if (!g || !g.length)
return void fa.game.log.trace("cannot find atlas.");
for (d = 0,
e = g.length; e > d && (c = g[d],
"qc.Atlas" !== c["class"]); d++)
;
if ("qc.Atlas" !== c["class"])
return void fa.game.log.trace("cannot find atlas.")
}
var h, i, j, k, l, m, n, o, p = c.url, q = this.canvas, r = c.frames;
for (b || (b = p.endsWith(".bin") ? p.slice(0, -4) + "@atlas" : p + "@atlas"),
e = r.length,
f = 0,
d = 0; e > d; d++)
h = r[d],
i = h.x,
j = h.y,
k = h.width,
l = h.height,
q.setAttribute("width", k),
q.setAttribute("height", l),
m = q.getContext("2d"),
m.clearRect(0, 0, k, l),
m.drawImage(c.img, i, j, k, l, 0, 0, k, l),
n = q.toDataURL(),
o = b + "/" + h.name,
function(a) {
qc.editor.Operation.SAVE_IMAGE(a, n, function() {
fa.log.trace("image {0} has been saved.", a),
f++,
e > f || fa.notification.info(fa.log.toContent([fa._("decomposeAtlasFinish"), b]))
})
}(o)
}
;
var oc = m(null, b, function(a) {
var b = this;
b.initView(),
b._view.style.background = "rgb(48, 48, 52)",
b._scene = a,
b._interactionDiv.appendChild(a.view),
this._hRuler = q(),
this._vRuler = q(),
b.iv(),
fa.e.on(fa.e.GRID_VISIBLE_CHANGE, function() {
b.checkEnabled()
}),
fa.e.on(fa.e.PLAYING_CHANGE, function() {
b.checkEnabled()
}),
a.on("propertyChange", function() {
b.iv()
})
}, {}, {
properties: ["enabled", "color", "guideColor", "guideBackground", "rulerSize", "borderColor"],
view: !0,
emitter: !0
});
oc.prototype._enabled = !1,
oc.prototype._lastEnabled = -1,
oc.prototype._lastWidth = -1,
oc.prototype._lastHeight = -1,
oc.prototype._lastRulerSize = -1,
oc.prototype._color = "#caccd8",
oc.prototype._guideColor = "#3ae3ff",
oc.prototype._guideBackground = "#292a3a",
oc.prototype._borderColor = "#656567",
oc.prototype._rulerSize = 22,
oc.prototype.onPropertyChange = function() {
this.iv()
}
,
oc.prototype.checkEnabled = function() {
this.enabled = !fa.playing && fa.gridVisible ? !0 : !1
}
,
oc.prototype.validateImpl = function() {
var a = this._rulerSize
, b = this.clientWidth
, c = this.clientHeight
, d = this.enabled;
if (b !== this._lastWidth || c !== this._lastHeight || a !== this._lastRulerSize || d !== this._lastEnabled)
if (this._lastWidth = b,
this._lastHeight = c,
this._lastRulerSize = a,
this._lastEnabled = d,
d) {
this._hRuler.parentNode || (this._interactionDiv.appendChild(this._hRuler),
this._interactionDiv.appendChild(this._vRuler));
var e = Math.max(0, b - a)
, f = Math.max(0, c - a);
n(this._hRuler, a, 0, e, a),
n(this._vRuler, 0, a, a, f),
n(this._scene, a, a, e, f),
t(this._hRuler, e, a),
t(this._vRuler, a, f)
} else
this._hRuler.parentNode && (r(this._hRuler),
r(this._vRuler)),
n(this._scene, 0, 0, b, c);
this.drawRuler()
}
,
oc.prototype.drawRuler = function() {
if (fa.workable && this.enabled) {
var a, b, c, d, e, f, g = this._rulerSize, h = this._scene, i = h.zoom, j = Math.log(i) / Math.log(10), k = Math.floor(j), l = 100, m = 10, n = l / Math.pow(10, k) * i, o = n / m, p = k > 1 ? 40 + 10 * (k - 1) : 40, q = Math.round(h.translateX), r = Math.round(h.translateY), t = {
x: -q,
y: -r,
width: h.view.clientWidth,
height: h.view.clientHeight
}, u = Math.floor(t.x / n), v = Math.ceil((t.x + t.width) / n), w = Math.floor(t.y / n), x = Math.ceil((t.y + t.height) / n);
for (s(this._hRuler, 0, 0, 1, {
x: 0,
y: 0,
width: t.width,
height: g
}).restore(),
d = s(this._hRuler, q, 0, 1),
d.lineWidth = 1,
d.strokeStyle = this.color,
d.beginPath(),
a = u; v >= a; a++)
e = a * n,
f = k > 1 ? (e / i).toFixed(k - 1) : Math.round(e / i),
e = Math.round(e),
d.moveTo(e, g),
d.lineTo(e, 0),
S(d, f, null, this.color, e, 0, 1, g, "left");
for (d.stroke(),
d.beginPath(),
a = u; v >= a; a++)
for (c = 1; m > c; c++)
e = a * n + c * o,
f = k > 1 ? (e / i).toFixed(k - 1) : Math.round(e / i),
e = Math.round(e),
d.moveTo(e, g),
5 === c ? (d.lineTo(e, g - 11),
S(d, f, null, this.color, e, 0, 1, g, "left")) : (d.lineTo(e, g - 5),
o > p && S(d, f, null, this.color, e, 0, 1, g, "left"));
for (d.stroke(),
d.restore(),
s(this._vRuler, 0, 0, 1, {
x: 0,
y: 0,
width: g,
height: t.height
}).restore(),
d = s(this._vRuler, 0, r, 1),
d.lineWidth = 1,
d.strokeStyle = this.color,
d.beginPath(),
b = w; x >= b; b++)
e = b * n,
f = k > 1 ? (e / i).toFixed(k - 1) : Math.round(e / i),
e = Math.round(e),
d.moveTo(g, e),
d.lineTo(0, e),
this.drawVerticalText(d, f, e);
for (d.stroke(),
d.beginPath(),
b = w; x >= b; b++)
for (c = 1; m > c; c++)
e = b * n + c * o,
f = k > 1 ? (e / i).toFixed(k - 1) : Math.round(e / i),
e = Math.round(e),
d.moveTo(g, e),
5 === c ? (d.lineTo(g - 11, e),
this.drawVerticalText(d, f, e)) : (d.lineTo(g - 5, e),
o > p && this.drawVerticalText(d, f, e));
d.stroke(),
d.restore()
}
}
,
oc.prototype.drawVerticalText = function(a, b, c) {
a.save(),
a.translate(11, c + 11),
a.rotate(-Math.PI / 2),
S(a, b, null, this.color, 11, -11, 0, this.rulerSize, "right"),
a.restore()
}
;
var pc = m("qc.editor.Notification", null, function() {
this._showings = []
});
pc.prototype.easing = function(a) {
return (a -= 1) * a * (2.70158 * a + 1.70158) + 1
}
,
pc.prototype.info = function() {
this.show(fa.log.toContent(arguments), "#78C5E7", "white", 4e3)
}
,
pc.prototype.warn = function() {
this.show(fa.log.toContent(arguments), "#FFEDA4", "rgb(130, 98, 0)", 5e3)
}
,
pc.prototype.error = function() {
this.show(fa.log.toContent(arguments), "#FF8181", "white", 6e3)
}
,
pc.prototype.show = function(a, b, c, d) {
var e = this
, f = e._showings[e._showings.length - 1]
, g = p()
, h = g.style;
h.font = k.labelFont,
h.padding = "6px",
h.borderRadius = "2px",
h.position = "absolute",
h.width = "300px",
h.background = b,
h.color = c,
document.body.appendChild(g),
g.innerHTML = a;
var i = g.clientHeight
, j = f ? f.bottom + 5 : 5;
h.top = j + "px",
h.right = "-300px",
f = g._showing = {
div: g,
bottom: j + i
},
this._showings.push(f),
W({
duration: 300,
easing: e.easing,
finishFunc: function() {
h.cursor = "pointer",
g.onclick = function() {
e._hide(g)
}
,
setTimeout(function() {
e._hide(g)
}, d)
},
action: function(a) {
g.style.right = -300 + 305 * a + "px",
g.style.opacity = Xb(a, 0, 1)
}
})
}
,
pc.prototype._hide = function(a) {
var b = this;
a._hide || (a._hide = !0,
W({
duration: 300,
finishFunc: function() {
var c = b._showings.indexOf(a._showing);
b._showings.splice(c, 1),
r(a)
},
action: function(b) {
a.style.right = 5 + -305 * b + "px",
a.style.opacity = Xb(1 - b, 0, 1)
}
}))
}
,
a.onerror = function(a) {
$b(a)
}
,
fa.KEY_EDITOR_JS = {
DOUBLE_CLICK: 1,
SHIFT_DOUBLE_CLICK: 2
};
var rc = m("qc.editor.Preference", null, function() {
this.restore()
});
rc.prototype.restore = function() {
try {
var b = a.localStorage.getItem("QICI Engine");
this._data = b ? JSON.parse(b) : {}
} catch (c) {}
}
,
rc.prototype.query = function(a) {
return this._data[a]
}
,
rc.prototype.set = function(b, c) {
this._data[b] = c;
var d = JSON.stringify(this._data);
try {
a.localStorage.setItem("QICI Engine", d)
} catch (e) {}
}
;
var sc = qc.editor.SceneManager = function() {
this._dirty = !1,
this._unsaved = !1;
var a = this;
a._saveSceneInterval = fa.preference.query("saveSceneInterval") || 10,
this._timer = setInterval(function() {}, 1e3 * a._saveSceneInterval),
fa.inspector.propertyView.on(fa.e.INSPECTOR_COMP_VALUE_CHANGE, function(b) {
if (!fa.prefabInfo && fa.scene.editable) {
var c = b.node;
(c instanceof qc.Node || c instanceof qc.Behaviour) && (a._dirty = !0,
fa.actionEditor && b.field && fa.actionEditor.inspector.onValueChanged(b))
}
}),
fa.inspector.propertyView.on("checkChanged", function(b) {
fa.prefabInfo || fa.scene.editable && (b.source.parent instanceof qc.editor.ActionInspector || (fa.actionEditor && b.source && b.source.target instanceof qc.Node && fa.actionEditor.inspector.onVisibleChanged(b.source.target),
a._dirty = !0))
}),
fa.inspector.propertyView.on("remove", function(b) {
fa.prefabInfo || fa.scene.editable && (console.log("remove", b.source),
a._dirty = !0)
}),
fa.inspector.propertyView.on("addComponent", function(b) {
fa.prefabInfo || fa.scene.editable && (console.log("addComponent", b),
a._dirty = !0)
})
}
;
sc.prototype = {},
sc.prototype.constructor = sc,
b.defineProperties(sc.prototype, {
dirty: {
get: function() {
return this._dirty
},
set: function(a) {
a && fa.prefabInfo || (!a || fa.scene.editable) && (this._dirty = a)
}
},
unsaved: {
get: function() {
return this._unsaved
},
set: function(a) {
this._unsaved = a
}
}
}),
sc.prototype.resetTimer = function(a) {
this._saveSceneInterval != a && (clearInterval(this._timer),
this._timer = setInterval(function() {}, 1e3 * a))
}
,
fa.browserLanguage = a.navigator.language ? "zh" === a.navigator.language.slice(0, 2) ? "zh" : "en" : a.navigator.systemLanguage ? "zh" === a.navigator.systemLanguage.slice(0, 2) ? "zh" : "en" : a.navigator.browserLanguage && "zh" === a.navigator.browserLanguage.slice(0, 2) ? "zh" : "en";
var tc = a.applicationCache;
if (tc) {
var uc = function(b) {
"updateready" === b.type && (tc.swapCache(),
fa.silentRefresh = !0,
a.location.reload())
};
tc.addEventListener("updateready", uc, !1)
}
var vc = m("qc.editor.animation.AddPropertyButton", qc.editor.Button, function $f(a) {
var b = this;
$f["super"].constructor.call(b, a),
b._bindingHandleDocumentMousedown = b.handleDocumentMousedown.bind(b),
b._bindingHandleEscKey = b.handleEscKey.bind(b),
b.text = fa._("Add Property"),
b.disableToolTip(),
b.on("click", b.handleClick, b),
b.ninePatchImage = "addproperty.9",
b.ninePatchBorder = [10, 10, 10, 10],
b.hoverNinePatchImage = "addproperty.9",
b.hoverNinePatchBorder = [10, 10, 10, 10],
b.activeNinePatchImage = "addproperty_active.9",
b.activeNinePatchBorder = [10, 10, 10, 10],
b.textColor = "rgb(65, 36, 31)",
b.activeTextColor = "#f0c8a0",
b.borderWidth = 0,
b.preferredSize = {
width: 200,
height: 24
}
});
vc.prototype.handleEscKey = function(a) {
if (27 === a.keyCode) {
var b = this
, c = b._propertiesTree;
c && c.isInDOM() && b.removePopPanel()
}
}
,
vc.prototype.handleClick = function() {
var a = this
, b = a.view.getBoundingClientRect()
, c = a._propertiesTree;
if (c || (c = a._propertiesTree = new qc.widget.Tree,
c.preferredSize = {
width: 212,
height: 252
},
c.view.style.border = "1px solid rgb(110, 110, 110)",
c.view.style.background = "rgb(49, 49, 49)",
c.calculateClientWidth = function() {
return this.width - 2
}
,
c.calculateClientHeight = function() {
return this.height - 2
}
,
c.view.addEventListener("dblclick", function(b) {
var d = c.getDataAt(b);
d && a.emit("selectData", {
data: d
})
})),
c.isInDOM())
a.removePopPanel();
else {
a.emit("beforeShow", {
tree: c
});
var d = c.preferredSize
, e = qc.widget.Default.getWindowInfo()
, f = (d.width,
d.height)
, g = b.left
, h = b.top + b.height;
h + f > e.height && (h = h - f - b.height),
c.addToDOM({
x: g,
y: h,
width: a.width,
height: f
}),
document.addEventListener("mousedown", a._bindingHandleDocumentMousedown),
document.addEventListener("keydown", a._bindingHandleEscKey)
}
}
,
vc.prototype.handleDocumentMousedown = function(a) {
var b = this
, c = b._propertiesTree
, d = a.target;
c.view.contains(d) || b.view.contains(d) || b.removePopPanel()
}
,
vc.prototype.removePopPanel = function() {
var a = this._propertiesTree;
a.dispose(),
delete this._propertiesTree,
document.removeEventListener("mousedown", this._bindingHandleDocumentMousedown),
document.removeEventListener("keydown", this._bindingHandleEscKey)
}
,
vc.prototype.dispose = function() {}
;
var wc = m("qc.editor.animation.TimeLineBase", qc.widget.graph.GraphView, function _f(a, b) {
var c = this;
_f["super"].constructor.call(c),
c.pannable = !1,
c.scrollBarMode = "on",
c.scrollBarColor = "rgb(160, 160, 160)",
c.propertyTree = a,
c.propertyTreeContainer = b,
c.on("propertyChange", function(a) {
"translateX" === a.property ? c.parent.setTranslateX(a.newValue, c) : "guidePos" === a.property ? c.parent.setGuidePos(a.newValue, c) : "samples" === a.property && c.parent.setSamples(a.newValue, c)
});
var d = function(a) {
var b = c.getDataAt(a);
if (b)
if (c instanceof zc) {
var d = b.position
, e = c.timeLineZoom
, f = Math.round(d.x / e / 8);
c.guidePos = 0 > f ? 0 : f,
c.preGuidePos = c.guidePos
} else
c instanceof yc && fa.actionEditor.inspector.updateEventPanel(c.getDataIndex(b))
};
c.view.addEventListener("mousedown", function(a) {
d(a)
})
});
wc.prototype._rectSelectBorderColor = "rgb(90, 107, 132)",
wc.prototype._samples = 60,
wc.prototype._timeLineZoom = 1,
wc.prototype._translateX = 15,
wc.prototype._guidePos = 0,
wc.prototype.syncPosition = function(a) {
var b = this
, c = b.timeLineZoom
, d = b.propertyTree
, e = d.rowHeight;
if (a && !a._syncToFrame) {
var f = a.a("frame");
if (null != f) {
if (a._syncToPosition = !0,
b instanceof zc) {
var g = a.a("key")
, h = d.rowDatas.indexOf(d.dataModel.getDataById(g));
a.position = {
x: f * c * 8,
y: e * (h + 1) - e / 2
}
} else
b instanceof yc && (a.position = {
x: f * c * 8,
y: a.height / 2
});
delete a._syncToPosition
}
}
}
,
wc.prototype.adjustTranslateX = function(a) {
return a >= 15 ? 15 : a
}
,
wc.prototype.adjustTranslateY = function(a) {
return a > 0 ? 0 : a
}
,
wc.prototype.getDataIndex = function(a) {
var b = this
, c = [];
if (b instanceof zc) {
var d = a.a("key");
b.dataModel.datas.forEach(function(a) {
a.a("key") === d && c.push(a)
})
} else
b instanceof yc && (c = b.dataModel.datas);
return c.sort(function(a, b) {
var c = a.a("frame") - b.a("frame");
return 0 > c ? -1 : c > 0 ? 1 : 0
}),
c.indexOf(a)
}
,
wc.prototype.scrollZoomIn = function(a) {
this.setTimeLineZoom(this.timeLineZoom * this._scrollZoomIncrement, null, a)
}
,
wc.prototype.scrollZoomOut = function(a) {
this.setTimeLineZoom(this.timeLineZoom / this._scrollZoomIncrement, null, a)
}
,
wc.prototype.pinchZoomIn = function(a) {
this.setTimeLineZoom(this.timeLineZoom * this._pinchZoomIncrement, null, a)
}
,
wc.prototype.pinchZoomOut = function(a) {
this.setTimeLineZoom(this.timeLineZoom / this._pinchZoomIncrement, null, a)
}
,
wc.prototype.resetPosition = function() {
for (var a = this, b = a.dataModel.datas, c = 0; c < b.length; c++) {
var d = b[c];
a.syncPosition(d)
}
}
,
wc.prototype.lp = function(a) {
var b = this
, c = b._interactionDiv.getBoundingClientRect()
, d = k.isNumber(b.translateX) ? b.translateX : 0
, e = k.isNumber(b.translateY) ? b.translateY : 0;
return a = k.checkTouch(a),
{
x: a.clientX - c.left - d,
y: a.clientY - c.top - e
}
}
,
wc.prototype.calculateViewRect = function() {
var a = this
, b = a.translateX
, c = a.translateY
, d = a.width
, e = a.height
, f = {
x: -b,
y: -c,
width: d,
height: e
};
return f
}
,
wc.prototype.setTimeLineZoom = function(a, b, c) {
if (!(.006 > a || a > 16)) {
var d = this;
if (a !== d._timeLineZoom) {
d.validate();
var e = d._viewRect
, f = d._timeLineZoom;
if (0 !== e.width && 0 !== e.height) {
c = c ? c : {
x: e.x + e.width / 2,
y: e.y + e.height / 2
};
var g = c.x / f
, h = e.x / f
, i = d.parent._ignoreSyncTranslateX;
d.parent._ignoreSyncTranslateX = !0,
d.translateX = (g - h) * f - g * a,
d.parent._ignoreSyncTranslateX = i
}
d._timeLineZoom = a,
d.epc("timeLineZoom", f, a),
d.parent.setTimeLineZoom(a, b, c, d),
d.resetPosition()
}
}
}
,
wc.prototype.paintGuide = function(a) {
var b = this
, c = 8
, d = b.height
, e = b.translateY
, f = b.timeLineZoom
, g = c * f;
a.beginPath();
var h = b.guidePos;
null != h && (a.moveTo(h * g, -e),
a.lineTo(h * g, -e + d),
a.strokeStyle = "red",
a.stroke())
}
,
b.defineProperties(wc.prototype, {
timeLineZoom: {
get: function() {
return this._timeLineZoom
},
set: function(a) {
var b = this._timeLineZoom;
b !== a && this.setTimeLineZoom(a)
}
},
guidePos: {
get: function() {
return this._guidePos
},
set: function(a) {
var b = this._guidePos;
b !== a ? this.setPropertyValue("guidePos", a) : this.parent.setGuidePos(a, this)
}
},
samples: {
get: function() {
return this._samples
},
set: function(a) {
var b = this._samples;
b !== a && this.setPropertyValue("samples", a)
}
}
});
var xc = m("qc.editor.animation.TimeLineHeader", wc, function ag(a) {
var b = this;
ag["super"].constructor.call(b, a),
b.scrollBarMode = "off",
b.addTopPainter(b.paintTop.bind(b)),
b.rectSelectable = !1,
new Lc(b)
});
xc.prototype.adjustTranslateY = function() {
return 0
}
,
xc.prototype.paintTop = function(a) {
for (var b, c, d, e, f = this, g = f._samples, h = 8, i = [1, 5, 10, 30, 60, 300, 1800, 3600], j = f.width, k = f.height, l = f.translateX, m = f.translateY, n = f.timeLineZoom, o = h * n, p = 0, q = 0; q < i.length - 1; q++) {
var r = i[q];
if (p = o * r,
q >= 1 && (e = 40 * (r / i[q - 1])),
p >= 40) {
b = i[q],
q >= 1 && (c = i[q - 1],
q >= 2 && (d = i[q - 2]));
break
}
}
a.beginPath(),
a.rect(-l, -m, j, 16),
a.fillStyle = "rgb(44, 51, 57)",
a.fill();
var s, t, u, v;
0 > l ? (t = Math.floor(-l / o),
u = t * o) : (t = 0,
u = 0),
v = -l - u,
0 > v && (v = 0),
a.beginPath(),
s = t;
for (var q = u; u + j + v > q; q += o)
d && s % d === 0 && (a.moveTo(q, -m + 12),
a.lineTo(q, -m + 16)),
s++;
a.strokeStyle = "rgb(105, 130, 146)",
a.stroke(),
a.beginPath(),
s = t;
for (var q = u; u + j + v > q; q += o)
c && s % c === 0 && (a.moveTo(q, -m + 8),
a.lineTo(q, -m + 16)),
s++;
a.strokeStyle = "rgb(105, 130, 146)",
a.stroke(),
a.beginPath(),
s = t;
for (var q = u; u + j + v > q; q += o)
s % b === 0 && (a.moveTo(q, -m + 5),
a.lineTo(q, -m + 16)),
s++;
a.strokeStyle = "rgb(105, 130, 146)",
a.stroke(),
a.beginPath(),
a.font = "10px Arial",
a.fillStyle = "rgb(105, 130, 146)",
s = t;
for (var q = u; u + j + v > q; q += o) {
if (s % b === 0) {
var w, x = Math.floor(s / g) || 0, y = s % g;
w = 10 > y ? x + ":0" + y : x + ":" + y,
a.fillText(w, q + 2, -m + 10)
}
s++
}
a.fill(),
a.beginPath();
var z = f.guidePos;
null != z && (a.rect(z * o - 3, -m, 6, k),
a.fillStyle = "rgba(255, 0, 0, 0.5)",
a.strokeStyle = "red",
a.fill(),
a.stroke())
}
;
var yc = m("qc.editor.animation.TimeLineEvent", wc, function bg(a) {
var b = this;
bg["super"].constructor.call(b, a),
b.scrollBarMode = "off",
b.addBottomPainter(b.paintBottom.bind(b)),
b.view.style.background = "rgb(44, 45, 49)",
b.dataModel.selectionModel.on("selectionChange", function() {
var a = b.dataModel.selectionModel.selection;
b.dataModel.datas.forEach(function(a) {
a.s("shape.background", "rgb(110, 144, 149)")
}),
a.forEach(function(a) {
a.s("shape.background", "rgb(252, 157, 110)")
})
}),
b.dataModel.on("dataModelChange", function(a) {
if ("add" === a.kind) {
var c = a.data;
b.syncPosition(c)
}
}),
b.dataModel.on("dataPropertyChange", function(a) {
var c = a.source
, d = b.timeLineZoom;
if ("position" === a.property) {
if (!c._syncToPosition) {
var e = c.position;
c._syncToFrame = !0,
c.a("frame", Math.round(e.x / d / 8)),
delete c._syncToFrame
}
} else
"a:frame" === a.property && b.syncPosition(c)
}),
b.on("interaction", b.handleInteraction.bind(b)),
b.interactors = [new qc.widget.graph.PinchInteractor(b), new qc.widget.graph.ScrollBarInteractor(b), new qc.widget.graph.SelectInteractor(b), new Kc(b), new qc.widget.graph.BasicInteractor(b)],
b._initMenu()
});
yc.prototype.handleDelete = function() {
for (var a = this.selection.slice(0), b = 0; b < a.length; b++) {
var c = a[b]
, d = this.getDataIndex(c);
this.dataModel.remove(c),
fa.actionEditor.action.deleteEvent(d),
fa.actionEditor.inspector.updatePropertyPanel()
}
}
,
yc.prototype.adjustTranslateY = function() {
return 0
}
,
yc.prototype.handleInteraction = function(a) {
var b = this
, c = b.selectionModel.selection;
if ("beginMove" === a.kind)
for (var d = 0; d < c.length; d++) {
var e = c[d];
e.a("index", b.getDataIndex(e))
}
else if ("endMove" === a.kind)
for (var d = 0; d < c.length; d++) {
var e = c[d]
, f = e.a("index")
, g = fa.actionEditor.action.getEventInfo(f);
g && (fa.actionEditor.action.deleteEvent(f),
fa.actionEditor.action.addEvent(e.a("frame"), g.func, g.para))
}
}
,
yc.prototype.addEvent = function(a, b) {
var c = new qc.editor.animation.EventNode;
c.a("frame", a),
this.dataModel.add(c),
b && fa.actionEditor.action.addEvent(a)
}
,
yc.prototype.paintBottom = function(a) {
for (var b, c, d, e, f = 8, g = [1, 5, 10, 30, 60, 300, 1800, 3600, 18e3], h = this, i = h.width, j = h.height, k = h.translateX, l = h.translateY, m = h.timeLineZoom, n = f * m, o = 0, p = 0; p < g.length - 1; p++) {
var q = g[p];
if (o = n * q,
p >= 1 && (e = 40 * (q / g[p - 1])),
o >= 40) {
b = g[p],
p >= 1 && (c = g[p - 1],
p >= 2 && (d = g[p - 2]));
break
}
}
var r, s, t, u;
0 > k ? (s = Math.floor(-k / n),
t = s * n) : (s = 0,
t = 0),
u = -k - t,
0 > u && (u = 0),
a.beginPath(),
r = s;
for (var p = t; t + i + u > p; p += n)
r % b === 0 && (a.moveTo(p, -l),
a.lineTo(p, -l + j)),
r++;
a.strokeStyle = "rgb(80, 80, 80)",
a.stroke(),
h.paintGuide(a)
}
;
var zc = m("qc.editor.animation.TimeLineFrame", wc, function cg(a, b) {
var c = this;
cg["super"].constructor.call(c, a, b),
c.addBottomPainter(c.paintBottom.bind(c)),
c._finishSelect = !1,
c.dataModel.selectionModel.on("selectionChange", c._handleSelectionChange.bind(c)),
c.dataModel.on("dataModelChange", function(a) {
if ("add" === a.kind) {
var b = a.data;
c.syncPosition(b)
}
c.redraw()
}),
c.on("interaction", c.handleInteraction.bind(c)),
c.dataModel.on("dataPropertyChange", function(a) {
var b = a.source
, d = c.timeLineZoom;
if ("position" === a.property) {
if (!b._syncToPosition) {
var e = b.position;
b._syncToFrame = !0,
b.a("frame", Math.round(e.x / d / 8)),
delete b._syncToFrame
}
} else
"a:frame" === a.property && c.syncPosition(b)
}),
c.visibleFunc = function(b) {
var c = a.dataModel.getDataById(b.a("key"));
return a.isVisible(c) && a.rowDatas.indexOf(c) >= 0
}
,
c.interactors = [new qc.widget.graph.PinchInteractor(c), new qc.widget.graph.ScrollBarInteractor(c), new Mc(c), new Kc(c), new qc.widget.graph.BasicInteractor(c)],
c._initMenu()
});
zc.prototype.getDataByMouseEvent = function(a) {
var b = this
, c = b.lp(a)
, d = b.propertyTree
, e = d.rowDatas
, f = d.rowHeight
, g = e[Math.ceil(c.y / f) - 1];
return g
}
,
zc.prototype.handleDelete = function() {
for (var a = this.selection.slice(0), b = 0; b < a.length; b++)
this.removeFrame(a[b])
}
,
zc.prototype.handleInteraction = function(a) {
var b = this
, c = b.selectionModel.selection;
if ("beginMove" === a.kind)
for (var d = 0; d < c.length; d++) {
var e = c[d];
e.a("index", b.getDataIndex(e))
}
else if ("betweenMove" === a.kind) {
var f = a.moveFrameX;
b.guidePos = b.preGuidePos + f,
b.preGuidePos = b.guidePos;
for (var d = 0; d < c.length; d++) {
var e = c[d];
if (e.children.length > 0)
for (var g = 0; g < e.children.length; g++) {
var h = e.children[g]
, i = h.parent;
if (c.indexOf(h) < 0 && i.a("frame") !== h.a("frame")) {
var j = new qc.editor.animation.FrameNode;
j.a("frame", h.a("frame")),
j.a("key", i.a("key")),
b.dataModel.add(j),
h.parent = j
}
}
}
} else if ("endMove" === a.kind) {
for (var k = {}, d = 0; d < c.length; d++) {
var e = c[d]
, l = e.a("key").match(/(.*):(.*)~(.*)/);
if (l) {
var m = e.a("index")
, n = l[1]
, o = l[2]
, p = l[3]
, q = fa.actionEditor.action.getValueByIndex(n, o, p, m);
k[e.a("key")] = k[e.a("key")] || [],
k[e.a("key")].push({
index: m,
value: q,
time: e.a("frame")
})
}
if (e.children.length > 0)
for (var r = b.queryDatasByKeyAndFrame(e.a("key"), e.a("frame")), g = 0; g < r.length; g++) {
var s = r[g];
if (s !== e) {
for (var t = 0; t < s.children.length; t++) {
var h = s.children[t];
h.parent = e
}
b.dataModel.remove(s)
}
}
}
for (var u in k) {
for (var l = u.match(/(.*):(.*)~(.*)/), n = l[1], o = l[2], p = l[3], v = [], d = 0; d < k[u].length; d++)
v.push(k[u][d].index);
var w = function(a, b) {
return a - b
};
v = v.sort(w).reverse();
for (var d = 0; d < v.length; d++)
fa.actionEditor.action.deleteKey(n, o, p, v[d]);
for (var d = 0; d < k[u].length; d++)
fa.actionEditor.action.addKey(n, o, p, k[u][d].time, k[u][d].value)
}
fa.actionEditor.inspector.updatePropertyPanel(),
fa.actionEditor.inspector.nodePanel.updateDurationText(),
fa.actionEditor.updateActionFrame(!0)
}
}
,
zc.prototype.removeDataByKey = function(a) {
var b = this
, c = b.queryDatasByKey(a);
c.forEach(function(a) {
a.parent && 1 === a.parent.children.length && b.dataModel.remove(a.parent),
b.dataModel.remove(a)
})
}
,
zc.prototype.queryDatasByKey = function(a) {
var b = this
, c = b.dataModel
, d = [];
return c.datas.forEach(function(b) {
b.a("key") === a && d.push(b)
}),
d
}
,
zc.prototype.queryDatasByKeyAndFrame = function(a, b) {
var c = this
, d = c.dataModel
, e = [];
return d.datas.forEach(function(c) {
c.a("key") === a && c.a("frame") == b && e.push(c)
}),
e
}
,
zc.prototype.redrawAttrib = function(a, b, c) {
this.removeDataByKey(a);
for (var d = a.match(/(.*)~(.*)/), e = fa.actionEditor.propertyTree.dataModel.getDataById(d[1]), f = b.getKeyTimeList(c), g = 0; g < f.length; g++) {
var h = f[g];
fa.actionEditor.propertyTree.addKey(h, a, !1, e)
}
}
,
zc.prototype.redrawTextureFrame = function(a, b, c) {
var d = a.path + ":" + a.propertyId + "~texture"
, e = this.queryDatasByKeyAndFrame(d, c);
if (e[0]) {
var f = b ? b[0] : null;
f || (f = fa.game.assets.find("__builtin_resource__"));
var g, h = b ? b[1] : 0, i = f.json.frames;
i && i[h] ? g = i[h].frame : i && i[f.frameNames[0]] && (g = i[f.frameNames[0]].frame);
var j = e[0];
j.image = f.img,
j.texture = f,
g ? (j.a("clipX", g.x),
j.a("clipY", g.y),
j.a("clipWidth", g.w),
j.a("clipHeight", g.h)) : (j.a("clipX", null),
j.a("clipY", null),
j.a("clipWidth", null),
j.a("clipHeight", null))
}
}
,
zc.prototype.paintBottom = function(a) {
for (var b, c, d, e, f = 8, g = [1, 5, 10, 30, 60, 300, 1800, 3600], h = this, i = h.width, j = h.height, k = h.translateX, l = h.translateY, m = h.timeLineZoom, n = f * m, o = 0, p = 0; p < g.length - 1; p++) {
var q = g[p];
if (o = n * q,
p >= 1 && (e = 40 * (q / g[p - 1])),
o >= 40) {
b = g[p],
p >= 1 && (c = g[p - 1],
p >= 2 && (d = g[p - 2]));
break
}
}
var r = h.propertyTree
, s = r.rowHeight
, t = r.rowDatas
, u = 0;
a.beginPath(),
a.fillStyle = "rgb(49, 49, 49)",
a.rect(-k, 0, i, t.length * s),
a.fill();
for (var p = 0; p < t.length; p++) {
a.beginPath();
var v = t[p];
a.fillStyle = v.parent ? "rgb(52, 55, 60)" : "rgb(49, 50, 54)",
a.rect(-k, u + s * p + 1, i, s - 3),
a.fill()
}
var w, x, y, z;
0 > k ? (x = Math.floor(-k / n),
y = x * n) : (x = 0,
y = 0),
z = -k - y,
0 > z && (z = 0),
a.beginPath(),
w = x;
for (var p = y; y + i + z > p; p += n)
d && w % d === 0 && (a.moveTo(p, -l),
a.lineTo(p, -l + j)),
w++;
a.strokeStyle = "rgb(47, 56, 61)",
a.stroke(),
a.beginPath(),
w = x;
for (var p = y; y + i + z > p; p += n)
c && w % c === 0 && (a.moveTo(p, -l),
a.lineTo(p, -l + j)),
w++;
a.strokeStyle = "rgb(47, 56, 61)",
a.stroke(),
a.beginPath(),
w = x;
for (var p = y; y + i + z > p; p += n)
w % b === 0 && (a.moveTo(p, -l),
a.lineTo(p, -l + j)),
w++;
a.strokeStyle = "rgb(54, 63, 68)",
a.stroke();
for (var p = 0; p < t.length; p++) {
var v = t[p];
if (v.parent) {
var A = h.queryDatasByKey(v.id);
if (A.length > 1) {
A.sort(function(a, b) {
return a.position.x - b.position.x
});
var B = A[0].position.x
, C = A[A.length - 1].position.x;
a.beginPath(),
a.fillStyle = "rgba(65, 74, 81, 0.8)",
a.rect(B, u + s * p + s / 2 - 2, C - B, 4),
a.fill()
}
}
}
h.paintGuide(a)
}
,
zc.prototype._handleSelectionChange = function() {
var a = this
, b = a.dataModel.selectionModel.selection;
if (!a._finishSelect) {
for (var c = [], d = 0; d < b.length; d++) {
var e = b[d];
if (e.parent && b.indexOf(e.parent) < 0)
c.push(e.parent);
else
for (var f = e.children, g = 0; g < f.length; g++) {
var h = f[g];
b.indexOf(h) < 0 && c.push(h)
}
}
if (a._finishSelect = !0,
c.length > 0)
return void a.dataModel.selectionModel.appendSelection(c)
}
a._finishSelect && (a.dataModel.datas.forEach(function(a) {
a.s("shape.background", "rgb(110, 144, 149)")
}),
b.forEach(function(a) {
a.s("shape.background", "rgb(252, 157, 110)")
}),
a._finishSelect = !1)
}
,
zc.prototype.adjustTranslateY = function(a) {
if (a > 0)
return 0;
var b = this.scrollRect
, c = this.viewRect;
return -a + c.height > b.height ? c.height - b.height : a
}
,
zc.prototype.selectFrame = function(a) {
var b = this
, c = a.position
, d = b.timeLineZoom
, e = Math.round(c.x / d / 8);
b.guidePos = 0 > e ? 0 : e;
var f = b.selectionModel;
if (f.isSelected(a)) {
if (a.children.length > 0) {
var g = [];
a.children.forEach(function(a) {
f.isSelected(a) || g.push(a)
}),
f.appendSelection(g)
}
} else
f.selection = a;
var h = b.propertyTree
, i = h.dataModel.getDataById(a.a("key"));
h.dataModel.selectionModel.selection = i;
var j, k, l;
if (a.children.length > 0) {
var m = a.a("key")
, i = h.dataModel.getDataById(m);
h.expand(i);
var n = i.id.match(/(.*):(.*)/);
if (!n)
return;
j = n[1],
k = n[2],
l = qc.ActionProperties[k].properties[0].attrib
} else {
var n = i.id.match(/(.*):(.*)~(.*)/);
if (!n)
return;
j = n[1],
k = n[2],
l = n[3]
}
var o = fa.actionEditor.action.propertyList[j + ":" + k];
fa.actionEditor.inspector.updatePropertyPanel(o, l)
}
,
zc.prototype.getPreNextFrame = function(a) {
var b = this
, c = b.dataModel.datas;
if (c.length <= 0)
return [];
c.sort(function(a, b) {
var c = a.a("frame") - b.a("frame");
return 0 > c ? -1 : c > 0 ? 1 : 0
});
for (var d = !1, e = !1, f = 0; f < c.length; f++) {
var g = c[f]
, h = g.a("frame");
if (a > h)
d = h;
else if (h !== a) {
e = h;
break
}
}
return "boolean" == typeof d && a >= c[0].a("frame") && (d = c[0].a("frame")),
"boolean" == typeof e && a <= c[c.length - 1].a("frame") && (e = c[c.length - 1].a("frame")),
[d, e]
}
,
b.defineProperties(zc.prototype, {
scrollRect: {
get: function() {
var a = this
, b = a._viewRect
, c = a.contentRect
, d = k.unionRect(c, b);
d.width += d.x,
d.height += d.y,
d.x = 0,
d.y = 0;
var e = a.propertyTreeContainer;
return e && (d.height = e.scrollRect.height),
d
}
}
});
var Ac = m("qc.editor.animation.TimeLinePane", qc.widget.Container, function dg(a, b) {
var c = this;
dg["super"].constructor.call(c);
var d = c.layout = new qc.widget.layout.TableLayout(c);
d.padding = 0,
d.cellPadding = 0;
var e = c.gvHeader = new xc(a,b)
, f = c.gvEvent = new yc(a,b)
, g = c.gvFrame = new zc(a,b);
c.setItems([{
height: 22,
widths: [.1],
cells: [{
element: e
}]
}, {
height: 22,
widths: [.1],
cells: [{
element: f
}]
}, {
height: .1,
widths: [.1],
cells: [{
element: g
}]
}]),
c.scrollBarMode = "off",
c.propertyTree = a
});
Ac.prototype._samples = wc.prototype._samples,
Ac.prototype._timeLineZoom = wc.prototype._timeLineZoom,
Ac.prototype._guidePos = wc.prototype._guidePos,
Ac.prototype.setTranslateX = function(a, b) {
var c = this;
c._ignoreSyncTranslateX || (c._ignoreSyncTranslateX = !0,
b !== c.gvHeader && (c.gvHeader.translateX = a),
b !== c.gvEvent && (c.gvEvent.translateX = a),
b !== c.gvFrame && (c.gvFrame.translateX = a),
delete c._ignoreSyncTranslateX)
}
,
Ac.prototype.setGuidePos = function(a, b) {
var c = this;
c._ignoreSyncGuidePos || (c.setPropertyValue("guidePos", a),
c._ignoreSyncGuidePos = !0,
b !== c.gvHeader && (c.gvHeader.guidePos = a),
b !== c.gvEvent && (c.gvEvent.guidePos = a),
b !== c.gvFrame && (c.gvFrame.guidePos = a),
fa.actionEditor.inspector.updatePropertyPanel(),
fa.actionEditor.updateActionFrame(),
fa.actionEditor.recording = !0,
delete c._ignoreSyncGuidePos)
}
,
Ac.prototype.setSamples = function(a, b) {
var c = this;
c._ignoreSyncSamples || (c.setPropertyValue("samples", a),
c._ignoreSyncSamples = !0,
b !== c.gvHeader && (c.gvHeader.samples = a),
b !== c.gvEvent && (c.gvEvent.samples = a),
b !== c.gvFrame && (c.gvFrame.samples = a),
fa.actionEditor.action && (fa.actionEditor.action.samples = a),
fa.actionEditor.inspector.updatePropertyPanel(),
delete c._ignoreSyncSamples)
}
,
Ac.prototype.setTimeLineZoom = function(a, b, c, d) {
var e = this;
e._ignoreSyncTimeLineZoom || (e._timeLineZoom = a,
e._ignoreSyncTimeLineZoom = !0,
d !== e.gvHeader && e.gvHeader.setTimeLineZoom(a, b, c),
d !== e.gvEvent && e.gvEvent.setTimeLineZoom(a, b, c),
d !== e.gvFrame && e.gvFrame.setTimeLineZoom(a, b, c),
delete e._ignoreSyncTimeLineZoom)
}
,
b.defineProperties(Ac.prototype, {
timeLineZoom: {
get: function() {
return this._timeLineZoom
},
set: function(a) {
var b = this;
b.setTimeLineZoom(a)
}
},
guidePos: {
get: function() {
return this._guidePos
},
set: function(a) {
var b = this;
b.setGuidePos(a)
}
},
samples: {
get: function() {
return this._samples
},
set: function(a) {
var b = this;
b.setSamples(a)
}
},
guideSecond: {
get: function() {
return this._guidePos / this._samples
}
}
}),
m("qc.editor.animation.FrameNode", qc.widget.graph.Node, function eg() {
var a = this;
eg["super"].constructor.call(a),
a.s("shape", "diamond"),
a.s("shape.background", "rgb(110, 144, 149)"),
a.s("shape.border.width", 0),
a.s("select.width", 0),
a.width = 12,
a.height = 12
});
var Bc = m("qc.editor.animation.TextureFrameNode", qc.editor.animation.FrameNode, function() {
var a = this;
qc.editor.animation.FrameNode["super"].constructor.call(a),
a.width = 22,
a.height = 22,
a.anchor = {
x: 0,
y: .5
},
a.s("select.padding", 0),
a.s("pixel.perfect", !1),
a.image = "UnknowIcon"
}, {
_wrapImage: {
width: {
func: function(a) {
return a._width || 22
}
},
height: {
func: function(a) {
return a._height || 22
}
},
clip: !0,
comps: {
func: function(a) {
return a.getImageComps()
}
}
}
}, {}, {
image: {
set: function(a) {
qc.editor.animation.TextureFrameNode.setSuperProperty(this, "image", a)
},
get: function() {
return this._wrapImage
}
}
});
Bc.prototype.getImageComps = function() {
return [{
type: "image",
stretch: null,
name: {
func: function(a, b) {
var c = a._canvas;
if (c)
return c;
var d = k.getImage(a._image);
if (d && "[object HTMLImageElement]" === d.toString() && null != a.a("clipX")) {
var e = a.width
, f = a.height;
"list" === b.layout && (e = f,
f = f),
c = a._canvas = document.createElement("canvas"),
t(c, e, f);
var g, h = s(c, 0, 0, 1), i = (a.a("clipX"),
a.a("clipY"),
a.a("clipWidth")), j = a.a("clipHeight");
(i > e || j > f) && (g = Math.min(e / i, f / j),
i *= g,
j *= g);
var l = Math.round((e - i) / 2)
, m = Math.round((f - j) / 2);
return h.drawImage(d, a.a("clipX"), a.a("clipY"), a.a("clipWidth"), a.a("clipHeight"), l, m, i, j),
h.restore(),
c
}
return d
}
},
rect: {
func: function() {
return [0, 0, 22, 22]
}
}
}]
}
,
Bc.prototype._imageRelativeProperties = {
"a:clipX": !0,
"a:clipY": !0,
"a:clipWidth": !0,
"a:clipHeight": !0,
image: !0,
width: !0,
height: !0
},
Bc.prototype.onPropertyChange = function(a) {
Bc["super"].onPropertyChange.call(this, a);
var b = this;
b._imageRelativeProperties[a.property] && (b._canvas = null)
}
;
var Cc = (m("qc.editor.animation.EventNode", qc.widget.graph.Node, function fg() {
var a = this;
fg["super"].constructor.call(a),
a.s("shape", "event"),
a.s("shape.background", "rgb(110, 144, 149)"),
a.s("shape.border.width", 0),
a.s("select.width", 0),
a.width = 4,
a.height = 14
}),
m("qc.editor.animation.PropertyTree", qc.widget.Tree, function(a, b) {
var c = this;
c.initTree(),
c.initList(a),
new Dc(c),
k.initObject(c, b),
c.scrollBarMode = "off",
c.rowHeight = 22,
c.labelFont = "14px Calibri",
c.sortFunc = function(a, b) {
var c = a.a("sortId")
, d = b.a("sortId");
return c === d ? 0 : c > d ? 1 : d > c ? -1 : void 0
}
,
c.addTopPainter(c.paintButton.bind(c)),
c.selectionModel.on("selectionChange", function() {
if (fa.actionEditor.action && fa.actionEditor.action.targetObject) {
fa.actionEditor.recording = !0;
for (var a = [], b = 0; b < c.selectionModel.selection.length; b++) {
var d = c.selectionModel.selection[b]
, e = d.id.match(/(.*):(.*)/)
, f = e[1]
, g = fa.actionEditor.action.targetObject.find(f);
g && a.push(fa.hierarchy.dataModel.getDataById(g.uuid))
}
a.length > 0 && (fa.hierarchy.selectionModel.selection = a)
}
}),
c.view.addEventListener("click", function(a) {
var b = c.lp(a)
, d = c.getDataAt(a)
, e = c.width;
if (b.x > e - 12)
if (d.parent) {
var f = fa.actionEditor.timeLine.gvFrame.queryDatasByKeyAndFrame(d.id, fa.actionEditor.timeLine.guidePos);
f[0] && (fa.actionEditor.timeLine.gvFrame.removeFrame(f[0]),
fa.actionEditor.inspector.updatePropertyPanel(),
fa.actionEditor.inspector.nodePanel.updateDurationText())
} else {
var g = new qc.editor.ContextMenu([{
label: fa._("Remove Properties"),
func: function() {
c.removeProperty(d)
}
}]);
g._bindingHandleDocMouseDown = function(a) {
g.view.contains(a.target) || g.hide()
}
,
g.registerCloseEvent(g._bindingHandleDocMouseDown),
g.on("action", function(a) {
a.item.func && ("function" == typeof a.item.func ? a.item.func() : c[a.item.func](a))
}),
g.show(a.clientX, a.clientY)
}
b.x > e - 28 && b.x < e - 15 && d.parent && c.addKey(fa.actionEditor.timeLine.guidePos, d.id, !0, d.parent, d.children)
}),
c._initMenu()
}));
Cc.prototype.drawTree = function(a, b, c, d, e, f) {
var g = this
, h = g._indent
, i = g.getLevel(b)
, j = g.getIcon(b) ? h : 0
, l = g.getToggleIcon(b)
, m = b.a("hierarchy") || 1;
c += h * (m - 1),
l ? (c += h * i,
k.drawImage(a, l, null, c, d, h, f, b, g),
c += h) : c += h * (i + 1),
g.drawIcon(a, b, c, d, j, f),
g.drawLabel(a, b, c + j, d, f)
}
,
Cc.prototype.isOnToggleIcon = function(a) {
var b = this.getDataAt(a);
if (!b)
return !1;
if (this.getToggleIcon(b)) {
var c = this._indent
, d = this.getLevel(b)
, e = b.a("hierarchy") || 1
, f = this.lp(a).x
, g = c * d;
return g += c * (e - 1),
f >= g && g + c >= f ? !0 : !1
}
}
,
Cc.prototype._findByName = function(a, b) {
var c = a.children
, d = [];
for (var e in c)
c[e].name === b && d.push(c[e]);
return 0 === d.length ? null : 1 === d.length ? d[0] : d
}
,
Cc.prototype.find = function(a, b) {
if ("" === b || "." === b || "./" === b)
return a;
for (var c = b.split("/"), d = a, e = 0; e < c.length - 1; e++) {
var f = c[e];
if ("" !== f)
if (".." !== f) {
if (d = d._findByName(c[e]),
!d)
return d
} else if (d = a.parent,
d === a.game.stage)
return null
}
var f = c[c.length - 1];
return "" === f || "." === f ? d : ".." === f ? d.parent === a.game.stage ? null : d.parent : this._findByName(d, f)
}
,
Cc.prototype.parseProperties = function(a) {
var b = this.dataModel
, c = qc.ActionProperties;
for (var d in a) {
var e, f = d.match(/(.*):(.*)/), g = f[1], h = f[2], i = !1;
if (this.target) {
var j = this.find(this.target, g);
Array.isArray(j) ? (e = j[0],
i = !0) : e = j
}
var k = "";
e && "/" === g ? k = e.name : (f = g.match(/([^\/.]*)$/),
f && (k = f[1]));
var l = new qc.widget.Data
, m = c[h].name;
l.id = d,
l.name = k ? k + " : " + m : m,
"/" === g ? l.a("hierarchy", 1) : l.a("hierarchy", g.match(/\//gi).length + 1),
l.a("gameObject", e),
l.a("duplicate", i),
l.a("sortId", g),
b.add(l);
var n = a[d];
for (var o in n.propMap) {
var p = new qc.widget.Data;
p.id = l.id + "~" + o,
p.parent = l,
p.name = c[h].isCustomProperty ? o : m + "." + o,
p.a("key", o),
p.a("hierarchy", l.a("hierarchy")),
p.a("gameObject", l.a("gameObject")),
p.a("duplicate", l.a("duplicate")),
p.a("sortId", g),
b.add(p);
for (var q = n.getKeyTimeList(o), r = 0; r < q.length; r++) {
var s = q[r];
fa.actionEditor.timeLine.gvFrame.queryDatasByKeyAndFrame(d + "~" + o, s)[0] || this.addKey(s, d + "~" + o, !1, l)
}
}
}
}
,
Cc.prototype._createTextureFrameNode = function(a, b, c) {
var d = new qc.editor.animation.TextureFrameNode;
d.a("frame", c),
d.a("key", b);
var e = a();
if (!e)
return d;
var f = e[0]
, g = e[1];
if (f) {
var h, i = f.json.frames;
i && i[g] ? h = i[g].frame : i && i[f.frameNames[0]] && (h = i[f.frameNames[0]].frame),
d.image = f.img,
d.texture = f,
h && (d.a("clipX", h.x),
d.a("clipY", h.y),
d.a("clipWidth", h.w),
d.a("clipHeight", h.h))
}
return fa.actionEditor.timeLine.gvFrame.dataModel.add(d),
d
}
,
Cc.prototype._createFrameNode = function(a, b) {
var c = new qc.editor.animation.FrameNode;
return c.a("frame", b),
c.a("key", a),
c
}
,
Cc.prototype.addKey = function(a, b, c, d, e, f) {
if (fa.actionEditor.action && fa.actionEditor.action.targetObject) {
var g, h = this, i = fa.actionEditor.timeLine.gvFrame.queryDatasByKeyAndFrame(b, a)[0];
if (!i) {
var j;
if (d) {
var k = b.match(/(.*):(.*)~(.*)/);
j = {
path: k[1],
attrib: k[3],
parentPropertyId: k[2],
parentPropertyName: qc.ActionProperties[k[2]].name
}
}
j && "Texture" === j.parentPropertyName ? i = h._createTextureFrameNode(function() {
var b, c, d;
return f ? (g = fa.actionEditor.action.targetObject.find(j.path),
g && (c = g.texture ? g.texture.atlas : g.texture,
d = g.frame)) : (b = fa.actionEditor.action.getValue(j.path, j.parentPropertyId, j.attrib, a),
c = b ? b[0] : null,
d = b ? b[1] : 0),
c || (c = fa.game.assets.find("__builtin_resource__")),
d = d ? d : 0,
[c, d]
}, b, a) : (i = h._createFrameNode(b, a),
fa.actionEditor.timeLine.gvFrame.dataModel.add(i))
}
if (d) {
var l = fa.actionEditor.timeLine.gvFrame.queryDatasByKeyAndFrame(d.id, a)[0];
if (l)
i.parent = l;
else {
var m = h._createFrameNode(d.id, a);
i.parent = m,
fa.actionEditor.timeLine.gvFrame.dataModel.add(m)
}
if (c) {
var n, o = b.match(/(.*):(.*)~(.*)/), p = o[1], q = o[2], r = o[3];
if (g = fa.actionEditor.action.targetObject.find(p),
f && g)
if (q == qc.PROP_TEXTURE) {
var s = g.texture ? g.texture.atlas : g.texture
, t = g.frame;
n = [s, t]
} else
n = g[r];
else if (n = fa.actionEditor.action.getValue(p, q, r, a, !0),
!n && (isNaN(n) || null === n) && g)
if (q == qc.PROP_TEXTURE) {
var s = g.texture ? g.texture.atlas : g.texture
, t = g.frame;
n = [s, t]
} else
n = g[r];
fa.actionEditor.action.addKey(p, q, r, a, n),
fa.actionEditor.timeLine.gvFrame.selectFrame(i)
}
} else if (e && e.length > 0)
if (b.match(/(.*):(.*)/)[2] == qc.PROP_TEXTURE) {
var u = e[0];
if (fa.actionEditor.timeLine.gvFrame.queryDatasByKeyAndFrame(u.id, a)[0])
return;
var o = u.id.match(/(.*):(.*)~(.*)/)
, p = o[1]
, q = o[2]
, r = o[3];
g = fa.actionEditor.action.targetObject.find(p);
var v = h._createTextureFrameNode(function() {
var b, c, d;
return g = fa.actionEditor.action.targetObject.find(p),
f && g ? (c = g.texture ? g.texture.atlas : g.texture,
d = g.frame) : (b = fa.actionEditor.action.getValue(p, qc.PROP_TEXTURE, r, a),
c = b ? b[0] : null,
d = b ? b[1] : 0),
c || (c = fa.game.assets.find("__builtin_resource__")),
d = d ? d : 0,
[c, d]
}, u.id, a);
if (v.parent = i,
c) {
var n;
if (f && g)
s = g.texture ? g.texture.atlas : g.texture,
t = g.frame,
n = [s, t];
else if (n = fa.actionEditor.action.getValue(p, q, r, a, !0),
!n && (isNaN(n) || null === n) && g) {
var s = g.texture ? g.texture.atlas : g.texture
, t = g.frame;
n = [s, t]
}
fa.actionEditor.action.addKey(p, q, r, a, n),
fa.actionEditor.timeLine.gvFrame.selectFrame(i)
}
} else {
for (var w = 0; w < e.length; w++) {
var u = e[w];
if (!fa.actionEditor.timeLine.gvFrame.queryDatasByKeyAndFrame(u.id, a)[0]) {
var v = h._createFrameNode(u.id, a);
if (v.parent = i,
fa.actionEditor.timeLine.gvFrame.dataModel.add(v),
c) {
var n, o = u.id.match(/(.*):(.*)~(.*)/), p = o[1], q = o[2], r = o[3];
g = fa.actionEditor.action.targetObject.find(p),
f && g ? n = g[r] : (n = fa.actionEditor.action.getValue(p, q, r, a, !0),
n || !isNaN(n) && null !== n || !g || (n = g[r])),
fa.actionEditor.action.addKey(p, q, r, a, n)
}
}
}
c && fa.actionEditor.timeLine.gvFrame.selectFrame(i)
}
fa.actionEditor.inspector.nodePanel.updateDurationText()
}
}
,
Cc.prototype.removeProperty = function(a) {
for (var b = fa.actionEditor.timeLine.gvFrame.queryDatasByKey(a.id), c = 0; c < b.length; c++)
fa.actionEditor.timeLine.gvFrame.removeFrame(b[c]);
var d = a.id.match(/(.*):(.*)/);
if (d) {
var e = d[1]
, f = d[2]
, g = fa.actionEditor.action.propertyList[a.id];
fa.actionEditor.action.removeProperty(e, f),
g === fa.actionEditor.inspector.propOb && fa.actionEditor.inspector.draw(fa.actionEditor.action),
(f == qc.PROP_POSITION || f == qc.PROP_ANCHORED_POSITION) && fa.scene.iv()
}
this.dataModel.remove(a),
fa.actionEditor.inspector.nodePanel.updateDurationText()
}
,
Cc.prototype.getLabel = function(a) {
var b;
return b = this.labelFunc ? this.labelFunc(a) : null == a.displayName ? a.name : a.displayName,
a.a("gameObject") ? a.a("duplicate") && (b += "(duplicate)") : b += "(missing)",
b
}
,
Cc.prototype.paintButton = function(a) {
for (var b = this, c = b.width, d = b.rowDatas, e = b.rowHeight, f = 0, g = "rgb(63, 68, 71)", h = 0; h < d.length; h++) {
var i = d[h]
, j = e * h;
a.beginPath(),
a.rect(c - 30, j, 30, e),
a.fillStyle = g,
a.fill(),
i.parent && k.drawImage(a, k.getImage("action_expand"), "centerUniform", f + c - 28, j, 13, 22),
a.beginPath(),
k.drawImage(a, k.getImage("action_collapse"), "centerUniform", f + c - 13, j, 13, 22)
}
}
,
Cc.prototype.getLabelColor = function(a) {
if (a === this.draggingData)
return "#fce486";
if (this.checkMode) {
if (this._focusData === a)
return this.labelSelectColor
} else if (this.isSelected(a))
return this.labelSelectColor;
return !a.a("gameObject") || a.a("duplicate") ? "rgb(235, 213, 65)" : this.labelColor
}
,
Cc.prototype.resetDataModel = function() {
var a = this
, b = a.dataModel;
b.clear()
}
,
Cc.prototype.redrawTree = function() {
this.resetDataModel();
var a = [];
fa.actionEditor.action && (fa.actionEditor.action.refreshActionList(),
a = fa.actionEditor.action.propertyList),
this.parseProperties(a)
}
,
b.defineProperties(Cc.prototype, {
target: {
get: function() {
return this._target
},
set: function(a) {
var b = this;
b.setPropertyValue("target", a)
}
}
});
var Dc = m(null, "qc.widget.TreeInteractor", function gg(a) {
gg["super"].constructor.call(this, a)
}, {
handle_touchstart: function(a) {
var b = this
, c = b.view
, d = c.getDataAt(a);
if (c.requestFocus(),
Y(a),
b.clear(a),
b._clientPoint = B(a),
b._tx = c.translateX,
b._ty = c.translateY,
d) {
b.handleSelectMode(a, d);
var e = fa.actionEditor.timeLine.gvFrame.queryDatasByKey(d.id);
fa.actionEditor.timeLine.gvFrame.selectionModel.selection = e
}
b._isV = c.isCloseToVScrollBar(a),
b._isH = c.isCloseToHScrollBar(a),
!d && c.clearSelectionOnBackgroundClicked && c.selectionModel.clearSelection(),
k.startDragging(b, a)
},
handle_touchend: function(a) {
var b = this
, c = b.view;
if (!b._isV && !b._isH && b._clientPoint && !b._state) {
var d = c.getDataAt(a);
d && b.handleClickCallback(d, a)
}
b.clear(a)
}
})
, Ec = m(null, b, function(a) {
var b = this;
b._propertyPane = a,
b.addListeners()
}, {
handle_contextmenu: function(a) {
Y(a)
}
}, {
interactor: !0
}, {
view: {
get: function() {
return this._propertyPane
}
}
})
, Fc = m("qc.editor.animation.PropertyPane", qc.widget.Container, function hg() {
var a = this;
hg["super"].constructor.call(a);
var b = a.propertyTree = new Cc
, c = new qc.widget.Container
, d = new qc.widget.layout.TableLayout(c);
d.cellPadding = 0,
d.padding = 2,
c.layout = d,
c.background = "rgb(67, 74, 82)";
var e = a.btnRecord = new qc.editor.ToggleButton;
e.icon = "action_record",
e.activeIcon = "action_record_active",
e.background = null,
e.hoverBackground = null,
e.activeBackground = "rgb(51, 56, 62)",
e.activeGradientColor = null,
e.borderWidth = 0;
var f = a.btnRun = new qc.editor.ToggleButton;
f.background = null,
f.hoverBackground = null,
f.activeBackground = "rgb(51, 56, 62)",
f.activeGradientColor = null,
f.icon = "action_play",
f.activeIcon = "action_play_active",
f.borderWidth = 0;
var g = new qc.editor.Button({
icon: "action_addframe",
activeIcon: "action_addframe_active",
background: null,
hoverBackground: null,
activeBackground: "rgb(51, 56, 62)",
activeGradientColor: null,
borderWidth: 0
})
, h = new qc.editor.Button({
icon: "action_addevent",
activeIcon: "action_addevent_active",
background: null,
hoverBackground: null,
activeBackground: "rgb(51, 56, 62)",
activeGradientColor: null,
borderWidth: 0
})
, i = new qc.editor.Button({
icon: "action_nextframe",
activeIcon: "action_nextframe_active",
background: null,
hoverBackground: null,
activeBackground: "rgb(51, 56, 62)",
activeGradientColor: null,
borderWidth: 0
})
, j = new qc.editor.Button({
icon: "action_preframe",
activeIcon: "action_preframe_active",
background: null,
hoverBackground: null,
activeBackground: "rgb(51, 56, 62)",
activeGradientColor: null,
borderWidth: 0
})
, k = a.txtFrame = new qc.editor.IntInput({
value: 0
});
c.setItems([{
height: .1,
widths: [20, 24, 24, 24, 40, .1, 20, 20],
cells: [{
element: e
}, {
element: f
}, {
element: j
}, {
element: i
}, {
element: k
}, {
element: null
}, {
element: g
}, {
element: h
}]
}]),
e.on("propertyChange", function(b) {
"selected" === b.property && a.emit(b.newValue ? "startRecord" : "stopRecord")
}),
g.on("click", function() {
a.emit("addKey")
}),
h.on("click", function() {
a.emit("addEvent")
}),
f.on("propertyChange", function(b) {
f._settingSelected || "selected" === b.property && a.emit(b.newValue ? "play" : "stop")
}),
i.on("click", function() {
var a = fa.actionEditor.timeLine.gvFrame.getPreNextFrame(fa.actionEditor.timeLine.guidePos);
"number" == typeof a[1] && (fa.actionEditor.timeLine.guidePos = a[1])
}),
j.on("click", function() {
var a = fa.actionEditor.timeLine.gvFrame.getPreNextFrame(fa.actionEditor.timeLine.guidePos);
"number" == typeof a[0] && (fa.actionEditor.timeLine.guidePos = a[0])
});
var l = new qc.widget.Container
, m = new qc.widget.layout.TableLayout(l);
m.cellPadding = 0,
m.padding = 2,
l.layout = m,
l.background = "rgb(60, 65, 71)",
l.gradientColor = null;
var n = new vc
, o = a.txtSamples = new qc.editor.IntInput({
value: 60
})
, p = new qc.editor.Button({
icon: "action_expand",
actionIcon: "action_expand_active",
background: null,
hoverBackground: null,
activeBackground: "rgb(51, 56, 62)",
activeGradientColor: null,
borderWidth: 0
});
l.setItems([{
height: .1,
widths: [24, .1, 50, 50],
cells: [{
element: p
}, {
element: null
}, {
element: new qc.editor.Text({
text: fa._("Samples") + "&nbsp;",
align: "right"
})
}, {
element: o
}]
}]),
p.on("click", function() {
"action_expand" === p.icon ? (b.expandAll(),
p.icon = "action_collapse",
p.activeIcon = "action_collapse_active") : (b.collapseAll(),
p.icon = "action_expand",
p.activeIcon = "action_expand_active")
}),
o.onValueChanged = function(b) {
a.emit("valueChange", {
kind: "samples",
newValue: b
})
}
;
var q = a.propertyTreeContainer = new qc.widget.Container;
q.scrollBarMode = "on",
q.scrollBarColor = "rgb(160, 160, 160)",
q.layout = new qc.widget.layout.VBoxLayout(q),
q.layout.padding = [0, 2, 2, 2];
var r = new qc.widget.Container;
r.layout = new qc.widget.layout.TableLayout(r),
r.setItems([{
height: 26,
widths: [.1],
cells: [{
cellPadding: [2, 25, 2, 25],
element: n
}]
}]),
q.setItems([b, r]),
b.selectionModel.on("selectionChange", function() {
var a = b.selectionModel.selection;
if (a[0]) {
if (!a[0].id)
return;
var c = a[0].id.match(/(.*):(.*)~(.*)/);
if (!c)
return;
var d = c[1]
, e = c[2]
, f = c[3]
, g = fa.actionEditor.action.propertyList[d + ":" + e];
fa.actionEditor.inspector.updatePropertyPanel(g, f)
}
}),
n.on("selectData", function(a) {
var c, d = a.data, e = d.a("gameObject");
if (d && e) {
c = d.a("property");
var f = c.name
, g = d.id
, h = e.name
, i = new qc.widget.Data;
if (i.id = g,
i.name = h ? h + " : " + f : f,
i.a("hierarchy", d.a("hierarchy")),
i.a("gameObject", d.a("gameObject")),
i.a("sortId", d.a("sortId")),
b.dataModel.add(i),
c) {
for (var j = 0; j < c.properties.length; j++) {
var k = c.properties[j]
, l = new qc.widget.Data;
l.parent = i,
l.id = i.id + "~" + k.attrib,
l.name = c.isCustomProperty ? k.attrib : d.name + "." + k.attrib,
l.a("propertyKey", k.attrib),
l.a("hierarchy", i.a("hierarchy")),
l.a("gameObject", d.a("gameObject")),
l.a("sortId", i.a("sortId")),
b.dataModel.add(l)
}
var m = g.match(/(.*):(.*)/)
, o = m[1]
, p = m[2];
fa.actionEditor.action.addProperty(o, p, null, !0);
var q = fa.actionEditor.timeLine.guidePos;
b.addKey(0, g, !0, null, i.children, !0);
var r = fa.actionEditor.action.duration || fa.actionEditor.timeLine.samples;
b.addKey(r, g, !0, null, i.children, !0),
fa.actionEditor.timeLine.guidePos = q,
fa.actionEditor.inspector.nodePanel.updateDurationText()
}
n.removePopPanel()
}
}),
n.on("beforeShow", function(a) {
var c = a.tree
, d = function(a, e) {
var f = qc.ActionProperties
, g = qc.propertyList["qc.Node"];
if ("qc.Node" !== a["class"] && qc.propertyList[a["class"]] && (g = g.concat(qc.propertyList[a["class"]])),
g) {
var h, i = 1;
h = e ? e.name : "";
for (var j = e; j; )
i++,
j = j.parent,
j && (h = j.name + "/" + h);
h = "/" + h;
for (var k = 0; k < g.length; k++) {
var l = g[k];
if ("string" == typeof l) {
for (var m = l.split("."), n = a, o = 0; o < m.length - 1 && (n = n[m[o]],
n); o++)
;
if (!n)
continue
}
var p = f[l]
, q = h + ":" + l;
if (!b.dataModel.getDataById(q)) {
var r = new qc.widget.Data;
r.name = p.name,
r.id = q,
r.a("gameObject", a),
r.a("property", p),
"/" === h ? r.a("hierarchy", 1) : r.a("hierarchy", h.match(/\//gi).length + 1),
r.a("sortId", q.replace(/\:\d+/gi, "")),
r.parent = e,
c.dataModel.add(r)
}
}
}
var s = a.children;
if (s && s.length > 0)
for (var o = 0; o < s.length; o++) {
var t = s[o];
if (t) {
var u = new qc.widget.Data;
u.name = t.name,
u.parent = e,
c.dataModel.add(u),
d(t, u)
}
}
}
, e = b.target;
if (e)
d(e);
else {
var f = fa.actionEditor.inspector.findViewById("actionNodePanel_targetObject");
f && f.blink(),
fa.notification.warn(fa._("targetObject is null"))
}
});
var s = new qc.widget.layout.TableLayout(a);
s.padding = 0,
s.cellPadding = 0,
a.layout = s,
a.setItems([{
height: 22,
widths: [.1],
cells: [{
element: c
}]
}, {
height: 22,
widths: [.1],
cells: [{
element: l
}]
}, {
height: .1,
widths: [.1],
cells: [{
element: q
}]
}]),
new Ec(a),
a.disabledBackground = "rgba(0,0,0,0.4)",
a.disabled = !0
})
, Gc = m("qc.editor.ActionNodePanel", qc.editor.Panel, function ig(a) {
var b = this;
ig["super"].constructor.call(b, a),
b.title = "qc.Action",
b.checkable = !1,
b.removable = !1,
b.lockable = !1
});
Gc.prototype.paint = function() {
var a = this
, b = a.target;
_.columnWidths = ["95+0.1", "90+0.5"],
_.line([_.text("Name", {
toolTip: fa._("CNode.name")
}), _.stringInput({
value: b.name
}, null, function(a) {
b.name = a
})]);
var c = Gd.drawNodeRef(b, "targetObject")
, d = c.row.cells[1].element;
d.id = "actionNodePanel_targetObject",
d.onValueChanged = function() {
var a = fa.actionEditor.propertyTree;
a.resetDataModel(),
a.target = b.targetObject,
a.parseProperties(fa.actionEditor.action.propertyList),
fa.actionEditor.updateActionFrame()
}
,
_.line([_.text(Gd.makePropertyName("targetLocked"), {
align: "left",
toolTip: fa._("Target object is locked. It is not changed by Animator.")
}), _.checkBox({
selected: b.targetLocked
}, null, function(a) {
b.targetLocked = a
})]),
_.line([_.text(Gd.makePropertyName("loop"), {
align: "left",
toolTip: fa._("Loop")
}), _.checkBox({
selected: b.loop
}, null, function(a) {
b.loop = a
})]);
var e = b.getDuration(!1, !0);
e = e === qc.MAX_DURATION ? "infinity" : e.toString() + " (" + (e / b.samples).toFixed(2) + "s)";
var f;
_.line([_.text("Duration", {
align: "left",
toolTip: fa._("Duration")
}), f = _.text(e)]),
f.id = "durationText"
}
,
Gc.prototype.updateDurationText = function() {
var a = this.target
, b = a.getDuration(!1, !0);
b = b === qc.MAX_DURATION ? "infinity" : b.toString() + " (" + (b / a.samples).toFixed(2) + "s)";
var c = this.findViewById("durationText");
c && (c.text = b)
}
;
var Hc = m("qc.editor.ActionFilePanel", qc.editor.Panel, function jg(a, b, c) {
var d = this;
a && (d.actionAsset = fa.game.assets.find(a.uuid)),
d.fileType = b || "Action",
d.editor = c,
jg["super"].constructor.call(d, a);
var e = "Action File";
"ActionManager" === b && (e = "ActionManager File"),
d.title = e,
d.checkable = !1,
d.removable = !1,
d.lockable = !1
});
Hc.prototype.paint = function() {
var a = this
, b = a.target;
_.columnWidths = ["40+0.1", "130+0.5"];
var c = "action";
"ActionManager" === a.fileType && (c = "actionManager"),
_.line([_.text("File"), _.objectInput({
objectType: c,
target: a,
targetField: "actionAsset",
bind: "actionAsset",
onValueChanged: function(b) {
var c = fa.game.assets.find(b);
c instanceof qc.ActionAsset ? fa.actionEditor.onActionChanged(c) : c instanceof qc.ActionManagerAsset && a.editor.onFileChanged(c)
}
})]),
b ? (_.columnWidths = [20, "60+0.1", "60+0.1", 20],
_.line([_.empty(), a.createBtn = _.button(fa._("Create")), a.saveBtn = _.button(fa._("Save")), _.empty()]),
a.createBtn.on("click", this.createNewAction.bind(this)),
a.saveBtn.on("click", this.saveAction.bind(this))) : (_.columnWidths = [20, "60+0.1", 20],
_.line([_.empty(), a.btn = _.button(fa._("Create")), _.empty()]),
a.btn.on("click", this.createNewAction.bind(this)))
}
,
Hc.prototype.onValueChanged = function(a) {
var b = fa.game.assets.find(a);
b instanceof qc.ActionAsset ? fa.actionEditor.onActionChanged(b) : b instanceof qc.ActionManagerAsset && this.editor.onFileChanged(b)
}
,
Hc.prototype.createNewAction = function() {
var a = this;
Fb(fa._("Enter the new file name"), "", function(b) {
if (b) {
var c, d = "Assets/action/" + b + ".bin", e = function(b) {
if (-1 === b)
return void fa.notification.warn(fa._("File already exists"));
var c = JSON.parse(b[0])
, e = JSON.parse(b[1]);
if ("ActionManager" === a.fileType) {
fa.game.assets.cache(c.uuid, d, new qc.ActionManagerAsset(c.uuid,d,e,c)),
fa.hiddenGame.assets.cache(c.uuid, d, new qc.ActionManagerAsset(c.uuid,d,e,c));
var f = fa.game.assets.find(d);
a.editor.onFileChanged(f)
} else if ("Action" === a.fileType) {
fa.game.assets.cache(c.uuid, d, new qc.ActionAsset(c.uuid,d,e,c)),
fa.hiddenGame.assets.cache(c.uuid, d, new qc.ActionAsset(c.uuid,d,e,c));
var f = fa.game.assets.find(d);
fa.actionEditor.onActionChanged(f)
}
};
"ActionManager" === a.fileType ? c = qc.ActionManager.buildEmptyBundle() : "Action" === a.fileType && (c = qc.Action.buildEmptyBundle()),
fa.service.request("SAVE_ACTION", {
path: d,
data: c,
type: a.fileType,
newAction: !0
}, e)
}
})
}
,
Hc.prototype.saveAction = function() {
"Action" === this.fileType && fa.actionEditor && fa.actionEditor.action ? qc.editor.Operation.SAVE_ACTION(fa.actionEditor.action, fa.actionEditor.action.key) : "ActionManager" === this.fileType && this.editor && this.editor.actionManager && qc.editor.Operation.SAVE_ACTION(this.editor.actionManager, this.editor.actionManager.key)
}
;
var Ic = m("qc.editor.ActionInspector", qc.widget.Container, function kg(a) {
var b = this;
kg["super"].constructor.call(b, a),
b.layout = new qc.widget.layout.VBoxLayout(b),
b.layout.padding = [0, 0, 0, 0],
b.layout.gap = 5,
b.propertyPanel = null,
b.eventPanel = null,
b.draw(),
new Pe(b),
fa.scene.on("position", this.onPositionChanged.bind(this)),
fa.scene.on("scaleX", this.onScaleChanged.bind(this)),
fa.scene.on("scaleY", this.onScaleChanged.bind(this)),
fa.scene.on("pivot", this.onPivotChanged.bind(this)),
fa.scene.on("rotation", this.onRotationChanged.bind(this)),
fa.scene.on("size", this.onSizeChanged.bind(this))
});
Ic.prototype.updatePropertyPanel = function(a, b) {
return this.eventIdx = null,
a && (this.propOb = a),
b && (this.attrib = b),
this.propertyPanel ? void this.propertyPanel.inspect(this.target, this.propOb, this.attrib) : void (fa.actionEditor._timer || this.inspect(this.target))
}
,
Ic.prototype.updateEventPanel = function(a) {
return "number" == typeof a && (this.eventIdx = a),
this.eventPanel ? void this.eventPanel.inspect(this.target, this.eventIdx) : void this.inspect(this.target)
}
,
Ic.prototype.draw = function(a) {
this.propOb = null,
this.attrib = null,
this.eventIdx = null,
this.time = null,
this.inspect(a)
}
,
Ic.prototype.inspect = function(a) {
var b = this;
b.clear(),
b.target = a;
var c = b.propOb
, d = b.attrib
, e = b.eventIdx
, f = []
, g = new qc.editor.ActionFilePanel(a);
if (f.push(g),
a) {
var h = b.nodePanel = new qc.editor.ActionNodePanel(a);
if (f.push(h),
"number" == typeof e) {
var i = b.eventPanel = new qc.editor.ActionEventPanel(a,e);
f.push(i),
b.propertyPanel = null
} else if (c && d) {
var j = b.propertyPanel = new qc.editor.ActionPropertyPanel(a,c,d);
f.push(j),
b.eventPanel = null
} else
b.eventPanel = null,
b.propertyPanel = null
}
b.setItems(f)
}
,
Ic.prototype.clear = function() {
var a = this
, b = a.children;
a.setItems([]),
b && b.forEach(function(a) {
a && a.dispose()
}),
a.target = null
}
,
Ic.prototype.getPanelInstance = function(a, b) {
return a === qc.editor.Panel || k.isSubClassOf(a, qc.editor.Panel) ? new a(b) : new a
}
,
Ic.prototype.getCompAt = function(a) {
a = k.checkTouch(a);
var b = this
, c = a.target
, d = b.children;
if (d)
for (var e = 0; e < d.length; e++) {
var f = d[e];
if (f instanceof Qa) {
var g = f.eachChildren(function(a) {
return a.view.contains(c) ? !0 : void 0
});
if (g)
return g
}
}
}
,
Ic.prototype.destroy = function() {
fa.scene.off("position", this.onPositionChanged.bind(this)),
fa.scene.off("scaleX", this.onScaleChanged.bind(this)),
fa.scene.off("scaleY", this.onScaleChanged.bind(this)),
fa.scene.off("pivot", this.onPivotChanged.bind(this)),
fa.scene.off("rotation", this.onRotationChanged.bind(this)),
fa.scene.off("size", this.onSizeChanged.bind(this))
}
,
Ic.prototype.getPropOb = function(a, b) {
if (this.target && this.target.targetObject)
for (var c in this.target.propertyList) {
var d = c.match(/(.*):(.*)/)
, e = d[1]
, f = d[2]
, g = this.target.targetObject.find(e);
if (g && g.uuid === a.uuid && f == b)
return this.target.propertyList[c]
}
}
,
Ic.prototype.getPropValue = function(a, b, c, d, e) {
if (this.target && this.target.targetObject) {
if (e === qc.CURVE_TYPE_ABSOLUTE)
return d = Number.isInteger(d) ? d : parseFloat(Number.prototype.toFixed.call(d, 3));
if (e === qc.CURVE_TYPE_RELATIVE) {
var f = b.propMap[c].from
, g = d - f;
return g = Number.isInteger(g) ? g : parseFloat(Number.prototype.toFixed.call(g, 3))
}
if (e === qc.CURVE_TYPE_TWEEN_ABSOLUTE) {
var f = b.propMap[c].from
, h = b.propMap[c].to
, i = (d - f) / (h - f);
return i = Number.isInteger(i) ? i : parseFloat(Number.prototype.toFixed.call(i, 3))
}
if (e === qc.CURVE_TYPE_TWEEN_RELATIVE) {
var f = b.propMap[c].from
, h = b.propMap[c].to
, i = (d - f) / h;
return i = Number.isInteger(i) ? i : parseFloat(Number.prototype.toFixed.call(i, 3))
}
}
}
,
Ic.prototype.onPositionChanged = function(a) {
if (fa.actionEditor && fa.actionEditor.recording) {
var b = a.node
, c = a.x
, d = a.y
, e = fa.actionEditor.timeLine.guidePos
, f = this.getPropOb(b, qc.PROP_POSITION);
if (f) {
if (c) {
var g = this.getPropValue(b, f, "x", c, f.propMap.x.curveType)
, h = f.setValue("x", e, g);
h && fa.actionEditor.addKey(f, "x", e, g, !0),
this.updatePropertyPanel()
}
if (d) {
var g = this.getPropValue(b, f, "y", d, f.propMap.y.curveType)
, h = f.setValue("y", e, g);
h && fa.actionEditor.addKey(f, "y", e, g, !0),
this.updatePropertyPanel()
}
}
if (f = this.getPropOb(b, qc.PROP_ANCHORED_POSITION)) {
if (c) {
var g = this.getPropValue(b, f, "anchoredX", c, f.propMap.anchoredX.curveType)
, h = f.setValue("anchoredX", e, g);
h && fa.actionEditor.addKey(f, "anchoredX", e, g, !0),
this.updatePropertyPanel()
}
if (d) {
var g = this.getPropValue(b, f, "anchoredY", d, f.propMap.anchoredY.curveType)
, h = f.setValue("anchoredY", e, g);
h && fa.actionEditor.addKey(f, "anchoredY", e, g, !0),
this.updatePropertyPanel()
}
}
}
}
,
Ic.prototype.onScaleChanged = function(a) {
if (fa.actionEditor && fa.actionEditor.recording) {
var b = a.node
, c = a.scaleX
, d = a.scaleY
, e = fa.actionEditor.timeLine.guidePos
, f = this.getPropOb(b, qc.PROP_SCALE);
if (f) {
if (c) {
var g = this.getPropValue(b, f, "scaleX", c, f.propMap.scaleX.curveType)
, h = f.setValue("scaleX", e, g);
h && fa.actionEditor.addKey(f, "scaleX", e, g, !0),
this.updatePropertyPanel()
}
if (d) {
var g = this.getPropValue(b, f, "scaleY", d, f.propMap.scaleY.curveType)
, h = f.setValue("scaleY", e, g);
h && fa.actionEditor.addKey(f, "scaleY", e, g, !0),
this.updatePropertyPanel()
}
}
}
}
,
Ic.prototype.onPivotChanged = function(a) {
if (fa.actionEditor && fa.actionEditor.recording) {
var b = a.node
, c = a.pivotX
, d = a.pivotY
, e = fa.actionEditor.timeLine.guidePos
, f = this.getPropOb(b, qc.PROP_PIVOT);
if (f) {
if (c) {
var g = this.getPropValue(b, f, "pivotX", c, f.propMap.pivotX.curveType)
, h = f.setValue("pivotX", e, g);
h && fa.actionEditor.addKey(f, "pivotX", e, g, !0),
this.updatePropertyPanel()
}
if (d) {
var g = this.getPropValue(b, f, "pivotY", d, f.propMap.pivotY.curveType)
, h = f.setValue("pivotY", e, g);
h && fa.actionEditor.addKey(f, "pivotY", e, g, !0),
this.updatePropertyPanel()
}
}
}
}
,
Ic.prototype.onRotationChanged = function(a) {
if (fa.actionEditor && fa.actionEditor.recording) {
var b = a.node
, c = a.rotation
, d = fa.actionEditor.timeLine.guidePos
, e = this.getPropOb(b, qc.PROP_ROTATION);
if (e && c) {
var f = this.getPropValue(b, e, "rotation", c, e.propMap.rotation.curveType)
, g = e.setValue("rotation", d, f);
g && fa.actionEditor.addKey(e, "rotation", d, f, !0),
this.updatePropertyPanel()
}
}
}
,
Ic.prototype.onSizeChanged = function(a) {
if (fa.actionEditor && fa.actionEditor.recording) {
var b = a.node
, c = a.width
, d = a.height
, e = fa.actionEditor.timeLine.guidePos
, f = this.getPropOb(b, qc.PROP_SIZE);
if (f) {
if (c) {
var g = this.getPropValue(b, f, "width", c, f.propMap.width.curveType)
, h = f.setValue("width", e, g);
h && fa.actionEditor.addKey(f, "width", e, g, !0),
this.updatePropertyPanel()
}
if (d) {
var g = this.getPropValue(b, f, "height", d, f.propMap.height.curveType)
, h = f.setValue("height", e, g);
h && fa.actionEditor.addKey(f, "height", e, g, !0),
this.updatePropertyPanel()
}
}
}
}
,
Ic.prototype.onVisibleChanged = function(a) {
if (fa.actionEditor && fa.actionEditor.recording) {
var b = fa.actionEditor.timeLine.guidePos
, c = this.getPropOb(a, qc.PROP_VISIBLE);
if (c) {
var d = a.visible
, e = c.setValue("visible", b, d);
e && fa.actionEditor.addKey(c, "visible", b, d, !0),
this.updatePropertyPanel()
}
}
}
,
Ic.prototype.onValueChanged = function(a) {
if (fa.actionEditor && fa.actionEditor.recording) {
var b, c, d, e = a.node, f = a.field;
b = this.getPropOb(e, f),
d = e[f];
var g = fa.actionEditor.timeLine.guidePos;
if (!(e instanceof qc.Behaviour) || (c = e.key + "." + f,
f = c,
b = this.getPropOb(e.gameObject, c))) {
if (b) {
if (!b.propertyInfo || !b.propertyInfo.properties || !b.propertyInfo.properties[0])
return;
var h = b.propertyInfo.properties[0].type;
h === qc.Serializer.NUMBER ? d = this.getPropValue(e, b, f, d, b.propMap[f].curveType) : h === qc.Serializer.TEXTURE && (d = d ? [d.atlas, d.frame] : null);
var i = b.setValue(f, g, d);
return i && fa.actionEditor.addKey(b, f, g, d, !0),
void this.updatePropertyPanel()
}
if ("texture" !== f && "frame" !== f && "texture/frame" !== f) {
if ("size" === f || "width" === f || "height" === f) {
if (c = qc.PROP_SIZE,
b = this.getPropOb(e, c)) {
if ("size" === f) {
d = e.width,
d = this.getPropValue(e, b, "width", d, b.propMap.width.curveType);
var i = b.setValue("width", g, d);
return i && fa.actionEditor.addKey(b, "width", g, d, !0),
d = e.height,
d = this.getPropValue(e, b, "height", d, b.propMap.height.curveType),
i = b.setValue("height", g, d),
i && fa.actionEditor.addKey(b, "height", g, d, !0),
void this.updatePropertyPanel()
}
d = this.getPropValue(e, b, f, e[f], b.propMap[f].curveType)
}
} else {
if ("anchoredX" === f || "anchoredY" === f || "x" === f || "y" === f) {
var b = this.getPropOb(e, qc.PROP_POSITION);
if (b) {
"anchoredX" === f ? f = "x" : "anchoredY" === f && (f = "y"),
d = e[f],
d = this.getPropValue(e, b, f, d, b.propMap[f].curveType);
var i = b.setValue(f, g, d);
i && fa.actionEditor.addKey(b, f, g, d, !0),
this.updatePropertyPanel()
}
if (b = this.getPropOb(e, qc.PROP_ANCHORED_POSITION)) {
"x" === f ? f = "anchoredX" : "y" === f && (f = "anchoredY"),
d = e[f],
d = this.getPropValue(e, b, f, d, b.propMap[f].curveType);
var i = b.setValue(f, g, d);
i && fa.actionEditor.addKey(b, f, g, d, !0),
this.updatePropertyPanel()
}
return
}
"rotation" === f ? (c = qc.PROP_ROTATION,
b = this.getPropOb(e, c),
b && (d = this.getPropValue(e, b, f, e[f], b.propMap[f].curveType))) : "scaleX" === f || "scaleY" === f ? (c = qc.PROP_SCALE,
b = this.getPropOb(e, c),
b && (d = this.getPropValue(e, b, f, e[f], b.propMap[f].curveType))) : "colorTint" === f ? (c = qc.PROP_COLOR_TINT,
b = this.getPropOb(e, c),
b && (d = e[f])) : "color" === f ? (c = qc.PROP_COLOR,
b = this.getPropOb(e, c),
b && (d = e[f])) : "skewX" === f || "skewY" === f ? (c = qc.PROP_SKEW,
b = this.getPropOb(e, c),
b && (d = this.getPropValue(e, b, f, e[f], b.propMap[f].curveType))) : "pivotX" === f || "pivotY" === f ? (c = qc.PROP_PIVOT,
b = this.getPropOb(e, c),
b && (d = this.getPropValue(e, b, f, e[f], b.propMap[f].curveType))) : "defaultAnimation" === f ? (c = qc.PROP_ANIMATION,
b = this.getPropOb(e, c),
b && (d = e[f])) : "text" === f ? (c = qc.PROP_TEXT,
b = this.getPropOb(e, c),
b && (d = e[f])) : "horizontalNormalizedPosition" === f || "verticalNormalizedPosition" === f ? (c = qc.PROP_SCROLLVIEW_POSITION,
b = this.getPropOb(e, c),
b && (d = this.getPropValue(e, b, f, e[f], b.propMap[f].curveType))) : "audio" === f ? (c = qc.PROP_SOUND,
b = this.getPropOb(e, c),
b && (d = e[f])) : "on" === f ? (c = qc.PROP_TOGGLE_ON,
b = this.getPropOb(e, c),
b && (d = e[f])) : "innerHTML" === f ? (c = qc.PROP_DOM_INNERHTML,
b = this.getPropOb(e, c),
b && (d = e[f])) : "scrollX" === f || "scrollY" === f ? (c = qc.PROP_TILEMAP_POSITION,
b = this.getPropOb(e, c),
b && (d = this.getPropValue(e, b, f, e[f], b.propMap[f].curveType))) : "value" === f && ("qc.ProgressBar" === e["class"] ? c = qc.PROP_PROGRESSBAR_VALUE : "qc.Slider" === e["class"] ? c = qc.PROP_SLIDER_VALUE : "qc.ScrollBar" === e["class"] && (c = qc.PROP_SCROLLBAR_VALUE),
b = this.getPropOb(e, c),
b && (d = this.getPropValue(e, b, f, e[f], b.propMap[f].curveType)))
}
if (b) {
var i = b.setValue(f, g, d);
i && fa.actionEditor.addKey(b, f, g, d, !0),
this.updatePropertyPanel()
}
} else if (b = this.getPropOb(e, qc.PROP_TEXTURE)) {
d = [e.texture.atlas, e.frame];
var i = b.setValue("texture", g, d);
i && fa.actionEditor.addKey(b, "texture", g, d, !0),
this.updatePropertyPanel()
}
}
}
}
;
var Jc = m("qc.editor.animation.ActionEditor", qc.widget.Container, function lg() {
var a = this;
lg["super"].constructor.call(a);
var b = a.propertyPane = new Fc
, c = a.propertyTree = b.propertyTree
, d = a.propertyTreeContainer = b.propertyTreeContainer
, e = a.txtFrame = b.txtFrame
, f = a.timeLine = new Ac(c,b.propertyTreeContainer)
, g = a.inspector = new Ic
, h = new qc.widget.layout.BorderLayout(a);
a.layout = h,
a.layout.splitterSize = 1,
a.layout.splitterColor = "rgb(54, 63, 68)",
a.layout.leftToggleVisible = !1,
a.layout.rightToggleVisible = !1,
a.background = "rgb(49, 50, 54)",
a.setItems([{
region: "left",
width: 220,
element: b
}, {
region: "center",
element: f
}, {
region: "right",
width: 220,
element: g
}]),
c.dataModel.on("dataModelChange", function() {
f.gvFrame.redraw()
}),
c.on("propertyChange", function(a) {
"calcdPreferredSize" === a.property && (f.gvFrame.resetPosition(),
f.gvFrame.redraw())
}),
d.on("propertyChange", function(b) {
"translateY" === b.property && (a._syncToPropertyTree || (a._syncToTimeLine = !0,
f.gvFrame.translateY = b.newValue,
delete a._syncToTimeLine))
}),
f.gvFrame.on("propertyChange", function(b) {
"translateY" === b.property && (a._syncToTimeLine || (a._syncToPropertyTree = !0,
d.translateY = b.newValue,
delete a._syncToPropertyTree))
}),
e.onValueChanged = function(b) {
a._syncGuidePosToTxtFrame || (a._syncGuidePosToTimeLine = !0,
f.guidePos = b,
delete a._syncGuidePosToTimeLine)
}
,
f.on("propertyChange", function(b) {
"guidePos" === b.property && (a._syncGuidePosToTimeLine || (a._syncGuidePosToTxtFrame = !0,
e.value = b.newValue,
delete a._syncGuidePosToTxtFrame))
}),
b.on("valueChange", function(a) {
if ("samples" === a.kind) {
var b = f.gvFrame.translateX
, c = f.samples;
f.samples = parseInt(a.newValue) || 60;
var d = f.timeLineZoom / (f.samples / c);
f.timeLineZoom = d,
f.setTranslateX(b)
}
}),
b.on("addKey", function() {
if (a.action) {
var b = c.selectionModel.lastData
, d = a.timeLine.guidePos;
if (b && null != d) {
if (f.gvFrame.queryDatasByKeyAndFrame(b.id, d)[0])
return;
c.addKey(d, b.id, !0, b.parent, b.children)
}
}
}),
b.on("addEvent", function() {
if (a.action) {
var b = a.timeLine.guidePos;
null != b && f.gvEvent.addEvent(b, !0)
}
}),
b.on("play", function() {
a.play()
}),
b.on("stop", function() {
a.stop()
}),
b.on("startRecord", function() {
a.recording = !0
}),
b.on("stopRecord", function() {
a.recording = !1
}),
g.on("addComponent", function() {
g.inspect(a.action)
}),
a.action = null
});
Jc.prototype.onActionChanged = function(a, b) {
this.action && (this.action.destroy(),
this.action = null),
a && (this.action = qc.Action.restoreBundle(a, fa.game, !0),
this.action && b && (this.action.targetObject = b)),
this.inspector.draw(this.action);
var c = this.propertyTree;
if (c.resetDataModel(),
this.propertyPane.btnRecord.selected = !1,
this.propertyPane.disabled = !0,
this.timeLine.gvFrame.dataModel.clear(),
this.timeLine.gvEvent.dataModel.clear(),
this.timeLine.guidePos = 0,
this.action) {
this.propertyPane.disabled = !1,
this.propertyPane.txtSamples.value = this.action.samples,
c.target = this.action.targetObject,
c.parseProperties(this.action.propertyList);
for (var d = 0; d < this.action.eventList.length; d++) {
var e = this.action.eventList[d];
this.timeLine.gvEvent.addEvent(e[0])
}
this.updateActionFrame(!0),
this.propertyPane.btnRecord.selected = !0
}
}
,
Jc.prototype.addKey = function(a, b, c, d, e) {
if (this.action) {
var f = a.path + ":" + a.propertyId + "~" + b
, g = this.propertyTree.dataModel.getDataById(f);
if (g) {
if (this.timeLine.gvFrame.queryDatasByKeyAndFrame(f, c)[0])
return;
this.propertyTree.addKey(c, f, !e, g.parent, g.children)
}
}
}
,
Jc.prototype.updateActionFrame = function(a) {
if (this.action && this.action.targetObject) {
var b, c = this.timeLine.guidePos;
"number" == typeof this.deltaFrame ? b = 1e3 * (c - this.action.elapsedFrame) / this.timeLine.samples : (b = 1e3 / this.timeLine.samples,
this.action.elapsedFrame = c - 1),
this.action.startTime || (this.action.startTime = this.action.game.time.scaledTime),
this.action.update(b, null, !0, a)
}
}
,
Jc.prototype.play = function() {
var a = this;
a.action && a.action.targetObject && (a.timeLine.guidePos >= a.action.duration && (a.timeLine.guidePos = 0),
a._timer = a.action.game.timer.loop(0, function() {
var b = a.action.game.time.deltaTime
, c = Math.round(b * a.timeLine.samples / 1e3)
, d = a.timeLine.guidePos;
return a.action.duration <= d ? void (a.action.loop ? a.timeLine.guidePos = 0 : a.stop()) : (a.deltaFrame = c,
void (a.timeLine.guidePos = d + c))
}, a))
}
,
Jc.prototype.stop = function() {
var a = this;
a.action && a.action.targetObject && (a._timer && (a.action.game.timer.remove(this._timer),
a._timer = null),
a.deltaFrame = null,
a.propertyPane.btnRun._settingSelected = !0,
a.propertyPane.btnRun.selected = !1,
delete a.propertyPane.btnRun._settingSelected)
}
,
Jc.prototype.destroy = function() {
this.stop(),
this.timeLine.gvFrame.guidePos = 0,
this.inspector && this.inspector.destroy(),
this.inspector = null
}
,
b.defineProperties(Jc.prototype, {
recording: {
get: function() {
return this._recording
},
set: function(a) {
this._updating || (this._updating = !0,
this.setPropertyValue("recording", a),
this.propertyPane.btnRecord.selected = a,
this._updating = !1)
}
}
}),
Jc.prototype.drawPath = function(a) {
if (this.action && this.action.targetObject) {
Q(a, [4]);
for (var b, c, d = !1, e = {}, f = ["#FF0099", "#000099", "#880099", "#440099", "#BB0099", "#00FF00", "#FFFF00", "#00FFFF"], g = 0, h = 0; h < this.propertyTree.selection.length; h++) {
var i = this.propertyTree.selection[h];
i.parent && (i = i.parent);
var j = i.id.match(/(.*):(.*)/)
, d = j[1]
, b = qc.PROP_POSITION
, c = d + ":" + b
, k = this.action.propertyList[c];
if (k || (b = qc.PROP_ANCHORED_POSITION,
c = d + ":" + b,
k = this.action.propertyList[c]),
k) {
var l = this.action.targetObject.find(d);
if (!l || e[l.uuid])
continue;
e[l.uuid] = 1;
var m = [];
for (var n in k.propMap) {
var o = k.propMap[n].curve;
0 !== o._keys.length && (m.push(o._keys[0].time),
m.push(o._keys[o._keys.length - 1].time))
}
var p = function(a, b) {
return a - b
};
m = m.sort(p);
var q = m[0]
, r = m[m.length - 1];
a.strokeStyle = f[g++] || "#FF0099",
a.lineWidth = 3,
a.beginPath();
var s, t, u = function(a, b) {
var c = l.parent.rect;
return "anchoredX" === a ? b + (c.width * l.minAnchor.x + c.x) : b + (c.height * l.minAnchor.y + c.y)
}, v = "x", w = "y";
b == qc.PROP_ANCHORED_POSITION ? (s = u("anchoredX", k.getValue("anchoredX", q)),
t = u("anchoredY", k.getValue("anchoredY", q)),
v = "anchoredX",
w = "anchoredY") : (s = k.getValue(v, q),
t = k.getValue(w, q));
var x = l.parent.toGlobal({
x: s,
y: t
});
a.moveTo(x.x, x.y);
for (var y = q + 1; r >= y; y++) {
var z, A;
b == qc.PROP_ANCHORED_POSITION ? (z = u(v, k.getValue(v, y)),
A = u(w, k.getValue(w, y))) : (z = k.getValue(v, y),
A = k.getValue(w, y)),
x = l.parent.toGlobal({
x: z,
y: A
}),
a.lineTo(x.x, x.y)
}
a.stroke()
}
}
R(a, [4])
}
}
;
var Kc = k.define(null, qc.widget.graph.MoveInteractor, function(a) {
Kc["super"].constructor.call(this, a)
}, {
handle_touchstart: function(a) {
this._startDraging = !1,
Kc["super"].handle_touchstart.call(this, a)
},
handleWindowTouchMove: function(a) {
var b = this
, c = b._graphView
, d = {
kind: b._startDraging ? "betweenMove" : "beginMove",
event: a
}
, e = c.lp(a);
if (b._startDraging = !0,
"beginMove" === d.kind)
return void b.emit(d);
for (var f = c.selectionModel.selection, g = f[0].position.x, h = 0; h < f.length; h++) {
var i = f[h];
i.position.x < g && (g = i.position.x)
}
var j = e.x - b._lastLogicalPoint.x;
0 > j && 0 > g + j && (j = -g);
var k = 8 * c._timeLineZoom
, l = Math.round(j / k);
0 !== l && (b._logicalPoint = c.lp(a),
j = l * k,
c.moveSelection(j, 0),
e.x = j + b._lastLogicalPoint.x,
b._lastLogicalPoint = e,
b.autoScroll(a),
d.moveFrameX = l,
b.emit(d))
}
})
, Lc = m(null, b, function(a) {
var b = this;
b._graph = a,
b.addListeners()
}, {
handle_mousedown: function(a) {
this.handle_touchstart(a)
},
handle_touchstart: function(a) {
k.preventDefault(a);
var b = this
, c = b._graph
, d = c.lp(a);
if (d.y > 0 && d.y < 16) {
var e = Math.round(d.x / (8 * c.timeLineZoom));
c.guidePos = 0 > e ? 0 : e,
b.preGuidePos = c.guidePos,
k.startDragging(b, a)
}
},
handle_mouseup: function(a) {
this.handle_touchend(a)
},
handle_touchend: function() {},
handleWindowMouseMove: function(a) {
this.handleWindowTouchMove(a)
},
handleWindowTouchMove: function(a) {
var b = this
, c = b._graph
, d = c.lp(a)
, e = Math.round(d.x / (8 * c.timeLineZoom));
e = 0 > e ? 0 : e,
b.preGuidePos != e && (c.guidePos = 0 > e ? 0 : e,
b.preGuidePos = c.guidePos)
},
handleWindowMouseUp: function(a) {
this.handleWindowTouchEnd(a)
},
handleWindowTouchEnd: function() {},
handle_contextmenu: function(a) {
Y(a)
}
}, {
interactor: !0
}, {
view: {
get: function() {
return this._graph
}
}
})
, Mc = m(null, qc.widget.graph.SelectInteractor, function(a) {
Mc["super"].constructor.call(this, a)
}, {
handle_touchstart: function(a) {
var b = this
, c = b._graphView
, d = c._interactionState;
if (delete b._pendingCS,
!(k.getTouchCount(a) > 1 || d.editing || d.scrolling)) {
var e = c.getDataAt(a)
, f = c.selectionModel;
if (k.isCtrlDown(a)) {
if (k.isLeftButton(a) && e && !f.isSelected(e)) {
for (var g = [], h = 0; h < f.selection.length; h++)
g.push(f.selection[h]);
g.push(e),
f.selection = g
}
} else
e ? c.selectFrame(e) : c.pannable ? b._pendingCS = k.getClientPoint(a) : k.isLeftButton(a) && (f.clearSelection(),
c.rectSelectable && (b.startDragging(a),
d.selecting = !0))
}
}
})
, Nc = m("qc.editor.ActionEventPanel", qc.editor.Panel, function mg(a, b, c) {
var d = this;
d.eventIdx = b,
d.actionManager = c,
mg["super"].constructor.call(d, a),
d.title = "Action Event",
d.checkable = !1,
d.removable = !1
});
Nc.prototype.paint = function() {
var a = this
, c = this.target
, d = this.eventIdx
, e = ["95+0.1", "90+0.5"];
_.columnWidths = e;
var f = [0]
, g = c.targetObject
, h = g ? g.scripts : null
, i = {
constructor: 1,
getMeta: 1,
clazz: 1,
update: 1,
awake: 1,
preUpdate: 1,
postUpdate: 1,
onClick: 1,
onUp: 1,
onDown: 1,
onEnable: 1,
onDisable: 1
};
if (h)
for (var j = 0; j < h.length; j++) {
var k = h[j];
if (!k.constructor.__menu)
for (var l = b.getPrototypeOf(k); l instanceof qc.Behaviour; ) {
for (var m = b.keys(l), n = 0; n < m.length; n++)
i[m[n]] || f.push(m[n]);
l = l.__proto__
}
}
var o, p, q = c.getEventInfo(d);
q && (o = q.func,
p = q.para,
o && -1 === f.indexOf(o) && (o += "(Function Not Found)",
f.push(o))),
_.line([_.text(fa._("Function"), {
toolTip: fa._("Action Fuction")
}), _.dropDownList({
items: f,
value: o
}, null, function(a) {
a && -1 != a.indexOf("(") && (a = a.substring(0, a.indexOf("("))),
c.setEvent(d, 1, a)
})]),
Array.isArray(p) || (p = "string" == typeof p ? [p] : []);
var r, s = {
para: p
}, t = _.titleLine("Parameters");
t.add(_.line([_.text(" Length", {
align: "right"
}), r = _.intInput()]));
var u = p.length;
r.value = u,
r.input.addEventListener("change", function() {
var b = r.value;
if (0 > b && (b = 0),
b !== u) {
for (var e = [], f = 0; b > f; f++)
e.push(u > f ? p[f] : null);
s.para = e,
c.setEvent(d, 2, e),
c instanceof qc.Action ? fa.actionEditor.inspector.updateEventPanel(d) : c instanceof qc.ActionManager && a.actionManager.inspector.updateEventPanel(d)
}
});
var v = function(a) {
var b;
t.add(_.line([_.text("" + a, {
align: "right"
}), b = _.stringInput({
value: p[a]
}, null, function(b) {
p[a] = b,
c.setEvent(d, 2, p)
})]))
};
for (var j in p)
v(j, p[j]);
_.line([_.text("Play In Editor", {
toolTip: fa._("Play In Editor")
}), _.checkBox({
selected: c.playEventInEditor
}, null, function(a) {
c.playEventInEditor = a
})])
}
,
Nc.prototype.inspect = function(a, b) {
this.target = a,
this.eventIdx = b,
this.repaint()
}
,
fa.extend.inspector("qc.CurveProp", function() {
var a = this
, b = this.target
, c = this.propOb
, d = this.attrib
, e = fa.actionEditor.timeLine.guidePos
, f = qc.editor.gui
, g = ["80+0.1", "115+0.5"];
f.columnWidths = g;
var h = {};
h[qc.CURVE_TYPE_RELATIVE] = "Relative",
h[qc.CURVE_TYPE_ABSOLUTE] = "Absolute",
h[qc.CURVE_TYPE_TWEEN_RELATIVE] = "TweenRelative",
h[qc.CURVE_TYPE_TWEEN_ABSOLUTE] = "TweenAbsolute";
var i = {
Relative: qc.CURVE_TYPE_RELATIVE,
Absolute: qc.CURVE_TYPE_ABSOLUTE,
TweenRelative: qc.CURVE_TYPE_TWEEN_RELATIVE,
TweenAbsolute: qc.CURVE_TYPE_TWEEN_ABSOLUTE
}
, j = h[c.propMap[d].curveType]
, k = function(a, b) {
if (c.propMap[d].curve._keys[0]) {
var e = c.propMap[d].curve;
if ("Absolute" === a) {
if ("Relative" === b) {
var f = e._keys[0].value;
c.setData(d, {
from: f
});
for (var g = 0; g < e._keys.length; g++)
e._keys[g].value = e._keys[g].value - f,
e.makeKeyframeLinear(g - 1),
e.makeKeyframeLinear(g),
e.makeKeyframeLinear(g + 1)
} else if ("TweenAbsolute" === b) {
var f = e._keys[0].value
, h = c.getMaxValue(d);
c.setData(d, {
from: f,
to: h
});
for (var g = 0; g < e._keys.length; g++)
e._keys[g].value = h - f === 0 ? 0 : (e._keys[g].value - f) / (h - f),
e.makeKeyframeLinear(g - 1),
e.makeKeyframeLinear(g),
e.makeKeyframeLinear(g + 1)
} else if ("TweenRelative" === b) {
var f = e._keys[0].value
, h = c.getMaxValue(d);
h -= f,
c.setData(d, {
from: f,
to: h
});
for (var g = 0; g < e._keys.length; g++)
e._keys[g].value = 0 === h ? 0 : (e._keys[g].value - f) / h,
e.makeKeyframeLinear(g - 1),
e.makeKeyframeLinear(g),
e.makeKeyframeLinear(g + 1)
}
} else if ("Relative" === a) {
if ("Absolute" === b)
for (var f = c.propMap[d].from, g = 0; g < e._keys.length; g++)
e._keys[g].value = e._keys[g].value + f,
e.makeKeyframeLinear(g - 1),
e.makeKeyframeLinear(g),
e.makeKeyframeLinear(g + 1);
else if ("TweenAbsolute" === b) {
var f = c.propMap[d].from
, h = c.getMaxValue(d);
c.setData(d, {
from: f,
to: h
});
for (var g = 0; g < e._keys.length; g++)
e._keys[g].value = h - f === 0 ? 0 : e._keys[g].value / (h - f),
e.makeKeyframeLinear(g - 1),
e.makeKeyframeLinear(g),
e.makeKeyframeLinear(g + 1)
} else if ("TweenRelative" === b) {
var f = c.propMap[d].from
, h = c.getMaxValue(d);
h -= f,
c.setData(d, {
from: f,
to: h
});
for (var g = 0; g < e._keys.length; g++)
e._keys[g].value = 0 === h ? 0 : e._keys[g].value / h,
e.makeKeyframeLinear(g - 1),
e.makeKeyframeLinear(g),
e.makeKeyframeLinear(g + 1)
}
} else if ("TweenAbsolute" === a) {
if ("Absolute" === b)
for (var f = c.propMap[d].from, h = c.propMap[d].to, g = 0; g < e._keys.length; g++)
e._keys[g].value = f + e._keys[g].value * (h - f),
e.makeKeyframeLinear(g - 1),
e.makeKeyframeLinear(g),
e.makeKeyframeLinear(g + 1);
else if ("Relative" === b)
for (var f = c.propMap[d].from, h = c.propMap[d].to, g = 0; g < e._keys.length; g++)
e._keys[g].value = e._keys[g].value * (h - f),
e.makeKeyframeLinear(g - 1),
e.makeKeyframeLinear(g),
e.makeKeyframeLinear(g + 1);
else if ("TweenRelative" === b) {
var f = c.propMap[d].from
, h = c.propMap[d].to;
h -= f,
c.setData(d, {
to: h
})
}
} else if ("TweenRelative" === a)
if ("Absolute" === b)
for (var f = c.propMap[d].from, h = c.propMap[d].to, g = 0; g < e._keys.length; g++)
e._keys[g].value = f + e._keys[g].value * h,
e.makeKeyframeLinear(g - 1),
e.makeKeyframeLinear(g),
e.makeKeyframeLinear(g + 1);
else if ("Relative" === b)
for (var f = c.propMap[d].from, h = c.propMap[d].to, g = 0; g < e._keys.length; g++)
e._keys[g].value = e._keys[g].value * h,
e.makeKeyframeLinear(g - 1),
e.makeKeyframeLinear(g),
e.makeKeyframeLinear(g + 1);
else if ("TweenAbsolute" === b) {
var f = c.propMap[d].from
, h = c.propMap[d].to;
h = f + h,
c.setData(d, {
to: h
})
}
}
};
f.line([f.text("Curve Type", {
toolTip: fa._("Curve Type")
}), f.dropDownList({
items: ["Absolute", "Relative", "TweenAbsolute", "TweenRelative"],
value: j
}, null, function(e) {
k(h[c.propMap[d].curveType], e),
c.setData(d, {
curveType: i[e]
}),
a.inspect(b, c, d, !0),
fa.actionEditor.updateActionFrame(!0)
})]);
for (var l = "numberInput", m = {}, n = 0; n < c.propertyInfo.properties.length; n++)
if (m = c.propertyInfo.properties[n],
m.attrib === d) {
"angle" === m.type && (l = "angleInput");
break
}
var j = c.propMap[d].curveType;
if (j === qc.CURVE_TYPE_RELATIVE || j === qc.CURVE_TYPE_TWEEN_RELATIVE) {
var o = c.getFromValue(b.targetObject, d, e);
"angleInput" === l && (o = o / Math.PI * 180),
f.line([f.text("From", {
toolTip: fa._("Original value"),
"for": "curveOriginal",
dragStep: .1
}), f.numberInput({
value: o,
id: "curveOriginal"
}, null, function(a) {
"angleInput" === l && (a = a / 180 * Math.PI),
c.setData(d, {
from: a
}),
fa.actionEditor.updateActionFrame(!0)
})]),
f.line([f.empty(), a.btn = f.button(fa._("Set Curr To Start"))]),
a.btn.on("click", function() {
if (b.targetObject && b.targetObject.find(c.path)) {
var e, f = b.targetObject.find(c.path), g = c.propMap[d];
if (g.attribArray) {
var h = g.attribArray.length;
if (2 === h)
e = f[g.attribArray[0]] ? f[g.attribArray[0]][g.attribArray[1]] : null;
else if (h > 2) {
for (var i = f, j = 0; h - 1 > j && (i = i[g.attribArray[j]],
i); j++)
;
i && (e = i[g.attribArray[h - 1]])
}
} else
e = f[d];
"angleInput" != l && (e = Number.isInteger(e) ? e : parseFloat(Number.prototype.toFixed.call(e, 3))),
c.setData(d, {
from: e
});
var k = fa.actionEditor.timeLine.guidePos;
"number" == typeof c.isKey(d, k) && c.setValue(d, k, 0),
a.inspect(b, c, d, !0),
fa.actionEditor.updateActionFrame(!0)
}
})
}
var p = (c.propMap[d].from,
c.propMap[d].to);
if (j === qc.CURVE_TYPE_TWEEN_ABSOLUTE) {
var o = c.getFromValue(b.targetObject, d, e);
"angleInput" === l && (o = o / Math.PI * 180),
f.line([f.text("From (0,0)", {
"for": "curveFrom",
dragStep: .1,
toolTip: fa._("The value according to point(0,0) of Tween Editor")
}), f.numberInput({
value: o,
id: "curveFrom"
}, null, function(a) {
"angleInput" === l && (a = a / 180 * Math.PI),
c.setData(d, {
from: a
}),
fa.actionEditor.updateActionFrame(!0)
})]),
"angleInput" === l && (p = p / Math.PI * 180),
f.line([f.text("To (0,1)", {
"for": "curveTo",
dragStep: .1,
toolTip: fa._("The value according to point(0,1) of Tween Editor")
}), f.numberInput({
value: p,
id: "curveTo"
}, null, function(a) {
"angleInput" === l && (a = a / 180 * Math.PI),
c.setData(d, {
to: a
}),
fa.actionEditor.updateActionFrame(!0)
})])
} else if (j === qc.CURVE_TYPE_TWEEN_RELATIVE) {
"angleInput" === l && (p = p / Math.PI * 180);
var q = f.titleLine("Distance from (0,0) to (0,1)");
q.add(f.line([f.text("Distance", {
"for": "curveDistance",
dragStep: .1,
toolTip: fa._("The distance between point(0,0) and point(0,1) of Tween Editor")
}), f.numberInput({
value: p,
id: "curveDistance"
}, null, function(a) {
"angleInput" === l && (a = a / 180 * Math.PI),
c.setData(d, {
to: a
}),
fa.actionEditor.updateActionFrame(!0)
})]))
}
f.columnWidths = [25, "55+0.1", "115+0.5"];
var q = f.titleLine("Tween");
q.add(f.line([f.empty(), f.text("Curve", {
toolTip: fa._("Tween.curve")
}), a._curveButton = f.curveButton({})], 60)),
a._curveButton.bezierCurve = c.propMap[d].curve,
a._curveButton.fromActionEditor = !0,
a._curveButton.isAngle = "angleInput" === l ? !0 : !1,
a._curveButton.rangeY = {
min: m.min,
max: m.max
},
a._curveButton.on("close", function() {
a.inspect(b, c, d);
var e = c.path + ":" + c.propertyId + "~" + d;
fa.actionEditor.timeLine.gvFrame.redrawAttrib(e, c, d),
fa.actionEditor.updateActionFrame(!0)
});
var r, s = c.getValue(d, e, !0);
"angleInput" === l && j < qc.CURVE_TYPE_TWEEN_RELATIVE && (s = s / Math.PI * 180),
q.add(f.line([f.empty(), f.text("Value", {
"for": "curveValue",
dragStep: .1
}), r = f[l]({
value: s,
id: "curveValue",
bind: d,
min: m.min,
max: m.max,
precision: m.precision
}, null, function(a) {
if (!this._updating) {
e = fa.actionEditor.timeLine.guidePos,
"angleInput" === l && j < qc.CURVE_TYPE_TWEEN_RELATIVE && (a = a / 180 * Math.PI);
var b = c.setValue(d, e, a);
b && fa.actionEditor.addKey(c, d, e, a, !0),
fa.actionEditor.updateActionFrame(!0)
}
})])),
r.valueFunc = function(a, b) {
var c = a.propOb
, d = (a.target,
a.attrib);
a._curveButton.iv();
var e = c.getValue(d, b, !0);
return "angleInput" === l && j < qc.CURVE_TYPE_TWEEN_RELATIVE && (e = e / Math.PI * 180),
e
}
}),
fa.extend.inspector("qc.KeyPropAnimationdefaultAnimation", function() {
var a = this.target
, b = this.propOb
, c = (this.attrib,
fa.actionEditor.timeLine.guidePos)
, d = qc.editor.gui
, e = ["120+0.4", "90+0.5"];
d.columnWidths = e;
var f = [];
a.targetObject && a.targetObject.find(b.path) && a.targetObject.find(b.path).animationNameList ? f = ["none"].concat(a.targetObject.find(b.path).animationNameList) : f.push("");
var g = b.getValue("defaultAnimation", c, !0);
!g && a.targetObject && a.targetObject.find(b.path) && a.targetObject.find(b.path).defaultAnimation && (g = a.targetObject.find(b.path).defaultAnimation),
g || (g = f.length <= 1 ? "" : "none");
var h;
d.line([d.text("Default Animation", {
toolTip: "defaultAnimation"
}), h = d.dropDownList({
items: f,
value: g,
bind: "defaultAnimation"
}, null, function(a) {
if (!this._updating) {
c = fa.actionEditor.timeLine.guidePos,
"none" === a && (a = "");
var d = b.setValue("defaultAnimation", c, a);
d && fa.actionEditor.addKey(b, "defaultAnimation", c, a, !0),
fa.actionEditor.updateActionFrame(!0)
}
})]),
h.valueFunc = function(a, b) {
var c = a.propOb
, d = a.target
, e = [];
d.targetObject && d.targetObject.find(c.path) && d.targetObject.find(c.path).animationNameList ? e = ["none"].concat(d.targetObject.find(c.path).animationNameList) : e.push("");
var f = c.getValue("defaultAnimation", b, !0);
return !f && d.targetObject && d.targetObject.find(c.path) && d.targetObject.find(c.path).defaultAnimation && (f = d.targetObject.find(c.path).defaultAnimation),
f || (f = e.length <= 1 ? "" : "none"),
h.items = e,
f
}
});
var Oc = m("qc.editor.ActionPropertyPanel", qc.editor.Panel, function ng(a, b, c) {
var d = this;
d.propOb = b,
d.attrib = c,
ng["super"].constructor.call(d, a),
d.title = b.propertyInfo.name,
d.checkable = !1,
d.removable = !1
});
Oc.prototype.defaultDraw = function() {
var a = this
, b = this.target
, c = this.propOb
, d = this.attrib
, e = ["95+0.1", "90+0.5"];
_.columnWidths = e;
for (var f, g, h = c.propertyInfo.properties, i = 0; i < h.length; i++)
if (h[i].attrib === d) {
g = h[i],
f = h[i].type;
break
}
if (f) {
var j = fa.actionEditor.timeLine.guidePos
, k = c.getValue(d, j)
, l = qc.Serializer;
switch (f) {
case l.INT:
var m = "intInput";
case l.NUMBER:
var m = "numberInput";
a.drawCommonField(d, null, m, {
id: "numberInput",
min: g.min,
max: g.max,
precision: g.precision,
value: k,
bind: d
}, function(a) {
if (!this._updating) {
j = fa.actionEditor.timeLine.guidePos;
var b = c.setValue(d, j, a);
b && fa.actionEditor.addKey(c, d, j, a, !0),
fa.actionEditor.updateActionFrame(!0)
}
});
break;
case l.STRING:
var m = "stringInput";
a.drawCommonField(d, null, m, {
value: k,
bind: d
}, function(a) {
if (!this._updating) {
j = fa.actionEditor.timeLine.guidePos;
var b = c.setValue(d, j, a);
b && fa.actionEditor.addKey(c, d, j, a, !0),
fa.actionEditor.updateActionFrame(!0)
}
});
break;
case l.BOOLEAN:
a.drawCommonField(d, null, "checkBox", {
selected: k,
bind: d,
bindKey: "selected"
}, function(a) {
if (!this._updating) {
j = fa.actionEditor.timeLine.guidePos;
var b = c.setValue(d, j, a);
b && fa.actionEditor.addKey(c, d, j, a, !0),
fa.actionEditor.updateActionFrame(!0)
}
});
break;
case l.COLOR:
a.drawCommonField(d, null, "colorPicker", {
"dropDown.colorChooser.alphaEnabled": !1,
value: k,
bind: d
}, function(a) {
if (!this._updating) {
j = fa.actionEditor.timeLine.guidePos;
var b = c.setValue(d, j, a);
b && fa.actionEditor.addKey(c, d, j, a, !0),
fa.actionEditor.updateActionFrame(!0)
}
});
break;
case l.TEXTURE:
_.columnWidths = ["60+0.1", "130+0.5"];
var b = {
bind: d
}
, n = k && k[0] ? k[0].getTexture(k[1]) : null;
!n && a.target.targetObject && a.target.targetObject.find(c.path) && (n = ec(a.target.targetObject.find(c.path), d)),
fc(b, d, n, !0);
var o = Gd.drawTextureInput(b, {
title: d,
toolTip: fa._("CUIImage.texture")
}, d, function(b) {
if (!this._updating) {
j = fa.actionEditor.timeLine.guidePos;
var e = b.match(/([^@]*)$/);
b = e ? e[1] : b;
var f = a.target.game.assets.find(b)
, g = [f];
f.json.frames && f.frameNames && (g[1] = f.frameNames[0]);
var h = c.setValue(d, j, g);
h && fa.actionEditor.addKey(c, d, j, g, !0),
fa.actionEditor.updateActionFrame(!0),
fa.actionEditor.timeLine.gvFrame.redrawTextureFrame(c, g, j),
a.inspect(a.target, c, d, !0)
}
});
o.id = "actionPropertyPanel_texture",
o.bindFunc = "setTextureObjectValue",
o.bindFuncParas = [null, !0],
o.valueFunc = function(a, b) {
var c = a.target
, e = a.propOb
, f = e.getValue(d, b, !0)
, g = f && f[0] ? f[0].getTexture(f[1]) : null;
return !g && c.targetObject && c.targetObject.find(e.path) && (g = ec(c.targetObject.find(e.path), d)),
g
}
;
var p, q = ec(b, d);
p = !q || q.atlas && !q.atlas.json.frames ? [0] : q ? q.atlas.frameNames : [0];
var r = k ? k[1] : 0;
p.indexOf(r) < 0 && (r = p[0]);
var s;
_.line([_.text("Frame", {
toolTip: fa._("CUIImage.frame")
}), s = _.dropDownList({
items: p,
value: r,
bind: "frame"
}, null, function(b) {
if (!this._updating) {
var e = [];
if (o) {
var f = o.associatedViewAndData;
if (f) {
var g = f.fileList;
"string" == typeof g ? f.fileList = [g, b] : g[1] = b
}
var h = o.value.match(/([^@]*)$/)
, i = h ? h[1] : ""
, k = fa.game.assets.find(i);
if (!k || !k.json.frames)
return;
e[0] = k
}
j = fa.actionEditor.timeLine.guidePos,
e[1] = b;
var l = c.setValue(d, j, e);
l && fa.actionEditor.addKey(c, d, j, e, !0),
fa.actionEditor.updateActionFrame(!0),
fa.actionEditor.timeLine.gvFrame.redrawTextureFrame(c, e, j),
a.inspect(a.target, c, d, !0)
}
})]),
s.valueFunc = function(a, b) {
var c, e = a.propOb, f = a.findViewById("actionPropertyPanel_texture"), g = f.value.match(/([^@]*)$/), h = g ? g[1] : "", i = fa.game.assets.find(h);
c = i && !i.json.frames ? [0] : i ? i.frameNames : [0];
var j = e.getValue(d, b, !0)
, k = j ? j[1] : 0;
return c.indexOf(k) < 0 && (k = c[0]),
s.items = c,
k
}
;
break;
case l.AUDIO:
_.columnWidths = ["60+0.1", "130+0.5"];
var b = {
bind: d
};
b[d] = k;
var t = Gd.drawSoundInput(b, Gd.makePropertyName(d), d, function(b) {
if (!this._updating) {
j = fa.actionEditor.timeLine.guidePos;
var e = a.target.game.assets.find(b)
, f = c.setValue(d, j, e);
f && fa.actionEditor.addKey(c, d, j, e, !0),
fa.actionEditor.updateActionFrame(!0)
}
});
t.bindFunc = "setObjectValue",
t.bindFuncParas = [!0]
}
}
}
,
Oc.prototype.paint = function() {
var a = this.propOb
, b = a.propertyInfo
, c = this.attrib;
this.title = b.name;
var d = fa.extend.findActionInspector(b["class"], b.name, c);
return d ? void d.call(this) : void this.defaultDraw()
}
,
Oc.prototype.inspect = function(a, b, c, d) {
!d && this.propOb && a === this.target && b.path === this.propOb.path && b.propertyId === this.propOb.propertyId && c === this.attrib ? (this.target = a,
this.propOb = b,
this.attrib = c,
this.updateCompValue()) : (this.target = a,
this.propOb = b,
this.attrib = c,
this.repaint(!0))
}
,
Oc.prototype.updateCompValue = function() {
var a = this
, b = a.propOb;
a.eachChildren(function(c) {
if (c.bind) {
var d = fa.actionEditor.timeLine.guidePos;
c._updating = !0;
var e;
if (e = c.valueFunc ? c.valueFunc(a, d) : b.getValue(c.bind, d),
c.bindFunc) {
var f = [e];
c.bindFuncParas && (f = f.concat(c.bindFuncParas)),
c[c.bindFunc].apply(c, f)
} else
c.bindKey ? c[c.bindKey] = e : c.value = e;
c._updating = !1
}
})
}
,
Oc.prototype.drawCommonField = function(a, b, c, d, e) {
var f, g;
d && d.id && (f = d.id,
g = .01),
_.line([_.text(Gd.makePropertyName(a), {
"for": f,
dragStep: g,
toolTip: b,
align: "left"
}), _[c](d, null, e)])
}
,
Oc.prototype.getCompAt = function(a) {
a = k.checkTouch(a);
var b = this
, c = a.target
, d = b.children;
if (d)
for (var e = 0; e < d.length; e++) {
var f = d[e];
if (f instanceof Qa) {
var g = f.eachChildren(function(a) {
return a.view.contains(c) ? !0 : void 0
});
if (g)
return g
}
}
}
,
yc.prototype._initMenu = function() {
var a = this
, b = a.menu = new qc.editor.ContextMenu([]);
b.on("action", function(b) {
b.item.func && ("function" == typeof b.item.func ? b.item.func() : a[b.item.func](b))
}),
b.addTo(a),
b.on("preShow", function(c) {
var d = a.getDataAt(c.event);
if (d)
b.items = [{
label: fa._("Delete Event"),
func: "handleDeleteEvent"
}],
b.data = d;
else {
b.items = [{
label: fa._("Add Event"),
func: "handleAdd"
}];
var e = a.lp(c.event)
, f = a.timeLineZoom
, g = Math.round(e.x / f / 8);
g = 0 > g ? 0 : g,
b.frame = g
}
})
}
,
yc.prototype.handleDeleteEvent = function() {
var a = this.getDataIndex(this.menu.data);
this.dataModel.remove(this.menu.data),
fa.actionEditor.action.deleteEvent(a),
fa.actionEditor.inspector.updatePropertyPanel()
}
,
yc.prototype.handleAdd = function() {
this.addEvent(this.menu.frame, !0)
}
,
zc.prototype._initMenu = function() {
var a = this
, b = a.menu = new qc.editor.ContextMenu([]);
b.on("action", function(b) {
b.item.func && ("function" == typeof b.item.func ? b.item.func() : a[b.item.func](b))
}),
b.addTo(a),
b.on("preShow", function(c) {
var d = a.getDataAt(c.event);
if (d)
b.items = [{
label: fa._("Delete Key"),
func: "handleDeleteFrame"
}],
b.data = d;
else {
b.items = [{
label: fa._("Add Key"),
func: "handleAdd"
}];
var e = a.lp(c.event)
, f = a.timeLineZoom
, g = Math.round(e.x / f / 8);
g = 0 > g ? 0 : g,
b.frame = g,
b.data = a.getDataByMouseEvent(c.event)
}
})
}
,
zc.prototype.removeFrame = function(a) {
var b = this;
if (a && b.dataModel.contains(a)) {
if (a.parent) {
var c = b.getDataIndex(a)
, d = a.a("key").match(/(.*):(.*)~(.*)/)
, e = d[1]
, f = d[2]
, g = d[3];
fa.actionEditor.action.deleteKey(e, f, g, c),
b.dataModel.remove(a.parent.children.length > 1 ? a : a.parent)
} else if (a.children) {
for (var h = 0; h < a.children.length; h++) {
var i = a.children[h]
, c = b.getDataIndex(i)
, d = i.a("key").match(/(.*):(.*)~(.*)/)
, e = d[1]
, f = d[2]
, g = d[3];
fa.actionEditor.action.deleteKey(e, f, g, c)
}
b.dataModel.remove(a)
}
fa.actionEditor.inspector.updatePropertyPanel(),
fa.actionEditor.inspector.nodePanel.updateDurationText()
}
}
,
zc.prototype.handleDeleteFrame = function() {
var a = this;
a.removeFrame(a.menu.data)
}
,
zc.prototype.handleAdd = function() {
var a = this.menu.data;
a && this.propertyTree.addKey(this.menu.frame, a.id, !0, a.parent, a.children)
}
,
Cc.prototype._initMenu = function() {
var a = this
, b = a.menu = new qc.editor.ContextMenu([]);
b.on("action", function(b) {
b.item.func && ("function" == typeof b.item.func ? b.item.func() : a[b.item.func](b))
}),
b.addTo(a),
b.on("preShow", function(c) {
var d = a.getDataAt(c.event);
if (d) {
var e = [];
if (d.parent)
e = [{
label: fa._("Copy"),
func: "handleCopy"
}, {
label: fa._("Paste"),
disabled: function() {
var a = d.id.match(/(.*):(.*)/);
if (a) {
var b = a[2];
if (fa.actionEditorCache[b])
return !1
}
return !0
},
func: "handlePaste"
}, {
type: "-"
}, {
label: fa._("Add Key"),
func: "handleAddKey"
}, {
label: fa._("Delete Key"),
func: "handleDeleteKey"
}];
else {
e = [{
label: fa._("Remove Properties"),
func: "handleRemoveProperties"
}, {
type: "-"
}, {
label: fa._("Copy"),
func: "handleCopy"
}, {
label: fa._("Paste"),
disabled: function() {
var a = d.id.match(/(.*):(.*)/);
if (a) {
var b = a[2];
if (fa.actionEditorCache[b])
return !1
}
return !0
},
func: "handlePaste"
}, {
type: "-"
}, {
label: fa._("Add Key"),
func: "handleAddKey"
}, {
label: fa._("Delete Key"),
func: "handleDeleteKey"
}];
var f = d.id.match(/(.*):(.*)/);
f && "/" != f[1] && (e.push({
type: "-"
}),
e.push({
label: fa._("Rename"),
func: "handleRename"
}))
}
b.items = e,
b.data = d
}
})
}
,
Cc.prototype.handleRename = function() {
var a, c, d = this.menu.data, e = d.id.match(/(.*):(.*)/);
e && (a = e[1]),
a && (e = a.match(/([^\/.]*)$/),
e && (c = e[1])),
a && c && Fb(fa._("Enter the new name"), c, function(d) {
if (d) {
if (c === d)
return;
var e = a.match(/([^\/.]*)$/);
if (!e)
return;
for (var f = a.substring(0, e.index) + d, g = fa.actionEditor.action, h = b.keys(g.propertyList), i = 0; i < h.length; i++) {
var j = h[i];
if (e = j.match(/(.*):(.*)/),
e && 0 === e[1].indexOf(a) && (e[1].length == a.length || "/" === e[1][a.length])) {
e[1].length != a.length && (f += e[1].substring(a.length));
var k = f + ":" + e[2];
g.propertyList[k] = g.propertyList[j],
g.propertyList[k].path = f,
delete g.propertyList[j]
}
}
fa.actionEditor.propertyTree.redrawTree()
}
})
}
,
Cc.prototype.handleRemoveProperties = function() {
var a = this;
a.removeProperty(a.menu.data)
}
,
Cc.prototype.handleCopy = function() {
var a, b = this.menu.data, c = b.id.match(/(.*):(.*)/), d = c[1], e = c[2], f = e;
c = e.match(/(.*)~(.*)/),
c && (f = c[1],
a = c[2]);
var g, h = d + ":" + f;
fa.actionEditor.action.propertyList[h] && (g = fa.actionEditor.action.propertyList[h].toJson({})),
fa.actionEditorCache = {},
fa.actionEditorCache[e] = {
value: g,
attrib: a
}
}
,
Cc.prototype.handlePaste = function() {
var a, b = this.menu.data, c = b.id.match(/(.*):(.*)/), d = c[1], e = c[2], f = e;
c = e.match(/(.*)~(.*)/),
c && (f = c[1],
a = c[2]);
var g = qc.ActionProperties[f];
if (!g)
return void this.game.log.important("Can't find propertyId : {0} in handlePaste", f);
var h = fa.actionEditorCache[e];
if (h) {
var i = h.value;
if (h.attrib)
for (var j = 0; j < g.properties.length; j++)
if (g.properties[j].attrib === h.attrib) {
var k = [];
k[j] = i[j],
i = k;
break
}
var l = d + ":" + f
, m = fa.actionEditor.action.propertyList[l];
if (m) {
var n = m.fromJson(g, i);
fa.actionEditor.action.duration < n && (fa.actionEditor.action.duration = n),
fa.actionEditorCache = {};
for (var j = 0; j < g.properties.length; j++) {
var a = g.properties[j].attrib;
fa.actionEditor.timeLine.gvFrame.redrawAttrib(l + "~" + a, m, a)
}
}
}
}
,
Cc.prototype.handleAddKey = function() {
var a = this.menu.data
, b = fa.actionEditor.timeLine.guidePos;
a && this.addKey(b, a.id, !0, a.parent, a.children)
}
,
Cc.prototype.handleDeleteKey = function() {
var a = this.menu.data;
if (a) {
var b = fa.actionEditor.timeLine.gvFrame.queryDatasByKeyAndFrame(a.id, fa.actionEditor.timeLine.guidePos);
fa.actionEditor.timeLine.gvFrame.removeFrame(b[0])
}
}
;
var Pc = m("qc.editor.animation.AMTimeLineBase", qc.widget.graph.GraphView, function og(a, b, c) {
var d = this;
og["super"].constructor.call(d),
d.pannable = !1,
d.scrollBarMode = "on",
d.scrollBarColor = "rgb(160, 160, 160)",
d.actionList = b,
d.actionListContainer = c,
d.actionManager = a,
d.on("propertyChange", function(a) {
"translateX" === a.property ? d.parent.setTranslateX(a.newValue, d) : "guidePos" === a.property ? d.parent.setGuidePos(a.newValue, d) : "endPos" === a.property ? d.parent.setEndPos(a.newValue, d) : "samples" === a.property && d.parent.setSamples(a.newValue, d)
});
var e = function(a) {
var b = d.getDataAt(a);
if (b)
if (d instanceof Sc) {
var c = b.position
, e = d.timeLineZoom
, f = Math.round(c.x / e / 8);
d.guidePos = 0 > f ? 0 : f,
d.preGuidePos = d.guidePos
} else
d instanceof Rc && d.actionManager.inspector.updateEventPanel(d.getDataIndex(b))
};
d.view.addEventListener("mousedown", function(a) {
e(a)
})
});
Pc.prototype._rectSelectBorderColor = "rgb(90, 107, 132)",
Pc.prototype._samples = 60,
Pc.prototype._timeLineZoom = 1,
Pc.prototype._translateX = 15,
Pc.prototype._guidePos = 0,
Pc.prototype._endPos = 0,
Pc.prototype.syncPosition = function(a) {
var b = this
, c = b.timeLineZoom
, d = b.actionList
, e = d.rowHeight;
if (a && !a._syncToFrame) {
var f = a.a("frame");
if (null != f) {
if (a._syncToPosition = !0,
b instanceof Sc) {
var g = a.id
, h = d.rowDatas.indexOf(d.dataModel.getDataById(g));
a.position = {
x: f * c * 8,
y: e * h
};
var i = b.width - b.translateX
, j = !1;
a.s("shape.info") && a.s("shape.info").loop && (j = !0),
a.setWidth(a.a("duration"), j, c, i)
} else
b instanceof Rc && (a.position = {
x: f * c * 8,
y: a.height / 2
});
delete a._syncToPosition
}
}
}
,
Pc.prototype.adjustTranslateX = function(a) {
return a >= 15 ? 15 : a
}
,
Pc.prototype.adjustTranslateY = function(a) {
return a > 0 ? 0 : a
}
,
Pc.prototype.getDataIndex = function(a) {
var b = this
, c = [];
if (b instanceof Sc) {
var d = a.a("index");
b.dataModel.datas.forEach(function(a) {
a.a("index") === d && c.push(a)
})
} else
b instanceof Rc && (c = b.dataModel.datas);
return c.sort(function(a, b) {
var c = a.a("frame") - b.a("frame");
return 0 > c ? -1 : c > 0 ? 1 : 0
}),
c.indexOf(a)
}
,
Pc.prototype.scrollZoomIn = function(a) {
this.setTimeLineZoom(this.timeLineZoom * this._scrollZoomIncrement, null, a)
}
,
Pc.prototype.scrollZoomOut = function(a) {
this.setTimeLineZoom(this.timeLineZoom / this._scrollZoomIncrement, null, a)
}
,
Pc.prototype.pinchZoomIn = function(a) {
this.setTimeLineZoom(this.timeLineZoom * this._pinchZoomIncrement, null, a)
}
,
Pc.prototype.pinchZoomOut = function(a) {
this.setTimeLineZoom(this.timeLineZoom / this._pinchZoomIncrement, null, a)
}
,
Pc.prototype.resetPosition = function() {
for (var a = this, b = a.dataModel.datas, c = 0; c < b.length; c++) {
var d = b[c];
a.syncPosition(d)
}
}
,
Pc.prototype.lp = function(a) {
var b = this
, c = b._interactionDiv.getBoundingClientRect()
, d = k.isNumber(b.translateX) ? b.translateX : 0
, e = k.isNumber(b.translateY) ? b.translateY : 0;
return a = k.checkTouch(a),
{
x: a.clientX - c.left - d,
y: a.clientY - c.top - e
}
}
,
Pc.prototype.calculateViewRect = function() {
var a = this
, b = a.translateX
, c = a.translateY
, d = a.width
, e = a.height
, f = {
x: -b,
y: -c,
width: d,
height: e
};
return f
}
,
Pc.prototype.setTimeLineZoom = function(a, b, c) {
if (!(.006 > a || a > 16)) {
var d = this;
if (a !== d._timeLineZoom) {
d.validate();
var e = d._viewRect
, f = d._timeLineZoom;
if (0 !== e.width && 0 !== e.height) {
c = c ? c : {
x: e.x + e.width / 2,
y: e.y + e.height / 2
};
var g = c.x / f
, h = e.x / f
, i = d.parent._ignoreSyncTranslateX;
d.parent._ignoreSyncTranslateX = !0,
d.translateX = (g - h) * f - g * a,
d.parent._ignoreSyncTranslateX = i
}
d._timeLineZoom = a,
d.epc("timeLineZoom", f, a),
d.parent.setTimeLineZoom(a, b, c, d),
d.resetPosition()
}
}
}
,
Pc.prototype.paintGuide = function(a) {
var b = this
, c = 8
, d = b.height
, e = b.translateY
, f = b.timeLineZoom
, g = c * f;
a.beginPath();
var h = b.guidePos;
null != h && (a.moveTo(h * g, -e),
a.lineTo(h * g, -e + d),
a.strokeStyle = "red",
a.stroke())
}
,
Pc.prototype.paintEndLine = function(a) {
if (this.actionManager && this.actionManager.actionManager && !(this.actionManager.actionManager.endLinePos <= -1)) {
var b = this
, c = 8
, d = b.height
, e = b.translateY
, f = b.timeLineZoom
, g = c * f;
a.beginPath();
var h = b.actionManager.actionManager.endLinePos;
null != h && (a.moveTo(h * g, -e),
a.lineTo(h * g, -e + d),
a.strokeStyle = "green",
a.stroke())
}
}
,
b.defineProperties(Pc.prototype, {
timeLineZoom: {
get: function() {
return this._timeLineZoom
},
set: function(a) {
var b = this._timeLineZoom;
b !== a && this.setTimeLineZoom(a)
}
},
guidePos: {
get: function() {
return this._guidePos
},
set: function(a) {
var b = this._guidePos;
b !== a ? this.setPropertyValue("guidePos", a) : this.parent.setGuidePos(a, this)
}
},
endPos: {
get: function() {
return this._endPos
},
set: function(a) {
var b = this._endPos;
b !== a ? this.setPropertyValue("endPos", a) : this.parent.setEndPos(a, this)
}
},
samples: {
get: function() {
return this._samples
},
set: function(a) {
var b = this._samples;
b !== a && this.setPropertyValue("samples", a)
}
}
});
var Qc = m("qc.editor.animation.AMTimeLineHeader", Pc, function pg(a, b) {
var c = this;
pg["super"].constructor.call(c, a, b),
c.scrollBarMode = "off",
c.actionManager = a,
c.addTopPainter(c.paintTop.bind(c)),
c.rectSelectable = !1,
new Zc(c)
});
Qc.prototype.adjustTranslateY = function() {
return 0
}
,
Qc.prototype.paintTop = function(a) {
for (var b, c, d, e, f = this, g = f._samples, h = 8, i = [1, 5, 10, 30, 60, 300, 1800, 3600], j = f.width, k = f.height, l = f.translateX, m = f.translateY, n = f.timeLineZoom, o = h * n, p = 0, q = 0; q < i.length - 1; q++) {
var r = i[q];
if (p = o * r,
q >= 1 && (e = 40 * (r / i[q - 1])),
p >= 40) {
b = i[q],
q >= 1 && (c = i[q - 1],
q >= 2 && (d = i[q - 2]));
break
}
}
a.beginPath(),
a.rect(-l, -m, j, 16),
a.fillStyle = "rgb(44, 51, 57)",
a.fill();
var s, t, u, v;
0 > l ? (t = Math.floor(-l / o),
u = t * o) : (t = 0,
u = 0),
v = -l - u,
0 > v && (v = 0),
a.beginPath(),
s = t;
for (var q = u; u + j + v > q; q += o)
d && s % d === 0 && (a.moveTo(q, -m + 12),
a.lineTo(q, -m + 16)),
s++;
a.strokeStyle = "rgb(105, 130, 146)",
a.stroke(),
a.beginPath(),
s = t;
for (var q = u; u + j + v > q; q += o)
c && s % c === 0 && (a.moveTo(q, -m + 8),
a.lineTo(q, -m + 16)),
s++;
a.strokeStyle = "rgb(105, 130, 146)",
a.stroke(),
a.beginPath(),
s = t;
for (var q = u; u + j + v > q; q += o)
s % b === 0 && (a.moveTo(q, -m + 5),
a.lineTo(q, -m + 16)),
s++;
a.strokeStyle = "rgb(105, 130, 146)",
a.stroke(),
a.beginPath(),
a.font = "10px Arial",
a.fillStyle = "rgb(105, 130, 146)",
s = t;
for (var q = u; u + j + v > q; q += o) {
if (s % b === 0) {
var w, x = Math.floor(s / g) || 0, y = s % g;
w = 10 > y ? x + ":0" + y : x + ":" + y,
a.fillText(w, q + 2, -m + 10)
}
s++
}
a.fill(),
a.beginPath();
var z = f.guidePos;
if (null != z && (a.rect(z * o - 3, -m, 6, k),
a.fillStyle = "rgba(255, 0, 0, 0.5)",
a.strokeStyle = "red",
a.fill(),
a.stroke()),
f.actionManager && f.actionManager.actionManager && f.actionManager.actionManager.endLinePos > -1) {
a.beginPath();
var A = f.actionManager.actionManager.endLinePos;
null != A && (a.rect(A * o - 3, -m, 6, k),
a.fillStyle = "rgba(0, 255, 0, 0.5)",
a.strokeStyle = "green",
a.fill(),
a.stroke())
}
}
;
var Rc = m("qc.editor.animation.AMTimeLineEvent", Pc, function qg(a, b) {
var c = this;
qg["super"].constructor.call(c, a, b),
c.scrollBarMode = "off",
c.addBottomPainter(c.paintBottom.bind(c)),
c.view.style.background = "rgb(44, 45, 49)",
c.actionManager = a,
c.dataModel.selectionModel.on("selectionChange", function() {
var a = c.dataModel.selectionModel.selection;
c.dataModel.datas.forEach(function(a) {
a.s("shape.background", "rgb(110, 144, 149)")
}),
a.forEach(function(a) {
a.s("shape.background", "rgb(252, 157, 110)")
})
}),
c.dataModel.on("dataModelChange", function(a) {
if ("add" === a.kind) {
var b = a.data;
c.syncPosition(b)
}
}),
c.dataModel.on("dataPropertyChange", function(a) {
var b = a.source
, d = c.timeLineZoom;
if ("position" === a.property) {
if (!b._syncToPosition) {
var e = b.position;
b._syncToFrame = !0,
b.a("frame", Math.round(e.x / d / 8)),
delete b._syncToFrame
}
} else
"a:frame" === a.property && c.syncPosition(b)
}),
c.on("interaction", c.handleInteraction.bind(c)),
c.interactors = [new qc.widget.graph.PinchInteractor(c), new qc.widget.graph.ScrollBarInteractor(c), new qc.widget.graph.SelectInteractor(c), new $c(c), new qc.widget.graph.BasicInteractor(c)],
c._initMenu()
});
Rc.prototype.handleDelete = function() {
if (this.actionManager && this.actionManager.actionManager) {
for (var a = this.selection.slice(0), b = 0; b < a.length; b++) {
var c = a[b]
, d = this.getDataIndex(c);
this.dataModel.remove(c),
this.actionManager.actionManager.deleteEvent(d)
}
this.actionManager.inspector.updateActionInfoPanel()
}
}
,
Rc.prototype.adjustTranslateY = function() {
return 0
}
,
Rc.prototype.handleInteraction = function(a) {
var b = this
, c = b.selectionModel.selection;
if (b.actionManager && b.actionManager.actionManager)
if ("beginMove" === a.kind)
for (var d = 0; d < c.length; d++) {
var e = c[d];
e.a("index", b.getDataIndex(e))
}
else if ("endMove" === a.kind)
for (var d = 0; d < c.length; d++) {
var e = c[d]
, f = e.a("index")
, g = b.actionManager.actionManager.getEventInfo(f);
g && (b.actionManager.actionManager.deleteEvent(f),
b.actionManager.actionManager.addEvent(e.a("frame"), g.func, g.para))
}
}
,
Rc.prototype.addEvent = function(a, b) {
var c = new qc.editor.animation.EventNode;
c.a("frame", a),
this.dataModel.add(c),
b && this.actionManager.actionManager.addEvent(a)
}
,
Rc.prototype.paintBottom = function(a) {
for (var b, c, d, e, f = 8, g = [1, 5, 10, 30, 60, 300, 1800, 3600, 18e3], h = this, i = h.width, j = h.height, k = h.translateX, l = h.translateY, m = h.timeLineZoom, n = f * m, o = 0, p = 0; p < g.length - 1; p++) {
var q = g[p];
if (o = n * q,
p >= 1 && (e = 40 * (q / g[p - 1])),
o >= 40) {
b = g[p],
p >= 1 && (c = g[p - 1],
p >= 2 && (d = g[p - 2]));
break
}
}
var r, s, t, u;
0 > k ? (s = Math.floor(-k / n),
t = s * n) : (s = 0,
t = 0),
u = -k - t,
0 > u && (u = 0),
a.beginPath(),
r = s;
for (var p = t; t + i + u > p; p += n)
r % b === 0 && (a.moveTo(p, -l),
a.lineTo(p, -l + j)),
r++;
a.strokeStyle = "rgb(80, 80, 80)",
a.stroke(),
h.paintGuide(a),
h.paintEndLine(a)
}
;
var Sc = m("qc.editor.animation.AMTimeLineFrame", Pc, function rg(a, b, c) {
var d = this;
rg["super"].constructor.call(d, a, b, c),
d.addBottomPainter(d.paintBottom.bind(d)),
d.addTopPainter(d.paintTop.bind(d)),
d._finishSelect = !1,
d.actionManager = a,
d.dataModel.selectionModel.on("selectionChange", d._handleSelectionChange.bind(d)),
d.dataModel.on("dataModelChange", function(a) {
if ("add" === a.kind) {
var b = a.data;
d.syncPosition(b)
}
d.redraw()
}),
d.on("interaction", d.handleInteraction.bind(d)),
d.dataModel.on("dataPropertyChange", function(a) {
var b = a.source
, c = d.timeLineZoom;
if ("position" === a.property) {
if (!b._syncToPosition) {
var e = b.position;
b._syncToFrame = !0,
b.a("frame", Math.round(e.x / c / 8)),
delete b._syncToFrame
}
} else
"a:frame" === a.property && d.syncPosition(b)
}),
d.on("propertyChange", function(a) {
if ("width" === a.property || "translateX" === a.property || "timeLineZoom" === a.property)
for (var b = d.dataModel, c = 0; c < b.datas.length; c++) {
var e = b.datas[c]
, f = e.a("realDuration")
, g = e.a("samples")
, h = d.actionManager.actionManager.samples
, i = e.getDuration(f, h, g, e.a("speed"));
e.a("duration", i);
var j = d.width - d.translateX
, k = !1;
e.s("shape.info") && e.s("shape.info").loop && (k = !0),
e.setWidth(i, k, d.timeLineZoom, j)
}
}),
d.visibleFunc = function(a) {
var c = b.dataModel.getDataById(a.id);
return b.isVisible(c) && b.rowDatas.indexOf(c) >= 0
}
,
d.interactors = [new qc.widget.graph.PinchInteractor(d), new qc.widget.graph.ScrollBarInteractor(d), new Yc(d), new $c(d), new qc.widget.graph.BasicInteractor(d)],
d._initMenu()
});
Sc.prototype.getDataByMouseEvent = function(a) {
var b = this
, c = b.lp(a)
, d = b.actionList
, e = d.rowDatas
, f = d.rowHeight
, g = e[Math.ceil(c.y / f) - 1];
return g
}
,
Sc.prototype.handleInteraction = function(a) {
var b = this;
if (b.actionManager && b.actionManager.actionManager) {
var d = b.selectionModel.selection;
if ("betweenMove" === a.kind) {
var e = a.moveFrameX;
b.guidePos = b.preGuidePos + e,
b.preGuidePos = b.guidePos
} else if ("endMove" === a.kind) {
b.edgeData && (b.edgeData = c,
b.edgeType = c);
for (var f = 0; f < d.length; f++) {
var g = d[f]
, h = g.a("index")
, i = Math.round(g.position.x / 8 / b.timeLineZoom);
b.actionManager.actionManager.updateActionTime(h, i)
}
b.actionManager.inspector.updateActionInfoPanel(),
b.actionManager.inspector.nodePanel.updateDurationText(),
b.actionManager.updateCurrentFrame(!0)
} else if ("doubleClickData" === a.kind) {
var g = a.data
, j = b.actionManager.actionManager.actionList[g.a("index")];
if (!j)
return;
var k = j[1];
k instanceof qc.Action ? ac(g.a("url"), k.targetObject) : k instanceof qc.ActionManager && bc(g.a("url"), k.targetObject)
}
}
}
,
Sc.prototype.removeDataByKey = function(a) {
var b = this
, c = b.queryDatasByKey(a);
c.forEach(function(a) {
b.dataModel.remove(a)
})
}
,
Sc.prototype.queryDatasByKey = function(a) {
var b = this
, c = b.dataModel
, d = [];
return c.datas.forEach(function(b) {
b.a("index") === a && d.push(b)
}),
d
}
,
Sc.prototype.queryDatasByKeyAndFrame = function(a, b) {
var c = this
, d = c.dataModel
, e = [];
return d.datas.forEach(function(c) {
c.a("index") === a && c.a("frame") == b && e.push(c)
}),
e
}
,
Sc.prototype.paintBottom = function(a) {
for (var b, c, d, e, f = 8, g = [1, 5, 10, 30, 60, 300, 1800, 3600], h = this, i = h.width, j = h.height, k = h.translateX, l = h.translateY, m = h.timeLineZoom, n = f * m, o = 0, p = 0; p < g.length - 1; p++) {
var q = g[p];
if (o = n * q,
p >= 1 && (e = 40 * (q / g[p - 1])),
o >= 40) {
b = g[p],
p >= 1 && (c = g[p - 1],
p >= 2 && (d = g[p - 2]));
break
}
}
var r = h.actionList
, s = r.rowHeight
, t = r.rowDatas
, u = 0;
a.beginPath(),
a.fillStyle = "rgb(49, 49, 49)",
a.rect(-k, 0, i, t.length * s),
a.fill();
for (var p = 0; p < t.length; p++) {
a.beginPath();
var v = t[p];
a.fillStyle = v.parent ? "rgb(52, 55, 60)" : "rgb(49, 50, 54)",
a.rect(-k, u + s * p + 1, i, s - 3),
a.fill()
}
var w, x, y, z;
0 > k ? (x = Math.floor(-k / n),
y = x * n) : (x = 0,
y = 0),
z = -k - y,
0 > z && (z = 0),
a.beginPath(),
w = x;
for (var p = y; y + i + z > p; p += n)
d && w % d === 0 && (a.moveTo(p, -l),
a.lineTo(p, -l + j)),
w++;
a.strokeStyle = "rgb(47, 56, 61)",
a.stroke(),
a.beginPath(),
w = x;
for (var p = y; y + i + z > p; p += n)
c && w % c === 0 && (a.moveTo(p, -l),
a.lineTo(p, -l + j)),
w++;
a.strokeStyle = "rgb(47, 56, 61)",
a.stroke(),
a.beginPath(),
w = x;
for (var p = y; y + i + z > p; p += n)
w % b === 0 && (a.moveTo(p, -l),
a.lineTo(p, -l + j)),
w++;
a.strokeStyle = "rgb(54, 63, 68)",
a.stroke()
}
,
Sc.prototype.paintTop = function(a) {
this.paintGuide(a),
this.paintEndLine(a)
}
,
Sc.prototype._handleSelectionChange = function() {
var a = this
, b = a.dataModel.selectionModel.selection;
a.dataModel.datas.forEach(function(a) {
a.s("shape.background", "rgb(110, 144, 149)")
}),
b.forEach(function(a) {
a.s("shape.background", "rgb(252, 157, 110)")
});
for (var c, d = [], e = 0; e < b.length; e++) {
var f = b[e]
, g = a.actionList
, h = g.dataModel.getDataById(f.id);
g.selectionModel.isSelected(h) || (c = !0),
d.push(h)
}
(a.actionList.dataModel.selectionModel.selection.length !== b.length || c && d.length > 0) && (a.actionList.dataModel.selectionModel.selection = d)
}
,
Sc.prototype.adjustTranslateY = function(a) {
if (a > 0)
return 0;
var b = this.scrollRect
, c = this.viewRect;
return -a + c.height > b.height ? c.height - b.height : a
}
,
Sc.prototype.selectAction = function(a) {
var b = this
, c = a.position
, d = b.timeLineZoom
, e = Math.round(c.x / d / 8);
b.guidePos = 0 > e ? 0 : e;
var f = b.selectionModel;
f.isSelected(a) || (f.selection = a),
b.actionManager.inspector.updateActionInfoPanel(a.id)
}
,
Sc.prototype.drawAction = function(a, b, c) {
var d = c.getDuration(!1, !0)
, e = this.actionManager.actionManager.samples
, f = c.samples
, g = this.queryDatasByKey(b)
, h = this.width - this.translateX;
if (g[0]) {
g[0].a("frame", a),
g[0].a("url", c.key),
g[0].a("realDuration", d),
g[0].a("speed", c.speed),
g[0].a("amSamples", e),
g[0].a("samples", f);
var i = g[0].getDuration(d, e, f, c.speed);
g[0].a("duration", i),
g[0].s("shape.info", {
loop: c.loop
}),
g[0].setWidth(i, c.loop, this.timeLineZoom, h)
} else {
var j = new qc.editor.animation.AMFrameNode;
j.a("frame", a),
j.a("index", b),
j.a("url", c.key),
j.id = b,
j.a("realDuration", d),
j.a("speed", c.speed),
j.a("amSamples", e),
j.a("samples", f);
var i = j.getDuration(d, e, f, c.speed);
j.a("duration", i),
j.s("shape.info", {
loop: c.loop
}),
j.setWidth(i, c.loop, this.timeLineZoom, h),
this.dataModel.add(j)
}
}
,
Sc.prototype.getPreNextFrame = function(a) {
var b = this
, c = b.dataModel.datas;
if (c.length <= 0)
return [];
c.sort(function(a, b) {
var c = a.a("frame") - b.a("frame");
return 0 > c ? -1 : c > 0 ? 1 : 0
});
for (var d = !1, e = !1, f = 0; f < c.length; f++) {
var g = c[f]
, h = g.a("frame");
if (a > h)
d = h;
else if (h !== a) {
e = h;
break
}
}
return "boolean" == typeof d && a >= c[0].a("frame") && (d = c[0].a("frame")),
"boolean" == typeof e && a <= c[c.length - 1].a("frame") && (e = c[c.length - 1].a("frame")),
[d, e]
}
,
b.defineProperties(Sc.prototype, {
scrollRect: {
get: function() {
var a = this
, b = a._viewRect
, c = a.contentRect
, d = k.unionRect(c, b);
d.width += d.x,
d.height += d.y,
d.x = 0,
d.y = 0;
var e = a.actionListContainer;
return e && (d.height = e.scrollRect.height),
d
}
}
});
var Tc = m("qc.editor.animation.AMTimeLinePane", qc.widget.Container, function sg(a, b, c) {
var d = this;
sg["super"].constructor.call(d);
var e = d.layout = new qc.widget.layout.TableLayout(d);
e.padding = 0,
e.cellPadding = 0,
d.actionManager = a;
var f = d.gvHeader = new Qc(a,b,c)
, g = d.gvEvent = new Rc(a,b,c)
, h = d.gvFrame = new Sc(a,b,c);
d.setItems([{
height: 22,
widths: [.1],
cells: [{
element: f
}]
}, {
height: 22,
widths: [.1],
cells: [{
element: g
}]
}, {
height: .1,
widths: [.1],
cells: [{
element: h
}]
}]),
d.scrollBarMode = "off",
d.actionList = b
});
Tc.prototype._samples = Pc.prototype._samples,
Tc.prototype._timeLineZoom = Pc.prototype._timeLineZoom,
Tc.prototype._guidePos = Pc.prototype._guidePos,
Tc.prototype._endPos = Pc.prototype._endPos,
Tc.prototype.setTranslateX = function(a, b) {
var c = this;
c._ignoreSyncTranslateX || (c._ignoreSyncTranslateX = !0,
b !== c.gvHeader && (c.gvHeader.translateX = a),
b !== c.gvEvent && (c.gvEvent.translateX = a),
b !== c.gvFrame && (c.gvFrame.translateX = a),
delete c._ignoreSyncTranslateX)
}
,
Tc.prototype.setGuidePos = function(a, b) {
var c = this;
c._ignoreSyncGuidePos || (c.setPropertyValue("guidePos", a),
c._ignoreSyncGuidePos = !0,
b !== c.gvHeader && (c.gvHeader.guidePos = a),
b !== c.gvEvent && (c.gvEvent.guidePos = a),
b !== c.gvFrame && (c.gvFrame.guidePos = a),
c.actionManager.updateCurrentFrame(),
delete c._ignoreSyncGuidePos)
}
,
Tc.prototype.setEndPos = function(a, b) {
var c = this;
c._ignoreSyncEndPos || (c.setPropertyValue("endPos", a),
c.actionManager && c.actionManager.actionManager && (c.actionManager.actionManager.endLinePos = a),
c.actionManager.inspector && c.actionManager.inspector.nodePanel && c.actionManager.inspector.nodePanel.updateDurationText(),
c._ignoreSyncEndPos = !0,
b !== c.gvHeader && (c.gvHeader.endPos = a),
b !== c.gvEvent && (c.gvEvent.endPos = a),
b !== c.gvFrame && (c.gvFrame.endPos = a),
c.actionManager.updateCurrentFrame(),
delete c._ignoreSyncEndPos)
}
,
Tc.prototype.setSamples = function(a, b) {
var c = this;
c._ignoreSyncSamples || (c.setPropertyValue("samples", a),
c._ignoreSyncSamples = !0,
b !== c.gvHeader && (c.gvHeader.samples = a),
b !== c.gvEvent && (c.gvEvent.samples = a),
b !== c.gvFrame && (c.gvFrame.samples = a),
c.actionManager && c.actionManager.actionManager && (c.actionManager.actionManager.samples = a),
delete c._ignoreSyncSamples)
}
,
Tc.prototype.setTimeLineZoom = function(a, b, c, d) {
var e = this;
e._ignoreSyncTimeLineZoom || (e._timeLineZoom = a,
e._ignoreSyncTimeLineZoom = !0,
d !== e.gvHeader && e.gvHeader.setTimeLineZoom(a, b, c),
d !== e.gvEvent && e.gvEvent.setTimeLineZoom(a, b, c),
d !== e.gvFrame && e.gvFrame.setTimeLineZoom(a, b, c),
delete e._ignoreSyncTimeLineZoom)
}
,
Tc.prototype.addAction = function(a, b, c) {
this.gvFrame.drawAction(a, b, c)
}
,
b.defineProperties(Tc.prototype, {
timeLineZoom: {
get: function() {
return this._timeLineZoom
},
set: function(a) {
var b = this;
b.setTimeLineZoom(a)
}
},
guidePos: {
get: function() {
return this._guidePos
},
set: function(a) {
var b = this;
b.setGuidePos(a)
}
},
endPos: {
get: function() {
return this._endPos
},
set: function(a) {
var b = this;
b.setEndPos(a)
}
},
samples: {
get: function() {
return this._samples
},
set: function(a) {
var b = this;
b.setSamples(a)
}
},
guideSecond: {
get: function() {
return this._guidePos / this._samples
}
}
});
var Uc = m("qc.editor.ActionManagerNodePanel", qc.editor.Panel, function tg(a, b) {
var c = this;
tg["super"].constructor.call(c, b),
c.actionManager = a,
c.title = "qc.ActionManager",
c.checkable = !1,
c.removable = !1,
c.lockable = !1
});
Uc.prototype.paint = function() {
var a = this
, b = a.target;
_.columnWidths = ["95+0.1", "90+0.5"],
_.line([_.text("Name", {
toolTip: fa._("CNode.name")
}), _.stringInput({
value: b.name
}, null, function(a) {
b.name = a
})]);
var c = Gd.drawNodeRef(b, "targetObject")
, d = c.row.cells[1].element;
d.id = "actionManagerNodePanel_targetObject",
d.onValueChanged = function() {
a.actionManager.updateCurrentFrame(),
a.actionManager.inspector.updateActionInfoPanel()
}
,
_.line([_.text(Gd.makePropertyName("targetLocked"), {
align: "left",
toolTip: fa._("Target Locked")
}), _.checkBox({
selected: b.targetLocked
}, null, function(a) {
b.targetLocked = a
})]),
_.line([_.text(Gd.makePropertyName("loop"), {
align: "left",
toolTip: fa._("Loop")
}), _.checkBox({
selected: b.loop
}, null, function(a) {
b.loop = a
})]);
var e = b.endLinePos > -1 ? !0 : !1;
_.line([_.text(Gd.makePropertyName("endLine"), {
align: "left",
toolTip: fa._("endLine")
}), _.checkBox({
selected: e
}, null, function(c) {
if (c) {
for (var d = 0, e = 0; e < b.actionList.length; e++) {
var f = b.actionList[e];
if (f) {
var g = f[1].getDuration(!1, !0)
, h = f[0];
if (g === qc.MAX_DURATION)
d = qc.MAX_DURATION;
else {
var i = a.actionManager.actionManager.samples
, j = f[1].samples;
g = g * i / j,
h + g > d && (d = h + g)
}
}
}
a.actionManager.timeLine.endPos = d === qc.MAX_DURATION ? 60 : d
} else
a.actionManager.timeLine.endPos = -1;
a.updateDurationText()
})]);
var f = b.getDuration(!1, !0);
f = f === qc.MAX_DURATION ? "infinity" : Math.round(f).toString() + " (" + (f / b.samples).toFixed(2) + "s)";
var g;
_.line([_.text("Duration", {
align: "left",
toolTip: fa._("Duration")
}), g = _.text(f)]),
g.id = "durationText"
}
,
Uc.prototype.updateDurationText = function() {
var a = this.target
, b = a.getDuration(!1, !0);
b = b === qc.MAX_DURATION ? "infinity" : Math.round(b).toString() + " (" + (b / a.samples).toFixed(2) + "s)";
var c = this.findViewById("durationText");
c && (c.text = b)
}
;
var Vc = m("qc.editor.ActionManagerInspector", qc.widget.Container, function ug(a, b) {
var c = this;
ug["super"].constructor.call(c, b),
c.actionManager = a,
c.layout = new qc.widget.layout.VBoxLayout(c),
c.layout.padding = [0, 0, 0, 0],
c.layout.gap = 5,
c.actionInfoPanel = null,
c.eventPanel = null,
c.draw(),
new Pe(c)
});
Vc.prototype.updateActionInfoPanel = function(a) {
return this.eventIdx = null,
"number" == typeof a && (this.actionIdx = a),
this.actionInfoPanel ? void this.actionInfoPanel.inspect(this.actionIdx) : void (this.actionManager._timer || this.inspect(this.target))
}
,
Vc.prototype.updateEventPanel = function(a) {
return "number" == typeof a && (this.eventIdx = a),
this.eventPanel ? void this.eventPanel.inspect(this.target, this.eventIdx) : void this.inspect(this.target)
}
,
Vc.prototype.draw = function(a) {
this.eventIdx = null,
this.actionIdx = null,
this.inspect(a)
}
,
Vc.prototype.inspect = function(a) {
var b = this;
b.clear(),
b.target = a;
var c = b.eventIdx
, d = b.actionIdx
, e = []
, f = new qc.editor.ActionFilePanel(a,"ActionManager",b.actionManager);
if (e.push(f),
a) {
var g = b.nodePanel = new qc.editor.ActionManagerNodePanel(b.actionManager,a);
if (e.push(g),
"number" == typeof c) {
var h = b.eventPanel = new qc.editor.ActionEventPanel(a,c,b.actionManager);
e.push(h),
b.actionInfoPanel = null
} else if ("number" == typeof d) {
var i = b.actionInfoPanel = new qc.editor.ActionInfoPanel(b.actionManager,a,d);
e.push(i),
b.eventPanel = null
} else
b.eventPanel = null,
b.actionInfoPanel = null
}
b.setItems(e)
}
,
Vc.prototype.clear = function() {
var a = this
, b = a.children;
a.setItems([]),
b && b.forEach(function(a) {
a && a.dispose()
}),
a.target = null
}
,
Vc.prototype.getPanelInstance = function(a, b) {
return a === qc.editor.Panel || k.isSubClassOf(a, qc.editor.Panel) ? new a(b) : new a
}
,
Vc.prototype.getCompAt = function(a) {
a = k.checkTouch(a);
var b = this
, c = a.target
, d = b.children;
if (d)
for (var e = 0; e < d.length; e++) {
var f = d[e];
if (f instanceof Qa) {
var g = f.eachChildren(function(a) {
return a.view.contains(c) ? !0 : void 0
});
if (g)
return g
}
}
}
,
Vc.prototype.destroy = function() {}
;
var Wc = m("qc.editor.animation.ActionManager", qc.widget.Container, function vg() {
var a = this;
vg["super"].constructor.call(a);
var b = a.actionPane = new dd(a)
, c = a.actionList = b.actionList
, d = a.actionListContainer = b.actionListContainer
, e = a.txtFrame = b.txtFrame
, f = a.timeLine = new Tc(a,c,b.actionListContainer)
, g = a.inspector = new Vc(a)
, h = new qc.widget.layout.BorderLayout(a);
a.layout = h,
a.layout.splitterSize = 1,
a.layout.splitterColor = "rgb(54, 63, 68)",
a.layout.leftToggleVisible = !1,
a.layout.rightToggleVisible = !1,
a.background = "rgb(49, 50, 54)",
a.setItems([{
region: "left",
width: 220,
element: b
}, {
region: "center",
element: f
}, {
region: "right",
width: 220,
element: g
}]),
e.onValueChanged = function(b) {
a._syncGuidePosToTxtFrame || (a._syncGuidePosToTimeLine = !0,
f.guidePos = b,
delete a._syncGuidePosToTimeLine)
}
,
c.dataModel.on("dataModelChange", function() {
f.gvFrame.redraw()
}),
c.on("propertyChange", function(a) {
"calcdPreferredSize" === a.property && (f.gvFrame.resetPosition(),
f.gvFrame.redraw())
}),
d.on("propertyChange", function(b) {
"translateY" === b.property && (a._syncToPropertyTree || (a._syncToTimeLine = !0,
f.gvFrame.translateY = b.newValue,
delete a._syncToTimeLine))
}),
f.gvFrame.on("propertyChange", function(b) {
"translateY" === b.property && (a._syncToTimeLine || (a._syncToPropertyTree = !0,
d.translateY = b.newValue,
delete a._syncToPropertyTree))
}),
f.on("propertyChange", function(b) {
"guidePos" === b.property && (a._syncGuidePosToTimeLine || (a._syncGuidePosToTxtFrame = !0,
e.value = b.newValue,
delete a._syncGuidePosToTxtFrame))
}),
b.on("valueChange", function(b) {
if ("samples" === b.kind) {
var c = f.gvFrame.translateX
, d = f.samples;
f.samples = parseInt(b.newValue) || 60;
var e = f.timeLineZoom / (f.samples / d);
f.timeLineZoom = e,
f.setTranslateX(c),
g.inspect(a.actionManager)
}
}),
b.on("addEvent", function() {
if (a.actionManager) {
var b = a.timeLine.guidePos;
null != b && f.gvEvent.addEvent(b, !0)
}
}),
b.on("play", function() {
a.play()
}),
b.on("stop", function() {
a.stop()
}),
a.actionManager = null
});
Wc.prototype.onFileChanged = function(a, b) {
this.actionManager && (this.actionManager.destroy(),
this.actionManager = null),
a && (this.actionManager = qc.ActionManager.restoreBundle(a, fa.game, !0),
this.actionManager && b && (this.actionManager.targetObject = b)),
this.inspector.draw(this.actionManager);
var c = this.actionList;
if (c.resetDataModel(),
this.actionPane.disabled = !0,
this.timeLine.gvFrame.dataModel.clear(),
this.timeLine.gvEvent.dataModel.clear(),
this.timeLine.guidePos = 0,
this.actionManager) {
this.actionPane.disabled = !1,
this.actionPane.txtSamples.value = this.actionManager.samples,
this.timeLine.endPos = this.actionManager.endLinePos,
c.target = this.actionManager.targetObject,
c.parseActionList(this.actionManager.actionList);
for (var d = 0; d < this.actionManager.eventList.length; d++) {
var e = this.actionManager.eventList[d];
this.timeLine.gvEvent.addEvent(e[0])
}
this.updateCurrentFrame(!0)
}
}
,
Wc.prototype.updateCurrentFrame = function(a) {
if (this.actionManager && this.actionManager.targetObject) {
var b, c = this.timeLine.guidePos;
if ("number" == typeof this.deltaFrame)
b = 1e3 * (c - this.actionManager.elapsedFrame) / (this.timeLine.samples * this.actionManager.speed);
else {
b = 1e3 / this.timeLine.samples;
var d = function(a, b) {
a.elapsedFrame = b;
for (var c = 0; c < a.actionList.length; c++) {
var e = a.actionList[c];
if (e) {
var f = e[0]
, g = e[1];
b = a.elapsedFrame - f;
var h = a.samples
, i = g.samples;
b = b * i / h * g.speed,
b = -1 > b ? 0 : b,
g instanceof qc.Action && (g.elapsedFrame = b),
g instanceof qc.ActionManager && d(g, b)
}
}
};
d(this.actionManager, c - 1)
}
this.actionManager.startTime || (this.actionManager.startTime = this.actionManager.game.time.scaledTime),
this.actionManager.update(b, null, !0, a)
}
}
,
Wc.prototype.play = function() {
var a = this;
a.actionManager && a.actionManager.targetObject && (a.timeLine.guidePos >= a.actionManager.getDuration(!1, !0) && (a.actionManager.reset(),
a.deltaFrame = 1,
a.timeLine.guidePos = 0),
a._timer = a.actionManager.game.timer.loop(0, function() {
var b = a.actionManager.game.time.deltaTime
, c = Math.round(b * a.timeLine.samples * a.actionManager.speed / 1e3)
, d = a.timeLine.guidePos;
return a.actionManager.duration <= d ? void (a.actionManager.loop ? a.timeLine.guidePos = 0 : a.stop()) : (a.deltaFrame = c,
void (a.timeLine.guidePos = d + c))
}, a))
}
,
Wc.prototype.stop = function() {
var a = this;
a.actionManager && a.actionManager.targetObject && (a._timer && (a.actionManager.game.timer.remove(this._timer),
a._timer = null),
a.deltaFrame = null,
a.actionPane.btnRun._settingSelected = !0,
a.actionPane.btnRun.selected = !1,
delete a.actionPane.btnRun._settingSelected)
}
,
Wc.prototype.destroy = function() {
this.stop(),
this.timeLine.gvFrame.guidePos = 0,
this.inspector && this.inspector.destroy(),
this.inspector = null
}
,
b.defineProperties(Wc.prototype, {}),
Rc.prototype._initMenu = function() {
var a = this
, b = a.menu = new qc.editor.ContextMenu([]);
b.on("action", function(b) {
b.item.func && ("function" == typeof b.item.func ? b.item.func() : a[b.item.func](b))
}),
b.addTo(a),
b.on("preShow", function(c) {
var d = a.getDataAt(c.event);
if (d)
b.items = [{
label: fa._("Delete Event"),
func: "handleDeleteEvent"
}],
b.data = d;
else {
b.items = [{
label: fa._("Add Event"),
func: "handleAdd"
}];
var e = a.lp(c.event)
, f = a.timeLineZoom
, g = Math.round(e.x / f / 8);
g = 0 > g ? 0 : g,
b.frame = g
}
})
}
,
Rc.prototype.handleDeleteEvent = function() {
var a = this.getDataIndex(this.menu.data);
this.dataModel.remove(this.menu.data),
this.actionManager && this.actionManager.actionManager && (this.actionManager.actionManager.deleteEvent(a),
this.actionManager.inspector.updateActionInfoPanel())
}
,
Rc.prototype.handleAdd = function() {
this.addEvent(this.menu.frame, !0)
}
,
Sc.prototype._initMenu = function() {
var a = this
, b = a.menu = new qc.editor.ContextMenu([]);
b.on("action", function(b) {
b.item.func && ("function" == typeof b.item.func ? b.item.func() : a[b.item.func](b))
}),
b.addTo(a),
b.on("preShow", function(d) {
var e = a.getDataAt(d.event);
e ? (b.items = [{
label: fa._("Open"),
func: "handleOpen"
}],
b.data = e) : (b.items = [{
label: fa._("Open"),
func: "handleOpen",
disabled: !0
}],
b.data = c)
})
}
,
Sc.prototype.handleOpen = function() {
var a = this.menu.data;
if (a && this.actionManager && this.actionManager.actionManager) {
var b = this.actionManager.actionManager.actionList[a.a("index")];
if (!b)
return;
var c = b[1];
c instanceof qc.Action ? ac(a.a("url"), c.targetObject) : c instanceof qc.ActionManager && bc(a.a("url"), c.targetObject)
}
}
;
var Xc = m("qc.editor.animation.AMFrameNode", qc.widget.graph.Node, function wg() {
var a = this;
wg["super"].constructor.call(a),
a.s("shape", "action"),
a.s("shape.background", "rgb(145, 182, 250)"),
a.s("shape.border.color", "black"),
a.s("shape.border.width", 1),
a.s("select.width", 0),
a.width = 12,
a.height = 22,
a.anchor = {
x: 0,
y: 0
}
});
Xc.prototype.setWidth = function(a, b, c, d) {
var e = a === qc.MAX_DURATION ? a : 8 * a * c + 4;
this.width = e >= 2 * d ? d : e,
b && d > e && (this.width = d)
}
,
Xc.prototype.getDuration = function(a, b, c, d) {
var e = a;
return a !== qc.MAX_DURATION && (e = a * b / c / d),
e
}
;
var Yc = m(null, qc.widget.graph.SelectInteractor, function(a) {
Yc["super"].constructor.call(this, a)
}, {
handle_touchstart: function(a) {
var b = this
, d = b._graphView
, e = d._interactionState;
if (d.edgeData = c,
d.edgeType = c,
delete b._pendingCS,
!(k.getTouchCount(a) > 1 || e.editing || e.scrolling)) {
var f = d.getDataAt(a)
, g = d.selectionModel;
if (k.isCtrlDown(a)) {
if (k.isLeftButton(a) && f && !g.isSelected(f)) {
for (var h = [], i = 0; i < g.selection.length; i++)
h.push(g.selection[i]);
h.push(f),
g.selection = h
}
} else if (f) {
if (d.selectAction(f),
!f.s("shape.info").loop && f.a("duration") != qc.MAX_DURATION) {
var j = d.lp(a)
, l = f.width
, m = f.height;
if (j.x >= f.position.x && j.x <= f.position.x + 4 && j.y >= f.position.y + 5 && j.y <= f.position.y + m - 5)
return d.edgeData = f,
void (d.edgeType = 1);
if (j.x >= f.position.x + l - 4 && j.x <= f.position.x + l && j.y >= f.position.y + 5 && j.y <= f.position.y + m - 5)
return d.edgeData = f,
void (d.edgeType = 2)
}
} else
d.pannable ? b._pendingCS = k.getClientPoint(a) : k.isLeftButton(a) && (g.clearSelection(),
d.rectSelectable && (b.startDragging(a),
e.selecting = !0))
}
}
})
, Zc = m(null, b, function(a) {
var b = this;
b._graph = a,
b.addListeners()
}, {
handle_mousedown: function(a) {
this.handle_touchstart(a)
},
handle_touchstart: function(a) {
k.preventDefault(a);
var b = this
, d = b._graph
, e = d.lp(a);
if (e.y > 0 && e.y < 16) {
var f = 8 * d.endPos * d.timeLineZoom;
if (-1 != d.endPos && e.x >= f - 3 && e.x <= f + 3)
b.preEndPos = d.endPos;
else {
var g = Math.round(e.x / (8 * d.timeLineZoom));
d.guidePos = 0 > g ? 0 : g,
b.preGuidePos = d.guidePos,
b.preEndPos = c
}
k.startDragging(b, a)
}
},
handle_mouseup: function(a) {
this.handle_touchend(a)
},
handle_touchend: function() {},
handleWindowMouseMove: function(a) {
this.handleWindowTouchMove(a)
},
handleWindowTouchMove: function(a) {
var b = this
, c = b._graph
, d = c.lp(a);
if ("number" == typeof b.preEndPos) {
var e = Math.round(d.x / (8 * c.timeLineZoom));
e = 0 > e ? 0 : e,
b.preEndPos != e && (c.endPos = 0 > e ? 0 : e,
b.preEndPos = c.endPos)
} else {
var f = Math.round(d.x / (8 * c.timeLineZoom));
f = 0 > f ? 0 : f,
b.preGuidePos != f && (c.guidePos = 0 > f ? 0 : f,
b.preGuidePos = c.guidePos)
}
},
handleWindowMouseUp: function(a) {
this.handleWindowTouchEnd(a)
},
handleWindowTouchEnd: function() {},
handle_contextmenu: function(a) {
Y(a)
}
}, {
interactor: !0
}, {
view: {
get: function() {
return this._graph
}
}
})
, $c = k.define(null, qc.widget.graph.MoveInteractor, function(a) {
$c["super"].constructor.call(this, a)
}, {
handle_touchstart: function(a) {
this._startDraging = !1,
$c["super"].handle_touchstart.call(this, a)
},
handleWindowTouchMove: function(a) {
var b = this
, c = b._graphView
, d = {
kind: b._startDraging ? "betweenMove" : "beginMove",
event: a
}
, e = c.lp(a);
if (b._startDraging = !0,
"beginMove" === d.kind)
return void b.emit(d);
var f = e.x - b._lastLogicalPoint.x;
if (c.edgeData) {
var g, h = c.edgeData, i = h.a("realDuration"), j = (h.a("duration"),
h.a("samples")), k = h.a("amSamples"), l = h.a("index");
if (1 === c.edgeType) {
var m = h.position.x + f;
0 > m && (f = -h.position.x),
g = h.width - f,
5 >= g && (g = 5,
f = h.width - 5),
c.moveSelection(f, 0),
g = h.width - f
} else
2 === c.edgeType && (g = h.width + f,
5 >= g && (g = 5,
f = h.width - 5));
var n = (g - 4) / 8 / c.timeLineZoom
, o = i * k / j / n;
.1 > o && (o = .1,
n = i * k / j / .1,
g = 8 * n * c.timeLineZoom + 4,
f = g - h.width),
h.a("speed", o),
h.a("duration", n),
h.width = g,
e.x = f + b._lastLogicalPoint.x,
b._lastLogicalPoint = e,
b._logicalPoint = c.lp(a);
var p = c.actionManager.actionManager.actionList[l][1];
return p.speed = o,
void c.actionManager.inspector.updateActionInfoPanel(l)
}
for (var q = c.selectionModel.selection, r = q[0].position.x, s = 0; s < q.length; s++) {
var h = q[s];
h.position.x < r && (r = h.position.x)
}
0 > f && 0 > r + f && (f = -r);
var t = 8 * c._timeLineZoom
, u = Math.round(f / t);
0 !== u && (b._logicalPoint = c.lp(a),
f = u * t,
c.moveSelection(f, 0),
e.x = f + b._lastLogicalPoint.x,
b._lastLogicalPoint = e,
b.autoScroll(a),
d.moveFrameX = u,
b.emit(d))
}
})
, _c = m("qc.editor.ActionInfoPanel", qc.editor.Panel, function xg(a, b, c) {
var d = this;
d.target = b,
d.actionManager = a,
d.actionIdx = c;
var e, f = b.actionList[c];
f && (d.action = f[1]),
xg["super"].constructor.call(d, b),
e && (d.title = e.name),
d.checkable = !1,
d.removable = !1
});
_c.prototype.paint = function() {
var a = this
, b = a.action;
a.title = b ? b.name : "";
var c = ["95+0.1", "90+0.5"];
_.columnWidths = c,
_.line([_.text(Gd.makePropertyName("targetObject")), _.objectInput({
objectType: "node",
target: b,
targetField: "targetObject",
bind: "targetObject",
onValueChanged: function() {
b.targetLocked = !0,
a.inspect(a.actionIdx)
}
})]),
_.line([_.text(Gd.makePropertyName("targetLocked"), {
align: "left",
toolTip: fa._("Target object is locked. It is not changed by Animator.")
}), _.checkBox({
selected: b.targetLocked
}, null, function(c) {
b.targetLocked = c,
c || (b.targetObject = a.target.targetObject,
a.inspect(a.actionIdx))
})]),
_.line([_.text(Gd.makePropertyName("loop"), {
align: "left",
toolTip: fa._("Loop")
}), _.checkBox({
selected: b.loop
}, null, function(c) {
b.loop = c;
var d = a.actionManager.actionManager.actionList[a.actionIdx];
a.actionManager.timeLine.gvFrame.drawAction(d[0], a.actionIdx, b),
a.actionManager.actionManager.getDuration(!0),
a.actionManager.inspector.nodePanel.updateDurationText()
})]),
_.line([_.text(Gd.makePropertyName("speed"), {
align: "left",
"for": "actionInfo_speed",
dragStep: .01,
toolTip: fa._("Speed")
}), _.numberInput({
value: b.speed,
min: .01,
precision: 3,
id: "actionInfo_speed"
}, null, function(c) {
b.speed = c;
var d = a.actionManager.actionManager.actionList[a.actionIdx];
a.actionManager.timeLine.gvFrame.drawAction(d[0], a.actionIdx, b),
a.actionManager.actionManager.getDuration(!0),
a.actionManager.inspector.nodePanel.updateDurationText(),
a.updateDurationText()
})]);
var d = b.getDuration(!1, !0);
if (d === qc.MAX_DURATION)
d = "infinity";
else {
var e = a.target.samples
, f = b.samples;
d = d * e / f / b.speed,
d = Math.round(d).toString() + " (" + (d / e).toFixed(2) + "s)"
}
var g;
_.line([_.text("Duration", {
align: "left",
toolTip: fa._("Duration")
}), g = _.text(d)]),
g.id = "durationText"
}
,
_c.prototype.updateDurationText = function() {
var a = this.target
, b = this.action
, c = b.getDuration(!1, !0);
if (c === qc.MAX_DURATION)
c = "infinity";
else {
var d = a.samples
, e = b.samples;
c = c * d / e / b.speed,
c = Math.round(c).toString() + " (" + (c / d).toFixed(2) + "s)"
}
var f = this.findViewById("durationText");
f && (f.text = c)
}
,
_c.prototype.inspect = function(a) {
if (this.target) {
this.actionIdx = a;
var b = this.target.actionList[a];
b && (this.action = b[1])
}
this.repaint(!0)
}
,
_c.prototype.getCompAt = function(a) {
a = k.checkTouch(a);
var b = this
, c = a.target
, d = b.children;
if (d)
for (var e = 0; e < d.length; e++) {
var f = d[e];
if (f instanceof Qa) {
var g = f.eachChildren(function(a) {
return a.view.contains(c) ? !0 : void 0
});
if (g)
return g
}
}
}
;
var ad = m("qc.editor.animation.ActionList", qc.widget.Tree, function yg(a, b) {
var c = this;
yg["super"].constructor.call(c),
c.initTree(),
k.initObject(c, b),
new bd(c),
c.actionManager = a,
c.scrollBarMode = "off",
c.rowHeight = 22,
c.labelFont = "14px Calibri",
c.sortFunc = function(a, b) {
var c = a.a("index")
, d = b.a("index");
return c === d ? 0 : c > d ? 1 : d > c ? -1 : void 0
}
,
c.addTopPainter(c.paintButton.bind(c)),
c.selectionModel.on("selectionChange", function() {
for (var a, b = [], d = 0; d < c.selectionModel.selection.length; d++) {
var e = c.selectionModel.selection[d]
, f = c.actionManager.timeLine.gvFrame.queryDatasByKey(e.id);
f && f[0] && (c.actionManager.timeLine.gvFrame.selectionModel.isSelected(f[0]) || (a = !0),
b.push(f[0]))
}
(c.actionManager.timeLine.gvFrame.selectionModel.selection.length !== c.selectionModel.selection.length || b.length > 0 && a) && (c.actionManager.timeLine.gvFrame.selectionModel.selection = b)
}),
c.view.addEventListener("click", function(a) {
var b = c.lp(a)
, d = c.getDataAt(a)
, e = c.width;
if (b.x > e - 12) {
var f = new qc.editor.ContextMenu([{
label: fa._("Remove Action"),
func: function() {
c.removeAction(d)
}
}]);
f._bindingHandleDocMouseDown = function(a) {
f.view.contains(a.target) || f.hide()
}
,
f.registerCloseEvent(f._bindingHandleDocMouseDown),
f.on("action", function(a) {
a.item.func && ("function" == typeof a.item.func ? a.item.func() : c[a.item.func](a))
}),
f.show(a.clientX, a.clientY)
}
})
});
ad.prototype.addAction = function(a) {
var b = this
, c = a.json.name || "undefined"
, d = "ActionIcon"
, e = 1;
if (b.actionManager.actionManager) {
var f, g = b.actionManager.actionManager.game;
if (a instanceof qc.ActionAsset)
f = qc.Action.restoreBundle(a, g, !g.serializer.isRestoring);
else if (a instanceof qc.ActionManagerAsset) {
var h = {};
if (h[b.actionManager.actionManager.uuid] = !0,
f = qc.ActionManager.restoreBundle(a, g, !g.serializer.isRestoring, h),
!f) {
var i = qc.Util.formatString(fa._("Recursive Error"), a.key);
return void fa.notification.error(i)
}
}
e = b.actionManager.actionManager.addAction([0, f, f.loop]),
b.actionManager.timeLine.addAction(0, e - 1, f),
a instanceof qc.ActionManagerAsset && (d = "ActionManagerIcon");
var j = new qc.widget.Data({
name: c,
icon: d
});
j.id = e - 1,
j.a("index", e - 1),
b.dataModel.add(j),
b.actionManager.inspector.nodePanel.updateDurationText()
}
}
,
ad.prototype.removeAction = function(a) {
var b = a.a("index");
this.actionManager && this.actionManager.actionManager && this.actionManager.actionManager.deleteAction(b),
this.dataModel.remove(a),
this.actionManager.inspector.nodePanel.updateDurationText()
}
,
ad.prototype.parseActionList = function(a) {
for (var b = 0; b < a.length; b++) {
var c = a[b];
if (c) {
var d = c[1]
, e = "ActionIcon";
d instanceof qc.ActionManager && (e = "ActionManagerIcon");
var f = new qc.widget.Data({
name: d.name,
icon: e
});
f.a("index", b),
f.id = b,
this.dataModel.add(f),
this.actionManager.timeLine.addAction(c[0], b, c[1])
}
}
}
,
ad.prototype.getLabel = function(a) {
var b;
return b = this.labelFunc ? this.labelFunc(a) : null == a.displayName ? a.name : a.displayName
}
,
ad.prototype.paintButton = function(a) {
for (var b = this, c = b.width, d = b.rowDatas, e = b.rowHeight, f = 0, g = "rgb(63, 68, 71)", h = 0; h < d.length; h++) {
var i = (d[h],
e * h);
a.beginPath(),
a.rect(c - 15, i, 15, e),
a.fillStyle = g,
a.fill(),
a.beginPath(),
k.drawImage(a, k.getImage("action_collapse"), "centerUniform", f + c - 13, i, 13, 22)
}
}
,
ad.prototype.getLabelColor = function(a) {
if (a === this.draggingData)
return "#fce486";
if (this.checkMode) {
if (this._focusData === a)
return this.labelSelectColor
} else if (this.isSelected(a))
return this.labelSelectColor;
return this.labelColor
}
,
ad.prototype.resetDataModel = function() {
var a = this
, b = a.dataModel;
b.clear()
}
,
ad.prototype.redrawList = function() {
this.resetDataModel(),
this.actionManager && this.actionManager.actionManager && this.parseActionList(this.actionManager.actionManager.actionList)
}
,
b.defineProperties(ad.prototype, {
target: {
get: function() {
return this._target
},
set: function(a) {
var b = this;
b.setPropertyValue("target", a)
}
}
});
var bd = m(null, "qc.widget.TreeInteractor", function zg(a) {
zg["super"].constructor.call(this, a)
}, {
handle_touchstart: function(a) {
var b = this
, c = b.view
, d = c.getDataAt(a);
c.requestFocus(),
Y(a),
b.clear(a),
b._clientPoint = B(a),
b._tx = c.translateX,
b._ty = c.translateY,
d && (b.handleSelectMode(a, d),
c.actionManager.inspector.updateActionInfoPanel(d.a("index"))),
b._isV = c.isCloseToVScrollBar(a),
b._isH = c.isCloseToHScrollBar(a),
!d && c.clearSelectionOnBackgroundClicked && c.selectionModel.clearSelection(),
k.startDragging(b, a)
},
handle_touchend: function(a) {
var b = this
, c = b.view;
if (!b._isV && !b._isH && b._clientPoint && !b._state) {
var d = c.getDataAt(a);
d && b.handleClickCallback(d, a)
}
b.clear(a)
}
})
, cd = m(null, b, function(a) {
var b = this;
b._actionPane = a,
b.addListeners()
}, {
handle_contextmenu: function(a) {
Y(a)
}
}, {
interactor: !0
}, {
view: {
get: function() {
return this._actionPane
}
}
})
, dd = m("qc.editor.animation.ActionPane", qc.widget.Container, function Ag(a) {
var b = this;
Ag["super"].constructor.call(b),
b.actionManager = a;
var c = new qc.widget.Container
, d = new qc.widget.layout.TableLayout(c);
d.cellPadding = 0,
d.padding = 2,
c.layout = d,
c.background = "rgb(67, 74, 82)";
var e = (b.btnRecord = new qc.editor.ToggleButton,
b.btnRun = new qc.editor.ToggleButton);
e.background = null,
e.hoverBackground = null,
e.activeBackground = "rgb(51, 56, 62)",
e.activeGradientColor = null,
e.icon = "action_play",
e.activeIcon = "action_play_active",
e.borderWidth = 0;
var f = new qc.editor.Button({
icon: "action_addevent",
activeIcon: "action_addevent_active",
background: null,
hoverBackground: null,
activeBackground: "rgb(51, 56, 62)",
activeGradientColor: null,
borderWidth: 0
})
, g = new qc.editor.Button({
icon: "action_nextframe",
activeIcon: "action_nextframe_active",
background: null,
hoverBackground: null,
activeBackground: "rgb(51, 56, 62)",
activeGradientColor: null,
borderWidth: 0
})
, h = new qc.editor.Button({
icon: "action_preframe",
activeIcon: "action_preframe_active",
background: null,
hoverBackground: null,
activeBackground: "rgb(51, 56, 62)",
activeGradientColor: null,
borderWidth: 0
})
, i = b.txtFrame = new qc.editor.IntInput({
value: 0
});
c.setItems([{
height: .1,
widths: [24, 24, 24, 40, .1, 20],
cells: [{
element: e
}, {
element: h
}, {
element: g
}, {
element: i
}, {
element: null
}, {
element: f
}]
}]),
f.on("click", function() {
b.emit("addEvent")
}),
e.on("propertyChange", function(a) {
e._settingSelected || "selected" === a.property && b.emit(a.newValue ? "play" : "stop")
}),
g.on("click", function() {
b.actionManager.timeLine.guidePos += 1
}),
h.on("click", function() {
b.actionManager.timeLine.guidePos -= 1,
b.actionManager.timeLine.guidePos < 0 && (b.actionManager.timeLine.guidePos = 0)
});
var j = new qc.widget.Container
, k = new qc.widget.layout.TableLayout(j);
k.cellPadding = 0,
k.padding = 2,
j.layout = k,
j.background = "rgb(60, 65, 71)",
j.gradientColor = null;
var l = b.txtSamples = new qc.editor.IntInput({
value: 60
});
j.setItems([{
height: .1,
widths: [.1, 50, 50],
cells: [{
element: null
}, {
element: new qc.editor.Text({
text: fa._("Samples") + "&nbsp;",
align: "right"
})
}, {
element: l
}]
}]),
l.onValueChanged = function(a) {
b.emit("valueChange", {
kind: "samples",
newValue: a
})
}
;
var m = b.actionListContainer = new qc.widget.Container;
m.scrollBarMode = "on",
m.scrollBarColor = "rgb(160, 160, 160)",
m.layout = new qc.widget.layout.VBoxLayout(m),
m.layout.padding = [0, 2, 2, 2];
var n = b.actionList = new ad(a)
, o = new qc.widget.Button({
text: fa._("Add Action")
});
o.disableToolTip(),
o.ninePatchImage = "addproperty.9",
o.ninePatchBorder = [10, 10, 10, 10],
o.hoverNinePatchImage = "addproperty.9",
o.hoverNinePatchBorder = [10, 10, 10, 10],
o.activeNinePatchImage = "addproperty_active.9",
o.activeNinePatchBorder = [10, 10, 10, 10],
o.textColor = "rgb(65, 36, 31)",
o.activeTextColor = "#f0c8a0",
o.borderWidth = 0,
o.preferredSize = {
width: 200,
height: 24
},
o.on("click", b.handleButtonClick, b),
b._bindingHandleDocumentMousedown = b.handleDocumentMousedown.bind(b),
b._bindingHandleEscKey = b.handleEscKey.bind(b);
var p = new qc.widget.Container;
p.layout = new qc.widget.layout.TableLayout(p),
p.setItems([{
height: 26,
widths: [.1],
cells: [{
cellPadding: [2, 25, 2, 25],
element: o
}]
}]),
m.setItems([n, p]);
var q = new qc.widget.layout.TableLayout(b);
q.padding = 0,
q.cellPadding = 0,
b.layout = q,
b.setItems([{
height: 22,
widths: [.1],
cells: [{
element: c
}]
}, {
height: 22,
widths: [.1],
cells: [{
element: j
}]
}, {
height: .1,
widths: [.1],
cells: [{
element: m
}]
}]),
new cd(b),
b.disabledBackground = "rgba(0,0,0,0.4)",
b.disabled = !0
});
dd.prototype.handleButtonClick = function() {
var a = this
, b = a._dialog;
if (!b) {
b = a._dialog = new qc.editor.Dialog,
b.on("close", function() {
a.removeDialog()
}),
b.title = fa._("Select Object");
var c = new Fa({
objectType: "animator"
});
c.onSelectAssetNode = function(c) {
if (b.hide(),
!c.isNoneNode) {
var d = fa.game.assets.findByUUID(c.a("asset"));
d ? a.actionList.addAction(d) : fa.game.assets.load(c.a("asset"), c.a("url"), function(a) {
console.log(a)
})
}
}
,
b.content = c,
b.contentPadding = [2, 4, 2, 4];
var d = Wb(700, 500);
b.width = d.width,
b.height = d.height
}
b.isInDOM() ? b.hide() : (b.show(),
c._searchInput.input.focus(),
document.addEventListener("mousedown", a._bindingHandleDocumentMousedown),
document.addEventListener("keydown", a._bindingHandleEscKey))
}
,
dd.prototype.handleDocumentMousedown = function(a) {
var b = this
, c = b._dialog
, d = a.target;
c.view.contains(d) || c.hide()
}
,
dd.prototype.handleEscKey = function(a) {
if (27 === a.keyCode) {
var b = this
, c = b._dialog;
c && c.isInDOM() && c.hide();
}
}
,
dd.prototype.removeDialog = function() {
delete this._dialog,
document.removeEventListener("mousedown", this._bindingHandleDocumentMousedown),
document.removeEventListener("keydown", this._bindingHandleEscKey)
}
;
var ed = m("qc.editor.HierarchySelectionInteractor", b, function(a) {
var b = this;
b._hierarchy = a,
b.addListeners()
}, {
clearFileListSelection: function() {
fa.fileList.selectionModel.clearSelection()
},
handle_mousemove: function(a) {
fa.highlightData = this._hierarchy.getDataAt(a)
},
handle_mousedown: function(a) {
this.handle_touchstart(a)
},
handle_touchstart: function(a) {
var b = this
, c = b._hierarchy;
if (b._isOnExpandIcon = null,
b._startPoint = null,
c.isCloseToVScrollBar(a))
;
else {
var d = c.getDataAt(a);
d ? (b._startPoint = B(a),
b._isOnExpandIcon = c.isOnToggleIcon(a)) : b.clearFileListSelection()
}
},
handle_mouseup: function(a) {
this.handle_touchend(a)
},
handle_touchend: function(a) {
var b = this
, c = b._startPoint
, d = B(a);
!b._isOnExpandIcon && c && y(c, d) < 2 && b.clearFileListSelection(),
b._startPoint = null,
b._isOnExpandIcon = null
}
}, {
interactor: !0
}, {
view: {
get: function() {
return this._hierarchy
}
}
})
, fd = m("qc.editor.Hierarchy", oa, function() {
var a = this;
fd["super"].constructor.call(a),
fa.e.on(fa.e.DATA_MODEL_CHANGE, function(b) {
var c = b.oldValue
, d = b.newValue;
c && c.selectionModel.off("selectionChange", a._updateActiveNode, a),
d.selectionModel.on("selectionChange", a._updateActiveNode, a),
a.dataModel = d,
a.rootData = a.dataModel.getDataById(a.game.world.uuid),
a.rootVisible = !1,
a._updateActiveNode()
}),
fa.e.on(fa.e.PREFAB_BROKEN, function() {
a.iv()
}),
fa.e.on(fa.e.HIGHLIGHT_DATA, function() {
a.iv()
}),
new ed(a),
a._initMenu(),
a.toggleOnDoubleClick = !1,
a.toggleIconStretch = "center"
});
b.defineProperties(fd.prototype, {
game: {
get: function() {
return this.dataModel.game
}
},
activeNode: {
get: function() {
return this._activeNode
},
set: function(a) {
this.selection = a ? this.dataModel.getDataById(a.uuid) : null
}
}
}),
fd.prototype._updateActiveNode = function() {
var a = this.dataModel.lastEditableNode;
if (!a) {
var b = this.dataModel.selectionModel.lastData;
b && (a = b.node)
}
var c = this._activeNode;
c !== a && (this._activeNode = a,
fa.e.emit(fa.e.ACTIVE_NODE_CHANGE, {
oldValue: c,
newValue: a
}))
}
,
fd.prototype.blink = function(a) {
var b = this;
if (b._anim && (b._anim.finishFunc = function() {
b._blinkData.s("blink.background", null),
b._anim = null,
b._blinkData = null
}
,
b._anim.stop()),
a) {
b._blinkData = a;
var c = 0
, d = function() {
4 > c ? (c++,
b._anim = W({
duration: 400,
finishFunc: d,
action: e
})) : (a.s("blink.background", null),
b._anim = null,
b._blinkData = null)
}
, e = function(b) {
c % 2 === 0 && (b = 1 - b),
a.s("blink.background", "rgba(255, 255, 0, " + b + ")")
};
d()
}
}
,
fd.prototype.clearHighlight = function() {
var a = this
, b = a.dataModel;
b.datas.forEach(function(a) {
a.s("blink.background", null)
})
}
,
fd.prototype.drawRowBackground = function(a, b, c, d, e, f) {
var g = this;
fd["super"].drawRowBackground.call(g, a, b, c, d, e, f);
var h = b.s("blink.background");
h && (a.beginPath(),
k.drawShape(a, "roundRect", {
x: c,
y: d,
width: e,
height: f
}),
a.fillStyle = h,
a.fill())
}
,
fd.prototype.getLabelColor = function(a) {
if (a === fa.highlightData)
return "#90dbed";
var b = a.node;
return b._bone || !b.worldVisible ? "rgb(126,126,126)" : b._prefab ? "rgb(73,116,190)" : fd["super"].getLabelColor.call(this, a)
}
,
fd.prototype.onDataDoubleClick = function(a) {
fa.scene.focusData(a, !0)
}
,
fd.prototype.drawTree = function(a, b, c, d, e, f) {
var g = this
, h = g._indent
, i = g.getLevel(b)
, j = g.getIcon(b) ? h : 0
, l = g.getToggleIcon(b);
l ? (c += h * i,
k.drawImage(a, l, g.toggleIconStretch, c, d, h, f, b, g),
c += h) : c += h * (i + 1),
g._checkMode && (k.drawImage(a, g.getCheckIcon(b), null, c, d, h, f, b, g),
c += h),
g.drawIcon(a, b, c, d, j, f),
g.drawLabel(a, b, c + j, d, f)
}
,
fd.prototype.rename = function(a, b) {
if (b) {
var c = a.node
, d = this.dataModel.createRenameUndoFunc(c);
b != c.name && (fa.sceneManager.dirty = !0,
fa.actionEditor && fa.actionEditor.propertyTree.redrawTree()),
c.name = b;
var e = this.dataModel.createRenameUndoFunc(c);
fa.undo.add(d, e)
}
}
,
fd.prototype.isVisible = function(a) {
return fa.prefabInfo && fa.prefabInfo.visibleMap[a.id] !== c ? !1 : this.visibleFunc ? this.visibleFunc(a) : !0
}
,
b.defineProperty(fd.prototype, "toggleIconStretch", {
get: function() {
return this._toggleIconStretch
},
set: function(a) {
this.setPropertyValue("toggleIconStretch", a)
}
});
var gd = m("qc.editor.HierarchyContainer", qc.widget.Container, function Bg() {
var a = this;
Bg["super"].constructor.call(a),
a.layout = new qc.widget.layout.BorderLayout(a),
a.layout.topToggleVisible = !1,
a.layout.topResizable = !1,
a.layout.leftToggleVisible = !1,
a.layout.splitterSize = 1,
a.layout.topSplitterSize = 0;
var b = a._ddlType = new wa;
b.preferredSize = {
width: 30,
height: 22
},
b.items = [{
label: fa._("Name"),
value: "name"
}, {
label: fa._("Type"),
value: "type"
}],
b.value = "name",
b.onValueChanged = function() {
a.resetHierarchyVisibleFunc()
}
;
var c = a._txtSearch = new Ba;
c.id = "hierarchySearch",
c.preferredSize = {
width: 100,
height: 22
},
c.padding = [2, 0, 2, 20],
c.background = "rgba(0,0,0,0)",
c.placeHolder = fa._("Search...");
var d = c.input.style;
d.backgroundImage = 'url("' + fa.assetPath + 'magnifying-glass.png")',
d.backgroundRepeat = "no-repeat",
d.backgroundSize = "12px 12px",
d.backgroundPosition = "2px 50%",
c.onValueChanged = function() {
a.resetHierarchyVisibleFunc()
}
;
var e = a._hierarchy = new fd;
e._oldDrawRow = e.drawRow,
e._oldValidateModel = e.validateModel,
e._oldBuildChildren = e.buildChildren;
var f = new qc.widget.Container;
f.layout = new qc.widget.layout.TableLayout(f),
f.setItems([{
height: 24,
widths: [60, .1],
cells: [{
fill: "h",
vAlign: "middle",
element: b
}, {
fill: "h",
vAlign: "middle",
element: c
}]
}]),
a.setItems([{
region: "top",
element: f
}, {
region: "center",
element: e
}])
});
gd.prototype.resetHierarchyVisibleFunc = function() {
var a = this
, b = a._ddlType
, d = a._txtSearch
, e = a._hierarchy
, f = d.value
, g = b.value
, h = function(a, b) {
if (f) {
if ("name" === g)
return b ? fa.prefabInfo && fa.prefabInfo.visibleMap[a.id] !== c ? !1 : !0 : a.name.toLowerCase().indexOf(f.toLowerCase()) >= 0;
if (b)
return fa.prefabInfo && fa.prefabInfo.visibleMap[a.id] !== c ? !1 : !0;
var d = a.node["class"];
return d = d.replace("qc.", ""),
d.toLowerCase().indexOf(f.toLowerCase()) >= 0
}
return !0
};
f ? (e.visibleFunc = function(a) {
if (a.node === fa.game.world)
return !1;
if (fa.prefabInfo) {
for (var b = 0; a; ) {
if (!h(a, 0 === b ? !1 : !0))
return !1;
b++,
a = a.parent
}
return !0
}
return h(a)
}
,
e.drawRow = qc.widget.List.prototype.drawRow,
e.validateModel = qc.widget.List.prototype.validateModel,
e.buildChildren = qc.widget.List.prototype.buildChildren,
e.ivm(),
e.iv()) : (e.visibleFunc = c,
e.drawRow = e._oldDrawRow,
e.validateModel = e._oldValidateModel,
e.buildChildren = e._oldBuildChildren,
e.ivm(),
e.iv())
}
,
fd.prototype.handleCrossDrag = function(a, b, c) {
if ("enter" === b) {
var d, e = c.view;
if (e instanceof qc.editor.DraggableButton)
d = "draggableButton";
else if (e === fa.fileList) {
var f = e.draggingData
, g = f.master ? f.master : f;
if (!g.treeData)
return;
if (f.name.lastIndexOf(".js") === f.name.length - 3)
d = "js";
else {
var h = fa.game.assets.find(g.treeData.resUUID);
if (!h)
return;
h.meta.type === fa.ASSET_TYPE.ASSET_PREFAB ? d = "prefab" : h.meta.type === fa.ASSET_TYPE.ASSET_ATLAS && (d = "atlas")
}
}
d && (fd["super"].handleCrossDrag.call(this, a, b, c),
this._crossDragInfo.crossDataType = d)
} else
fd["super"].handleCrossDrag.call(this, a, b, c)
}
,
fd.prototype._dragging = function(a, b) {
var c = this.rowHeight
, d = this.lp(a)
, e = d.y / c
, f = Math.floor(e)
, g = b.inView
, h = b.crossDataType;
if (g || "draggableButton" === h || "prefab" === h || "atlas" === h) {
if (f > this.rowDatas.length - 1)
b.rowIndex = this.rowDatas.length - 1,
b.type = "down";
else {
var i = d.y - f * c
, j = this.rowDatas[f];
b.type = xb(j.node) ? .25 * c > i ? "up" : i > .75 * c ? "down" : "parent" : .5 * c > i ? "up" : "down",
b.rowIndex = f
}
if (fa.prefabInfo && 0 === b.rowIndex && "parent" !== b.type) {
var j = this.rowDatas[f];
j && xb(j.node) ? b.type = "parent" : (b.type = null,
b.rowIndex = null)
}
this.autoScroll(a),
this.iv()
} else
"js" === h && this.rowDatas.length && (b.rowIndex = f > this.rowDatas.length - 1 ? this.rowDatas.length - 1 : f,
b.type = "parent",
this.autoScroll(a),
this.iv())
}
,
fd.prototype._endCrossDrag = function(a, b) {
if (this._crossDragInfo) {
var d = b.view
, e = this._crossDragInfo.type;
if (null != e) {
var f, g, h = this.rowDatas[this._crossDragInfo.rowIndex];
if (h)
if (g = h.node,
"parent" === e)
f = g.children.length;
else {
if (f = g.parent.getChildIndex(g),
g = g.parent,
!xb(g))
return;
"down" === e && (f += 1)
}
else
g = this.game.world,
f = g.children.length;
var i = null;
if (d instanceof qc.editor.DraggableButton) {
var j = b.tip;
"EmptyNode" === j ? i = fa.menu.createNode(g) : "Image" === j ? i = fa.menu.createImage(g) : "Sprite" === j ? i = fa.menu.createSprite(g) : "Text" === j ? i = fa.menu.createText(g) : "Button" === j ? i = fa.menu.createButton(g) : "Toggle" === j ? i = fa.menu.createToggle(g) : "ScrollBar" === j ? i = fa.menu.createScrollBar(g) : "ScrollView" === j ? i = fa.menu.createScrollView(g) : "Slider" === j ? i = fa.menu.createSlider(g) : "Dom" === j ? i = fa.menu.createDom(g) : "ProgressBar" === j ? i = fa.menu.createProgressBar(g) : "InputField" === j ? i = fa.menu.createInputField(g) : "Sound" === j ? i = fa.menu.createSound(g) : "Tilemap" === j && (i = fa.menu.createTilemap(g))
} else {
if (d !== fa.fileList)
return;
var k = d.draggingData
, l = k.master || k;
if (!l.treeData)
return;
if (k.name.lastIndexOf(".js") === k.name.length - 3) {
var m = k.treeData.id;
return void qc.editor.Operation.SOURCE(m, function(a) {
var b = a.source
, c = b.match(/qc.defineBehaviour[\(\s]*['"](.*)['"]/);
c && (c = c[1],
qc._userScripts[c] && "parent" === e && g && g.addScript(c) && (fa.inspector.propertyView.emit("addComponent", c),
fa.notification.info(fa._("Script added."))))
})
}
var n = fa.game.assets.find(l.treeData.resUUID);
if (!n)
return;
if (n.meta.type === fa.ASSET_TYPE.ASSET_PREFAB) {
if (n.hasUnloadedDependence(fa.game))
return void fa.notification.warn(fa._("Asset is not loaded, please try later."));
i = this.game.add.clone(n, g)
} else
n.meta.type === fa.ASSET_TYPE.ASSET_ATLAS && (i = fa.menu.createImage(g),
i.texture = new qc.Texture(n,k.master ? k.name : c),
i.resetNativeSize())
}
i && (g.setChildIndex(i, f),
fa.dataModel.addNodeForUndo(i),
fa.hierarchy.activeNode = i)
}
}
}
,
fd.prototype._endDrag = function(a, b) {
var c = b.rowIndex
, d = b.type
, e = this.rowDatas[c];
if (e) {
var f = e.node;
if ("parent" === d) {
if (!xb(f))
return
} else if (!xb(f.parent))
return;
var g = []
, h = [];
this.isSelected(this.draggingData) ? this.topRowOrderSelection.forEach(function(a) {
this._dropData(d, a, e, g, h)
}, this) : this._dropData(d, this.draggingData, e, g, h);
var i = g.length;
if (i) {
var j = this.dataModel
, k = function() {
for (var a = i - 1; a >= 0; a--)
j.restoreParentInfo(g[a])
}
, l = function() {
for (var a = 0; i > a; a++)
j.restoreParentInfo(h[a])
};
fa.undo.add(k, l)
}
}
}
,
fd.prototype._dropData = function(a, b, c, d, e) {
var f, g, h = this.dataModel, i = b.node, j = c.node;
if (wb(i, !1, !0)) {
if ("parent" === a)
try {
f = h.createParentInfo(i),
i.switchParent(j),
g = h.createParentInfo(i),
this.expand(c)
} catch (k) {
fa.log.error(k.stack)
}
else if (j !== this.game.world) {
var l = c.parent.node;
try {
f = h.createParentInfo(i),
i.parent !== l && i.switchParent(l);
var m = l.getChildIndex(j)
, n = l.getChildIndex(i);
"down" === a && m++,
m > n && m--,
l.setChildIndex(i, m),
g = h.createParentInfo(i)
} catch (k) {
fa.log.error(k.stack)
}
}
f && g && (d.push(f),
e.push(g))
}
}
,
fd.prototype._initMenu = function() {
var a = this
, b = new qc.editor.ContextMenu([{
label: fa._("Cut"),
func: "handleCut",
disabled: function() {
if (0 === a.selection.length)
return !0;
if (fa.prefabInfo && a.activeNode)
for (var b = a.selectionModel.selection, c = 0; c < b.length; c++) {
var d = b[c];
if (d.id === fa.prefabInfo.prefab.uuid)
return !0
}
}
}, {
label: fa._("Copy"),
func: "handleCopy",
disabled: function() {
if (0 === a.selection.length)
return !0;
if (fa.prefabInfo && a.activeNode)
for (var b = a.selectionModel.selection, c = 0; c < b.length; c++) {
var d = b[c];
if (d.id === fa.prefabInfo.prefab.uuid)
return !0
}
}
}, {
label: fa._("Paste"),
func: "handlePaste"
}, {
type: "-"
}, {
label: fa._("Create"),
items: [{
label: fa._("Empty Node"),
func: function() {
fa.menu.createNode()
}
}, {
label: fa._("Image"),
func: function() {
fa.menu.createImage()
}
}, {
label: fa._("Sprite"),
func: function() {
fa.menu.createSprite()
}
}, {
label: fa._("Text"),
func: function() {
fa.menu.createText()
}
}, {
label: fa._("Button"),
func: function() {
fa.menu.createButton()
}
}, {
label: fa._("Toggle"),
func: function() {
fa.menu.createToggle()
}
}, {
label: fa._("ScrollBar"),
func: function() {
fa.menu.createScrollBar()
}
}, {
label: fa._("ScrollView"),
func: function() {
fa.menu.createScrollView()
}
}, {
label: fa._("ProgressBar"),
func: function() {
fa.menu.createProgressBar()
}
}, {
label: fa._("Slider"),
func: function() {
fa.menu.createSlider()
}
}, {
label: fa._("Input Field"),
func: function() {
fa.menu.createInputField()
}
}, {
label: fa._("Dropdown"),
func: function() {
fa.menu.createDropdown()
}
}, {
label: fa._("Sound"),
func: function() {
fa.menu.createSound()
}
}, {
label: fa._("Dom"),
func: function() {
fa.menu.createDom()
}
}, {
label: fa._("Graphics"),
func: function() {
fa.menu.createGraphics()
}
}, {
label: fa._("Tilemap"),
func: function() {
fa.menu.createTilemap()
}
}]
}, {
label: fa._("Duplicate"),
func: "handleDuplicate",
disabled: function() {
if (0 === a.selection.length)
return !0;
if (fa.prefabInfo && a.activeNode)
for (var b = a.selectionModel.selection, c = 0; c < b.length; c++) {
var d = b[c];
if (d.id === fa.prefabInfo.prefab.uuid)
return !0
}
}
}, {
label: fa._("Delete"),
func: "handleDelete",
disabled: function() {
if (0 === a.selection.length)
return !0;
if (fa.prefabInfo && a.activeNode)
for (var b = a.selectionModel.selection, c = 0; c < b.length; c++) {
var d = b[c];
if (d.id === fa.prefabInfo.prefab.uuid)
return !0
}
}
}, {
label: fa._("Rename"),
func: "handleRename",
disabled: function() {
return 1 !== a.selection.length
}
}, {
type: "-"
}, {
label: fa._("Expand"),
func: "handleExpand"
}, {
label: fa._("Collapse"),
func: "handleCollapse"
}, {
label: fa._("Show Retainers"),
func: "showRetainers"
}]);
b.on("action", function(b) {
b.item.func && ("function" == typeof b.item.func ? b.item.func() : a[b.item.func](b))
}),
b.addTo(a),
a.menu = b
}
,
fd.prototype.handleExpand = function() {
var a = this.selectionModel.lastData;
this.expandAll(a)
}
,
fd.prototype.handleCollapse = function() {
var a = this.selectionModel.lastData;
this.collapseAll(a)
}
,
fd.prototype.handleCopy = function() {
var a = this.dataModel.getTopEditableSelection(null, !1, !0)
, b = [];
return a.forEach(function(a) {
var c = {}
, d = fa.game.serializer.buildBundle(a.node, c);
d.dependences = fa.game.serializer.combineDependence(c),
b.push(d)
}),
b.length && (fa.clipboard.data = b,
fa.clipboard.type = "node"),
a
}
,
fd.prototype.handlePaste = function() {
if ("node" === fa.clipboard.type) {
var a = []
, b = fa.hierarchy.activeNode ? fa.hierarchy.activeNode.parent : null;
fa.clipboard.data.forEach(function(c) {
var d = fa.game.serializer.restoreBundle(c, b);
a.push(this.dataModel.getDataById(d.uuid))
}, this),
this.selection = a,
this.dataModel.addDatasForUndo(a)
}
}
,
fd.prototype.handleDuplicate = function() {
var a = [];
this.dataModel.getTopEditableSelection(null, !1, !0).forEach(function(b) {
var c = b.node;
c = fa.game.add.clone(c, c.parent),
a.push(this.dataModel.getDataById(c.uuid))
}, this),
this.selection = a,
this.dataModel.addDatasForUndo(a)
}
,
fd.prototype.handleRename = function() {
var a = this.selectionModel.lastData;
a && this.beginEditing(a)
}
,
fd.prototype.handleCut = function() {
var a = this.handleCopy();
this.dataModel.deleteDatasForUndo(a)
}
,
fd.prototype.handleDelete = function() {
var a = this.dataModel
, b = a.getTopEditableSelection(null, !1, !0)
, c = b.length;
if (0 !== c) {
if (fa.prefabInfo)
for (var d = 0; d < b.length; d++) {
var e = b[d];
if (e.node.uuid === fa.prefabInfo.prefab.uuid)
return void fa.notification.info(fa._("Prefab cannot be removed"))
}
Eb(fa._("Sure to remove this node?"), fa._("Warning"), function() {
a.deleteDatasForUndo(b)
}, null, {
icon: "alert"
})
}
}
,
fd.prototype.showRetainers = function() {
var a = this.selectionModel.lastData;
if (a) {
var b = a.node
, c = []
, d = function(a) {
for (var e = a.children, f = 0; f < e.length; f++) {
var g = e[f]
, h = g.getMeta();
for (var i in h)
18 === h[i] && g[i] === b ? c.push({
node: g,
property: i
}) : 19 === h[i] && g[i] && g[i].indexOf(b) >= 0 && c.push({
node: g,
property: i
});
for (var j = g.scripts, k = 0; k < j.length; k++) {
var l = j[k];
h = l.getMeta();
for (var i in h)
18 === h[i] && l[i] === b ? c.push({
node: g,
script: l,
property: i
}) : 19 === h[i] && l[i] && l[i].indexOf(b) >= 0 && c.push({
node: g,
script: l,
property: i
})
}
d(g)
}
}
, e = fa.game.world;
d(e),
fa.inspector.propertyView.inspect(b, "Panel:ReferencePanel", c)
}
}
,
fd.prototype.addMenuItem = function(a, b) {
for (var c in this.menu.items) {
var d = this.menu.items[c];
if (d.label === a) {
var e = !1;
for (var f in d.items)
if (d.items[f].label === b.label) {
e = !0;
break
}
e || d.items.push(b);
break
}
}
}
;
var hd = m("qc.editor.Scene", b, function() {
var a = this;
a.initView(),
a._view.style.background = "#2c2d31",
a._view._dropView = a,
a._activable = !0;
var b = a._iframe = document.createElement("iframe");
k.setBorder(b, null, 0),
b.style.position = "absolute",
b.style.width = "100%",
b.style.height = "100%",
a._interactionDiv.appendChild(b),
a._editorCanvas = q(),
a._interactionDiv.appendChild(a._editorCanvas),
a._interactionState = {},
fa.e.on(fa.e.EDIT_MODE_CHANGE, function(b) {
a.editMode = b.newValue
}),
fa.e.on(fa.e.DATA_MODEL_CHANGE, function(b) {
a.dataModel = b.newValue
}),
fa.e.on(fa.e.GAME_SIZE_CHANGE, this._handleGameSizeAndOrientationChange, a),
fa.e.on(fa.e.ORIENTATION_CHANGE, this._handleGameSizeAndOrientationChange, a),
fa.e.on(fa.e.GRID_VISIBLE_CHANGE, function() {
a.iv()
}),
fa.e.on(fa.e.HIGHLIGHT_DATA, function() {
a.iv()
}),
fa.e.on(fa.e.EDIT_IN_RUN_CHANGE, function(b) {
a._resetInteractors(b.newValue),
a.updateEditorCanvas()
}),
fa.e.on(fa.e.PLAYING_CHANGE, function(a) {
a.newValue ? fa.workable ? qc.editor.Operation.SAVE_CURR_SCENE(function() {
fa.scene.editable = !1,
fa.playing && fa.scene.play("StartGame.html")
}) : (fa.scene.editable = !1,
fa.scene.play("StartGame.html")) : (fa.scene.editable = !0,
fa.scene.play("StartScene.html"))
})
}, {}, {
properties: ["editParentEnabled", "editRotationEnabled", "editScaleEnabled", "editPivotEnabled", "editCornerEnabled", "editEdgeEnabled", "editMoveEnabled", "editRectTransformEnabled", "editHitAreaEnabled", "editBox2dVerticesEnabled"],
view: !0,
emitter: !0
});
hd.prototype._debugEnabled = !1,
hd.prototype.onPropertyChange = function(a) {
"editHitAreaEnabled" === a.property && a.newValue && (this.editBox2dVerticesEnabled = !1),
"editBox2dVerticesEnabled" === a.property && a.newValue && (this.editHitAreaEnabled = !1),
this.updateEditorCanvas()
}
,
hd.prototype.handleCrossDrag = function(a, b, d) {
var e = d.view
, f = function(a) {
if (fa.prefabInfo)
return fa.dataModel.getDataById(fa.prefabInfo.prefab.uuid).node;
if (!a)
return fa.game.world;
for (var b, c = fa.dataModel.datas, d = 0; d < c.length; d++)
if (b = c[d].node,
b instanceof qc.UIRoot)
return b;
return new qc.UIRoot(fa.game)
};
if ("enter" === b || "over" === b)
;
else if ("drop" === b) {
if (e instanceof qc.editor.DraggableButton) {
var g, h = d.tip;
"EmptyNode" === h ? g = fa.menu.createNode(f()) : "Image" === h ? g = fa.menu.createImage(f(!0)) : "Sprite" === h ? g = fa.menu.createSprite(f()) : "Text" === h ? g = fa.menu.createText(f(!0)) : "Button" === h ? g = fa.menu.createButton(f(!0)) : "Toggle" === h ? g = fa.menu.createToggle(f(!0)) : "ScrollBar" === h ? g = fa.menu.createScrollBar(f(!0)) : "ScrollView" === h ? g = fa.menu.createScrollView(f(!0)) : "Slider" === h ? g = fa.menu.createSlider(f(!0)) : "Dom" === h ? g = fa.menu.createDom(f()) : "ProgressBar" === h ? g = fa.menu.createProgressBar(f(!0)) : "InputField" === h ? g = fa.menu.createInputField(f(!0)) : "Dropdown" === h ? g = fa.menu.createDropdown(f(!0)) : "Sound" === h ? g = fa.menu.createSound(f()) : "Tilemap" === h && (g = fa.menu.createTilemap(f()))
} else {
if (e !== fa.fileList)
return;
var i = e.draggingData
, j = i.master || i;
if (!j.treeData)
return;
var k = fa.game.assets.find(j.treeData.resUUID);
if (!k)
return;
if (k.meta.type === fa.ASSET_TYPE.ASSET_PREFAB) {
if (k.hasUnloadedDependence(fa.game))
return void fa.notification.warn(fa._("Asset is not loaded, please try later."));
g = this.game.add.clone(k, f())
} else
k.meta.type === fa.ASSET_TYPE.ASSET_ATLAS && (g = fa.menu.createImage(f(!0)),
g.texture = new qc.Texture(k,i.master ? i.name : c),
g.resetNativeSize())
}
if (g) {
var l = g.parent.getScript("qc.ScaleAdapter");
l && l.preUpdate();
var m = fa.scene.interactors[0].toGlobal(a);
m = g.parent.toLocal(m),
g.x = m.x,
g.y = m.y,
fa.dataModel.addNodeForUndo(g),
fa.hierarchy.activeNode = g
}
}
}
,
hd.prototype._handleGameSizeAndOrientationChange = function() {
var a;
if (fa.gameSize) {
var b = Math.min(fa.gameSize.width, fa.gameSize.height)
, c = Math.max(fa.gameSize.width, fa.gameSize.height);
a = "Portrait" === fa.orientation ? {
width: b,
height: c
} : {
width: c,
height: b
}
}
this.gameSize = a
}
,
hd.prototype.setTranslate = function(a, b, c) {
if (fa.workable) {
var d = this;
if (c = V(c)) {
d._translateAnim && d._translateAnim.stop(!0);
var e = d.translateX
, f = d.translateY;
c.action = function(c) {
d.setTranslate(e + (a - e) * c, f + (b - f) * c)
}
,
c.innerFunc = function() {
delete d._translateAnim
}
,
d._translateAnim = W(c)
} else
d.translateX = a,
d.translateY = b
}
}
,
hd.prototype.play = function(a) {
fa.windowDisabled = !0,
this._iframe.src = a
}
,
hd.prototype.reload = function() {
fa.actionEditor = null,
fa.shutdown(),
this.play(this._iframe.src)
}
,
hd.prototype.handleDelete = function() {
fa.hierarchy.handleDelete()
}
,
hd.prototype.handleCut = function() {
fa.hierarchy.handleCut()
}
,
hd.prototype.handleCopy = function() {
fa.hierarchy.handleCopy()
}
,
hd.prototype.handlePaste = function() {
fa.hierarchy.handlePaste()
}
,
hd.prototype.handleDuplicate = function() {
fa.hierarchy.handleDuplicate()
}
,
hd.prototype.reset = function(a) {
var b = this;
b.editable && fa.workable && (a ? b.setZoom(1, {
finishFunc: function() {
b.setTranslate(0, 0, a)
}
}) : (b.setZoom(1),
b.setTranslate(0, 0)))
}
,
hd.prototype.fitContent = function(a) {
var b = this;
if (b.editable && fa.workable) {
var c = b.game.world.rect
, d = c.x + c.width / 2
, e = c.y + c.height / 2
, f = b.clientWidth
, g = b.clientHeight
, h = Math.min(f / (c.width + 4), g / (c.height + 4))
, i = -d * b.zoom + f / 2
, j = -e * b.zoom + g / 2;
a ? b.setTranslate(i, j, {
finishFunc: function() {
b.setZoom(h, a)
}
}) : (b.setTranslate(i, j),
b.setZoom(h))
}
}
,
hd.prototype.focusData = function(a, b) {
var c = this;
if (c.editable && fa.workable) {
var d = c.game.world
, e = Ib(a.node);
e[0] = d.toLocal(e[0]),
e[1] = d.toLocal(e[1]),
e[2] = d.toLocal(e[2]),
e[3] = d.toLocal(e[3]);
var f = u(e);
(!f.width || f.width < .001) && (f.width = 50),
(!f.height || f.height < .001) && (f.height = 50);
var g = f.x + f.width / 2
, h = f.y + f.height / 2
, i = c.clientWidth
, j = c.clientHeight
, k = Math.min(i / (2.5 * f.width), j / (2.5 * f.height))
, l = -g * c.zoom + i / 2
, m = -h * c.zoom + j / 2;
b ? c.setTranslate(l, m, {
finishFunc: function() {
c.setZoom(k, b)
}
}) : (c.setTranslate(l, m),
c.setZoom(k))
}
}
,
hd.prototype.validateImpl = function() {
if (fa.workable) {
var a = this.game.phaser.scale
, b = this.clientWidth
, c = this.clientHeight;
if ((this._lastClientWidth !== b || this._lastClientHeight !== c) && (this._lastClientWidth = b,
this._lastClientHeight = c,
this.editable || this._resetPlayScaleMode(),
this.game.updateScale(),
this.game.world.updateDomRoot()),
this.editable || fa.editInRun) {
var d = this._editorCanvas;
(b !== d.clientWidth || c !== d.clientHeight) && (t(d, b, c),
this.editable && this._resetEditScaleMode());
var e = s(d, 0, 0, 1, {
x: 0,
y: 0,
width: b,
height: c
});
e.restore(),
e = s(d, a.margin.left, a.margin.top, a.scaleFactorInversed.x),
this.drawPath(e),
this.interactors && this.interactors.forEach(function(a) {
a.draw(e)
}),
e.restore()
}
}
}
,
hd.prototype.createDiv = function() {
var a = p()
, b = a.style;
return b.color = "white",
b.background = "rgba(0,0,0,0.3)",
b.font = k.labelFont,
b.padding = "6px",
b.borderRadius = "4px",
b.position = "absolute",
this._interactionDiv.appendChild(a),
a
}
,
hd.prototype.drawPath = function(a) {
fa.actionEditor && fa.actionEditor.drawPath(a)
}
,
hd.prototype.handleSelectionChange = function() {
this.editHitAreaEnabled = !1,
this.editBox2dVerticesEnabled = !1,
this.updateEditorCanvas()
}
,
b.defineProperties(hd.prototype, {
dataModel: {
get: function() {
return this._dataModel
},
set: function(a) {
var b = this;
if (!(a instanceof ic))
throw Error("dataModel对象必须是qc.editor.GameModel类型");
b._dataModel && b._dataModel.selectionModel.off("selectionChange", b.handleSelectionChange, b),
b._dataModel = a,
a.selectionModel.on("selectionChange", b.handleSelectionChange, b),
b.editable = b.editable,
b.gameSize = b.gameSize,
b.debugEnabled = b.debugEnabled
}
},
selectionModel: {
get: function() {
return this.dataModel.selectionModel
}
},
game: {
get: function() {
return this.dataModel ? this.dataModel.game : null
}
},
gameSize: {
get: function() {
return this._gameSize
},
set: function(a) {
var b = this._gameSize;
if (this._gameSize = a,
fa.workable && !this._editable && this._resetPlayScaleMode(),
this.epc("gameSize", b, a),
fa.workable && this._editable) {
var d = this.game.world;
a = this.game.fixedGameSize || a,
d._editorWidth = a ? a.width : c,
d._editorHeight = a ? a.height : c,
d.relayout()
}
}
},
translateX: {
get: function() {
return -this.game.camera.x
},
set: function(a) {
if (this.editable && fa.workable) {
var b = this.translateX;
this.game.camera.x = -a,
this.game.world.x = a,
this.epc("translateX", b, a)
}
}
},
translateY: {
get: function() {
return -this.game.camera.y
},
set: function(a) {
if (this.editable && fa.workable) {
var b = this.translateY;
this.game.camera.y = -a,
this.game.world.y = a,
this.epc("translateY", b, a)
}
}
},
debugEnabled: {
get: function() {
return this._debugEnabled
},
set: function(a) {
this._debugEnabled = a;
var b = fa.gameDebugger;
b && (a ? b.debugDiv.parentNode || this._interactionDiv.appendChild(b.debugDiv) : (b.debugDiv.parentNode && r(b.debugDiv),
b._debugDialog && b._debugDialog.hide()))
}
}
}),
hd.prototype._editable = !0,
hd.prototype._editParentEnabled = !0,
hd.prototype._editRotationEnabled = !0,
hd.prototype._editScaleEnabled = !0,
hd.prototype._editPivotEnabled = !0,
hd.prototype._editCornerEnabled = !0,
hd.prototype._editEdgeEnabled = !0,
hd.prototype._editMoveEnabled = !0,
hd.prototype._editRectTransformEnabled = !0,
hd.prototype._editHitAreaEnabled = !1,
hd.prototype._editBox2dVerticesEnabled = !1,
hd.prototype._editSelectionEnabled = !0,
hd.prototype._resetEditScaleMode = function() {
var a = this.game.phaser.scale;
a.scaleMode = Phaser.ScaleManager.NO_SCALE;
var b = this.clientWidth || 1
, c = this.clientHeight || 1;
a.setGameSize(b, c);
var d = this.game.camera;
d.bounds.setTo(-(1 / 0), -(1 / 0), 1 / 0, 1 / 0),
d.view.width = b / this.zoom,
d.view.height = c / this.zoom,
this.game.dirtyRectangle.forceDirty = !0
}
,
hd.prototype._resetPlayScaleMode = function() {
var a = this.game.phaser.scale;
if (a.scaleMode = Phaser.ScaleManager.SHOW_ALL,
!this.game.fixedGameSize) {
var b = this.gameSize
, c = this.clientWidth || 1
, d = this.clientHeight || 1
, e = b ? b.width : c
, f = b ? b.height : d
, g = e / f;
c / d > g ? a.setGameSize(d * g, d) : a.setGameSize(c, c / g)
}
this.game.dirtyRectangle.forceDirty = !0
}
,
hd.prototype._resetInteractors = function(a) {
var b = this;
a ? (b.interactors = [new md(b), new nd(b), new kd(b), new ld(b), new jd(b)],
b._editorCanvas.style.display = "block") : (b.interactors = null,
b._editorCanvas.style.display = "none")
}
,
b.defineProperties(hd.prototype, {
interactors: {
get: function() {
return this._interactors
},
set: function(a) {
var b = this._interactors;
b && b.forEach(function(a) {
a.tearDown()
}),
this._interactors = a,
a && a.forEach(function(a) {
a.setUp()
})
}
},
editable: {
get: function() {
return this._editable
},
set: function(a) {
var b = this
, c = b.game;
if (fa.workable) {
var d = c.phaser.scale;
this.dataModel.selectionModel.clearSelection(),
b.translateX = 0,
b.translateY = 0,
b.zoom = 1,
d.pageAlignHorizontally = !0,
d.pageAlignVertically = !0,
d.minWidth = null,
d.minHeight = null,
d.maxWidth = null,
d.maxHeight = null,
a ? (b._resetEditScaleMode(),
c.canvas.style.position = "absolute",
c.canvas.style.margin = 0,
c.input.enable = !1,
b._resetInteractors(!0)) : (b._resetPlayScaleMode(),
c.input.enable = !0,
b._resetInteractors(!1))
}
var e = b._editable;
b._editable = a,
b.epc("editable", e, a),
b.updateEditorCanvas()
}
},
editMode: {
get: function() {
return this._editMode
},
set: function(a) {
this.editHitAreaEnabled = !1,
this._editMode = a,
this.editParentEnabled = !1,
this.editRotationEnabled = !1,
this.editScaleEnabled = !1,
this.editPivotEnabled = !1,
this.editCornerEnabled = !1,
this.editEdgeEnabled = !1,
this.editMoveEnabled = !1,
this.editRectTransformEnabled = !1,
this.editSelectionEnabled = !1,
"pan" === a || ("default" === a ? (this.editRotationEnabled = !0,
this.editPivotEnabled = !0,
this.editMoveEnabled = !0,
this.editSelectionEnabled = !0) : "scale" === a ? (this.editParentEnabled = !0,
this.editScaleEnabled = !0,
this.editPivotEnabled = !0,
this.editMoveEnabled = !0,
this.editSelectionEnabled = !0) : "rectTransform" === a && (this.editCornerEnabled = !0,
this.editEdgeEnabled = !0,
this.editRectTransformEnabled = !0,
this.editSelectionEnabled = !0))
}
}
}),
hd.prototype._zoom = 1,
hd.prototype._minZoom = 1e-5,
hd.prototype._maxZoom = 1e8,
hd.prototype.scrollZoomIn = function(a) {
this._setZoomImpl(1.05 * this.zoom, a)
}
,
hd.prototype.scrollZoomOut = function(a) {
this._setZoomImpl(this.zoom / 1.05, a)
}
,
hd.prototype.pinchZoomIn = function(a) {
this._setZoomImpl(1.08 * this.zoom, a)
}
,
hd.prototype.pinchZoomOut = function(a) {
this._setZoomImpl(this.zoom / 1.08, a)
}
,
hd.prototype.adjustZoom = function(a) {
return a < this.minZoom ? this.minZoom : a > this.maxZoom ? this.maxZoom : a
}
,
hd.prototype.setZoom = function(a, b, c) {
var d = this;
if (d.editable && fa.workable)
if (b = V(b)) {
d._zoomAnim && d._zoomAnim.stop(!0);
var e = d.zoom;
b.action = function(b) {
d._setZoomImpl(e + (a - e) * b, c)
}
,
b.innerFunc = function() {
delete d._zoomAnim
}
,
d._zoomAnim = W(b)
} else
d._setZoomImpl(a, c)
}
,
hd.prototype._setZoomImpl = function(a, b) {
var c = this;
if (c.editable && fa.workable) {
var d = c.zoom;
if (a = c.adjustZoom(a),
a !== d && 0 !== a && !isNaN(a)) {
b && (b = c.game.world.toLocal(b));
var e = c.zoom
, f = c.game.camera.view
, g = {
x: f.x / e,
y: f.y / e,
width: f.width,
height: f.height
};
b = b ? b : {
x: g.x + g.width / 2,
y: g.y + g.height / 2
},
c.translateX = (b.x - g.x) * d - b.x * a,
c.translateY = (b.y - g.y) * d - b.y * a,
c.game.world.scaleX = a,
c.game.world.scaleY = a,
c._resetEditScaleMode(),
c.epc("zoom", d, a)
}
}
}
,
b.defineProperties(hd.prototype, {
zoom: {
get: function() {
return this.game.world.scaleX
},
set: function(a) {
this._setZoomImpl(a)
}
},
maxZoom: {
get: function() {
return this._maxZoom
},
set: function(a) {
var b = this._maxZoom;
this._maxZoom = a,
this.epc("maxZoom", b, a),
this._setZoomImpl(a)
}
},
minZoom: {
get: function() {
return this._minZoom
},
set: function(a) {
var b = this._minZoom;
this._minZoom = a,
this.epc("minZoom", b, a),
this._setZoomImpl(a)
}
}
}),
hd.prototype.updateEditorCanvas = function() {
(this.editable || fa.editInRun) && this.iv()
}
,
hd.prototype.checkForUpdate = function() {
if (this.editable || fa.editInRun) {
var a = this.dataModel.selectionModel.selection
, b = a.length;
if (b > 30)
this.iv();
else {
for (var c = this._checkCurrentEditNode(), d = 0; b > d; d++)
c = this._checkDataChange(a[d], c);
if (this._needToHighlightData() && (c = this._checkDataChange(fa.highlightData, c)),
!c) {
var e = this.game.phaser.scale;
(this._lastScaleMarginLeft !== e.margin.left || this._lastScaleMarginTop !== e.margin.top || this._lastScaleX !== e.scaleFactorInversed.x) && (c = !0),
c && (this._lastScaleMarginLeft = e.margin.left,
this._lastScaleMarginTop = e.margin.top,
this._lastScaleX = e.scaleFactorInversed.x,
fa.game.world.updateDomRoot())
}
c && this.iv()
}
this.validate()
}
}
,
hd.prototype._needToHighlightData = function() {
if (!fa.highlightData)
return !1;
if (fa.highlightData === fa.currentEditNode)
return !1;
var a = this._interactionState;
return a.editing || a.panning || a.moving || a.selecting ? !1 : !0
}
,
hd.prototype._checkDataChange = function(a, b) {
var c = a.node
, d = a.cache
, e = c.phaser.worldTransform;
return b || (d.a !== e.a || d.b !== e.b || d.c !== e.c || d.d !== e.d || d.tx !== e.tx || d.ty !== e.ty || d.width !== c.width || d.height !== c.height || d.pivotX !== c.pivotX || d.pivotY !== c.pivotY) && (b = !0),
b && (d.a = e.a,
d.b = e.b,
d.c = e.c,
d.d = e.d,
d.tx = e.tx,
d.ty = e.ty,
d.width = c.width,
d.height = c.height,
d.pivotX = c.pivotX,
d.pivotY = c.pivotY),
b
}
,
hd.prototype._checkCurrentEditNode = function() {
var a = !1
, b = fa.currentEditNode;
if (!b)
return a;
var c = this.dataModel.getDataById(b.uuid);
if (!c)
return a;
var d = c.cache;
if (a || (d.minAnchorX !== b.minAnchor.x || d.minAnchorY !== b.minAnchor.y || d.maxAnchorX !== b.maxAnchor.x || d.maxAnchorY !== b.maxAnchor.y) && (a = !0),
a && (d.minAnchorX = b.minAnchor.x,
d.minAnchorY = b.minAnchor.y,
d.maxAnchorX = b.maxAnchor.x,
d.maxAnchorY = b.maxAnchor.y),
this.editHitAreaEnabled) {
var e = d.hitArea
, f = b.hitArea;
a || (!e && f ? a = !0 : e && !f ? a = !0 : e && f && (e.x !== f.x || e.y !== f.y || e.width !== f.width || e.height !== f.height || e["class"] !== f["class"]) && (a = !0)),
a && (d.hitArea = f ? {
x: f.x,
y: f.y,
width: f.width,
height: f.height,
"class": f["class"]
} : null)
}
return a
}
;
var id = m(null, b, function(a) {
this._scene = a
}, {
draw: function() {},
setUp: function() {
this.addListeners()
},
tearDown: function() {
this.removeListeners()
},
toData: function(a) {
return a ? this.dataModel.getDataById(a.uuid) : null
}
}, {
interactor: !0
}, {
view: {
get: function() {
return this.scene._interactionDiv
}
},
game: {
get: function() {
return this.scene.game
}
},
dataModel: {
get: function() {
return this.scene.dataModel
}
},
selectionModel: {
get: function() {
return this.dataModel.selectionModel
}
},
scene: {
get: function() {
return this._scene
}
},
interactionState: {
get: function() {
return this.scene._interactionState
}
}
});
id.prototype.toGlobal = function(a) {
var b, c, d = this.game.phaser.scale, e = this.view.getBoundingClientRect();
return 2 === arguments.length ? (b = arguments[0],
c = arguments[1]) : (a = hc(a),
b = a.clientX,
c = a.clientY),
{
x: (b - e.left - d.margin.left) * d.scaleFactor.x,
y: (c - e.top - d.margin.top) * d.scaleFactor.y
}
}
,
id.prototype._iterateChildren = function(a, b) {
!b.visible || b.__lock || b._bone || (b instanceof qc.UIRoot || a.push(b),
b.children.forEach(function(b) {
this._iterateChildren(a, b)
}, this))
}
,
id.prototype.getNodeAt = function(a, b) {
var c = this
, d = c.toGlobal(a)
, e = [];
if (!c.game.world)
return null;
c.game.world.children.forEach(function(a) {
c._iterateChildren(e, a)
});
for (var f = null, g = e.length - 1; g >= 0; g--) {
var h = e[g];
if (this.hitNode(h, d)) {
if (b)
return h;
if (this.selectionModel.isSelected(this.toData(h)))
return h;
f || (f = h)
}
}
return f
}
,
id.prototype.selectNextNode = function(a) {
var b = this
, c = b.toGlobal(a)
, d = [];
if (b.game.world) {
b.game.world.children.forEach(function(a) {
b._iterateChildren(d, a)
});
for (var e = null, f = !1, g = d.length - 1; g >= 0; g--) {
var h = d[g];
if (this.hitNode(h, c))
if (this.selectionModel.isSelected(this.toData(h)))
f = !0;
else if (e || (e = h),
f) {
e = h;
break
}
}
if (e) {
var i = this.toData(e);
this.selectionModel.isSelected(i) || (this.selectionModel.selection = i)
}
}
}
,
id.prototype.hitNode = function(a, b) {
var c = a.toLocal(b)
, d = a.width * -a.pivotX
, e = a.height * -a.pivotY
, f = a.width
, g = a.height;
0 > f && (f = -f,
d -= f),
0 > g && (g = -g,
e -= g);
var h = new Phaser.Rectangle(d,e,f,g);
return h.contains(c.x, c.y)
}
;
var jd = m(null, id, function(a) {
jd["super"].constructor.call(this, a)
}, {
handle_mousemove: function(a) {
this.interactionState.editing || this.interactionState.panning || this.interactionState.moving || this.interactionState.selecting || (fa.highlightData = this.toData(this.getNodeAt(a, !0)))
},
handle_mousedown: function(a) {
this.handle_touchstart(a)
},
handle_touchstart: function(a) {
a.preventDefault(),
this.scene.requestFocus(),
M(a) > 1 || this.interactionState.editing || this.scene.editSelectionEnabled && this.getNodeAt(a) || N(a) && !P(a) && (this.translateX = this.scene.translateX,
this.translateY = this.scene.translateY,
this.lastGlobalPoint = this.toGlobal(a),
z(this, a))
},
handleWindowMouseUp: function(a) {
this.handleWindowTouchEnd(a)
},
handleWindowTouchEnd: function() {
this.interactionState.panning && delete this.interactionState.panning,
this.translateX = this.translateY = this.lastGlobalPoint = null
},
handleWindowMouseMove: function(a) {
this.handleWindowTouchMove(a)
},
handleWindowTouchMove: function(a) {
this.interactionState.panning = !0;
var b = this.toGlobal(a);
this.scene.setTranslate(this.translateX + b.x - this.lastGlobalPoint.x, this.translateY + b.y - this.lastGlobalPoint.y)
},
handle_mousewheel: function(a) {
this.handleScroll(a, a.wheelDelta)
},
handle_DOMMouseScroll: function(a) {
2 === a.axis && this.handleScroll(a, -a.detail)
},
handleScroll: function(a, b) {
a.preventDefault(),
b > 0 ? this.scene.scrollZoomIn(this.toGlobal(a)) : 0 > b && this.scene.scrollZoomOut(this.toGlobal(a))
},
handle_keydown: function(a) {
if (Y(a),
D(a))
this.selectionModel.selectAll();
else if (E(a))
fa.hierarchy.handleDelete();
else if (!this.dataModel.hasLockedSelection() && (J(a) || K(a) || H(a) || I(a))) {
var b = 0
, c = 0;
H(a) ? b = -1 : I(a) ? b = 1 : J(a) ? c = -1 : K(a) && (c = 1),
this.dataModel.moveSelection(b, c)
}
}
})
, kd = m(null, id, function(a) {
kd["super"].constructor.call(this, a)
}, {
clearFileListSelection: function() {
fa.fileList.selectionModel.clearSelection()
},
handle_mousedown: function(a) {
this.handle_touchstart(a)
},
handle_touchstart: function(a) {
var b = this;
if (b.hitBackgroundPoint = null,
b.doubleSelectPoint = null,
this.scene.editSelectionEnabled && !(M(a) > 1 || b.interactionState.editing)) {
b.clearFileListSelection();
var c = b.selectionModel
, d = b.getNodeAt(a)
, e = b.toData(d);
e ? (b.scene.editHitAreaEnabled = !1,
b.scene.editBox2dVerticesEnabled = !1,
P(a) ? c.isSelected(e) ? c.removeSelection(e) : c.appendSelection(e) : c.isSelected(e) ? b.doubleSelectPoint = B(a) : c.selection = e) : P(a) ? N(a) && (P(a) || c.clearSelection(),
b.interactionState.selecting = !0,
b.startGlobalPoint = b.toGlobal(a),
z(b, a)) : b.hitBackgroundPoint = B(a)
}
},
handle_mouseup: function(a) {
this.handle_touchend(a)
},
handle_touchend: function(a) {
this.hitBackgroundPoint && (y(this.hitBackgroundPoint, B(a)) <= 2 && (this.selectionModel.clearSelection(),
this.scene.editHitAreaEnabled = !1,
this.scene.editBox2dVerticesEnabled = !1),
this.hitBackgroundPoint = null),
this.doubleSelectPoint && (y(this.doubleSelectPoint, B(a)) <= 2 && this.selectNextNode(a),
this.doubleSelectPoint = null)
},
handleWindowMouseUp: function(a) {
this.handleWindowTouchEnd(a)
},
handleWindowTouchEnd: function() {
this.hitBackgroundPoint = null,
this.doubleSelectPoint = null,
this.startGlobalPoint && (this.mask && r(this.mask),
this.startGlobalPoint = this.mask = this.oldSelection = null,
delete this.interactionState.selecting)
},
handleWindowMouseMove: function(a) {
this.handleWindowTouchMove(a)
},
handleWindowTouchMove: function(a) {
var b = this;
b.mask || (b.oldSelection = b.selectionModel.selection.slice(),
b.mask = p(!1, b.view),
b.mask.style.border = "rgba(255,255,255,0.7) solid 1px",
b.mask.style.background = "rgba(200,200,255,0.3)");
var c = u(b.startGlobalPoint, b.toGlobal(a));
n(b.mask, c);
var d = {};
b.dataModel.forEach(function(a) {
Jb(a.node, c) && (d[a.uuid] = a)
});
var e = [];
b.oldSelection.forEach(function(a) {
d[a.uuid] ? delete d[a.uuid] : e.push(a)
});
for (var f in d)
e.push(d[f]);
b.selectionModel.selection = e
}
})
, ld = m(null, id, function(a) {
ld["super"].constructor.call(this, a)
}, {
handle_mousedown: function(a) {
this.handle_touchstart(a)
},
handle_touchstart: function(a) {
if (!(M(a) > 1 || !N(a) || this.interactionState.editing)) {
var b = this.getNodeAt(a);
b && (this.lastGlobalPoint = this.toGlobal(a),
z(this, a))
}
},
handleWindowMouseUp: function(a) {
this.handleWindowTouchEnd(a)
},
handleWindowTouchEnd: function() {
this.undo && fa.undo.add(this.undo, this.dataModel.createMoveUndoFunc()),
this.undo = this.interactionState.moving = this.lastGlobalPoint = this.globalPoint = null,
this.scene.updateEditorCanvas()
},
handleWindowMouseMove: function(a) {
this.handleWindowTouchMove(a)
},
handleWindowTouchMove: function(a) {
if (!this.dataModel.hasLockedSelection()) {
var b = this.toGlobal(a)
, c = b.x - this.lastGlobalPoint.x
, d = b.y - this.lastGlobalPoint.y;
if ((!this.interactionState.moving || "pending" === this.interactionState.moving) && Math.abs(c) <= 2 && Math.abs(d) <= 2)
return void (this.interactionState.moving = "pending");
this.interactionState.moving = !0,
this.undo || (this.undo = this.dataModel.createMoveUndoFunc()),
this.dataModel.moveSelection(c, d),
this.lastGlobalPoint = b
}
}
})
, md = m(null, id, function(a) {
md["super"].constructor.call(this, a)
}, {
handle_touchstart: function(a) {
if (2 === M(a)) {
a.preventDefault(),
z(this, a);
var b = {
x: a.touches[0].clientX,
y: a.touches[0].clientY
}
, c = {
x: a.touches[1].clientX,
y: a.touches[1].clientY
};
this.lastDistance = y(b, c)
}
},
handleWindowTouchEnd: function() {
self.lastDistance = null
},
handleWindowTouchMove: function(a) {
if (2 === M(a)) {
var b = {
x: event.touches[0].clientX,
y: event.touches[0].clientY
}
, c = {
x: event.touches[1].clientX,
y: event.touches[1].clientY
}
, d = y(b, c)
, e = this.toGlobal((b.x + c.x) / 2, (b.y + c.y) / 2);
this.lastDistance < d ? this.scene.pinchZoomIn(e) : this.scene.pinchZoomOut(e),
this.lastDistance = d
}
}
})
, nd = m(null, id, function(a) {
nd["super"].constructor.call(this, a)
}, {
RESIZE_TYPE_MAP: {
resize: !0,
left: !0,
top: !0,
bottom: !0,
right: !0
},
ANCHOR_TYPE_MAP: {
A0: !0,
A1: !0,
A2: !0,
A3: !0,
A: !0
},
handle_mousemove: function(a) {
this.handle_touchmove(a)
},
handle_touchmove: function(a) {
!A() && N(a) && this.checkEdit(a)
},
handle_mousedown: function(a) {
this.handle_touchstart(a)
},
handle_touchstart: function(a) {
if (N(a) && this.checkEdit(a)) {
var b = this.editInfo;
if ("box2dPoint" === b.type) {
if (P(a)) {
var c = this.node._body._rawVertices;
return c.splice(b.index, 1),
void this.node.body.setPolygonVertices(c, !0)
}
} else if ("box2dLine" === b.type) {
var d = this.toGlobal(a);
d = this.node.toLocal(d);
var e = this.node.rect;
e.width && (d.x = (d.x - e.x) / e.width),
e.height && (d.y = (d.y - e.y) / e.height);
var c = this.node._body._rawVertices;
c.splice(b.index, 0, d),
this.node.body.setPolygonVertices(c, !0)
}
z(this, a),
this.isDragging = !0
}
},
handleWindowMouseUp: function(a) {
this.handleWindowTouchEnd(a)
},
handleWindowTouchEnd: function() {
var a = this.dataModel
, b = this.editInfo;
if (b) {
var c, d = b.type, e = b.node, f = b.undo;
if (f)
this.RESIZE_TYPE_MAP[d] ? c = a.createResizeUndoFunc(e) : this.ANCHOR_TYPE_MAP[d] ? c = a.createAnchorUndoFunc(e) : "move" === d || "axisX" === d || "axisY" === d ? c = a.createMoveUndoFunc(e) : "pivot" === d ? c = a.createPivotUndoFunc(e) : "rotation" === d ? c = a.createRotationUndoFunc(e) : ("scaleX" === d || "scaleY" === d) && (c = a.createScaleUndoFunc(e)),
c && fa.undo.add(f, c);
else if ("parent" === d) {
var g = b.targetNode;
if (xb(g))
try {
f = a.createParentUndoFunc(e),
b.node.switchParent(g),
c = a.createParentUndoFunc(e),
fa.undo.add(f, c),
this.selectionModel.clearSelection(),
this.selectionModel.selection = this.toData(b.node)
} catch (h) {
fa.log.error(h.stack)
}
}
}
this.cursor = "",
delete this.editInfo,
delete this.isDragging,
delete this.interactionState.editing,
this.scene.updateEditorCanvas()
},
handleWindowMouseMove: function(a) {
this.handleWindowTouchMove(a)
},
handleWindowTouchMove: function(a) {
this.handleEdit(a)
},
draw: function(a) {
this.drawEdit(a)
}
});
nd.prototype.drawEdit = function(a) {
this.node = this.resizePoints = this.position = this.parentPoint = this.rotationPoint = this.axisXPoint = this.axisYPoint = this.movePoints = this.anchorInfo = this.hitPoints = this.box2dVertices = null,
this.drawGrid(a),
this.drawGameBounds(a),
this.drawEdges(a),
this.drawHighlighData(a),
this.node = fa.currentEditNode = this.dataModel.lastEditableNode,
this.node && (this.position = this.node.getWorldPosition(),
this.resizePoints = Ib(this.node),
this.node.__lock && (a.globalAlpha = .5),
this.drawRectTransform(a),
this.scene.editHitAreaEnabled ? this.drawHitArea(a) : this.scene.editBox2dVerticesEnabled ? this.drawBox2dVertices(a) : (this.drawResizeCorner(a),
this.drawAxisX(a),
this.drawAxisY(a),
this.drawMoveRect(a),
this.drawPivot(a),
this.drawChangingParent(a)),
this.node.__lock && (a.globalAlpha = 1))
}
,
nd.prototype.drawGameBounds = function(a) {
var b = this.game.world
, c = b.rect
, d = b.toGlobal({
x: 0,
y: 0
})
, e = b.toGlobal({
x: c.width,
y: c.height
});
a.beginPath(),
a.rect(Math.round(d.x), Math.round(d.y), Math.round(e.x - d.x), Math.round(e.y - d.y)),
Ub(a)
}
,
nd.prototype.drawBox2dVertices = function(a) {
var b = this.node
, c = this.box2dVertices = [];
if (b._body && b._body._rawVertices)
for (var d = b.rect, e = 0; e < b._body._rawVertices.length; e++) {
var f = b._body._rawVertices[e];
f = {
x: d.x + f.x * d.width,
y: d.y + f.y * d.height
},
c.push(b.toGlobal(f))
}
if (c.length > 1) {
var f = c[0];
a.beginPath(),
a.moveTo(f.x, f.y);
for (var e = 1; e < c.length; e++)
f = c[e],
a.lineTo(f.x, f.y);
a.closePath(),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment