Commit 9b8ae891 authored by haiyoucuv's avatar haiyoucuv

1

parent a3eb0863
File added
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="TsLint" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="JavaScriptSettings"> <component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" /> <option name="languageLevel" value="FLOW" />
</component> </component>
</project> </project>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<changelist name="Uncommitted_changes_before_Checkout_at_2020_5_15,_2_12_下午_[Default_Changelist]" date="1589523138013" recycled="false" toDelete="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2020_5_15,_2_12_下午_[Default_Changelist]/shelved.patch" />
<option name="DESCRIPTION" value="Uncommitted changes before Checkout at 2020/5/15, 2:12 下午 [Default Changelist]" />
</changelist>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<changelist name="Uncommitted_changes_before_Update_at_2020_5_14,_2_47_下午_[Default_Changelist]" date="1589438835098" recycled="false" toDelete="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_2020_5_14,_2_47_下午_[Default_Changelist]/shelved.patch" />
<option name="DESCRIPTION" value="Uncommitted changes before Update at 2020/5/14, 2:47 下午 [Default Changelist]" />
</changelist>
\ No newline at end of file
<changelist name="Uncommitted_changes_before_Update_at_2020_5_14,_2_47_下午_[Default_Changelist]1" date="1589438857749" recycled="true" deleted="true">
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_2020_5_14,_2_47_下午_[Default_Changelist]1/shelved.patch" />
<option name="DESCRIPTION" value="Uncommitted changes before Update at 2020/5/14, 2:47 下午 [Default Changelist]" />
</changelist>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="af35c04f-08f6-48ed-85db-2f94c60e87fd" name="Default Changelist" comment="" /> <list default="true" id="af35c04f-08f6-48ed-85db-2f94c60e87fd" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/debug/engine.js" beforeDir="false" afterPath="$PROJECT_DIR$/debug/engine.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/debug/engine.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/debug/engine.js.map" afterDir="false" />
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/rollup.config.js" beforeDir="false" afterPath="$PROJECT_DIR$/rollup.config.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/2d/display/Container.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/2d/display/Container.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/2d/display/Sprite.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/2d/display/Sprite.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/2d/display/Stage.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/2d/display/Stage.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/2d/events/Event.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/2d/events/Event.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/zeroing/decorators/auto-adjust.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/zeroing/decorators/auto-adjust.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/zeroing/game-warpper/GameStage.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/zeroing/game-warpper/GameStage.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/zeroing/launcher.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/zeroing/launcher.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/zeroing/utils/utils.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/zeroing/utils/utils.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/yarn.lock" beforeDir="false" afterPath="$PROJECT_DIR$/yarn.lock" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
...@@ -10,9 +26,9 @@ ...@@ -10,9 +26,9 @@
<component name="FileTemplateManagerImpl"> <component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES"> <option name="RECENT_TEMPLATES">
<list> <list>
<option value="JavaScript File" />
<option value="MarkDown" /> <option value="MarkDown" />
<option value="TypeScript File" /> <option value="TypeScript File" />
<option value="JavaScript File" />
</list> </list>
</option> </option>
</component> </component>
...@@ -25,28 +41,31 @@ ...@@ -25,28 +41,31 @@
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
<option name="UPDATE_TYPE" value="MERGE" /> <option name="UPDATE_TYPE" value="MERGE" />
</component> </component>
<component name="IgnoredFileRootStore"> <component name="JsFlowSettings">
<option name="generatedRoots"> <service-enabled>true</service-enabled>
<set> <exe-path />
<option value="$PROJECT_DIR$/.idea" /> <other-services-enabled>true</other-services-enabled>
</set> <auto-save>true</auto-save>
</option>
</component> </component>
<component name="ProjectId" id="1ZYzLmPKm3UfhIZLkr8RtiZwhUf" /> <component name="ProjectId" id="1ZYzLmPKm3UfhIZLkr8RtiZwhUf" />
<component name="ProjectViewState"> <component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showExcludedFiles" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" /> <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" /> <property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/src/zeroing/game-warpper/mvvm" /> <property name="last_opened_file_path" value="$PROJECT_DIR$/src/zeroing/game-warpper/mvvm" />
<property name="node.js.detected.package.eslint" value="true" />
<property name="node.js.path.for.package.eslint" value="project" />
<property name="node.js.path.for.package.tslint" value="project" />
<property name="node.js.selected.package.eslint" value="(autodetect)" />
<property name="node.js.selected.package.tslint" value="(autodetect)" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" /> <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" /> <property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="nodejs_package_manager_path" value="yarn" /> <property name="nodejs_package_manager_path" value="yarn" />
<property name="run.code.analysis.last.selected.profile" value="pProject Default" /> <property name="run.code.analysis.last.selected.profile" value="pProject Default" />
<property name="settings.editor.selected.configurable" value="settings.typescriptcompiler" /> <property name="settings.editor.selected.configurable" value="yiiguxing.plugin.translate" />
<property name="ts.external.directory.path" value="$PROJECT_DIR$/node_modules/typescript/lib" /> <property name="ts.external.directory.path" value="$PROJECT_DIR$/node_modules/typescript/lib" />
</component> </component>
<component name="RecentsManager"> <component name="RecentsManager">
...@@ -108,8 +127,8 @@ ...@@ -108,8 +127,8 @@
</configuration> </configuration>
<recent_temporary> <recent_temporary>
<list> <list>
<item itemvalue="npm.preprocess" />
<item itemvalue="npm.dev" /> <item itemvalue="npm.dev" />
<item itemvalue="npm.preprocess" />
<item itemvalue="npm.declare" /> <item itemvalue="npm.declare" />
<item itemvalue="npm.debug" /> <item itemvalue="npm.debug" />
<item itemvalue="npm.build:prod" /> <item itemvalue="npm.build:prod" />
...@@ -157,15 +176,22 @@ ...@@ -157,15 +176,22 @@
<workItem from="1587606438033" duration="14026000" /> <workItem from="1587606438033" duration="14026000" />
<workItem from="1587696728690" duration="5561000" /> <workItem from="1587696728690" duration="5561000" />
<workItem from="1587713741312" duration="310000" /> <workItem from="1587713741312" duration="310000" />
<workItem from="1589536818547" duration="8764000" />
<workItem from="1589709011120" duration="341000" />
<workItem from="1589766926355" duration="379000" />
<workItem from="1589767318703" duration="29000" />
<workItem from="1589767471060" duration="25732000" />
<workItem from="1589853014410" duration="21858000" />
<workItem from="1589888428282" duration="5840000" />
</task> </task>
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" /> <option name="version" value="2" />
<option name="exactExcludedFiles"> <option name="exactExcludedFiles">
<list> <list>
<option value="$PROJECT_DIR$/examples/scripts/Wave.js" />
<option value="$PROJECT_DIR$/examples/scripts/TouchZoom.js" /> <option value="$PROJECT_DIR$/examples/scripts/TouchZoom.js" />
<option value="$PROJECT_DIR$/examples/scripts/Wave.js" />
</list> </list>
</option> </option>
</component> </component>
...@@ -190,37 +216,37 @@ ...@@ -190,37 +216,37 @@
<screen x="1680" y="-229" width="1920" height="1177" /> <screen x="1680" y="-229" width="1920" height="1177" />
</state> </state>
<state width="969" height="466" key="DebuggerActiveHint/35.23.1645.1027/1680.-229.1920.1177@1680.-229.1920.1177" timestamp="1585535223173" /> <state width="969" height="466" key="DebuggerActiveHint/35.23.1645.1027/1680.-229.1920.1177@1680.-229.1920.1177" timestamp="1585535223173" />
<state width="584" height="1056" key="GridCell.Tab.0.bottom" timestamp="1587713730150"> <state width="493" height="821" key="GridCell.Tab.0.bottom" timestamp="1589897780335">
<screen x="1680" y="-252" width="1920" height="1200" /> <screen x="1680" y="-229" width="1920" height="1177" />
</state> </state>
<state width="276" height="1101" key="GridCell.Tab.0.bottom/0.0.1680.1050/1680.-252.1920.1200@1680.-252.1920.1200" timestamp="1587712516387" /> <state width="276" height="1101" key="GridCell.Tab.0.bottom/0.0.1680.1050/1680.-252.1920.1200@1680.-252.1920.1200" timestamp="1587712516387" />
<state width="584" height="1056" key="GridCell.Tab.0.bottom/0.23.1680.1027/1680.-252.1920.1200@1680.-252.1920.1200" timestamp="1587713730150" /> <state width="584" height="1056" key="GridCell.Tab.0.bottom/0.23.1680.1027/1680.-252.1920.1200@1680.-252.1920.1200" timestamp="1587713730150" />
<state width="584" height="1056" key="GridCell.Tab.0.bottom/35.23.1645.1027/1680.-229.1920.1177@1680.-229.1920.1177" timestamp="1587710590931" /> <state width="493" height="821" key="GridCell.Tab.0.bottom/35.23.1645.1027/1680.-229.1920.1177@1680.-229.1920.1177" timestamp="1589897780335" />
<state width="336" height="906" key="GridCell.Tab.0.bottom/35.23.1645.1027/1680.-229.1920.1177@35.23.1645.1027" timestamp="1585720951511" /> <state width="687" height="907" key="GridCell.Tab.0.bottom/35.23.1645.1027/1680.-229.1920.1177@35.23.1645.1027" timestamp="1589767347615" />
<state width="427" height="906" key="GridCell.Tab.0.bottom/35.23.1645.1027@35.23.1645.1027" timestamp="1586963282147" /> <state width="427" height="906" key="GridCell.Tab.0.bottom/35.23.1645.1027@35.23.1645.1027" timestamp="1586963282147" />
<state width="584" height="1056" key="GridCell.Tab.0.center" timestamp="1587713730146"> <state width="493" height="821" key="GridCell.Tab.0.center" timestamp="1589897780335">
<screen x="1680" y="-252" width="1920" height="1200" /> <screen x="1680" y="-229" width="1920" height="1177" />
</state> </state>
<state width="276" height="1101" key="GridCell.Tab.0.center/0.0.1680.1050/1680.-252.1920.1200@1680.-252.1920.1200" timestamp="1587712516380" /> <state width="276" height="1101" key="GridCell.Tab.0.center/0.0.1680.1050/1680.-252.1920.1200@1680.-252.1920.1200" timestamp="1587712516380" />
<state width="584" height="1056" key="GridCell.Tab.0.center/0.23.1680.1027/1680.-252.1920.1200@1680.-252.1920.1200" timestamp="1587713730146" /> <state width="584" height="1056" key="GridCell.Tab.0.center/0.23.1680.1027/1680.-252.1920.1200@1680.-252.1920.1200" timestamp="1587713730146" />
<state width="584" height="1056" key="GridCell.Tab.0.center/35.23.1645.1027/1680.-229.1920.1177@1680.-229.1920.1177" timestamp="1587710590929" /> <state width="493" height="821" key="GridCell.Tab.0.center/35.23.1645.1027/1680.-229.1920.1177@1680.-229.1920.1177" timestamp="1589897780335" />
<state width="336" height="906" key="GridCell.Tab.0.center/35.23.1645.1027/1680.-229.1920.1177@35.23.1645.1027" timestamp="1585720951508" /> <state width="687" height="907" key="GridCell.Tab.0.center/35.23.1645.1027/1680.-229.1920.1177@35.23.1645.1027" timestamp="1589767347614" />
<state width="427" height="906" key="GridCell.Tab.0.center/35.23.1645.1027@35.23.1645.1027" timestamp="1586963282146" /> <state width="427" height="906" key="GridCell.Tab.0.center/35.23.1645.1027@35.23.1645.1027" timestamp="1586963282146" />
<state width="584" height="1056" key="GridCell.Tab.0.left" timestamp="1587713730145"> <state width="493" height="821" key="GridCell.Tab.0.left" timestamp="1589897780334">
<screen x="1680" y="-252" width="1920" height="1200" /> <screen x="1680" y="-229" width="1920" height="1177" />
</state> </state>
<state width="276" height="1101" key="GridCell.Tab.0.left/0.0.1680.1050/1680.-252.1920.1200@1680.-252.1920.1200" timestamp="1587712516377" /> <state width="276" height="1101" key="GridCell.Tab.0.left/0.0.1680.1050/1680.-252.1920.1200@1680.-252.1920.1200" timestamp="1587712516377" />
<state width="584" height="1056" key="GridCell.Tab.0.left/0.23.1680.1027/1680.-252.1920.1200@1680.-252.1920.1200" timestamp="1587713730145" /> <state width="584" height="1056" key="GridCell.Tab.0.left/0.23.1680.1027/1680.-252.1920.1200@1680.-252.1920.1200" timestamp="1587713730145" />
<state width="584" height="1056" key="GridCell.Tab.0.left/35.23.1645.1027/1680.-229.1920.1177@1680.-229.1920.1177" timestamp="1587710590928" /> <state width="493" height="821" key="GridCell.Tab.0.left/35.23.1645.1027/1680.-229.1920.1177@1680.-229.1920.1177" timestamp="1589897780334" />
<state width="336" height="906" key="GridCell.Tab.0.left/35.23.1645.1027/1680.-229.1920.1177@35.23.1645.1027" timestamp="1585720951505" /> <state width="687" height="907" key="GridCell.Tab.0.left/35.23.1645.1027/1680.-229.1920.1177@35.23.1645.1027" timestamp="1589767347614" />
<state width="427" height="906" key="GridCell.Tab.0.left/35.23.1645.1027@35.23.1645.1027" timestamp="1586963282146" /> <state width="427" height="906" key="GridCell.Tab.0.left/35.23.1645.1027@35.23.1645.1027" timestamp="1586963282146" />
<state width="584" height="1056" key="GridCell.Tab.0.right" timestamp="1587713730146"> <state width="493" height="821" key="GridCell.Tab.0.right" timestamp="1589897780335">
<screen x="1680" y="-252" width="1920" height="1200" /> <screen x="1680" y="-229" width="1920" height="1177" />
</state> </state>
<state width="276" height="1101" key="GridCell.Tab.0.right/0.0.1680.1050/1680.-252.1920.1200@1680.-252.1920.1200" timestamp="1587712516385" /> <state width="276" height="1101" key="GridCell.Tab.0.right/0.0.1680.1050/1680.-252.1920.1200@1680.-252.1920.1200" timestamp="1587712516385" />
<state width="584" height="1056" key="GridCell.Tab.0.right/0.23.1680.1027/1680.-252.1920.1200@1680.-252.1920.1200" timestamp="1587713730146" /> <state width="584" height="1056" key="GridCell.Tab.0.right/0.23.1680.1027/1680.-252.1920.1200@1680.-252.1920.1200" timestamp="1587713730146" />
<state width="584" height="1056" key="GridCell.Tab.0.right/35.23.1645.1027/1680.-229.1920.1177@1680.-229.1920.1177" timestamp="1587710590930" /> <state width="493" height="821" key="GridCell.Tab.0.right/35.23.1645.1027/1680.-229.1920.1177@1680.-229.1920.1177" timestamp="1589897780335" />
<state width="336" height="906" key="GridCell.Tab.0.right/35.23.1645.1027/1680.-229.1920.1177@35.23.1645.1027" timestamp="1585720951509" /> <state width="687" height="907" key="GridCell.Tab.0.right/35.23.1645.1027/1680.-229.1920.1177@35.23.1645.1027" timestamp="1589767347615" />
<state width="427" height="906" key="GridCell.Tab.0.right/35.23.1645.1027@35.23.1645.1027" timestamp="1586963282147" /> <state width="427" height="906" key="GridCell.Tab.0.right/35.23.1645.1027@35.23.1645.1027" timestamp="1586963282147" />
<state x="445" y="278" key="IDE.errors.dialog" timestamp="1585719736587"> <state x="445" y="278" key="IDE.errors.dialog" timestamp="1585719736587">
<screen x="35" y="23" width="1645" height="1027" /> <screen x="35" y="23" width="1645" height="1027" />
...@@ -230,10 +256,14 @@ ...@@ -230,10 +256,14 @@
<screen x="1680" y="-229" width="1920" height="1177" /> <screen x="1680" y="-229" width="1920" height="1177" />
</state> </state>
<state x="2356" y="82" key="MultipleFileMergeDialog/35.23.1645.1027/1680.-229.1920.1177@1680.-229.1920.1177" timestamp="1586919094159" /> <state x="2356" y="82" key="MultipleFileMergeDialog/35.23.1645.1027/1680.-229.1920.1177@1680.-229.1920.1177" timestamp="1586919094159" />
<state x="2149" y="-2" key="SettingsEditor" timestamp="1585555176349"> <state x="631" y="245" key="RollbackChangesDialog" timestamp="1589766990893">
<screen x="35" y="23" width="1645" height="1027" />
</state>
<state x="631" y="245" key="RollbackChangesDialog/35.23.1645.1027/1680.-229.1920.1177@35.23.1645.1027" timestamp="1589766990893" />
<state x="2149" y="-2" key="SettingsEditor" timestamp="1589888551577">
<screen x="1680" y="-229" width="1920" height="1177" /> <screen x="1680" y="-229" width="1920" height="1177" />
</state> </state>
<state x="2149" y="-2" key="SettingsEditor/35.23.1645.1027/1680.-229.1920.1177@1680.-229.1920.1177" timestamp="1585555176349" /> <state x="2149" y="-2" key="SettingsEditor/35.23.1645.1027/1680.-229.1920.1177@1680.-229.1920.1177" timestamp="1589888551577" />
<state x="2441" y="283" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1587713822207"> <state x="2441" y="283" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1587713822207">
<screen x="1680" y="-229" width="1920" height="1177" /> <screen x="1680" y="-229" width="1920" height="1177" />
</state> </state>
...@@ -248,11 +278,12 @@ ...@@ -248,11 +278,12 @@
<screen x="1680" y="-229" width="1920" height="1177" /> <screen x="1680" y="-229" width="1920" height="1177" />
</state> </state>
<state x="2327" y="157" key="git4idea.merge.GitPullDialog/35.23.1645.1027/1680.-229.1920.1177@1680.-229.1920.1177" timestamp="1587714144888" /> <state x="2327" y="157" key="git4idea.merge.GitPullDialog/35.23.1645.1027/1680.-229.1920.1177@1680.-229.1920.1177" timestamp="1587714144888" />
<state x="2305" y="18" width="670" height="690" key="search.everywhere.popup" timestamp="1587713287518"> <state x="2305" y="36" width="670" height="676" key="search.everywhere.popup" timestamp="1589893517546">
<screen x="1680" y="-252" width="1920" height="1200" /> <screen x="1680" y="-229" width="1920" height="1177" />
</state> </state>
<state x="2305" y="18" width="670" height="690" key="search.everywhere.popup/0.0.1680.1050/1680.-252.1920.1200@1680.-252.1920.1200" timestamp="1587713287518" /> <state x="2305" y="18" width="670" height="690" key="search.everywhere.popup/0.0.1680.1050/1680.-252.1920.1200@1680.-252.1920.1200" timestamp="1587713287518" />
<state x="2305" y="36" width="670" height="676" key="search.everywhere.popup/35.23.1645.1027/1680.-229.1920.1177@1680.-229.1920.1177" timestamp="1587712362381" /> <state x="2305" y="36" width="670" height="676" key="search.everywhere.popup/35.23.1645.1027/1680.-229.1920.1177@1680.-229.1920.1177" timestamp="1589893517546" />
<state x="570" y="254" width="670" height="590" key="search.everywhere.popup/35.23.1645.1027/1680.-229.1920.1177@35.23.1645.1027" timestamp="1587004990635" /> <state x="570" y="254" width="670" height="590" key="search.everywhere.popup/35.23.1645.1027/1680.-229.1920.1177@35.23.1645.1027" timestamp="1587004990635" />
<state x="570" y="254" width="670" height="590" key="search.everywhere.popup/35.23.1645.1027@35.23.1645.1027" timestamp="1589767535433" />
</component> </component>
</project> </project>
\ No newline at end of file
...@@ -2,10 +2,10 @@ var __extends;var __assign;var __rest;var __decorate;var __param;var __metadata; ...@@ -2,10 +2,10 @@ var __extends;var __assign;var __rest;var __decorate;var __param;var __metadata;
}};__exportStar=function(m,exports){for(var p in m){if(!exports.hasOwnProperty(p)){exports[p]=m[p]}}};__values=function(o){var m=typeof Symbol==="function"&&o[Symbol.iterator],i=0;if(m){return m.call(o)}return{next:function(){if(o&&i>=o.length){o=void 0}return{value:o&&o[i++],done:!o}}}};__read=function(o,n){var m=typeof Symbol==="function"&&o[Symbol.iterator];if(!m){return o}var i=m.call(o),r,ar=[],e;try{while((n===void 0||n-->0)&&!(r=i.next()).done){ar.push(r.value)}}catch(error){e={error:error}}finally{try{if(r&&!r.done&&(m=i["return"])){m.call(i)}}finally{if(e){throw e.error}}}return ar};__spread=function(){for(var ar=[],i=0;i<arguments.length;i++){ar=ar.concat(__read(arguments[i]))}return ar};__spreadArrays=function(){for(var s=0,i=0,il=arguments.length;i<il;i++){s+=arguments[i].length}for(var r=Array(s),k=0,i=0;i<il;i++){for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++){r[k]=a[j]}}return r};__await=function(v){return this instanceof __await?(this.v=v,this):new __await(v)};__asyncGenerator=function(thisArg,_arguments,generator){if(!Symbol.asyncIterator){throw new TypeError("Symbol.asyncIterator is not defined.")}var g=generator.apply(thisArg,_arguments||[]),i,q=[];return i={},verb("next"),verb("throw"),verb("return"),i[Symbol.asyncIterator]=function(){return this},i;function verb(n){if(g[n]){i[n]=function(v){return new Promise(function(a,b){q.push([n,v,a,b])>1||resume(n,v)})}}}function resume(n,v){try{step(g[n](v))}catch(e){settle(q[0][3],e)}}function step(r){r.value instanceof __await?Promise.resolve(r.value.v).then(fulfill,reject):settle(q[0][2],r)}function fulfill(value){resume("next",value)}function reject(value){resume("throw",value)}function settle(f,v){if(f(v),q.shift(),q.length){resume(q[0][0],q[0][1])}}};__asyncDelegator=function(o){var i,p;return i={},verb("next"),verb("throw",function(e){throw e}),verb("return"),i[Symbol.iterator]=function(){return this},i;function verb(n,f){i[n]=o[n]?function(v){return(p=!p)?{value:__await(o[n](v)),done:n==="return"}:f?f(v):v}:f}};__asyncValues=function(o){if(!Symbol.asyncIterator){throw new TypeError("Symbol.asyncIterator is not defined.")}var m=o[Symbol.asyncIterator],i;return m?m.call(o):(o=typeof __values==="function"?__values(o):o[Symbol.iterator](),i={},verb("next"),verb("throw"),verb("return"),i[Symbol.asyncIterator]=function(){return this},i);function verb(n){i[n]=o[n]&&function(v){return new Promise(function(resolve,reject){v=o[n](v),settle(resolve,reject,v.done,v.value)})}}function settle(resolve,reject,d,v){Promise.resolve(v).then(function(v){resolve({value:v,done:d})},reject)}};__makeTemplateObject=function(cooked,raw){if(Object.defineProperty){Object.defineProperty(cooked,"raw",{value:raw})}else{cooked.raw=raw}return cooked};__importStar=function(mod){if(mod&&mod.__esModule){return mod}var result={};if(mod!=null){for(var k in mod){if(Object.hasOwnProperty.call(mod,k)){result[k]=mod[k]}}}result["default"]=mod;return result};__importDefault=function(mod){return(mod&&mod.__esModule)?mod:{"default":mod}};exporter("__extends",__extends);exporter("__assign",__assign);exporter("__rest",__rest);exporter("__decorate",__decorate);exporter("__param",__param);exporter("__metadata",__metadata);exporter("__awaiter",__awaiter);exporter("__generator",__generator);exporter("__exportStar",__exportStar);exporter("__values",__values);exporter("__read",__read);exporter("__spread",__spread);exporter("__spreadArrays",__spreadArrays);exporter("__await",__await);exporter("__asyncGenerator",__asyncGenerator);exporter("__asyncDelegator",__asyncDelegator);exporter("__asyncValues",__asyncValues);exporter("__makeTemplateObject",__makeTemplateObject);exporter("__importStar",__importStar);exporter("__importDefault",__importDefault)}); }};__exportStar=function(m,exports){for(var p in m){if(!exports.hasOwnProperty(p)){exports[p]=m[p]}}};__values=function(o){var m=typeof Symbol==="function"&&o[Symbol.iterator],i=0;if(m){return m.call(o)}return{next:function(){if(o&&i>=o.length){o=void 0}return{value:o&&o[i++],done:!o}}}};__read=function(o,n){var m=typeof Symbol==="function"&&o[Symbol.iterator];if(!m){return o}var i=m.call(o),r,ar=[],e;try{while((n===void 0||n-->0)&&!(r=i.next()).done){ar.push(r.value)}}catch(error){e={error:error}}finally{try{if(r&&!r.done&&(m=i["return"])){m.call(i)}}finally{if(e){throw e.error}}}return ar};__spread=function(){for(var ar=[],i=0;i<arguments.length;i++){ar=ar.concat(__read(arguments[i]))}return ar};__spreadArrays=function(){for(var s=0,i=0,il=arguments.length;i<il;i++){s+=arguments[i].length}for(var r=Array(s),k=0,i=0;i<il;i++){for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++){r[k]=a[j]}}return r};__await=function(v){return this instanceof __await?(this.v=v,this):new __await(v)};__asyncGenerator=function(thisArg,_arguments,generator){if(!Symbol.asyncIterator){throw new TypeError("Symbol.asyncIterator is not defined.")}var g=generator.apply(thisArg,_arguments||[]),i,q=[];return i={},verb("next"),verb("throw"),verb("return"),i[Symbol.asyncIterator]=function(){return this},i;function verb(n){if(g[n]){i[n]=function(v){return new Promise(function(a,b){q.push([n,v,a,b])>1||resume(n,v)})}}}function resume(n,v){try{step(g[n](v))}catch(e){settle(q[0][3],e)}}function step(r){r.value instanceof __await?Promise.resolve(r.value.v).then(fulfill,reject):settle(q[0][2],r)}function fulfill(value){resume("next",value)}function reject(value){resume("throw",value)}function settle(f,v){if(f(v),q.shift(),q.length){resume(q[0][0],q[0][1])}}};__asyncDelegator=function(o){var i,p;return i={},verb("next"),verb("throw",function(e){throw e}),verb("return"),i[Symbol.iterator]=function(){return this},i;function verb(n,f){i[n]=o[n]?function(v){return(p=!p)?{value:__await(o[n](v)),done:n==="return"}:f?f(v):v}:f}};__asyncValues=function(o){if(!Symbol.asyncIterator){throw new TypeError("Symbol.asyncIterator is not defined.")}var m=o[Symbol.asyncIterator],i;return m?m.call(o):(o=typeof __values==="function"?__values(o):o[Symbol.iterator](),i={},verb("next"),verb("throw"),verb("return"),i[Symbol.asyncIterator]=function(){return this},i);function verb(n){i[n]=o[n]&&function(v){return new Promise(function(resolve,reject){v=o[n](v),settle(resolve,reject,v.done,v.value)})}}function settle(resolve,reject,d,v){Promise.resolve(v).then(function(v){resolve({value:v,done:d})},reject)}};__makeTemplateObject=function(cooked,raw){if(Object.defineProperty){Object.defineProperty(cooked,"raw",{value:raw})}else{cooked.raw=raw}return cooked};__importStar=function(mod){if(mod&&mod.__esModule){return mod}var result={};if(mod!=null){for(var k in mod){if(Object.hasOwnProperty.call(mod,k)){result[k]=mod[k]}}}result["default"]=mod;return result};__importDefault=function(mod){return(mod&&mod.__esModule)?mod:{"default":mod}};exporter("__extends",__extends);exporter("__assign",__assign);exporter("__rest",__rest);exporter("__decorate",__decorate);exporter("__param",__param);exporter("__metadata",__metadata);exporter("__awaiter",__awaiter);exporter("__generator",__generator);exporter("__exportStar",__exportStar);exporter("__values",__values);exporter("__read",__read);exporter("__spread",__spread);exporter("__spreadArrays",__spreadArrays);exporter("__await",__await);exporter("__asyncGenerator",__asyncGenerator);exporter("__asyncDelegator",__asyncDelegator);exporter("__asyncValues",__asyncValues);exporter("__makeTemplateObject",__makeTemplateObject);exporter("__importStar",__importStar);exporter("__importDefault",__importDefault)});
var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: __decorate,__param: __param,__metadata: __metadata,__awaiter: __awaiter,__generator: __generator,__exportStar: __exportStar,__values: __values,__read: __read,__spread: __spread,__spreadArrays: __spreadArrays,__await: __await,__asyncGenerator: __asyncGenerator,__asyncDelegator: __asyncDelegator,__asyncValues: __asyncValues,__makeTemplateObject: __makeTemplateObject,__importStar: __importStar,__importDefault: __importDefault}; var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: __decorate,__param: __param,__metadata: __metadata,__awaiter: __awaiter,__generator: __generator,__exportStar: __exportStar,__values: __values,__read: __read,__spread: __spread,__spreadArrays: __spreadArrays,__await: __await,__asyncGenerator: __asyncGenerator,__asyncDelegator: __asyncDelegator,__asyncValues: __asyncValues,__makeTemplateObject: __makeTemplateObject,__importStar: __importStar,__importDefault: __importDefault};
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tslib')) : typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tslib'), require('props-compute')) :
typeof define === 'function' && define.amd ? define(['exports', 'tslib'], factory) : typeof define === 'function' && define.amd ? define(['exports', 'tslib', 'props-compute'], factory) :
(global = global || self, factory(global.engine = {}, global.tslib)); (global = global || self, factory(global.engine = {}, global.tslib, global.propsCompute));
}(this, function (exports, tslib_1) { 'use strict'; }(this, (function (exports, tslib_1, propsCompute) { 'use strict';
var HashObject = (function () { var HashObject = (function () {
function HashObject() { function HashObject() {
...@@ -63,6 +63,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -63,6 +63,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
s.type = type; s.type = type;
delete s.data; delete s.data;
}; };
Event.MAYBE_ALIGN = "maybeAlign";
Event.RESIZE = "onResize"; Event.RESIZE = "onResize";
Event.ON_SCROLL_TO_HEAD = "onScrollToHead"; Event.ON_SCROLL_TO_HEAD = "onScrollToHead";
Event.ON_SCROLL_STOP = "onScrollStop"; Event.ON_SCROLL_STOP = "onScrollStop";
...@@ -1634,135 +1635,6 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -1634,135 +1635,6 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return MouseEvent; return MouseEvent;
}(Event)); }(Event));
function applyAutoAdjust(ctor) {
ctor.prototype.applyAutoAdjust = function () {
var adjustProxy = this.adjustProxy = new AdjustProxy(this);
this.addEventListener(Event.ADDED_TO_STAGE, adjustProxy.onAddedToStage, adjustProxy);
this.addEventListener(Event.REMOVED_FROM_STAGE, adjustProxy.onRemovedFromStage, adjustProxy);
};
var temp = new AdjustProxy(null);
var _loop_1 = function (key) {
Object.defineProperty(ctor.prototype, key, {
get: function () {
return this.adjustProxy.data[key];
},
set: function (v) {
var adjustProxy = this.adjustProxy;
if (adjustProxy.data[key] !== v) {
adjustProxy.data[key] = v;
adjustProxy.makeDirty();
}
},
enumerable: true,
configurable: true
});
};
for (var key in temp.data) {
_loop_1(key);
}
}
var AdjustProxy = (function () {
function AdjustProxy(host) {
this.data = {
percentWidth: NaN,
percentHeight: NaN,
left: NaN,
top: NaN,
right: NaN,
bottom: NaN,
horizonCenter: NaN,
verticalCenter: NaN,
};
this._host = host;
this.makeDirty();
}
AdjustProxy.prototype.makeDirty = function () {
this._sizeDirty = true;
};
AdjustProxy.prototype.onAddedToStage = function (e) {
this._host.parent.addEventListener(Event.RESIZE, this.onResize, this);
this._host.addEventListener(Event.RESIZE, this.onResize, this);
this._host.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, this);
};
AdjustProxy.prototype.onRemovedFromStage = function (e) {
this._host.removeEventListener(Event.RESIZE, this.onResize, this);
this._host.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
};
AdjustProxy.prototype.setFrom = function (adjustProxy) {
for (var k in adjustProxy.data) {
this.data[k] = adjustProxy.data[k];
}
};
AdjustProxy.prototype.onResize = function (e) {
this._sizeDirty = true;
};
AdjustProxy.prototype.onEnterFrame = function (e) {
if (this._sizeDirty) {
this._sizeDirty = false;
this.adjustLayout();
}
};
AdjustProxy.prototype.adjustLayout = function () {
var that = this._host;
var _a = that.parent, pWidth = _a.width, pHeight = _a.height;
var width = that.width, height = that.height;
var _b = this.data, percentWidth = _b.percentWidth, percentHeight = _b.percentHeight, left = _b.left, top = _b.top, right = _b.right, bottom = _b.bottom, horizonCenter = _b.horizonCenter, verticalCenter = _b.verticalCenter;
var applyPercentWidth = function () {
if (t(percentWidth)) {
that.width = pWidth * percentWidth / 100;
}
};
var applyPercentHeight = function () {
if (t(percentHeight)) {
that.height = pHeight * percentHeight / 100;
}
};
var pw = true, ph = true;
if (t(horizonCenter)) {
applyPercentWidth();
that.x = (pWidth - that.width) / 2 + horizonCenter;
}
else {
if (t(left)) {
that.x = left;
if (t(right)) {
that.width = pWidth - left - right;
pw = false;
}
}
else if (t(right)) {
that.x = pWidth - width - right;
}
if (pw) {
applyPercentWidth();
}
}
if (t(verticalCenter)) {
applyPercentHeight();
that.y = (pHeight - that.height) / 2 + verticalCenter;
}
else {
if (t(top)) {
that.y = top;
if (t(bottom)) {
that.height = pHeight - top - bottom;
ph = false;
}
}
else if (t(bottom)) {
that.y = pHeight - height - bottom;
}
if (ph) {
applyPercentHeight();
}
}
};
return AdjustProxy;
}());
function t(v) {
return !isNaN(v) && v !== null && v !== undefined;
}
var ESCAPE_REG_EXP = /\$\{[\u4e00-\u9fa5_a-zA-Z0-9\|]+\}/g; var ESCAPE_REG_EXP = /\$\{[\u4e00-\u9fa5_a-zA-Z0-9\|]+\}/g;
var linkedFlag = '$_linked_$'; var linkedFlag = '$_linked_$';
var nodeScheme = 'node://'; var nodeScheme = 'node://';
...@@ -2016,6 +1888,198 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -2016,6 +1888,198 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
} }
} }
function toBoolean(v) {
return !isNaN(v) && v !== null && v !== undefined;
}
var AlignManager = (function () {
function AlignManager() {
this.alignList = [];
}
AlignManager.prototype.flush = function () {
var _this = this;
this.alignList.forEach(function (v) {
_this.autoSize(v);
_this.align(v);
});
this.alignList.forEach(function (v) {
if (v.alignMode === ALIGN_MODE.ONCE) {
v.alignEnabled = false;
}
});
this.alignList.length = 0;
};
AlignManager.prototype.align = function (that) {
var _this = this;
if (!that.alignEnabled)
return;
var percentWidth = that.percentWidth, percentHeight = that.percentHeight, left = that.left, top = that.top, right = that.right, bottom = that.bottom, horizonCenter = that.horizonCenter, verticalCenter = that.verticalCenter;
var _a = that._width, tW_Z = _a === void 0 ? 0 : _a, _b = that._height, tH_Z = _b === void 0 ? 0 : _b;
var _c = (that.parent || {}), _d = _c._width, pW_Z = _d === void 0 ? 0 : _d, _e = _c._height, pH_Z = _e === void 0 ? 0 : _e;
if (toBoolean(left) && toBoolean(right)) {
that.x = left;
that.width = pW_Z - left - right;
}
else {
toBoolean(percentWidth) && (tW_Z = that.width = pW_Z * percentWidth / 100);
if (toBoolean(horizonCenter)) {
that.x = pW_Z / 2 - tW_Z / 2 + horizonCenter;
}
else if (toBoolean(left)) {
that.x = left;
}
else if (toBoolean(right)) {
that.x = pW_Z - right - tW_Z;
}
}
if (toBoolean(top) && toBoolean(bottom)) {
that.y = top;
that.height = pH_Z - top - bottom;
}
else {
toBoolean(percentHeight) && (tH_Z = that.height = pH_Z * percentHeight / 100);
if (toBoolean(verticalCenter)) {
that.y = pH_Z / 2 - tH_Z / 2 + verticalCenter;
}
else if (toBoolean(top)) {
that.y = top;
}
else if (toBoolean(bottom)) {
that.y = pH_Z - bottom - tH_Z;
}
}
that.children.forEach(function (v) { return _this.align(v); });
};
AlignManager.prototype.autoSize = function (that) {
var len = that.children.length;
if (len > 0) {
if (that.autoWidth && !toBoolean(that.right) && !toBoolean(that.percentWidth)) {
var max = 0;
for (var i = 0; i < len; i++) {
if (toBoolean(that.children[i].right))
continue;
var _x = that.children[i].x || 0;
var _w = that.children[i].__width || 0;
if (_x + _w > max) {
max = _x + _w;
}
}
that.width = max;
}
if (that.autoHeight && !toBoolean(that.bottom) && !toBoolean(that.percentHeight)) {
var max = 0;
for (var i = 0; i < len; i++) {
if (toBoolean(that.children[i].bottom))
continue;
var _y = that.children[i].y || 0;
var _h = that.children[i].__height || 0;
if (_y + _h > max) {
max = _y + _h;
}
}
that.height = max;
}
}
};
AlignManager.prototype.addAlign = function (obj) {
if (this.alignList.indexOf(obj) < 0) {
this.alignList.push(obj);
}
};
return AlignManager;
}());
var alignMgr = new AlignManager();
function applyAutoAdjust(ctor) {
ctor.prototype.applyAutoAdjust = function () {
var adjustProxy = this.adjustProxy = new AdjustProxy(this);
this.addEventListener(Event.ADDED_TO_STAGE, adjustProxy.onAddedToStage, adjustProxy);
this.addEventListener(Event.REMOVED_FROM_STAGE, adjustProxy.onRemovedFromStage, adjustProxy);
};
var temp = new AdjustProxy(null);
var _loop_1 = function (key) {
if (key == 'alignMode')
return "continue";
Object.defineProperty(ctor.prototype, key, {
get: function () {
return this.adjustProxy.data[key];
},
set: function (v) {
var adjustProxy = this.adjustProxy;
if (adjustProxy.data[key] !== v && !(isNaN(adjustProxy.data[key]) && isNaN(v))) {
adjustProxy.data[key] = v;
adjustProxy.makeDirty();
}
},
enumerable: true,
configurable: true
});
};
for (var key in temp.data) {
_loop_1(key);
}
Object.defineProperty(ctor.prototype, 'alignMode', {
get: function () {
return this.adjustProxy.data['alignMode'];
},
set: function (v) {
var adjustProxy = this.adjustProxy;
if (adjustProxy.data['alignMode'] !== v) {
adjustProxy.data['alignMode'] = v;
adjustProxy.makeDirty();
if (v == ALIGN_MODE.ALWAYS)
this.alignEnabled = true;
}
},
enumerable: true,
configurable: true
});
}
var ALIGN_MODE;
(function (ALIGN_MODE) {
ALIGN_MODE["ONCE"] = "once";
ALIGN_MODE["ALWAYS"] = "always";
})(ALIGN_MODE || (ALIGN_MODE = {}));
var AdjustProxy = (function () {
function AdjustProxy(host) {
this.data = {
percentWidth: NaN,
percentHeight: NaN,
left: NaN,
top: NaN,
right: NaN,
bottom: NaN,
horizonCenter: NaN,
verticalCenter: NaN,
alignEnabled: true,
alignMode: ALIGN_MODE.ALWAYS,
};
this._host = host;
this.makeDirty();
}
AdjustProxy.prototype.makeDirty = function () {
this._sizeDirty = true;
this._host && alignMgr.addAlign(this._host);
this._host && this._host.parent && this._host.parent.adjustProxy.makeDirty();
};
AdjustProxy.prototype.onAddedToStage = function (e) {
this._host.addEventListener(Event.MAYBE_ALIGN, this.readyAlign, this);
};
AdjustProxy.prototype.onRemovedFromStage = function (e) {
this._host.removeEventListener(Event.MAYBE_ALIGN, this.readyAlign);
};
AdjustProxy.prototype.setFrom = function (adjustProxy) {
for (var k in adjustProxy.data) {
this.data[k] = adjustProxy.data[k];
}
};
AdjustProxy.prototype.readyAlign = function (e) {
this._sizeDirty = true;
this._host && alignMgr.addAlign(this._host);
this._host && this._host.parent && this._host.parent.adjustProxy.makeDirty();
};
return AdjustProxy;
}());
function transPoint(str, sep) { function transPoint(str, sep) {
if (sep === void 0) { sep = ','; } if (sep === void 0) { sep = ','; }
...@@ -3093,6 +3157,10 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -3093,6 +3157,10 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
function Container() { function Container() {
var _this = _super.call(this) || this; var _this = _super.call(this) || this;
_this._mouseChildren = true; _this._mouseChildren = true;
_this.__width = 0;
_this.__height = 0;
_this._autoWidth = false;
_this._autoHeight = false;
_this._instanceType = "Container"; _this._instanceType = "Container";
_this.children = []; _this.children = [];
_this._transform = _this.transform; _this._transform = _this.transform;
...@@ -3113,14 +3181,10 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -3113,14 +3181,10 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
Container.prototype.afterConstructor = function () { Container.prototype.afterConstructor = function () {
}; };
Container.prototype.onChildrenChange = function (index) { Container.prototype.onChildrenChange = function (index) {
this.dispatchEvent(Event.MAYBE_ALIGN);
}; };
Container.prototype.attachVisibility = function () { Container.prototype.attachVisibility = function () {
return; return;
this.dispatchEvent(this.worldVisible ? Event.VISIBLE : Event.HIDDEN);
for (var i = 0, li = this.children.length; i < li; i++) {
var child = this.children[i];
child.attachVisibility();
}
}; };
Container.prototype.addChild = function (child) { Container.prototype.addChild = function (child) {
this.addChildAt(child, this.children.length); this.addChildAt(child, this.children.length);
...@@ -3516,6 +3580,14 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -3516,6 +3580,14 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
this._width = value; this._width = value;
this._localBoundsSelf.width = value; this._localBoundsSelf.width = value;
this.dispatchEvent(Event.RESIZE); this.dispatchEvent(Event.RESIZE);
this.dispatchEvent(Event.MAYBE_ALIGN);
}
if (toBoolean(this.percentWidth)
|| (toBoolean(this.left) && toBoolean(this.right))) {
this.__width = 0;
}
else {
this.__width = value;
} }
}, },
enumerable: true, enumerable: true,
...@@ -3530,7 +3602,67 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -3530,7 +3602,67 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
this._height = value; this._height = value;
this._localBoundsSelf.height = value; this._localBoundsSelf.height = value;
this.dispatchEvent(Event.RESIZE); this.dispatchEvent(Event.RESIZE);
this.dispatchEvent(Event.MAYBE_ALIGN);
} }
if (toBoolean(this.percentHeight)
|| (toBoolean(this.top) && toBoolean(this.bottom))) {
this.__height = 0;
}
else {
this.__height = value;
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(Container.prototype, "autoWidth", {
get: function () {
return this._autoWidth;
},
set: function (autoWidth) {
this._autoWidth = autoWidth;
this.right = NaN;
this.percentWidth = NaN;
this.adjustProxy.makeDirty();
},
enumerable: true,
configurable: true
});
Object.defineProperty(Container.prototype, "autoHeight", {
get: function () {
return this._autoHeight;
},
set: function (autoHeight) {
this._autoHeight = autoHeight;
this.bottom = NaN;
this.percentHeight = NaN;
this.adjustProxy.makeDirty();
},
enumerable: true,
configurable: true
});
Object.defineProperty(Container.prototype, "x", {
get: function () {
return this.position.x;
},
set: function (value) {
if (value == this.transform.position.x)
return;
this.transform.position.x = value;
this.dispatchEvent(Event.MAYBE_ALIGN);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Container.prototype, "y", {
get: function () {
return this.position.y;
},
set: function (value) {
if (value == this.transform.position.y)
return;
this.transform.position.y = value;
this.dispatchEvent(Event.MAYBE_ALIGN);
}, },
enumerable: true, enumerable: true,
configurable: true configurable: true
...@@ -4675,7 +4807,6 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -4675,7 +4807,6 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
function determineCrossOrigin(url, loc) { function determineCrossOrigin(url, loc) {
if (loc === void 0) { loc = window.location; }
if (url.indexOf('data:') === 0) { if (url.indexOf('data:') === 0) {
return ''; return '';
} }
...@@ -5405,7 +5536,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -5405,7 +5536,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return color; return color;
} }
function inputFeildIosEnable() { function inputFeildIosEnable() {
var u = navigator.userAgent, app = navigator.appVersion; var u = navigator.userAgent;
var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
if (isIOS) { if (isIOS) {
setTimeout(function () { setTimeout(function () {
...@@ -5745,9 +5876,17 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -5745,9 +5876,17 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return Math.abs(this.scale.x) * this._texture.orig.width; return Math.abs(this.scale.x) * this._texture.orig.width;
}, },
set: function (value) { set: function (value) {
value = Math.abs(value);
var s = sign(this.scale.x) || 1; var s = sign(this.scale.x) || 1;
this.scale.x = s * value / this._texture.orig.width; this.scale.x = s * value / this._texture.orig.width;
this._width = value; this._width = value;
this.dispatchEvent(Event.MAYBE_ALIGN);
if (isNaN(this.percentWidth) || this.percentWidth === null) {
this.__width = value;
}
else {
this.__width = 0;
}
}, },
enumerable: true, enumerable: true,
configurable: true configurable: true
...@@ -5757,9 +5896,17 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -5757,9 +5896,17 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return Math.abs(this.scale.y) * this._texture.orig.height; return Math.abs(this.scale.y) * this._texture.orig.height;
}, },
set: function (value) { set: function (value) {
value = Math.abs(value);
var s = sign(this.scale.y) || 1; var s = sign(this.scale.y) || 1;
this.scale.y = s * value / this._texture.orig.height; this.scale.y = s * value / this._texture.orig.height;
this._height = value; this._height = value;
this.dispatchEvent(Event.MAYBE_ALIGN);
if (isNaN(this.percentHeight) || this.percentHeight === null) {
this.__height = value;
}
else {
this.__height = 0;
}
}, },
enumerable: true, enumerable: true,
configurable: true configurable: true
...@@ -8331,6 +8478,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -8331,6 +8478,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
Stage.flushAll = function () { Stage.flushAll = function () {
if (!GlobalPro.startTime) if (!GlobalPro.startTime)
GlobalPro.startTime = Date.now(); GlobalPro.startTime = Date.now();
alignMgr.flush();
if (!Stage._pause) { if (!Stage._pause) {
var len = Stage.allUpdateObjList.length; var len = Stage.allUpdateObjList.length;
for (var i = 0; i < len; i++) { for (var i = 0; i < len; i++) {
...@@ -11354,24 +11502,31 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -11354,24 +11502,31 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
var failedList = []; var failedList = [];
return Promise.all(config.map(function (assetConfig) { return Promise.all(config.map(function (assetConfig) {
assetsConfig.push(assetConfig); assetsConfig.push(assetConfig);
var url = assetConfig.url, ext = assetConfig.ext, uuid = assetConfig.uuid; if (assetConfig.url.indexOf(linkScheme) === 0) {
var linkUUID = assetConfig.url.replace(linkScheme, '');
assetConfig = getAssetByUUID(linkUUID);
}
if (assetConfig) {
var url_1 = assetConfig.url, ext = assetConfig.ext, uuid = assetConfig.uuid;
var loadFunc = loaderMapping[ext]; var loadFunc = loaderMapping[ext];
if (loadFunc) { if (loadFunc) {
if (url.indexOf(linkScheme) === 0) {
loaded++;
onProgress && onProgress(loaded, total);
return Promise.resolve();
}
var method = globalLoader['load' + loadFunc]; var method = globalLoader['load' + loadFunc];
return method.call(globalLoader, url, uuid).then(function (data) { return method.call(globalLoader, url_1, uuid).then(function (data) {
parse(assetConfig, data); parse(assetConfig, data);
loaded++; loaded++;
onProgress && onProgress(loaded, total); onProgress && onProgress(loaded, total);
}, function (error) { }, function (error) {
failedList.push(url); failedList.push(url_1);
}); });
} }
else { else {
return p();
}
}
else {
return p();
}
function p() {
loaded++; loaded++;
onProgress && onProgress(loaded, total); onProgress && onProgress(loaded, total);
return Promise.resolve(); return Promise.resolve();
...@@ -17150,10 +17305,14 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -17150,10 +17305,14 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
if (playEffect === void 0) { playEffect = true; } if (playEffect === void 0) { playEffect = true; }
return new Promise(function (resolve) { return new Promise(function (resolve) {
var action = 'popAll'; var action = 'popAll';
var lastView = _this.getChildAt(0);
var len = _this.childNum; var len = _this.childNum;
while (_this.children.length > 1) { if (len == 0) {
_this.removeChildAt(1); resolve();
return;
}
var lastView = _this.getChildAt(len);
while (_this.children.length > 2) {
_this.removeChildAt(0);
} }
if (_this._mutex) { if (_this._mutex) {
_this._stack.splice(0); _this._stack.splice(0);
...@@ -17162,7 +17321,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -17162,7 +17321,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
view.visible = false; view.visible = false;
_this.addChild(view); _this.addChild(view);
} }
var data = { action: action, view: view, lastView: lastView, options: options, hasView: len > 1 }; var data = { action: action, view: view, lastView: lastView, options: options, hasView: false };
_this.dispatchEvent(Event.START, data); _this.dispatchEvent(Event.START, data);
playViewEffect(playEffect ? options ? options.effect : null : null, options ? options.effectParams : {}, _this._mutex, lastView, view, _this, function () { playViewEffect(playEffect ? options ? options.effect : null : null, options ? options.effectParams : {}, _this._mutex, lastView, view, _this, function () {
_this.dispatchEvent(Event.COMPLETE, data); _this.dispatchEvent(Event.COMPLETE, data);
...@@ -20885,9 +21044,9 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -20885,9 +21044,9 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return sendData(); return sendData();
}; };
} }
function accessLog(pagebizid, params) { function accessLog(pageBizId, params) {
var p = { var p = {
pagebizid: pagebizid, pageBizId: pageBizId,
}; };
injectProp(p, params); injectProp(p, params);
return httpRequest('buriedPoint', 'get', p); return httpRequest('buriedPoint', 'get', p);
...@@ -20999,30 +21158,22 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -20999,30 +21158,22 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}); });
GameStage.prototype.launch = function (config, onPreloadAssetsProgress, onPreloadAssetsComplete, onStart) { GameStage.prototype.launch = function (config, onPreloadAssetsProgress, onPreloadAssetsComplete, onStart) {
return tslib_1.__awaiter(this, void 0, void 0, function () { return tslib_1.__awaiter(this, void 0, void 0, function () {
function p() { var _a, env, dataMapping, processes, builtinProcesses, customs;
loaded++; return tslib_1.__generator(this, function (_b) {
onPreloadAssetsProgress && onPreloadAssetsProgress(loaded, total); switch (_b.label) {
if (loaded >= total) {
onPreloadAssetsComplete && onPreloadAssetsComplete();
}
}
var assets, customs, loaded, assetsToLoad, total;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0: case 0:
this._config = config; this._config = config;
assets = config.assets, customs = config.customs; _a = this._config, env = _a.options.env, dataMapping = _a.dataMapping, processes = _a.processes, builtinProcesses = _a.builtinProcesses, customs = _a.customs;
loaded = 0; Stage.addUpdateObj(Tween);
assetsToLoad = assets; injectEnv(env);
if (!Array.isArray(assets)) { registerCustomModules(customs);
assetsToLoad = assets['common']; if (dataMapping) {
this.dataCenter.registerDataMapping(dataMapping);
} }
total = assetsToLoad.length; setProcessMetaLibs(processes, builtinProcesses);
return [4, loadAssets(assetsToLoad, p).catch(function (e) { return [4, this.loadPreloadAssets(onPreloadAssetsProgress, onPreloadAssetsComplete)];
console.log(e);
})];
case 1: case 1:
_a.sent(); _b.sent();
this.start(); this.start();
dealPxEnv(); dealPxEnv();
dealPageRemainTime(); dealPageRemainTime();
...@@ -21035,14 +21186,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -21035,14 +21186,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
GameStage.prototype.start = function () { GameStage.prototype.start = function () {
var _this = this; var _this = this;
var _a = this._config, _b = _a.options, entrySceneView = _b.entrySceneView, env = _b.env, dataMapping = _a.dataMapping, processes = _a.processes, builtinProcesses = _a.builtinProcesses, scripts = _a.scripts, customs = _a.customs; var entrySceneView = this._config.options.entrySceneView;
Stage.addUpdateObj(Tween);
injectEnv(env);
registerCustomModules(customs);
if (dataMapping) {
this.dataCenter.registerDataMapping(dataMapping);
}
setProcessMetaLibs(processes, builtinProcesses);
setTimeout(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () { setTimeout(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
var sceneEntry; var sceneEntry;
return tslib_1.__generator(this, function (_a) { return tslib_1.__generator(this, function (_a) {
...@@ -21119,6 +21263,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -21119,6 +21263,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
groups[viewConfig.uuid] = depAssets; groups[viewConfig.uuid] = depAssets;
} }
} }
if (!(Object.keys(groups).length > 0)) return [3, 2];
return [4, loadAssetsGroups(groups, function () { return tslib_1.__awaiter(_this, void 0, void 0, function () { return [4, loadAssetsGroups(groups, function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) { return tslib_1.__generator(this, function (_a) {
switch (_a.label) { switch (_a.label) {
...@@ -21206,6 +21351,58 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -21206,6 +21351,58 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
GameStage.prototype.onPopupContainerComplete = function (e) { GameStage.prototype.onPopupContainerComplete = function (e) {
}; };
GameStage.prototype.loadPreloadAssets = function (onPreloadAssetsProgress, onPreloadAssetsComplete) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
function p() {
loaded++;
onPreloadAssetsProgress && onPreloadAssetsProgress(loaded, total);
if (loaded >= total) {
onPreloadAssetsComplete && onPreloadAssetsComplete();
}
}
var assets, loaded, assetsToLoad, total;
var _this = this;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
assets = this._config.assets;
loaded = 0;
assetsToLoad = assets;
if (!!Array.isArray(assets)) return [3, 4];
assetsToLoad = assets['common'];
if (!(assetsToLoad.length > 0)) return [3, 3];
return [4, this.showInnerLoadingView()];
case 1:
_a.sent();
return [4, loadAssetsGroups({
preload: assetsToLoad,
}, function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
return [2];
});
}); }, function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
this.hideInnerLoadingView();
return [2];
});
}); })];
case 2:
_a.sent();
_a.label = 3;
case 3: return [3, 6];
case 4:
total = assetsToLoad.length;
return [4, loadAssets(assetsToLoad, p).catch(function (e) {
console.log(e);
})];
case 5:
_a.sent();
_a.label = 6;
case 6: return [2];
}
});
});
};
return GameStage; return GameStage;
}(Node$1)); }(Node$1));
...@@ -21293,6 +21490,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -21293,6 +21490,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
} }
var alignManager = alignMgr;
function launch(url, loadingDelegate, onStart) { function launch(url, loadingDelegate, onStart) {
if (queryParams.__proxy_mode__) { if (queryParams.__proxy_mode__) {
return Promise.resolve('cancel launch'); return Promise.resolve('cancel launch');
...@@ -21358,101 +21556,14 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -21358,101 +21556,14 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
}; };
/**
* Created by rockyl on 2020-01-27.
*/
var genericRegexp = /(\w+)(<(\w+)>)?/;
function compute(props, options) {
var result = props || {};
var _loop_1 = function (key) {
var sourceValue = getValue(result, options, key);
var value = sourceValue;
if (options) {
var option = options[key];
if (option && option.type) {
var _a = parseType(option.type), type = _a.type, generic_1 = _a.generic;
switch (type) {
case 'vector2':
value = parseVector2(sourceValue);
break;
case 'array':
var seps = sourceValue.split(',');
seps = seps.map(function (sep) {
var item;
if (generic_1) {
switch (generic_1) {
case 'number':
item = parseFloat(sep);
break;
case 'boolean':
item = sep === 'true';
break;
default:
item = sep;
break;
}
}
else {
item = sep;
}
return item;
});
value = seps;
break;
}
}
}
result[key] = value;
};
for (var key in options) {
_loop_1(key);
}
return result;
}
function parseType(typeStr) {
var type = typeStr, generic;
var regResult = typeStr.match(genericRegexp);
if (regResult) {
type = regResult[1];
generic = regResult[3];
}
return {
type: type, generic: generic,
};
}
function parseVector2(sourceValue) {
var value = sourceValue;
if (!sourceValue) {
value = { x: undefined, y: undefined };
}
if (typeof sourceValue === 'string') {
var arr = sourceValue.split(',');
value = {
x: arr[0] === '' ? undefined : parseFloat(arr[0]),
y: arr[1] === '' ? undefined : parseFloat(arr[1]),
};
}
else if (Array.isArray(sourceValue)) {
value = {
x: sourceValue[0] === '' ? undefined : parseFloat(sourceValue[0]),
y: sourceValue[1] === '' ? undefined : parseFloat(sourceValue[1]),
};
}
return value;
}
function getValue(props, options, key) {
var value;
if (props.hasOwnProperty(key)) {
value = props[key];
}
else if (options && options[key].hasOwnProperty('default')) {
value = options[key].default;
}
return value;
}
var emojiRegexp = emojiRegex(); var emojiRegexp = emojiRegex();
Object.defineProperty(exports, 'computeProps', {
enumerable: true,
get: function () {
return propsCompute.compute;
}
});
exports.BaseTexture = BaseTexture; exports.BaseTexture = BaseTexture;
exports.BaseTextureCache = BaseTextureCache; exports.BaseTextureCache = BaseTextureCache;
exports.BitmapText = BitmapText; exports.BitmapText = BitmapText;
...@@ -21517,6 +21628,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -21517,6 +21628,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
exports.abs = abs; exports.abs = abs;
exports.accessLog = accessLog; exports.accessLog = accessLog;
exports.addCustomModule = addCustomModule; exports.addCustomModule = addCustomModule;
exports.alignManager = alignManager;
exports.appendScript = appendScript; exports.appendScript = appendScript;
exports.applyEvents = applyEvents; exports.applyEvents = applyEvents;
exports.applyScript = applyScript; exports.applyScript = applyScript;
...@@ -21527,7 +21639,6 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -21527,7 +21639,6 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
exports.clearTextureCache = clearTextureCache; exports.clearTextureCache = clearTextureCache;
exports.cmdOldPrefix = cmdOldPrefix; exports.cmdOldPrefix = cmdOldPrefix;
exports.cmdPrefix = cmdPrefix; exports.cmdPrefix = cmdPrefix;
exports.computeProps = compute;
exports.copyProp = copyProp; exports.copyProp = copyProp;
exports.cos = cos; exports.cos = cos;
exports.countTrailingZeros = countTrailingZeros; exports.countTrailingZeros = countTrailingZeros;
...@@ -21633,6 +21744,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -21633,6 +21744,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
exports.strLen = strLen; exports.strLen = strLen;
exports.strShort = strShort; exports.strShort = strShort;
exports.string2hex = string2hex; exports.string2hex = string2hex;
exports.toBoolean = toBoolean;
exports.toDisplayDataURL = toDisplayDataURL; exports.toDisplayDataURL = toDisplayDataURL;
exports.transPoint = transPoint; exports.transPoint = transPoint;
exports.traverseViewNode = traverseViewNode; exports.traverseViewNode = traverseViewNode;
...@@ -21642,5 +21754,5 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -21642,5 +21754,5 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
Object.defineProperty(exports, '__esModule', { value: true }); Object.defineProperty(exports, '__esModule', { value: true });
})); })));
//# sourceMappingURL=engine.js.map //# sourceMappingURL=engine.js.map
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -26,10 +26,10 @@ export default { ...@@ -26,10 +26,10 @@ export default {
}, },
], ],
plugins: [ plugins: [
progress(), // progress(),
resolve({}), resolve({}),
typescript({ typescript({
//useTsconfigDeclarationDir: true, // useTsconfigDeclarationDir: true,
}), }),
commonjs(), commonjs(),
process.env.BUILD === 'production' && uglify({}) process.env.BUILD === 'production' && uglify({})
......
import {DisplayObject} from './DisplayObject'; import { DisplayObject } from './DisplayObject';
import {Rectangle} from "../math/Rectangle"; import { Rectangle } from "../math/Rectangle";
import {Point} from '../math/index'; import { Point } from '../math/index';
import CanvasRenderer from '../renderers/CanvasRenderer'; import CanvasRenderer from '../renderers/CanvasRenderer';
import {Event} from "../events/Event" import { Event } from "../events/Event"
import {WebglRenderer} from '../renderers/WebglRenderer'; import { WebglRenderer } from '../renderers/WebglRenderer';
import {applyAutoAdjust} from "../../zeroing/decorators/auto-adjust"; import { applyAutoAdjust } from "../../zeroing/decorators/auto-adjust";
import {applyScript} from "../../zeroing/decorators/scripts"; import { applyScript } from "../../zeroing/decorators/scripts";
import {applyEvents} from "../../zeroing/decorators/events"; import { applyEvents } from "../../zeroing/decorators/events";
import {afterConstructor} from "../../zeroing/decorators/after-constructor"; import { afterConstructor } from "../../zeroing/decorators/after-constructor";
import {injectProperties, instantiateScript} from "../../zeroing/utils/index"; import { injectProperties, instantiateScript, toBoolean } from "../../zeroing/utils/index";
import {isUI} from "../../zeroing/game-warpper/nodes/IUIComponent"; import { isUI } from "../../zeroing/game-warpper/nodes/IUIComponent";
import Transform from "../math/Transform"; import Transform from "../math/Transform";
/** /**
...@@ -81,12 +81,13 @@ export default class Container extends DisplayObject { ...@@ -81,12 +81,13 @@ export default class Container extends DisplayObject {
onChildrenChange(index) { onChildrenChange(index) {
/* empty */ /* empty */
//子类需要时重写 //子类需要时重写
this.dispatchEvent(Event.MAYBE_ALIGN);
} }
attachVisibility() { attachVisibility() {
return; return;
this.dispatchEvent(this.worldVisible ? Event.VISIBLE : Event.HIDDEN); this.dispatchEvent(this.worldVisible ? Event.VISIBLE : Event.HIDDEN);
for (let i = 0, li = this.children.length; i < li; i++) { for(let i = 0, li = this.children.length; i < li; i++) {
const child = <Container>this.children[i]; const child = <Container>this.children[i];
child.attachVisibility(); child.attachVisibility();
} }
...@@ -110,18 +111,18 @@ export default class Container extends DisplayObject { ...@@ -110,18 +111,18 @@ export default class Container extends DisplayObject {
* @return {DisplayObject} The child that was added. * @return {DisplayObject} The child that was added.
*/ */
addChildAt(child: DisplayObject, index: number): DisplayObject { addChildAt(child: DisplayObject, index: number): DisplayObject {
if (!child) return; if(!child) return;
let s = this; let s = this;
let sameParent = (s == child.parent); let sameParent = (s == child.parent);
let len: number; let len: number;
if (child.parent) { if(child.parent) {
if (!sameParent) { if(!sameParent) {
child.parent.removeChild(child); child.parent.removeChild(child);
} else { } else {
len = s.children.length; len = s.children.length;
for (let i = 0; i < len; i++) { for(let i = 0; i < len; i++) {
if (s.children[i] == child) { if(s.children[i] == child) {
s.children.splice(i, 1); s.children.splice(i, 1);
break; break;
} }
...@@ -137,16 +138,16 @@ export default class Container extends DisplayObject { ...@@ -137,16 +138,16 @@ export default class Container extends DisplayObject {
this._boundsID++; this._boundsID++;
len = s.children.length; len = s.children.length;
if (index >= len) { if(index >= len) {
s.children[s.children.length] = child; s.children[s.children.length] = child;
index = len; index = len;
} else if (index == 0 || index < 0) { } else if(index == 0 || index < 0) {
s.children.unshift(child); s.children.unshift(child);
index = 0; index = 0;
} else { } else {
s.children.splice(index, 0, child); s.children.splice(index, 0, child);
} }
if (s.stage && !sameParent) { if(s.stage && !sameParent) {
// child["_cp"] = true; // child["_cp"] = true;
child._onDispatchBubbledEvent(Event.ADDED_TO_STAGE); child._onDispatchBubbledEvent(Event.ADDED_TO_STAGE);
} }
...@@ -162,24 +163,24 @@ export default class Container extends DisplayObject { ...@@ -162,24 +163,24 @@ export default class Container extends DisplayObject {
* @param {DisplayObject} child2 - Second display object to swap * @param {DisplayObject} child2 - Second display object to swap
*/ */
swapChildren(child1: DisplayObject, child2: DisplayObject) { swapChildren(child1: DisplayObject, child2: DisplayObject) {
if (child1 === child2) { if(child1 === child2) {
return; return;
} }
let s = this; let s = this;
let id1 = -1; let id1 = -1;
let id2 = -1; let id2 = -1;
let childCount = s.children.length; let childCount = s.children.length;
if (typeof (child1) == "number") { if(typeof (child1) == "number") {
id1 = child1; id1 = child1;
} else { } else {
id1 = s.getChildIndex(child1); id1 = s.getChildIndex(child1);
} }
if (typeof (child2) == "number") { if(typeof (child2) == "number") {
id2 = child2; id2 = child2;
} else { } else {
id2 = s.getChildIndex(child2); id2 = s.getChildIndex(child2);
} }
if (id1 == id2 || id1 < 0 || id1 >= childCount || id2 < 0 || id2 >= childCount) { if(id1 == id2 || id1 < 0 || id1 >= childCount || id2 < 0 || id2 >= childCount) {
return false; return false;
} else { } else {
let temp: any = s.children[id1]; let temp: any = s.children[id1];
...@@ -200,7 +201,7 @@ export default class Container extends DisplayObject { ...@@ -200,7 +201,7 @@ export default class Container extends DisplayObject {
getChildIndex(child: DisplayObject): number { getChildIndex(child: DisplayObject): number {
const index = this.children.indexOf(child); const index = this.children.indexOf(child);
if (index === -1) { if(index === -1) {
return null return null
} }
return index; return index;
...@@ -229,7 +230,7 @@ export default class Container extends DisplayObject { ...@@ -229,7 +230,7 @@ export default class Container extends DisplayObject {
* @return {DisplayObject} The child at the given index, if any. * @return {DisplayObject} The child at the given index, if any.
*/ */
getChildAt(index: number): DisplayObject { getChildAt(index: number): DisplayObject {
if (index < 0 || index >= this.children.length) { if(index < 0 || index >= this.children.length) {
return null return null
} }
return this.children[index]; return this.children[index];
...@@ -241,14 +242,14 @@ export default class Container extends DisplayObject { ...@@ -241,14 +242,14 @@ export default class Container extends DisplayObject {
* @param method * @param method
*/ */
getChildByPath(path: any, method: string): DisplayObject { getChildByPath(path: any, method: string): DisplayObject {
if (!path) { if(!path) {
return null; return null;
} }
let p = this; let p = this;
while (path.length > 0) { while(path.length > 0) {
let segment = path.shift(); let segment = path.shift();
p = p[method](segment); p = p[method](segment);
if (!p) { if(!p) {
break; break;
} }
} }
...@@ -279,15 +280,15 @@ export default class Container extends DisplayObject { ...@@ -279,15 +280,15 @@ export default class Container extends DisplayObject {
* @param uuid * @param uuid
*/ */
findChildByUUID(uuid: string) { findChildByUUID(uuid: string) {
if (this['uuid'] === uuid) { if(this['uuid'] === uuid) {
return this; return this;
} }
if (this.children && this.children.length > 0) { if(this.children && this.children.length > 0) {
for (let child of this.children) { for(let child of this.children) {
if (child.findChildByUUID) { if(child.findChildByUUID) {
let target = child.findChildByUUID(uuid); let target = child.findChildByUUID(uuid);
if (target) { if(target) {
return target; return target;
} }
} }
...@@ -302,10 +303,10 @@ export default class Container extends DisplayObject { ...@@ -302,10 +303,10 @@ export default class Container extends DisplayObject {
* @param isRecursive * @param isRecursive
*/ */
public getChildByName(name: string | RegExp, isOnlyOne: boolean = true, isRecursive: boolean = false): any { public getChildByName(name: string | RegExp, isOnlyOne: boolean = true, isRecursive: boolean = false): any {
if (!name) return null; if(!name) return null;
let s = this; let s = this;
let rex: any; let rex: any;
if (typeof (name) == "string") { if(typeof (name) == "string") {
rex = new RegExp("^" + name + "$"); rex = new RegExp("^" + name + "$");
} else { } else {
rex = name; rex = name;
...@@ -313,9 +314,9 @@ export default class Container extends DisplayObject { ...@@ -313,9 +314,9 @@ export default class Container extends DisplayObject {
let elements: Array<DisplayObject> = []; let elements: Array<DisplayObject> = [];
Container._getElementsByName(rex, s, isOnlyOne, isRecursive, elements); Container._getElementsByName(rex, s, isOnlyOne, isRecursive, elements);
let len = elements.length; let len = elements.length;
if (len == 0) { if(len == 0) {
return null; return null;
} else if (len == 1) { } else if(len == 1) {
return elements[0]; return elements[0];
} else { } else {
return elements; return elements;
...@@ -331,7 +332,7 @@ export default class Container extends DisplayObject { ...@@ -331,7 +332,7 @@ export default class Container extends DisplayObject {
const index = this.children.indexOf(child); const index = this.children.indexOf(child);
if (index === -1) return null; if(index === -1) return null;
this.removeChildAt(index); this.removeChildAt(index);
...@@ -347,10 +348,10 @@ export default class Container extends DisplayObject { ...@@ -347,10 +348,10 @@ export default class Container extends DisplayObject {
let s = this; let s = this;
let child: any; let child: any;
let len = s.children.length - 1; let len = s.children.length - 1;
if (len < 0) return; if(len < 0) return;
if (index == len) { if(index == len) {
child = s.children.pop(); child = s.children.pop();
} else if (index == 0) { } else if(index == 0) {
child = s.children.shift(); child = s.children.shift();
} else { } else {
child = s.children.splice(index, 1)[0]; child = s.children.splice(index, 1)[0];
...@@ -381,12 +382,12 @@ export default class Container extends DisplayObject { ...@@ -381,12 +382,12 @@ export default class Container extends DisplayObject {
const range = end - begin; const range = end - begin;
let removed; let removed;
if (range > 0 && range <= end) { if(range > 0 && range <= end) {
removed = this.children.splice(begin, range); removed = this.children.splice(begin, range);
for (let i = 0; i < removed.length; ++i) { for(let i = 0; i < removed.length; ++i) {
removed[i].parent = null; removed[i].parent = null;
if (removed[i].transform) { if(removed[i].transform) {
removed[i].transform._parentID = -1; removed[i].transform._parentID = -1;
} }
} }
...@@ -395,12 +396,12 @@ export default class Container extends DisplayObject { ...@@ -395,12 +396,12 @@ export default class Container extends DisplayObject {
this.onChildrenChange(beginIndex); this.onChildrenChange(beginIndex);
for (let i = 0; i < removed.length; ++i) { for(let i = 0; i < removed.length; ++i) {
removed[i]._onDispatchBubbledEvent(Event.REMOVED_FROM_STAGE); removed[i]._onDispatchBubbledEvent(Event.REMOVED_FROM_STAGE);
} }
return removed; return removed;
} else if (range === 0 && this.children.length === 0) { } else if(range === 0 && this.children.length === 0) {
return []; return [];
} }
...@@ -416,9 +417,9 @@ export default class Container extends DisplayObject { ...@@ -416,9 +417,9 @@ export default class Container extends DisplayObject {
//考虑是否要加, //考虑是否要加,
this._boundsID++; this._boundsID++;
//children遍历计算 //children遍历计算
for (let i = 0, j = this.children.length; i < j; ++i) { for(let i = 0, j = this.children.length; i < j; ++i) {
const child = this.children[i]; const child = this.children[i];
if (child.visible) { if(child.visible) {
child.updateTransform(); child.updateTransform();
} }
} }
...@@ -435,30 +436,30 @@ export default class Container extends DisplayObject { ...@@ -435,30 +436,30 @@ export default class Container extends DisplayObject {
* 都是全局的 * 都是全局的
*/ */
calculateBounds() { calculateBounds() {
if (this._lastBoundsID == this._boundsID) return if(this._lastBoundsID == this._boundsID) return
this._lastBoundsID = this._boundsID this._lastBoundsID = this._boundsID
this._bounds.clear(); this._bounds.clear();
//算自己的 //算自己的
this._calculateBounds(); this._calculateBounds();
for (let i = 0; i < this.children.length; i++) { for(let i = 0; i < this.children.length; i++) {
const child = this.children[i]; const child = this.children[i];
if (!child.visible || !child.renderable) { if(!child.visible || !child.renderable) {
continue; continue;
} }
child.calculateBounds(); child.calculateBounds();
if (child.$mask) { if(child.$mask) {
child.$mask.calculateBounds(); child.$mask.calculateBounds();
//取交集矩形 //取交集矩形
if (child._bounds.x < child.$mask._bounds.x) { if(child._bounds.x < child.$mask._bounds.x) {
child._bounds.x = child.$mask._bounds.x; child._bounds.x = child.$mask._bounds.x;
} }
if (child._bounds.y < child.$mask._bounds.y) { if(child._bounds.y < child.$mask._bounds.y) {
child._bounds.y = child.$mask._bounds.y; child._bounds.y = child.$mask._bounds.y;
} }
if (child._bounds.width > child.$mask._bounds.width) { if(child._bounds.width > child.$mask._bounds.width) {
child._bounds.width = child.$mask._bounds.width; child._bounds.width = child.$mask._bounds.width;
} }
if (child._bounds.height > child.$mask._bounds.height) { if(child._bounds.height > child.$mask._bounds.height) {
child._bounds.height = child.$mask._bounds.height; child._bounds.height = child.$mask._bounds.height;
} }
Rectangle.createFromRects(this._bounds, child._bounds); Rectangle.createFromRects(this._bounds, child._bounds);
...@@ -488,7 +489,7 @@ export default class Container extends DisplayObject { ...@@ -488,7 +489,7 @@ export default class Container extends DisplayObject {
this._bounds.height = this._height; this._bounds.height = this._height;
}*/ }*/
if(widthSetted || heightSetted){ if(widthSetted || heightSetted) {
const rect = this._localBoundsSelf; const rect = this._localBoundsSelf;
var matrix = this.transform.worldMatrix; var matrix = this.transform.worldMatrix;
matrix.transformPoint(rect.x, rect.y, DisplayObject._p1); matrix.transformPoint(rect.x, rect.y, DisplayObject._p1);
...@@ -505,43 +506,43 @@ export default class Container extends DisplayObject { ...@@ -505,43 +506,43 @@ export default class Container extends DisplayObject {
*/ */
hitTestPoint(globalPoint: Point, isMouseEvent: boolean = false) { hitTestPoint(globalPoint: Point, isMouseEvent: boolean = false) {
//如果不可见 //如果不可见
if (!this.visible) return null if(!this.visible) return null
//如果禁止子级的鼠标事件 //如果禁止子级的鼠标事件
if (isMouseEvent && !this.mouseChildren){ if(isMouseEvent && !this.mouseChildren) {
return this.hitTestSelf(globalPoint); return this.hitTestSelf(globalPoint);
} }
var children = this.children; var children = this.children;
var length = children.length; var length = children.length;
let child, hitDisplayObject; let child, hitDisplayObject;
//后序遍历,后添加的在上层 //后序遍历,后添加的在上层
for (var i = length - 1; i >= 0; i--) { for(var i = length - 1; i >= 0; i--) {
child = children[i]; child = children[i];
//当作遮罩的不作为检测,跳过 //当作遮罩的不作为检测,跳过
if (child.isUsedToMask) continue; if(child.isUsedToMask) continue;
//有遮罩,但是不在遮罩内,跳过 //有遮罩,但是不在遮罩内,跳过
if (child.mask && !child.mask.hitTestPoint(globalPoint, isMouseEvent)) continue; if(child.mask && !child.mask.hitTestPoint(globalPoint, isMouseEvent)) continue;
//检测 //检测
hitDisplayObject = child.hitTestPoint(globalPoint, isMouseEvent); hitDisplayObject = child.hitTestPoint(globalPoint, isMouseEvent);
//存在直接返回 //存在直接返回
if (hitDisplayObject) return hitDisplayObject; if(hitDisplayObject) return hitDisplayObject;
} }
return this.displayObjectHitTestPoint(globalPoint, isMouseEvent); return this.displayObjectHitTestPoint(globalPoint, isMouseEvent);
} }
hitTestSelf(globalPoint) { hitTestSelf(globalPoint) {
if (this.mouseEnabled) { if(this.mouseEnabled) {
return this.hitTestSelfBounds(globalPoint); return this.hitTestSelfBounds(globalPoint);
} }
return null; return null;
} }
hitTestSelfBounds(globalPoint) { hitTestSelfBounds(globalPoint) {
if (this._width && this._height) { if(this._width && this._height) {
//let {x: tx, y: ty} = this.getBounds(); //let {x: tx, y: ty} = this.getBounds();
let {tx, ty} = this.worldMatrix; let {tx, ty} = this.worldMatrix;
const {x, y} = globalPoint; const {x, y} = globalPoint;
if (x > tx && if(x > tx &&
x < tx + this.width && x < tx + this.width &&
y > ty && y > ty &&
y < ty + this.height y < ty + this.height
...@@ -556,17 +557,17 @@ export default class Container extends DisplayObject { ...@@ -556,17 +557,17 @@ export default class Container extends DisplayObject {
*/ */
renderWebGL(renderer: WebglRenderer) { renderWebGL(renderer: WebglRenderer) {
//不可见,全局透明度为0,或者 不渲染,直接return //不可见,全局透明度为0,或者 不渲染,直接return
if (!this.visible || this.worldAlpha <= 0 || !this.renderable) { if(!this.visible || this.worldAlpha <= 0 || !this.renderable) {
return; return;
} }
//是否有遮罩。到时如果有滤镜, //是否有遮罩。到时如果有滤镜,
if (this.mask) { if(this.mask) {
this.renderAdvancedWebGL(renderer); this.renderAdvancedWebGL(renderer);
} else { } else {
//自身先渲染 //自身先渲染
this._renderWebGL(renderer); this._renderWebGL(renderer);
//遍历children //遍历children
for (let i = 0, j = this.children.length; i < j; ++i) { for(let i = 0, j = this.children.length; i < j; ++i) {
this.children[i].renderWebGL(renderer); this.children[i].renderWebGL(renderer);
} }
} }
...@@ -586,7 +587,7 @@ export default class Container extends DisplayObject { ...@@ -586,7 +587,7 @@ export default class Container extends DisplayObject {
const mask = this.mask; const mask = this.mask;
if (mask) { if(mask) {
//先画遮罩 //先画遮罩
renderer.maskManager.pushMask(this, this.mask); renderer.maskManager.pushMask(this, this.mask);
} }
...@@ -595,14 +596,14 @@ export default class Container extends DisplayObject { ...@@ -595,14 +596,14 @@ export default class Container extends DisplayObject {
this._renderWebGL(renderer); this._renderWebGL(renderer);
//遍历children //遍历children
for (let i = 0, j = this.children.length; i < j; i++) { for(let i = 0, j = this.children.length; i < j; i++) {
this.children[i].renderWebGL(renderer); this.children[i].renderWebGL(renderer);
} }
//刷掉批处理 //刷掉批处理
renderer.batchManager.flush(); renderer.batchManager.flush();
if (mask) { if(mask) {
//移除遮罩,支持多重遮罩 //移除遮罩,支持多重遮罩
renderer.maskManager.popMask(this, this.mask); renderer.maskManager.popMask(this, this.mask);
} }
...@@ -622,20 +623,20 @@ export default class Container extends DisplayObject { ...@@ -622,20 +623,20 @@ export default class Container extends DisplayObject {
* @param {CanvasRenderer} renderer - The renderer * @param {CanvasRenderer} renderer - The renderer
*/ */
renderCanvas(renderer: CanvasRenderer) { renderCanvas(renderer: CanvasRenderer) {
if (!this.visible || this.worldAlpha <= 0 || !this.renderable) { if(!this.visible || this.worldAlpha <= 0 || !this.renderable) {
return; return;
} }
if (this.mask) { if(this.mask) {
renderer.maskManager.pushMask(this.mask); renderer.maskManager.pushMask(this.mask);
} }
this._renderCanvas(renderer); this._renderCanvas(renderer);
for (let i = 0, j = this.children.length; i < j; ++i) { for(let i = 0, j = this.children.length; i < j; ++i) {
this.children[i].renderCanvas(renderer); this.children[i].renderCanvas(renderer);
} }
if (this.mask) { if(this.mask) {
renderer.maskManager.popMask(renderer); renderer.maskManager.popMask(renderer);
} }
} }
...@@ -659,7 +660,7 @@ export default class Container extends DisplayObject { ...@@ -659,7 +660,7 @@ export default class Container extends DisplayObject {
super.update(deltaTime) super.update(deltaTime)
//更新儿子们的 //更新儿子们的
let len = this.children.length; let len = this.children.length;
for (let i = len - 1; i >= 0; i--) { for(let i = len - 1; i >= 0; i--) {
const child = this.children[i]; const child = this.children[i];
/*if (child.visible)*/ /*if (child.visible)*/
child.update(deltaTime); child.update(deltaTime);
...@@ -677,9 +678,9 @@ export default class Container extends DisplayObject { ...@@ -677,9 +678,9 @@ export default class Container extends DisplayObject {
public _onDispatchBubbledEvent(type: string): void { public _onDispatchBubbledEvent(type: string): void {
let s = this; let s = this;
let len = s.children.length; let len = s.children.length;
if (type == Event.REMOVED_FROM_STAGE && !s.stage) return; if(type == Event.REMOVED_FROM_STAGE && !s.stage) return;
super._onDispatchBubbledEvent(type); super._onDispatchBubbledEvent(type);
for (let i = 0; i < len; i++) { for(let i = 0; i < len; i++) {
s.children[i]._onDispatchBubbledEvent(type); s.children[i]._onDispatchBubbledEvent(type);
} }
...@@ -691,7 +692,7 @@ export default class Container extends DisplayObject { ...@@ -691,7 +692,7 @@ export default class Container extends DisplayObject {
destroy() { destroy() {
let s = this; let s = this;
//让子级也destroy //让子级也destroy
for (let i = s.children.length - 1; i >= 0; i--) { for(let i = s.children.length - 1; i >= 0; i--) {
s.children[i].destroy(); s.children[i].destroy();
} }
super.destroy(); super.destroy();
...@@ -715,12 +716,21 @@ export default class Container extends DisplayObject { ...@@ -715,12 +716,21 @@ export default class Container extends DisplayObject {
// } else { // } else {
// this.scale.x = 1; // this.scale.x = 1;
// } // }
if (this._width !== value) { if(this._width !== value) {
//子类有用,有_width,才需设置scaleX //子类有用,有_width,才需设置scaleX
this._width = value; this._width = value;
this._localBoundsSelf.width = value; this._localBoundsSelf.width = value;
//if (this.stage) this.stage.layoutInvalid = true; //if (this.stage) this.stage.layoutInvalid = true;
this.dispatchEvent(Event.RESIZE); this.dispatchEvent(Event.RESIZE);
this.dispatchEvent(Event.MAYBE_ALIGN);
}
// 如果它设置了 percentWidth 或同时设置了 left 和 right 则表示他的宽度是相对的,则对于父级来说它的宽度永远是 0
if(toBoolean(this.percentWidth)
|| (toBoolean(this.left) && toBoolean(this.right))
) {
this.__width = 0;
} else {
this.__width = value;
} }
} }
...@@ -740,12 +750,76 @@ export default class Container extends DisplayObject { ...@@ -740,12 +750,76 @@ export default class Container extends DisplayObject {
// } else { // } else {
// this.scale.y = 1; // this.scale.y = 1;
// } // }
if (this._height !== value) { if(this._height !== value) {
this._height = value; this._height = value;
this._localBoundsSelf.height = value; this._localBoundsSelf.height = value;
//if (this.stage) this.stage.layoutInvalid = true; //if (this.stage) this.stage.layoutInvalid = true;
this.dispatchEvent(Event.RESIZE); this.dispatchEvent(Event.RESIZE);
this.dispatchEvent(Event.MAYBE_ALIGN);
}
// 如果它设置了 percentHeight 或同时设置了 top 和 bottom 则表示他的高度是相对的,则对于父级来说它的高度永远是 0
if(toBoolean(this.percentHeight)
|| (toBoolean(this.top) && toBoolean(this.bottom))
) {
this.__height = 0;
} else {
this.__height = value;
}
}
protected __width = 0; // 忽略 相对宽度 的 宽度,在父级计算自动宽度的时候用到
protected __height = 0; // 忽略 相对高度 的 高度,在父级计算自动高度的时候用到
protected _autoWidth = false; // 自动宽度?
protected _autoHeight = false; // 自动高度?
public get autoWidth() {
return this._autoWidth;
}
public get autoHeight() {
return this._autoHeight;
}
public set autoWidth(autoWidth) {
this._autoWidth = autoWidth;
this.right = NaN; /// TODO 不知道需不需要
this.percentWidth = NaN; /// TODO 不知道需不需要
this.adjustProxy.makeDirty();
} }
public set autoHeight(autoHeight) {
this._autoHeight = autoHeight;
this.bottom = NaN; /// TODO 不知道需不需要
this.percentHeight = NaN; /// TODO 不知道需不需要
this.adjustProxy.makeDirty();
}
// public judgeAutoSize() {
// this.autoWidth = !(toBoolean(this.right) || toBoolean(this.percentWidth) || toBoolean(this._width));
// this.autoHeight = !(toBoolean(this.bottom) || toBoolean(this.percentHeight) || toBoolean(this._height));
// }
get x(): number {
return this.position.x;
}
set x(value: number) {
if(value == this.transform.position.x) return;
this.transform.position.x = value;
this.dispatchEvent(Event.MAYBE_ALIGN);
}
get y(): number {
return this.position.y;
}
set y(value: number) {
if(value == this.transform.position.y) return;
this.transform.position.y = value;
this.dispatchEvent(Event.MAYBE_ALIGN);
} }
clone(withEvents = false, withScripts = false) { clone(withEvents = false, withScripts = false) {
...@@ -757,20 +831,20 @@ export default class Container extends DisplayObject { ...@@ -757,20 +831,20 @@ export default class Container extends DisplayObject {
target['__originConfig'] = originConfig; target['__originConfig'] = originConfig;
injectProperties(target, properties); injectProperties(target, properties);
if (withScripts) { if(withScripts) {
if (scripts && scripts.length > 0) { if(scripts && scripts.length > 0) {
for (let scriptConfig of scripts) { for(let scriptConfig of scripts) {
instantiateScript(target, scriptConfig); instantiateScript(target, scriptConfig);
} }
} }
} }
if (withEvents) { if(withEvents) {
if (events) { if(events) {
target.eventsProxy.start(events); target.eventsProxy.start(events);
} }
} }
for (let child of this.children) { for(let child of this.children) {
let childCopy = child.clone(withEvents, withScripts); let childCopy = child.clone(withEvents, withScripts);
target.addChild(childCopy); target.addChild(childCopy);
} }
...@@ -781,14 +855,14 @@ export default class Container extends DisplayObject { ...@@ -781,14 +855,14 @@ export default class Container extends DisplayObject {
get $store() { get $store() {
let p = this; let p = this;
do { do {
if (p['$isViewRoot']) { if(p['$isViewRoot']) {
break; break;
} }
p = p.parent; p = p.parent;
} }
while (p.parent); while(p.parent);
if (p) { if(p) {
return p['$_store']; return p['$_store'];
} }
} }
...@@ -806,22 +880,22 @@ export default class Container extends DisplayObject { ...@@ -806,22 +880,22 @@ export default class Container extends DisplayObject {
*/ */
private static _getElementsByName(rex: RegExp, root: Container, isOnlyOne: boolean, isRecursive: boolean, resultList: Array<DisplayObject>): void { private static _getElementsByName(rex: RegExp, root: Container, isOnlyOne: boolean, isRecursive: boolean, resultList: Array<DisplayObject>): void {
let len = root.children.length; let len = root.children.length;
if (len > 0) { if(len > 0) {
let name: string; let name: string;
let child: any; let child: any;
for (let i = 0; i < len; i++) { for(let i = 0; i < len; i++) {
child = root.children[i]; child = root.children[i];
name = child.name; name = child.name;
if (name && name != "") { if(name && name != "") {
if (rex.test(name)) { if(rex.test(name)) {
resultList[resultList.length] = child; resultList[resultList.length] = child;
if (isOnlyOne) { if(isOnlyOne) {
return; return;
} }
} }
} }
if (isRecursive) { if(isRecursive) {
if (child["children"] != null) { if(child["children"] != null) {
Container._getElementsByName(rex, child, isOnlyOne, isRecursive, resultList); Container._getElementsByName(rex, child, isOnlyOne, isRecursive, resultList);
} }
} }
......
...@@ -395,10 +395,19 @@ export default class Sprite extends Container { ...@@ -395,10 +395,19 @@ export default class Sprite extends Container {
} }
set width(value) { set width(value) {
value = Math.abs(value);
const s = sign(this.scale.x) || 1; const s = sign(this.scale.x) || 1;
this.scale.x = s * value / this._texture.orig.width; this.scale.x = s * value / this._texture.orig.width;
this._width = value; this._width = value;
this.dispatchEvent(Event.MAYBE_ALIGN);
if(isNaN(this.percentWidth) || this.percentWidth === null) {
this.__width = value;
} else {
this.__width = 0;
}
} }
/** /**
...@@ -410,9 +419,17 @@ export default class Sprite extends Container { ...@@ -410,9 +419,17 @@ export default class Sprite extends Container {
} }
set height(value) { set height(value) {
value = Math.abs(value);
const s = sign(this.scale.y) || 1; const s = sign(this.scale.y) || 1;
this.scale.y = s * value / this._texture.orig.height; this.scale.y = s * value / this._texture.orig.height;
this._height = value; this._height = value;
this.dispatchEvent(Event.MAYBE_ALIGN);
if(isNaN(this.percentHeight) || this.percentHeight === null) {
this.__height = value;
} else {
this.__height= 0;
}
} }
/** /**
......
...@@ -12,6 +12,7 @@ import {WebglRenderer} from "../renderers/WebglRenderer"; ...@@ -12,6 +12,7 @@ import {WebglRenderer} from "../renderers/WebglRenderer";
import {GDispatcher} from "../events/GDispatcher"; import {GDispatcher} from "../events/GDispatcher";
import CanvasRenderer from "../renderers/CanvasRenderer"; import CanvasRenderer from "../renderers/CanvasRenderer";
import {GlobalPro, isWebGLSupported} from "../utils/index"; import {GlobalPro, isWebGLSupported} from "../utils/index";
import { alignMgr } from "../../zeroing/decorators/AlignManager";
//如果以后还出现帧率问题,使用ticker; //如果以后还出现帧率问题,使用ticker;
//兼容requestAnimationFrame //兼容requestAnimationFrame
...@@ -972,12 +973,13 @@ export class Stage extends Container { ...@@ -972,12 +973,13 @@ export class Stage extends Container {
if (!GlobalPro.startTime) GlobalPro.startTime = Date.now(); if (!GlobalPro.startTime) GlobalPro.startTime = Date.now();
//console.log('flushAll', Date.now()); //console.log('flushAll', Date.now());
alignMgr.flush();
if (!Stage._pause) { if (!Stage._pause) {
let len = Stage.allUpdateObjList.length; let len = Stage.allUpdateObjList.length;
for (let i = 0; i < len; i++) { for (let i = 0; i < len; i++) {
Stage.allUpdateObjList[i] && Stage.allUpdateObjList[i].flush(); Stage.allUpdateObjList[i] && Stage.allUpdateObjList[i].flush();
} }
} }
requestAnimationFrame(Stage.flushAll); requestAnimationFrame(Stage.flushAll);
} }
......
...@@ -9,8 +9,9 @@ import {HashObject} from "../HashObject"; ...@@ -9,8 +9,9 @@ import {HashObject} from "../HashObject";
*/ */
export class Event extends HashObject { export class Event extends HashObject {
// public static IMAGE_LOADED: string = "onImageLoaded" public static MAYBE_ALIGN: string = "maybeAlign";
// public static IMAGE_LOADED: string = "onImageLoaded"
/** /**
* 舞台尺寸发生变化时触发 * 舞台尺寸发生变化时触发
* @Event * @Event
......
import { ALIGN_MODE } from "./auto-adjust";
import { toBoolean } from "../utils/utils";
/**
* 自适应管理器
* @constructor
*/
class AlignManager {
// 这个列表里的对象会在渲染前被自动调整
private alignList = [];
constructor() {
}
/**
* flash (渲染前)
*/
public flush() {
this.alignList.forEach((v) => {
this.autoSize(v); // 去调整大小
this.align(v); // 去自动对齐
});
// 要在这里单独检查,因为对齐一次后可能遇到其父节点需要对齐导致其再对齐一次
this.alignList.forEach((v) => {
if(v.alignMode === ALIGN_MODE.ONCE) { // 如果是单次对齐则一次运算之后就关闭它
v.alignEnabled = false;
}
});
// 干掉列表
this.alignList.length = 0;
}
/**
* align
* @param that
*/
private align(that) {
// if(that)
if(!that.alignEnabled) return; // 如果的自动对齐关闭里则啥也不干
// if(that.alignMode === ALIGN_MODE.ONCE) { // 如果是单次对齐则一次运算之后就关闭它
// that.alignEnabled = false;
// }
const {percentWidth, percentHeight, left, top, right, bottom, horizonCenter, verticalCenter} = that;
let {_width: tW_Z = 0, _height: tH_Z = 0} = that;
const {_width: pW_Z = 0, _height: pH_Z = 0} = (that.parent || {});
/**
* 计算 width 和 x 值
*/
if(toBoolean(left) && toBoolean(right)) { // left right 都有则直接拉伸或缩小
that.x = left;
that.width = pW_Z - left - right;
} else {
// 先设置下自己的 width
toBoolean(percentWidth) && (tW_Z = that.width = pW_Z * percentWidth / 100);
// 先考虑 horizonCenter 属性
if(toBoolean(horizonCenter)) {
// x 值 = 父节点的中间值 - 自己宽度的一半 - 居中差值
that.x = pW_Z / 2 - tW_Z / 2 + horizonCenter;
} else if(toBoolean(left)) { // 假如有左边距
that.x = left;
} else if(toBoolean(right)) { // 假如有右边距
that.x = pW_Z - right - tW_Z;
}
}
/**
* 计算 height 和 y 值
*/
if(toBoolean(top) && toBoolean(bottom)) { // top bottom 都有则直接拉伸或缩小
that.y = top;
that.height = pH_Z - top - bottom;
} else {
// 先设置下自己的 height
toBoolean(percentHeight) && (tH_Z = that.height = pH_Z * percentHeight / 100);
// 先考虑 horizonCenter 属性
if(toBoolean(verticalCenter)) {
// x 值 = 父节点的中间值 - 自己高度的一半 - 居中差值
that.y = pH_Z / 2 - tH_Z / 2 + verticalCenter;
} else if(toBoolean(top)) { // 假如有 top
that.y = top;
} else if(toBoolean(bottom)) { // 假如有 bottom
that.y = pH_Z - bottom - tH_Z;
}
}
// console.log(that.name, that.width, that.height);
that.children.forEach(v => this.align(v));
}
/**
* 自动大小
* @param that
*/
private autoSize(that) {
let len = that.children.length
if(len > 0) {
// 检测本身的是否是可以自动宽
if(that.autoWidth && !toBoolean(that.right) && !toBoolean(that.percentWidth)) {
// 找出子节点最小x
// let minX = 0;
// for(let i = 0; i < len; i++) {
// if(that.children[i].x < minX) {
// minX = that.children[i].x;
// }
// }
// if(minX < 0) {
// that.children.forEach(v => v.x -= minX);
// that.x += minX;
// that.width -= minX;
// }
// 找出最右值
let max = 0;
for(let i = 0; i < len; i++) {
if(toBoolean(that.children[i].right)) continue;
let _x = that.children[i].x || 0;
let _w = that.children[i].__width || 0;
if(_x + _w > max) {
max = _x + _w;
}
}
that.width = max;
}
// 检测本身的是否是可以自动高
if(that.autoHeight && !toBoolean(that.bottom) && !toBoolean(that.percentHeight)) {
// 找出子节点最小y
// let minY = 0;
// for(let i = 1; i < len; i++) {
// if(that.children[i].y < minY) {
// minY = that.children[i].y;
// }
// }
// if(minY < 0) {
// that.children.forEach(v => v.y -= minY);
// that.y += minY;
// that.height -= minY;
// }
// 找出最下值
let max = 0;
for(let i = 0; i < len; i++) {
if(toBoolean(that.children[i].bottom)) continue;
let _y = that.children[i].y || 0;
let _h = that.children[i].__height || 0;
if(_y + _h > max) {
max = _y + _h;
}
}
that.height = max;
}
}
}
/**
* 添加一个变脏的对象
* @param obj
*/
public addAlign(obj) {
if(this.alignList.indexOf(obj) < 0) {
this.alignList.push(obj);
}
}
}
export let alignMgr = new AlignManager();
...@@ -4,27 +4,32 @@ ...@@ -4,27 +4,32 @@
* 自适应功能 * 自适应功能
*/ */
import {Event} from "../../2d/events/index"; import { Event } from "../../2d/events/index";
import { alignMgr } from "./AlignManager";
/** /**
* 应用自适应 * 应用自适应
* @param ctor * @param ctor
*/ */
export function applyAutoAdjust(ctor: Function) { export function applyAutoAdjust(ctor: Function) {
ctor.prototype.applyAutoAdjust = function () { ctor.prototype.applyAutoAdjust = function() {
let adjustProxy = this.adjustProxy = new AdjustProxy(this); let adjustProxy = this.adjustProxy = new AdjustProxy(this);
this.addEventListener(Event.ADDED_TO_STAGE, adjustProxy.onAddedToStage, adjustProxy); this.addEventListener(Event.ADDED_TO_STAGE, adjustProxy.onAddedToStage, adjustProxy);
this.addEventListener(Event.REMOVED_FROM_STAGE, adjustProxy.onRemovedFromStage, adjustProxy); this.addEventListener(Event.REMOVED_FROM_STAGE, adjustProxy.onRemovedFromStage, adjustProxy);
}; };
let temp = new AdjustProxy(null); let temp = new AdjustProxy(null);
for (let key in temp.data) for(let key in temp.data) {
if(key == 'alignMode'
// || key == 'percentWidth' || key == 'percentHeight'
) continue;
Object.defineProperty(ctor.prototype, key, { Object.defineProperty(ctor.prototype, key, {
get: function () { get: function() {
return this.adjustProxy.data[key]; return this.adjustProxy.data[key];
}, },
set: function (v) { set: function(v) {
const adjustProxy: AdjustProxy = this.adjustProxy; const adjustProxy: AdjustProxy = this.adjustProxy;
if (adjustProxy.data[key] !== v) { if(adjustProxy.data[key] !== v && !(isNaN(adjustProxy.data[key]) && isNaN(v))) {
adjustProxy.data[key] = v; adjustProxy.data[key] = v;
adjustProxy.makeDirty(); adjustProxy.makeDirty();
} }
...@@ -32,6 +37,64 @@ export function applyAutoAdjust(ctor: Function) { ...@@ -32,6 +37,64 @@ export function applyAutoAdjust(ctor: Function) {
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
}
// Object.defineProperty(ctor.prototype, 'percentWidth', {
// get: function() {
// return this.adjustProxy.data['percentWidth'];
// },
// set: function(v) {
// const adjustProxy: AdjustProxy = this.adjustProxy;
// if(adjustProxy.data['percentWidth'] !== v) {
// adjustProxy.data['percentWidth'] = v;
// adjustProxy.makeDirty();
//
// this._autoWidth = false;
// }
// },
// enumerable: true,
// configurable: true
// });
//
// Object.defineProperty(ctor.prototype, 'percentHeight', {
// get: function() {
// return this.adjustProxy.data['percentHeight'];
// },
// set: function(v) {
// const adjustProxy: AdjustProxy = this.adjustProxy;
// if(adjustProxy.data['percentHeight'] !== v) {
// adjustProxy.data['percentHeight'] = v;
// adjustProxy.makeDirty();
//
// this._autoHeight = isNaN(this._height) || this._height === null || this._height === undefined;
// }
// },
// enumerable: true,
// configurable: true
// });
Object.defineProperty(ctor.prototype, 'alignMode', {
get: function() {
return this.adjustProxy.data['alignMode'];
},
set: function(v) {
const adjustProxy: AdjustProxy = this.adjustProxy;
if(adjustProxy.data['alignMode'] !== v) {
adjustProxy.data['alignMode'] = v;
adjustProxy.makeDirty();
if(v == ALIGN_MODE.ALWAYS) this.alignEnabled = true; // 如果设置为 always 则自动开启
}
},
enumerable: true,
configurable: true
});
}
export enum ALIGN_MODE {
ONCE = 'once',
ALWAYS = 'always',
} }
/** /**
...@@ -47,6 +110,9 @@ class AdjustProxy { ...@@ -47,6 +110,9 @@ class AdjustProxy {
bottom: NaN, bottom: NaN,
horizonCenter: NaN, horizonCenter: NaN,
verticalCenter: NaN, verticalCenter: NaN,
alignEnabled: true,
alignMode: ALIGN_MODE.ALWAYS,
}; };
private _host; private _host;
...@@ -59,96 +125,199 @@ class AdjustProxy { ...@@ -59,96 +125,199 @@ class AdjustProxy {
makeDirty() { makeDirty() {
this._sizeDirty = true; this._sizeDirty = true;
this._host && alignMgr.addAlign(this._host);
this._host && this._host.parent && this._host.parent.adjustProxy.makeDirty();
} }
onAddedToStage(e) { onAddedToStage(e) {
this._host.parent.addEventListener(Event.RESIZE, this.onResize, this); this._host.addEventListener(Event.MAYBE_ALIGN, this.readyAlign, this);
this._host.addEventListener(Event.RESIZE, this.onResize, this); // this._host.parent.addEventListener(Event.MAYBE_ALIGN, this.align, this);
this._host.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, this); // this._host.parent.addEventListener(Event.RESIZE, this.align, this);
// this._host.addEventListener(Event.RESIZE, this.align, this);
// this._host.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, this);
} }
onRemovedFromStage(e) { onRemovedFromStage(e) {
//this._host.parent.removeEventListener(Event.RESIZE, this.onResize); this._host.removeEventListener(Event.MAYBE_ALIGN, this.readyAlign);
this._host.removeEventListener(Event.RESIZE, this.onResize, this); // this._host.parent.removeEventListener(Event.MAYBE_ALIGN, this.align);
this._host.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame); // this._host.parent.removeEventListener(Event.RESIZE, this.align);
// this._host.removeEventListener(Event.RESIZE, this.align, this);
// this._host.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} }
setFrom(adjustProxy: AdjustProxy) { setFrom(adjustProxy: AdjustProxy) {
for (let k in adjustProxy.data) { for(let k in adjustProxy.data) {
this.data[k] = adjustProxy.data[k]; this.data[k] = adjustProxy.data[k];
} }
} }
private onResize(e) { /**
* align 方式 T + 1
* @param e
*/
private readyAlign(e) {
this._sizeDirty = true; this._sizeDirty = true;
this._host && alignMgr.addAlign(this._host);
this._host && this._host.parent && this._host.parent.adjustProxy.makeDirty(); // 它爸爸也要设置一次。可能有autoSize
} }
private onEnterFrame(e) { // autoSize() {
if (this._sizeDirty) { // let that = this._host.parent;
this._sizeDirty = false; // if(that.name !== 'rect1' && that.name !== 'rect_main' && that.name !== 'rect2' && that.name !== 'rect3') return;
//
this.adjustLayout(); // if(that.name == "scene-container"
} // || that.name == "game-stage"
} // || that.name == "main")
// return;
adjustLayout() { //
const that = this._host; // // 检测本身的是否是自动宽高
// let len = that.children.length
const {width: pWidth, height: pHeight} = that.parent; // if(len > 0) {
const {width, height} = that; // // if(that._autoWidth) {
const {percentWidth, percentHeight, left, top, right, bottom, horizonCenter, verticalCenter} = this.data; // // 找出子节点最小x
// // let minX = that.children[0].x;
const applyPercentWidth = function () { // // for(let i = 1; i < len; i++) {
if (t(percentWidth)) { // // if(that.children[i].x < minX) {
that.width = pWidth * percentWidth / 100; // // minX = that.children[i].x;
} // // }
}; // // }
const applyPercentHeight = function () { // // that.children.forEach(v => v._x -= minX);
if (t(percentHeight)) { // // that._x += minX;
that.height = pHeight * percentHeight / 100; //
} // // 找出右值
}; // let max = 0;
// for(let i = 0; i < len; i++) {
let pw = true, ph = true; // if(t(that.children[i].right)) continue;
if (t(horizonCenter)) { // let _x = that.children[i].x || 0;
applyPercentWidth(); // let _w = that.children[i].__width || 0;
that.x = (pWidth - that.width) / 2 + horizonCenter; // if(_x + _w > max) {
} else { // max = _x + _w;
if (t(left)) { // }
that.x = left; // }
if (t(right)) { // that.width = max;
that.width = pWidth - left - right; // // let dw = that.width - max;
pw = false; // // that._width -= dw;
} // // }
} else if (t(right)) { //
that.x = pWidth - width - right; // // if(that._autoHeight) {
} // // 找出子节点最小y
if (pw) { // // let minY = that.children[0].y;
applyPercentWidth(); // // for(let i = 1; i < len; i++) {
} // // if(that.children[i].x < minY) {
} // // minY = that.children[i].y;
// // }
if (t(verticalCenter)) { // // }
applyPercentHeight(); // // that.children.forEach(v => v._y -= minY);
that.y = (pHeight - that.height) / 2 + verticalCenter; // // that._y += minY;
} else { //
if (t(top)) { // // 找出右值
that.y = top; // max = 0;
if (t(bottom)) { // for(let i = 0; i < len; i++) {
that.height = pHeight - top - bottom; // if(t(that.children[i].bottom)) continue;
ph = false; // let _y = that.children[i].y || 0;
} // let _h = that.children[i].__height || 0;
} else if (t(bottom)) { // if(_y + _h > max) {
that.y = pHeight - height - bottom; // max = _y + _h;
} // }
if (ph) { // }
applyPercentHeight(); // that.height = max;
} // // let dh = that.height - max;
} // // that._height -= dh;
} // // }
// }
//
// }
} // private onEnterFrame(e) {
// if(this._sizeDirty) {
// this._sizeDirty = false;
//
// // this.adjustLayout();
// }
// }
function t(v) { // /**
return !isNaN(v) && v !== null && v !== undefined; // * 手动调用可在当前帧 align
// */
// adjustLayout() {
// // return;
//
// const that = this._host;
//
// if(!that.alignEnabled) return;
//
// if(that.alignMode === ALIGN_MODE.ONCE) { // 如果是单次对齐则一次运算之后就关闭它
// that.alignEnabled = false;
// }
//
// const {percentWidth, percentHeight, left, top, right, bottom, horizonCenter, verticalCenter} = this.data;
//
// let {_width: tW_Z = 0, _height: tH_Z = 0} = that;
// const {_width: pW_Z = 0, _height: pH_Z = 0} = that.parent;
//
// let {_width: tW, _height: tH} = that;
// const {_width: pW, _height: pH} = that.parent;
// this.autoSize();
//
// /**
// * 计算 width 和 x 值
// */
// if(t(left) && t(right)) { // left right 都有则直接拉伸或缩小
//
// that.x = left;
//
// that.width = pW_Z - left - right;
//
// } else {
// // 先设置下自己的 width
// t(percentWidth) && (tW_Z = that.width = pW_Z * percentWidth / 100);
//
// // 先考虑 horizonCenter 属性
// if(t(horizonCenter)) {
// // x 值 = 父节点的中间值 - 自己宽度的一半 - 居中差值
// that.x = pW_Z / 2 - tW_Z / 2 + horizonCenter;
//
// } else if(t(left)) { // 假如有左边距
//
// that.x = left;
//
// } else if(t(right)) { // 假如有右边距
//
// that.x = pW_Z - right - tW_Z;
//
// }
// }
//
// /**
// * 计算 height 和 y 值
// */
// if(t(top) && t(bottom)) { // top bottom 都有则直接拉伸或缩小
//
// that.y = top;
//
// that.height = pH_Z - top - bottom;
//
// } else {
// // 先设置下自己的 height
// t(percentHeight) && (tH_Z = that.height = pH_Z * percentHeight / 100);
//
// // 先考虑 horizonCenter 属性
// if(t(verticalCenter)) {
// // x 值 = 父节点的中间值 - 自己高度的一半 - 居中差值
// that.y = pH_Z / 2 - tH_Z / 2 + verticalCenter;
//
// } else if(t(top)) { // 假如有 top
//
// that.y = top;
//
// } else if(t(bottom)) { // 假如有 bottom
//
// that.y = pH_Z - bottom - tH_Z;
//
// }
// }
//
// // console.log(that.name, that.width, that.height);
// that.children.forEach(v => v.adjustProxy.adjustLayout());
// }
} }
...@@ -2,23 +2,23 @@ ...@@ -2,23 +2,23 @@
* Created by rockyl on 2019-11-05. * Created by rockyl on 2019-11-05.
*/ */
import {Stage} from "../../2d/display/index"; import { Stage } from "../../2d/display/index";
import {StackContainer} from "./StackContainer"; import { StackContainer } from "./StackContainer";
import {checkAssetGroupLoaded, loadAssetsGroup, loadAssets, loadAssetsGroups} from "./assets-manager"; import { checkAssetGroupLoaded, loadAssetsGroup, loadAssets, loadAssetsGroups } from "./assets-manager";
import {instantiate} from "./view-interpreter"; import { instantiate } from "./view-interpreter";
import {dataCenter, DataCenter} from "./data-center"; import { dataCenter, DataCenter } from "./data-center";
import {setProcessMetaLibs} from "../behavior-runtime/index"; import { setProcessMetaLibs } from "../behavior-runtime/index";
import {Tween} from "../../2d/tween/index"; import { Tween } from "../../2d/tween/index";
import {Rect} from "./nodes/index"; import { Rect } from "./nodes/index";
import {injectEnv} from "./enviroment"; import { injectEnv } from "./enviroment";
import {Toast} from "./Toast"; import { Toast } from "./Toast";
import {arrayFind} from "../utils/index"; import { arrayFind } from "../utils/index";
import {Node} from "./nodes/Node"; import { Node } from "./nodes/Node";
import {bind, createStore} from "./mvvm/index"; import { bind, createStore } from "./mvvm/index";
import {registerCustomModules} from "./custom-module"; import { registerCustomModules } from "./custom-module";
import {dealPageRemainTime, dealPxEnv} from "../px-logics"; import { dealPageRemainTime, dealPxEnv } from "../px-logics";
import Container from "../../2d/display/Container"; import Container from "../../2d/display/Container";
import {Event} from "../../2d/events/Event"; import { Event } from "../../2d/events/Event";
/** /**
* 游戏舞台 * 游戏舞台
...@@ -123,7 +123,7 @@ export class GameStage extends Node { ...@@ -123,7 +123,7 @@ export class GameStage extends Node {
registerCustomModules(customs); registerCustomModules(customs);
if (dataMapping) { if(dataMapping) {
this.dataCenter.registerDataMapping(dataMapping); this.dataCenter.registerDataMapping(dataMapping);
} }
setProcessMetaLibs(processes, builtinProcesses); setProcessMetaLibs(processes, builtinProcesses);
...@@ -145,12 +145,12 @@ export class GameStage extends Node { ...@@ -145,12 +145,12 @@ export class GameStage extends Node {
* 开始游戏 * 开始游戏
*/ */
start() { start() {
const {options: {entrySceneView, }, } = this._config; const {options: {entrySceneView,},} = this._config;
setTimeout(async () => { setTimeout(async () => {
let sceneEntry = await this.instantiateView(entrySceneView); let sceneEntry = await this.instantiateView(entrySceneView);
if (sceneEntry) { if(sceneEntry) {
this._sceneContainer.push(sceneEntry); this._sceneContainer.push(sceneEntry);
} }
}) })
...@@ -162,7 +162,7 @@ export class GameStage extends Node { ...@@ -162,7 +162,7 @@ export class GameStage extends Node {
async showInnerLoadingView() { async showInnerLoadingView() {
let loadingViewName = this._config.options.loadingView; let loadingViewName = this._config.options.loadingView;
let loadingView = this._loadingView.getChildAt(0); let loadingView = this._loadingView.getChildAt(0);
if (this._loadingView.children.length == 0 && loadingViewName) { if(this._loadingView.children.length == 0 && loadingViewName) {
loadingView = await this.instantiateView(loadingViewName, true, false); loadingView = await this.instantiateView(loadingViewName, true, false);
this._loadingView.addChild(loadingView); this._loadingView.addChild(loadingView);
} }
...@@ -173,7 +173,7 @@ export class GameStage extends Node { ...@@ -173,7 +173,7 @@ export class GameStage extends Node {
* 隐藏加载视图 * 隐藏加载视图
*/ */
hideInnerLoadingView() { hideInnerLoadingView() {
if (this._loadingView.visible) { if(this._loadingView.visible) {
this._loadingView.visible = false; this._loadingView.visible = false;
} }
} }
...@@ -186,40 +186,40 @@ export class GameStage extends Node { ...@@ -186,40 +186,40 @@ export class GameStage extends Node {
*/ */
async instantiateView(name, cache = true, showLoadingView = true) { async instantiateView(name, cache = true, showLoadingView = true) {
let view; let view;
if (cache) { if(cache) {
view = this._viewCache[name]; view = this._viewCache[name];
} }
if (!view) { if(!view) {
let viewConfig = this.getViewConfigByName(name); let viewConfig = this.getViewConfigByName(name);
if (viewConfig) { if(viewConfig) {
const {assets, customs} = this._config; const {assets, customs} = this._config;
if (!Array.isArray(assets)) { if(!Array.isArray(assets)) {
let groups = {}; let groups = {};
let {depCustoms} = viewConfig; let {depCustoms} = viewConfig;
if (depCustoms && depCustoms.length > 0) { if(depCustoms && depCustoms.length > 0) {
for (let custom of customs) { for(let custom of customs) {
if (depCustoms.indexOf(custom.id) >= 0 && custom.assets) { if(depCustoms.indexOf(custom.id) >= 0 && custom.assets) {
if (!checkAssetGroupLoaded(custom.id)) { if(!checkAssetGroupLoaded(custom.id)) {
groups[custom.id] = custom.assets; groups[custom.id] = custom.assets;
} }
} }
} }
} }
if (!checkAssetGroupLoaded(viewConfig.uuid)) { if(!checkAssetGroupLoaded(viewConfig.uuid)) {
let depAssets = assets[viewConfig.uuid]; let depAssets = assets[viewConfig.uuid];
if (depAssets && depAssets.length > 0) { if(depAssets && depAssets.length > 0) {
groups[viewConfig.uuid] = depAssets; groups[viewConfig.uuid] = depAssets;
} }
} }
if(Object.keys(groups).length > 0){ if(Object.keys(groups).length > 0) {
await loadAssetsGroups(groups, async () => { await loadAssetsGroups(groups, async () => {
if (showLoadingView) { if(showLoadingView) {
await this.showInnerLoadingView(); await this.showInnerLoadingView();
} }
}, async () => { }, async () => {
if (showLoadingView) { if(showLoadingView) {
this.hideInnerLoadingView(); this.hideInnerLoadingView();
} }
}); });
...@@ -228,7 +228,7 @@ export class GameStage extends Node { ...@@ -228,7 +228,7 @@ export class GameStage extends Node {
view = instantiate(viewConfig); view = instantiate(viewConfig);
let store = {}; let store = {};
if (viewConfig.store) { if(viewConfig.store) {
const {exp, computed} = viewConfig.store; const {exp, computed} = viewConfig.store;
store = createStore(exp, computed); store = createStore(exp, computed);
} }
...@@ -240,7 +240,7 @@ export class GameStage extends Node { ...@@ -240,7 +240,7 @@ export class GameStage extends Node {
bind(store, view); bind(store, view);
console.timeEnd('bind'); console.timeEnd('bind');
if (cache) { if(cache) {
this._viewCache[name] = view; this._viewCache[name] = view;
} }
} else { } else {
...@@ -262,11 +262,11 @@ export class GameStage extends Node { ...@@ -262,11 +262,11 @@ export class GameStage extends Node {
const {action, view, lastView, options, hasView} = e.data; const {action, view, lastView, options, hasView} = e.data;
const target = <StackContainer>e.target; const target = <StackContainer>e.target;
switch (action) { switch(action) {
case 'push': case 'push':
case 'replace': case 'replace':
case 'popAll': case 'popAll':
if (options && options.center) { if(options && options.center) {
view.x = (target.width - view.width) / 2; view.x = (target.width - view.width) / 2;
view.y = (target.height - view.height) / 2; view.y = (target.height - view.height) / 2;
} }
...@@ -275,18 +275,18 @@ export class GameStage extends Node { ...@@ -275,18 +275,18 @@ export class GameStage extends Node {
let blackLayer = this._blackLayer; let blackLayer = this._blackLayer;
let pParent = blackLayer.parent; let pParent = blackLayer.parent;
if (hasView) { if(hasView) {
target.addChildAt(blackLayer, target.childNum - 1 - (view ? 0 : 1)); target.addChildAt(blackLayer, target.childNum - 1 - (view ? 0 : 1));
let modalAlpha = 0.7; let modalAlpha = 0.7;
if(options && options.hasOwnProperty('modalAlpha')){ if(options && options.hasOwnProperty('modalAlpha')) {
modalAlpha = options.modalAlpha; modalAlpha = options.modalAlpha;
} }
if (!pParent || blackLayer['tween_count'] > 0) { if(!pParent || blackLayer['tween_count'] > 0) {
blackLayer.alpha = 0; blackLayer.alpha = 0;
Tween.get(blackLayer, null, null, true) Tween.get(blackLayer, null, null, true)
.to({alpha: modalAlpha}, 300); .to({alpha: modalAlpha}, 300);
} }
} else if (pParent) { } else if(pParent) {
Tween.get(blackLayer, null, null, true) Tween.get(blackLayer, null, null, true)
.to({alpha: 0}, 300) .to({alpha: 0}, 300)
.call(() => { .call(() => {
...@@ -301,32 +301,32 @@ export class GameStage extends Node { ...@@ -301,32 +301,32 @@ export class GameStage extends Node {
lazyLoadAllAssets = async () => { lazyLoadAllAssets = async () => {
let {assets, customs} = this._config; let {assets, customs} = this._config;
if (!Array.isArray(assets)) { if(!Array.isArray(assets)) {
for (let uuid in assets) { for(let uuid in assets) {
let group = assets[uuid]; let group = assets[uuid];
if (group && group.length > 0) { if(group && group.length > 0) {
await loadAssetsGroup(group, uuid); await loadAssetsGroup(group, uuid);
} }
} }
} }
for (let custom of customs) { for(let custom of customs) {
let group = custom.assets; let group = custom.assets;
if (group && group.length > 0) { if(group && group.length > 0) {
await loadAssetsGroup(group, custom.id); await loadAssetsGroup(group, custom.id);
} }
} }
}; };
async loadPreloadAssets(onPreloadAssetsProgress, onPreloadAssetsComplete){ async loadPreloadAssets(onPreloadAssetsProgress, onPreloadAssetsComplete) {
const {assets, } = this._config; const {assets,} = this._config;
let loaded = 0; let loaded = 0;
let assetsToLoad = assets; let assetsToLoad = assets;
let total; let total;
if (!Array.isArray(assets)) { //如果是分组后的配置就加载共用分组,否则加载全部 if(!Array.isArray(assets)) { //如果是分组后的配置就加载共用分组,否则加载全部
assetsToLoad = assets['common']; assetsToLoad = assets['common'];
if(assetsToLoad.length > 0){ if(assetsToLoad.length > 0) {
await this.showInnerLoadingView(); await this.showInnerLoadingView();
await loadAssetsGroups({ await loadAssetsGroups({
preload: assetsToLoad, preload: assetsToLoad,
...@@ -336,7 +336,7 @@ export class GameStage extends Node { ...@@ -336,7 +336,7 @@ export class GameStage extends Node {
this.hideInnerLoadingView(); this.hideInnerLoadingView();
}); });
} }
}else{ } else {
total = assetsToLoad.length; total = assetsToLoad.length;
await loadAssets(assetsToLoad, p).catch(e => { await loadAssets(assetsToLoad, p).catch(e => {
console.log(e); console.log(e);
...@@ -347,7 +347,7 @@ export class GameStage extends Node { ...@@ -347,7 +347,7 @@ export class GameStage extends Node {
loaded++; loaded++;
onPreloadAssetsProgress && onPreloadAssetsProgress(loaded, total); onPreloadAssetsProgress && onPreloadAssetsProgress(loaded, total);
if (loaded >= total) { if(loaded >= total) {
onPreloadAssetsComplete && onPreloadAssetsComplete(); onPreloadAssetsComplete && onPreloadAssetsComplete();
} }
} }
......
...@@ -2,21 +2,23 @@ ...@@ -2,21 +2,23 @@
* Created by rockyl on 2019-11-08. * Created by rockyl on 2019-11-08.
*/ */
import {Stage} from "../2d/display/index"; import { Stage } from "../2d/display/index";
import {GameStage, registerCustomModuleFromConfig} from "./game-warpper/index"; import { GameStage, registerCustomModuleFromConfig } from "./game-warpper/index";
import {setGlobalContext, setProcessMetaLibs} from "./behavior-runtime/index"; import { setGlobalContext, setProcessMetaLibs } from "./behavior-runtime/index";
import {globalLoader} from "../2d/loader/Loader"; import { globalLoader } from "../2d/loader/Loader";
import {Event} from "../2d/events/Event"; import { Event } from "../2d/events/Event";
import builtinLoadingView from "./game-warpper/LoadingView"; import builtinLoadingView from "./game-warpper/LoadingView";
import {queryParams} from "./web"; import { queryParams } from "./web";
import {initAutoLayout} from "./game-warpper/auto-layout"; import { initAutoLayout } from "./game-warpper/auto-layout";
import {registerScripts} from "./decorators/scripts"; import { registerScripts } from "./decorators/scripts";
import {RENDERER_TYPE, StageScaleMode} from "../2d/const"; import { RENDERER_TYPE, StageScaleMode } from "../2d/const";
import { alignMgr } from "./decorators/AlignManager";
export let gameStage: GameStage; export let gameStage: GameStage;
export let alignManager = alignMgr;
export function launch(url, loadingDelegate?, onStart?) { export function launch(url, loadingDelegate?, onStart?) {
if (queryParams.__proxy_mode__) { if(queryParams.__proxy_mode__) {
return Promise.resolve('cancel launch'); return Promise.resolve('cancel launch');
} }
return globalLoader.loadJson(url) return globalLoader.loadJson(url)
...@@ -52,6 +54,7 @@ export async function launchWithConfig(config, loadingDelegate?, onStart?) { ...@@ -52,6 +54,7 @@ export async function launchWithConfig(config, loadingDelegate?, onStart?) {
setTimeout(resolve, 300); setTimeout(resolve, 300);
}); });
return await new Promise(resolve => { return await new Promise(resolve => {
const {containerId, designWidth, designHeight, frameRate, scaleMode, rendererType, bgColor, autoResize,} = config.options; const {containerId, designWidth, designHeight, frameRate, scaleMode, rendererType, bgColor, autoResize,} = config.options;
let stage = window['stage'] = new Stage( let stage = window['stage'] = new Stage(
containerId || "game-container", containerId || "game-container",
...@@ -67,6 +70,8 @@ export async function launchWithConfig(config, loadingDelegate?, onStart?) { ...@@ -67,6 +70,8 @@ export async function launchWithConfig(config, loadingDelegate?, onStart?) {
initAutoLayout(stage); initAutoLayout(stage);
Stage.flushAll(); Stage.flushAll();
// Stage.addUpdateObj(alignMgr);
stage.addEventListener(Event.ON_INIT_STAGE, () => { stage.addEventListener(Event.ON_INIT_STAGE, () => {
gameStage = new GameStage(stage); gameStage = new GameStage(stage);
setGlobalContext({ setGlobalContext({
...@@ -76,9 +81,9 @@ export async function launchWithConfig(config, loadingDelegate?, onStart?) { ...@@ -76,9 +81,9 @@ export async function launchWithConfig(config, loadingDelegate?, onStart?) {
let delegate = loadingDelegate || builtinLoadingView; let delegate = loadingDelegate || builtinLoadingView;
gameStage.launch(config, function (done, total) { gameStage.launch(config, function(done, total) {
delegate.onProgress && delegate.onProgress(done, total) delegate.onProgress && delegate.onProgress(done, total)
}, function () { }, function() {
delegate.onComplete && delegate.onComplete(); delegate.onComplete && delegate.onComplete();
}, onStart); }, onStart);
}); });
......
...@@ -14,13 +14,13 @@ export const linkScheme = 'link://'; ...@@ -14,13 +14,13 @@ export const linkScheme = 'link://';
* @param predicate * @param predicate
*/ */
export function arrayFind(arr, predicate) { export function arrayFind(arr, predicate) {
if (!arr) { if(!arr) {
return; return;
} }
for (let i = 0, li = arr.length; i < li; i++) { for(let i = 0, li = arr.length; i < li; i++) {
const item = arr[i]; const item = arr[i];
if (predicate(item, i, arr)) { if(predicate(item, i, arr)) {
return item; return item;
} }
} }
...@@ -39,9 +39,9 @@ const percentKeys = ['width', 'height']; ...@@ -39,9 +39,9 @@ const percentKeys = ['width', 'height'];
export function propertyParse(key, node, properties) { export function propertyParse(key, node, properties) {
let value = properties[key]; let value = properties[key];
let targetKey = key; let targetKey = key;
if (percentKeys.indexOf(key) >= 0) { if(percentKeys.indexOf(key) >= 0) {
if (typeof value === 'string') { if(typeof value === 'string') {
if (value[value.length - 1] === '%') { if(value[value.length - 1] === '%') {
targetKey = 'percent' + key[0].toUpperCase() + key.substr(1); targetKey = 'percent' + key[0].toUpperCase() + key.substr(1);
} }
value = parseInt(value); value = parseInt(value);
...@@ -60,9 +60,9 @@ export function getDataByPath(scope, path, throwException?) { ...@@ -60,9 +60,9 @@ export function getDataByPath(scope, path, throwException?) {
let func = new Function('scope', `return scope` + (path ? ('.' + path) : '')); let func = new Function('scope', `return scope` + (path ? ('.' + path) : ''));
try { try {
return func(scope); return func(scope);
} catch (e) { } catch(e) {
//console.warn(e); //console.warn(e);
if (throwException) { if(throwException) {
throw e; throw e;
} }
} }
...@@ -77,8 +77,8 @@ export function safeEval(code, throwException = false) { ...@@ -77,8 +77,8 @@ export function safeEval(code, throwException = false) {
let func = new Function(code); let func = new Function(code);
try { try {
return func(); return func();
} catch (e) { } catch(e) {
if (throwException) { if(throwException) {
throw e; throw e;
} }
} }
...@@ -95,20 +95,20 @@ export function safeEval(code, throwException = false) { ...@@ -95,20 +95,20 @@ export function safeEval(code, throwException = false) {
* @return 是否有字段注入 * @return 是否有字段注入
*/ */
export function injectProp(target: any, data?: any, callback?: Function, ignoreMethod: boolean = true, ignoreNull: boolean = true): boolean { export function injectProp(target: any, data?: any, callback?: Function, ignoreMethod: boolean = true, ignoreNull: boolean = true): boolean {
if (!target || !data) { if(!target || !data) {
return false; return false;
} }
let result = false; let result = false;
for (let key in data) { for(let key in data) {
let value: any = data[key]; let value: any = data[key];
if ((!ignoreMethod || typeof value != 'function') && (!ignoreNull || value != null)) { if((!ignoreMethod || typeof value != 'function') && (!ignoreNull || value != null)) {
if (callback) { if(callback) {
callback(target, key, value); callback(target, key, value);
} else { } else {
try { try {
target[key] = value; target[key] = value;
} catch (e) { } catch(e) {
} }
} }
...@@ -126,17 +126,17 @@ export function injectProp(target: any, data?: any, callback?: Function, ignoreM ...@@ -126,17 +126,17 @@ export function injectProp(target: any, data?: any, callback?: Function, ignoreM
* @param config * @param config
*/ */
export function copyProp(target, data, config?) { export function copyProp(target, data, config?) {
if (data) { if(data) {
for (let key in config) { for(let key in config) {
let valueConfig = config[key]; let valueConfig = config[key];
if (Array.isArray(valueConfig)) { if(Array.isArray(valueConfig)) {
target[key] = {}; target[key] = {};
for (let field of valueConfig) { for(let field of valueConfig) {
target[key][field] = data[key][field]; target[key][field] = data[key][field];
} }
} else if (typeof valueConfig === 'string') { } else if(typeof valueConfig === 'string') {
target[valueConfig] = data[valueConfig]; target[valueConfig] = data[valueConfig];
} else if (typeof valueConfig === 'object') { } else if(typeof valueConfig === 'object') {
target[key] = {}; target[key] = {};
copyProp(target[key], data[key], valueConfig) copyProp(target[key], data[key], valueConfig)
} }
...@@ -149,11 +149,11 @@ export function copyProp(target, data, config?) { ...@@ -149,11 +149,11 @@ export function copyProp(target, data, config?) {
* @param obj * @param obj
*/ */
export function obj2query(obj: any): string { export function obj2query(obj: any): string {
if (!obj) { if(!obj) {
return ''; return '';
} }
let arr: string[] = []; let arr: string[] = [];
for (let key in obj) { for(let key in obj) {
arr.push(key + (key ? '=' : '') + obj[key]); arr.push(key + (key ? '=' : '') + obj[key]);
} }
return arr.join('&'); return arr.join('&');
...@@ -169,7 +169,7 @@ function requireForCJS(id) { ...@@ -169,7 +169,7 @@ function requireForCJS(id) {
* @param node * @param node
*/ */
export function importCJSCode(code, node?) { export function importCJSCode(code, node?) {
if (node) { if(node) {
let create = new Function('module', 'require', code); let create = new Function('module', 'require', code);
let module = { let module = {
exports: {}, exports: {},
...@@ -201,19 +201,19 @@ export function importUMDCode(code) { ...@@ -201,19 +201,19 @@ export function importUMDCode(code) {
* @param char * @param char
*/ */
export function trimChar(str: string, char: string) { export function trimChar(str: string, char: string) {
if (!str || !char) { if(!str || !char) {
return; return;
} }
while (true) { while(true) {
let len = str.length, from = 0, end = len; let len = str.length, from = 0, end = len;
if (str[0] === char) { if(str[0] === char) {
from = 1; from = 1;
} }
if (str[len - 1] === char) { if(str[len - 1] === char) {
end = len - 1; end = len - 1;
} }
str = str.substring(from, end); str = str.substring(from, end);
if (str.length == len) { if(str.length == len) {
break; break;
} }
} }
...@@ -227,7 +227,7 @@ export function trimChar(str: string, char: string) { ...@@ -227,7 +227,7 @@ export function trimChar(str: string, char: string) {
*/ */
export function joinPath(...segments: string[]) { export function joinPath(...segments: string[]) {
let result = []; let result = [];
for (let segment of segments) { for(let segment of segments) {
result.push(trimChar(segment, '/')); result.push(trimChar(segment, '/'));
} }
return result.join('/'); return result.join('/');
...@@ -240,10 +240,10 @@ export function joinPath(...segments: string[]) { ...@@ -240,10 +240,10 @@ export function joinPath(...segments: string[]) {
*/ */
export function findVariable(name: string, ...contexts) { export function findVariable(name: string, ...contexts) {
let result; let result;
for (let context of contexts) { for(let context of contexts) {
if (context) { if(context) {
result = context[name]; result = context[name];
if (result !== undefined) { if(result !== undefined) {
break; break;
} }
} }
...@@ -258,7 +258,7 @@ let el; ...@@ -258,7 +258,7 @@ let el;
* @param htmlText * @param htmlText
*/ */
export function htmlToPureText(htmlText) { export function htmlToPureText(htmlText) {
if (!el) { if(!el) {
el = document.createElement('div'); el = document.createElement('div');
} }
el.innerHTML = htmlText; el.innerHTML = htmlText;
...@@ -277,7 +277,7 @@ const zhReg = /[\u4e00-\u9fa5]/; ...@@ -277,7 +277,7 @@ const zhReg = /[\u4e00-\u9fa5]/;
*/ */
export function strLen(str) { export function strLen(str) {
let len = 0; let len = 0;
for (let char of str) { for(let char of str) {
len += char.match(zhReg) ? 2 : 1; len += char.match(zhReg) ? 2 : 1;
} }
return len; return len;
...@@ -291,12 +291,12 @@ export function strLen(str) { ...@@ -291,12 +291,12 @@ export function strLen(str) {
*/ */
export function strShort(str, limit, replace = '…') { export function strShort(str, limit, replace = '…') {
let result = ''; let result = '';
if (strLen(str) > limit) { if(strLen(str) > limit) {
let len = 0; let len = 0;
for (let i = 0, li = str.length; i < li; i++) { for(let i = 0, li = str.length; i < li; i++) {
const char = str[i]; const char = str[i];
len += char.match(zhReg) ? 2 : 1; len += char.match(zhReg) ? 2 : 1;
if (len > limit) { if(len > limit) {
result += replace; result += replace;
break; break;
} else { } else {
...@@ -328,8 +328,8 @@ export const cmdOldPrefix = '//z-'; ...@@ -328,8 +328,8 @@ export const cmdOldPrefix = '//z-';
* @param source * @param source
*/ */
export function injectProperties(target, source) { export function injectProperties(target, source) {
for (let key in source) { for(let key in source) {
if (key.indexOf('//') !== 0 && !source.hasOwnProperty(cmdPrefix + key)) { if(key.indexOf('//') !== 0 && !source.hasOwnProperty(cmdPrefix + key)) {
propertyParse(key, target, source); propertyParse(key, target, source);
} }
} }
...@@ -344,14 +344,25 @@ export function injectProperties(target, source) { ...@@ -344,14 +344,25 @@ export function injectProperties(target, source) {
* @param includeSelf * @param includeSelf
*/ */
export function traverseViewNode(node: Container, callback: Function, includeSelf = false) { export function traverseViewNode(node: Container, callback: Function, includeSelf = false) {
if (includeSelf) { if(includeSelf) {
callback(node); callback(node);
} }
for (let child of node.children) { for(let child of node.children) {
callback(child, node); callback(child, node);
if (child.children && child.children.length > 0) { if(child.children && child.children.length > 0) {
traverseViewNode(child, callback); traverseViewNode(child, callback);
} }
} }
} }
/**
* 数字转化为boolean值
* NaN -> false 'aaa' -> false null -> false undefined -> false
* 666 -> true '007' -> true Infinity -> true
* @param v
* @returns {boolean}
*/
export function toBoolean(v): boolean {
return !isNaN(v) && v !== null && v !== undefined;
}
...@@ -438,10 +438,10 @@ rollup-plugin-node-resolve@^5.2.0: ...@@ -438,10 +438,10 @@ rollup-plugin-node-resolve@^5.2.0:
resolve "^1.11.1" resolve "^1.11.1"
rollup-pluginutils "^2.8.1" rollup-pluginutils "^2.8.1"
rollup-plugin-progress@^1.1.1: rollup-plugin-progress@^1.1.2:
version "1.1.1" version "1.1.2"
resolved "https://registry.npm.taobao.org/rollup-plugin-progress/download/rollup-plugin-progress-1.1.1.tgz#fcce2f915d545014ac89ea0927ee97cb48052f60" resolved "https://registry.npm.taobao.org/rollup-plugin-progress/download/rollup-plugin-progress-1.1.2.tgz#5c1dfe7c50f654906bc34d167d5512ee1a4b72d5"
integrity sha1-/M4vkV1UUBSsieoJJ+6Xy0gFL2A= integrity sha1-XB3+fFD2VJBrw00WfVUS7hpLctU=
dependencies: dependencies:
chalk "^2.4.2" chalk "^2.4.2"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment