Skip to content

Commit

Permalink
Disable bone edit if imported data is based on parent
Browse files Browse the repository at this point in the history
  • Loading branch information
Chenguang Liu committed Jan 6, 2015
1 parent 5191d25 commit d4c34e7
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ dataTypeAbsolute=Global
dataTypeRelative=Parent
compressData=Compress Data
dataTypeAbsoluteToolTip=Using global coordinate, perfect compatible with older version libraries, but file size will be bigger.
dataTypeAbsoluteDisableToolTip=Because the Imported data is based on parent coordinate. It cannot be exported to global coordinate.
dataTypeRelativeToolTip=Using parent coordinate, the exported data file can be further compressed, but it will not be older version libraries compatible and its skeleton hierarchy will not be editable after opened by DesignPanel.
compressDataToolTip=Enable compress data can great reduce exported data file size, but the exported data file will not be older version libraries compatible.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ dataTypeAbsolute=Mondial
dataTypeRelative=Mère
compressData=Comprimé Data
dataTypeAbsoluteToolTip=L'utilisation globale de coordonnées, parfaitement compatible avec l'ancienne version de la bibliothèque, mais la taille du fichier sera encore plus grand.
dataTypeAbsoluteDisableToolTip=En raison de l'importation de données sur la base de coordonnées de l'objet parent.Il ne peut pas être exportés vers les coordonnées mondial.
dataTypeRelativeToolTip=L'utilisation de coordonnées de l'objet parent, le document d'exportation de données peut en outre être comprimé, mais n'est pas compatible avec la base de l'ancienne version, le squelette de la hiérarchie ne sera pas ouvert designpanel après l'édition.
compressDataToolTip=De sorte que la compression des données, on peut considérablement réduire la taille du fichier de données d'exportation, mais le fichier de données d'exportation ne sera pas compatible avec une ancienne version de la bibliothèque.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ dataTypeAbsolute=世界の
dataTypeRelative=父の
compressData=圧縮データ
dataTypeAbsoluteToolTip=世界の座標のデータが完璧に互換ボス本の倉庫、しかしデータファイルサイズが大きい。
dataTypeAbsoluteDisableToolTip=導入に父からの座標係のデータに基づいて、ないからエクスポートを世界の座標係のデータ.
dataTypeRelativeToolTip=父の座標のデータが最大限の圧縮データサイズで、でもそれは上司と本のライブラリには対応していない、そしてエクスポートしたデータを支持しないでDesignPanelで再び改正骨格関係。
compressDataToolTip=開くデータ圧縮できる最大限の圧縮データサイズがターンの古いバージョンのライブラリには対応していない。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ dataTypeAbsolute=世界
dataTypeRelative=父
compressData=压缩数据
dataTypeAbsoluteToolTip=世界坐标数据能够完美兼容老板本的库,但是数据文件尺寸会比较大。
dataTypeAbsoluteDisableToolTip=因为导入的是基于父坐标系的数据,所以无法导出为基于世界坐标系的数据。
dataTypeRelativeToolTip=父坐标数据能够最大限度的压缩数据尺寸,但是可能会和老板本的库不兼容,并且导出的数据将不支持在DesignPanel中再次修改骨架关系。
compressDataToolTip=开启数据压缩能够最大限度的压缩数据尺寸,但是可能回合老版本的库不兼容。

Expand Down
31 changes: 7 additions & 24 deletions DragonBonesDesignPanelLib/src/core/SettingManager.as
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ package core
private static const ANIMATION_ADVANCED_EXPAND:String = "animationAdvancedExpand";
private static const SKELETON_ADVANCED_EXPAND:String = "skeletonAdvancedExpand";

private static const USER_NAME:String = "userName";
private static const USERE_MAIL:String = "userEmail";

private static var _instance:SettingManager;
public static function getInstance():SettingManager
{
Expand Down Expand Up @@ -108,17 +105,21 @@ package core

private var _shareObject:SharedObject = null;

public var enableDataTypeAbsolute:Boolean = true;
public var enableExportGlobalDataType:Boolean = true;
public var boneHierarchyEditable:Boolean = true;

public function updateSettingAfterImportData(dataType:String):void
{
if(dataType == GlobalConstValues.DATA_TYPE_PARENT)
{
exportDataTypeIndex = 1;
enableDataTypeAbsolute = false;
enableExportGlobalDataType = false;
boneHierarchyEditable = false;
}
else
{
enableDataTypeAbsolute = true;
enableExportGlobalDataType = true;
boneHierarchyEditable = true;
}
}

Expand Down Expand Up @@ -358,24 +359,6 @@ package core
setData(SKELETON_ADVANCED_EXPAND, value);
}

public function get userName():String
{
return hasData(USER_NAME)?getData(USER_NAME):"";
}
public function set userName(value:String):void
{
setData(USER_NAME, value);
}

public function get userEmail():String
{
return hasData(USERE_MAIL)?getData(USERE_MAIL):"";
}
public function set userEmail(value:String):void
{
setData(USERE_MAIL, value);
}

