character propetries window ui
This commit is contained in:
@@ -84,7 +84,7 @@ class CharacterAnimsWindow extends UIWindow {
|
||||
__rect.width = bWidth; __rect.height = bHeight;
|
||||
if(UIState.state.isOverlapping(this, __rect)) {
|
||||
var nextscrollY = scrollY - FlxG.mouse.wheel * 12;
|
||||
if (nextscrollY >= 0 && nextscrollY + CharacterEditor.instance.animsCamera.height <= (addButton.y +32 +26))
|
||||
if (nextscrollY >= 0 && nextscrollY + CharacterEditor.instance.animsCamera.height <= (addButton.y +32 +23))
|
||||
scrollY = nextscrollY;
|
||||
hovered = true;
|
||||
} else
|
||||
|
||||
@@ -52,7 +52,8 @@ class CharacterEditor extends UIState {
|
||||
label: "File",
|
||||
childs: [
|
||||
{
|
||||
label: "New"
|
||||
label: "New",
|
||||
onSelect: _file_new,
|
||||
},
|
||||
null,
|
||||
{
|
||||
@@ -122,11 +123,7 @@ class CharacterEditor extends UIState {
|
||||
{
|
||||
label: "Stop Animation",
|
||||
onSelect: _playback_stop_anim
|
||||
},
|
||||
null,
|
||||
{
|
||||
label: "Go to frame",
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -222,7 +219,7 @@ class CharacterEditor extends UIState {
|
||||
topMenuSpr = new UITopMenu(topMenu);
|
||||
topMenuSpr.cameras = uiGroup.cameras = [uiCamera];
|
||||
|
||||
characterPropertiresWindow = new CharacterPropertiesWindow(800-23,23 + 23, 450 + 23, 140, "Character Properties");
|
||||
characterPropertiresWindow = new CharacterPropertiesWindow();
|
||||
characterAnimsWindow = new CharacterAnimsWindow(character);
|
||||
uiGroup.add(characterPropertiresWindow);
|
||||
uiGroup.add(characterAnimsWindow);
|
||||
@@ -246,6 +243,9 @@ class CharacterEditor extends UIState {
|
||||
UIUtil.processShortcuts(topMenu);
|
||||
}
|
||||
|
||||
if (character != null)
|
||||
characterPropertiresWindow.characterInfo.text = '(Num) Animations: ${character.animation.getNameList().length}\nFlipped: ${character.flipX}\nSprite: ${character.sprite}\nAnim: ${character.animation.name}';
|
||||
|
||||
if (FlxG.mouse.wheel != 0 && !(characterPropertiresWindow.hovered || characterAnimsWindow.hovered)) {
|
||||
zoom += 0.25 * FlxG.mouse.wheel;
|
||||
__camZoom = Math.pow(2, zoom);
|
||||
@@ -263,8 +263,8 @@ class CharacterEditor extends UIState {
|
||||
}
|
||||
|
||||
charCamera.scroll.set(
|
||||
lerp(charCamera.scroll.x, nextScroll.x, 0.5),
|
||||
lerp(charCamera.scroll.y, nextScroll.y, 0.5)
|
||||
lerp(charCamera.scroll.x, nextScroll.x, 0.25),
|
||||
lerp(charCamera.scroll.y, nextScroll.y, 0.25)
|
||||
);
|
||||
|
||||
charCamera.zoom = lerp(charCamera.zoom, __camZoom, 0.125);
|
||||
@@ -286,15 +286,15 @@ class CharacterEditor extends UIState {
|
||||
FlxG.switchState(new CharacterSelection());
|
||||
}
|
||||
|
||||
function _file_new(_) {
|
||||
}
|
||||
|
||||
function _file_save(_) {
|
||||
}
|
||||
|
||||
function _file_saveas(_) {
|
||||
}
|
||||
|
||||
function _edit_delete(_) {
|
||||
}
|
||||
|
||||
function _edit_undo(_) {
|
||||
var v = undoList.shift();
|
||||
switch (v) {
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
package funkin.editors.character;
|
||||
|
||||
import flixel.util.FlxColor;
|
||||
|
||||
class CharacterPropertiesWindow extends UIWindow {
|
||||
|
||||
public var newButton:UIButton;
|
||||
public var editButton:UIButton;
|
||||
|
||||
public var characterInfo:UIText;
|
||||
|
||||
public function new() {
|
||||
super(800-23,23 + 23, 450 + 23, 140, "Character Properties");
|
||||
|
||||
newButton = new UIButton( x +(450 + 23)- 25 - 3 - 200, y + 12 + 31, "New Character", null, 200);
|
||||
members.push(newButton);
|
||||
newButton.color = FlxColor.GREEN;
|
||||
|
||||
editButton = new UIButton(newButton.x, newButton.y + 12 + 30 + 4, "Edit Character Info", null, 200);
|
||||
members.push(editButton);
|
||||
|
||||
characterInfo = new UIText(x + 450 + 20 - 42 - 400, y + 36 + 16, 400, "(Num) Animations:\nFlipped:\nSprite:\nCurrent Anim:");
|
||||
characterInfo.alignment = LEFT;
|
||||
members.push(characterInfo);
|
||||
}
|
||||
}
|
||||
@@ -356,7 +356,6 @@ class Charter extends UIState {
|
||||
sep.cameras = [charterCamera];
|
||||
}
|
||||
|
||||
|
||||
selectionBox = new UISliceSprite(0, 0, 2, 2, 'editors/ui/selection');
|
||||
selectionBox.visible = false;
|
||||
selectionBox.scrollFactor.set(1, 1);
|
||||
|
||||
Reference in New Issue
Block a user