public function SettingManager()
{
if (_instance)
Expand Down
1 change: 0 additions & 1 deletion DragonBonesDesignPanelLib/src/core/model/ImportModel.as
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ package core.model
_vo.skeleton = formatDataToCurrentVersion(_vo.skeleton);
setVersion();
break;

default:
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package core.service
import core.utils.OptimizeDataUtils;
import core.utils.PNGEncoder;

import dragonBones.core.DragonBones;
import dragonBones.objects.DataParser;
import dragonBones.utils.ConstValues;

Expand Down Expand Up @@ -198,6 +199,7 @@ package core.service
{
objData = DataFormatUtils.xmlToObject(importModel.vo.skeleton, GlobalConstValues.XML_LIST_NAMES);
objData[ConstValues.A_IS_GLOBAL] = 0;
objData[ConstValues.A_VERSION] = DragonBones.PARENT_COORDINATE_DATA_VERSION;
DataUtils.convertDragonBonesDataToRelativeObject(objData);
}

Expand Down
7 changes: 3 additions & 4 deletions DragonBonesDesignPanelLib/src/core/view/ArmatureView.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

<fx:Script>
<![CDATA[
import core.AssetManager;
import com.greensock.TweenMax;
import core.AssetManager;
import core.SettingManager;
import core.events.ViewEvent;
import core.utils.getPointTarget;
import dragonBones.Armature;
import dragonBones.Bone;
import dragonBones.Slot;
Expand Down Expand Up @@ -367,8 +367,7 @@
}
}
_armatureSymbols.update(_armatureScale, _boneSelected, _isDragedBone);
_armatureSymbols.update(_armatureScale, _boneSelected, SettingManager.getInstance().boneHierarchyEditable && _isDragedBone);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<s:HGroup width="100%" height="100%" gap="0">
<components:DragTree minWidth="40" width="100%" height="100%" borderVisible="false" textSelectedColor="#CCCCCC" textRollOverColor="#CCCCCC"
id="boneTree"
labelField="@name" dropEnabled="true" dragEnabled="true"
labelField="@name" dropEnabled="{_settingManager.boneHierarchyEditable}" dragEnabled="{_settingManager.boneHierarchyEditable}"
/>

<s:Line height="100%">
Expand Down
32 changes: 20 additions & 12 deletions DragonBonesDesignPanelLib/src/plugin/view/ExportWindow.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,27 @@
selectedIndex="@{_settingManager.exportDataFormatIndex}"
change="changeHandler(event)"
/>
<s:HGroup width="100%" height="24" gap="10" visible="{!_isMerged}" includeInLayout="{!_isMerged}">
<s:HGroup width="100%" height="24" gap="10" visible="{!_isMerged}" includeInLayout="{!_isMerged}" verticalAlign="middle">

<s:HGroup height="100%" verticalAlign="middle" gap="0"
toolTip="{_settingManager.enableExportGlobalDataType ?
resourceManager.getString('resources','dataTypeAbsoluteToolTip') :
resourceManager.getString('resources','dataTypeAbsoluteDisableToolTip')}">
<s:RadioButton id="absoluteDataTypeRadioBtn" groupName="exportDataType"
selected="{_settingManager.exportDataTypeIndex == 0}"
enabled="{_settingManager.enableExportGlobalDataType}"
change="exportDataTypeChanged(event)"/>
<s:Label enabled="{_settingManager.enableExportGlobalDataType}"
text="{resourceManager.getString('resources','dataTypeAbsolute')}"/>
</s:HGroup>
<s:HGroup height="100%" verticalAlign="middle" gap="0"
toolTip="{resourceManager.getString('resources','dataTypeRelativeToolTip')}">
<s:RadioButton id="relativeDataTypeRadioBtn" groupName="exportDataType"
selected="{_settingManager.exportDataTypeIndex == 1}"
change="exportDataTypeChanged(event)"/>
<s:Label text="{resourceManager.getString('resources','dataTypeRelative')}"/>
</s:HGroup>

<s:RadioButton id="absoluteDataTypeRadioBtn" groupName="exportDataType"
label="{resourceManager.getString('resources','dataTypeAbsolute')}"
selected="{_settingManager.exportDataTypeIndex == 0}"
enabled="{_settingManager.enableDataTypeAbsolute}"
change="exportDataTypeChanged(event)"
toolTip="{resourceManager.getString('resources','dataTypeAbsoluteToolTip')}"/>
<s:RadioButton id="relativeDataTypeRadioBtn" groupName="exportDataType"
label="{resourceManager.getString('resources','dataTypeRelative')}"
selected="{_settingManager.exportDataTypeIndex == 1}"
change="exportDataTypeChanged(event)"
toolTip="{resourceManager.getString('resources','dataTypeRelativeToolTip')}"/>
<s:Spacer width="20"/>
<s:CheckBox label="{resourceManager.getString('resources','compressData')}"
selected="@{_settingManager.enableDataOptimization}"
Expand Down

0 comments on commit d4c34e7

Please sign in to comment.