Skip to content
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

Commit 8565bf2

Browse files
committed
Character Editor Translatable
1 parent d39691a commit 8565bf2

File tree

10 files changed

+152
-130
lines changed

10 files changed

+152
-130
lines changed

assets/languages/en/Editors.xml

Lines changed: 74 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,24 @@
1111
<str id="close">Close</str>
1212
</group>
1313

14+
<group name="UIImageExplorer" prefix="uiImageExplorer.">
15+
<str id="symbol">Symbol</str>
16+
<str id="animation">Animation</str>
17+
<str id="atlas">Atlas</str>
18+
<str id="spritemap">Spritemap</str>
19+
20+
<str id="directory">Directory ({0}/)</str>
21+
<str id="found">{0} {1} Found</str>
22+
<str id="foundplural">{0} {1} Found</str>
23+
<str id="notFound">#NO {0}s Found#</str>
24+
<str id="foundAtlas">{0} Spritemap Found</str>
25+
<str id="foundAtlasplural">{0} Spritemaps Found</str>
26+
27+
<str id="fileAlreadyExists">The following files alreadly exist: \n\n{0}\n\nIMPORTANT: OVERRIDING CAN NOT BE UNDONE!!!!!!!!</str>
28+
<str id="override">Override Files</str>
29+
<str id="useExisting">Use Existing</str>
30+
</group>
31+
1432
<group name="EditorPicker" prefix="editor.">
1533
<str id="chart.name">Chart Editor</str>
1634
<str id="character.name">Character Editor</str>
@@ -314,52 +332,16 @@
314332
<str id="newCharacterDesc">Press ACCEPT to create a new character.</str>
315333
<str id="desc">Select a character to edit</str>
316334
<str id="desc-folder">Select a character to edit in {0}</str>
317-
318-
<group name="Warnings" prefix="warnings.">
319-
<str id="notImplemented-title">New Character: Feature Not Implemented!</str>
320-
<str id="notImplemented-body">This feature isn't implemented yet. Please wait for more cne updates to have this functional.\n\n\n- Codename Crew</str>
321-
</group>
322-
</group>
323-
324-
<group name="CharacterAnimScreen" prefix="characterAnimScreen.">
325-
<str id="win-title-creating">Creating Animation</str>
326-
<str id="win-title-editing">Animation {0} properties</str>
327-
328-
<str id="title-creating">Create New Animation</str>
329-
<str id="title-editing">Edit Animation Properties</str>
330-
331-
<str id="name">Name</str>
332-
<str id="anim">Animation</str>
333-
<str id="fps">FPS</str>
334-
<str id="looped">Looped</str>
335-
<str id="looping">Looping</str>
336-
<str id="indices">Indices</str>
337-
<str id="offset">Offset (X,Y)</str>
338335
</group>
339336

340337
<group name="CharacterInfoScreen" prefix="characterInfoScreen.">
341338
<str id="win-title">Editing Character</str>
342-
343-
<str id="spriteData">Sprite Data</str>
344-
345-
<str id="sprite">Sprite</str>
339+
<str id="title">Edit Character Info</str>
346340
<str id="icon">Icon</str>
347-
<str id="gameOverChar">Game Over Character</str>
348-
<str id="antialiasing">Antialiasing</str>
349-
<str id="antialiased">Antialiased</str>
350-
<str id="flipX">Flip X</str>
351-
<str id="flipped">Flipped</str>
352341
<str id="iconColor">Icon Color</str>
353-
354-
<str id="characterData">Character Data</str>
355-
356-
<str id="position">Position (X,Y)</str>
357-
<str id="cameraPosition">Camera Position (X,Y)</str>
358-
<str id="scale">Scale</str>
359-
<str id="singDuration">Sing Duration (Steps)</str>
342+
<str id="singDuration">Sing Duration</str>
343+
<str id="useSingDuration">Use Sing Duration?</str>
360344
<str id="customValues">Custom Values (Advanced)</str>
361-
<str id="isPlayer">Is Player</str>
362-
<str id="isGF">Is GF</str>
363345
</group>
364346

365347
<group name="CharacterEditor" prefix="characterEditor.">
@@ -374,22 +356,12 @@
374356

375357
<str id="topBar.edit">Edit</str>
376358
<group name="EditMenu" prefix="edit.">
359+
<str id="copyOffset">Copy Offset</str>
360+
<str id="pasteOffset">Paste Offset</str>
377361
<str id="undo">Undo</str>
378362
<str id="redo">Redo</str>
379-
</group>
380-
381-
<str id="topBar.character">Character</str>
382-
<group name="CharacterMenu" prefix="character.">
383-
<str id="newAnim">New Animation</str>
384-
<str id="editAnim">Edit Animation</str>
385-
<str id="deleteAnim">Delete Animation</str>
386-
<str id="editInfo">Edit Info</str>
387-
</group>
388-
389-
<str id="topBar.playback">Playback</str>
390-
<group name="PlaybackMenu" prefix="playback.">
391-
<str id="play">Play Animation</str>
392-
<str id="stop">Stop Animation</str>
363+
<str id="editInfo">Edit information</str>
364+
<str id="editSprite">Edit sprite</str>
393365
</group>
394366

395367
<str id="topBar.offset">Offsets</str>
@@ -402,34 +374,68 @@
402374
<str id="moveExtraUp">Move Extra Up</str>
403375
<str id="moveExtraDown">Move Extra Down</str>
404376
<str id="moveExtraRight">Move Extra Right</str>
377+
<str id="dragOffsetsMouse">Drag Offsets With Mouse?</str>
405378
<str id="clearOffsets">Clear Offsets</str>
406379
</group>
407380

381+
<str id="topBar.stage">Stage</str>
382+
<group name="StageMenu" prefix="stage.">
383+
<str id="useStage">Use "{0}"</str>
384+
<str id="useNone">Use No Stage</str>
385+
</group>
386+
408387
<str id="topBar.view">View</str>
409388
<group name="ViewMenu" prefix="view.">
410389
<str id="zoomIn">Zoom in</str>
411390
<str id="zoomOut">Zoom out</str>
412391
<str id="resetZoom">Reset Zoom</str>
392+
<str id="charHitbox">Character Hitbox?</str>
393+
<str id="charCam">Character Camera?</str>
394+
<str id="axis">XY Axis?</str>
413395
</group>
414-
</group>
415396

416-
<group prefix="characterAnimsWindow.">
417-
<str id="name">Character Animations</str>
418-
</group>
419-
<group prefix="characterPropertiesWindow.">
420-
<str id="name">Character Properties</str>
397+
<str id="topBar.animation">Animation</str>
398+
<group name="AnimationMenu" prefix="animation.">
399+
<str id="playAnim">Play Animation</str>
400+
<str id="stopAnim">Stop Animation</str>
401+
<str id="changeAnimUp">Change Animation ↑</str>
402+
<str id="changeAnimDown">Change Animation ↓</str>
403+
<str id="playAnimOnOffset">Play Animation On Offset?</str>
404+
</group>
405+
406+
<group name="CharacterPropertiesWindow" prefix="characterProperties.">
407+
<str id="position">Position (X, Y)</str>
408+
<str id="scale">Scale</str>
409+
<str id="editInfo">Edit Info</str>
410+
<str id="editSprite">Edit Sprite</str>
411+
<str id="camPosition">Camera Position (X, Y)</str>
412+
<str id="charFlipped">Flipped?</str>
413+
<str id="antialiased">Antialiased?</str>
414+
<str id="testCharAs">Test Character As...</str>
415+
<str id="charDesign">Char Designed As...</str>
416+
</group>
421417

422-
<str id="newCharacter">New Character</str>
423-
<str id="editCharacter">Edit Character Info</str>
418+
<group name="CharacterAnimButton" prefix="characterAnim.">
419+
<str id="defaultAnimName">New Anim</str>
420+
<str id="name">Name</str>
421+
<str id="anim">Animation</str>
422+
<str id="position">Position (X, Y)</str>
423+
<str id="fps">FPS</str>
424+
<str id="indices">Indices (Frames)</str>
425+
</group>
424426

427+
<group name="CharacterSpriteScreen" prefix="characterSpriteScreen.">
428+
<str id="win-title">Edit character sprite</str>
429+
<str id="charImageFile">Character Image File $* Required$</str>
430+
</group>
425431
</group>
426-
<str id="info.animations">{0} Animations</str>
427-
<str id="info.flipped">Flipped: {0}</str>
428-
<str id="info.sprite">Sprite: {0}</str>
429-
<str id="info.anim">Anim: {0}</str>
430-
<str id="info.offset">Offset: ({0}, {1})</str>
432+
<str id="name">Character Editor</str>
433+
</group>
431434

432-
<str id="info.invalidCharacter">Invalid Character</str>
435+
<group name="CharacterCreationScreen" prefix="characterCreationScreen.">
436+
<str id="win-title">Creating New Character</str>
437+
<str id="charName">Character Name $* Required$</str>
438+
<str id="charImgName">Character Image File $* Required$</str>
433439
</group>
434440
</group>
435441

@@ -441,7 +447,7 @@
441447

442448
<group name="Warnings" prefix="warnings.">
443449
<str id="notImplemented-title">New Typeface: Feature Not Implemented!</str>
444-
<str id="notImplemented-body">This feature isn't implemented yet. Please wait for more cne updates to have this functional.\n\n\n- Codename Devs</str>
450+
<str id="notImplemented-body">This feature isn't implemented yet. Please wait for more cne updates to have this functional.\n\n\n- Codename Crew</str>
445451
</group>
446452
</group>
447453

source/funkin/editors/character/CharacterAnimButton.hx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ class CharacterAnimButton extends UIButton {
4848
public var foldableButtons:Array<FlxSprite> = [];
4949
public var closed:Bool = true;
5050

51+
inline function translate(id:String, ?args:Array<Dynamic>)
52+
return TU.translate("characterEditor.characterAnim." + id, args);
53+
5154
public function new(x:Float, y:Float, animData:AnimData, parent:CharacterAnimsWindow) {
5255
this.anim = animData.name;
5356
this.data = animData;
@@ -76,13 +79,13 @@ class CharacterAnimButton extends UIButton {
7679
nameTextBox.onChange = (newName:String) -> {this.changeName(newName);};
7780
members.push(nameTextBox);
7881
foldableButtons.push(nameTextBox);
79-
addLabelOn(nameTextBox, "Name", 12);
82+
addLabelOn(nameTextBox, translate("name"), 12);
8083

8184
animTextBox = new UIAutoCompleteTextBox(nameTextBox.x + 100, nameTextBox.y, animData.anim, 156, 22, false, true);
8285
animTextBox.onChange = (newAnim:String) -> {this.changeAnim(newAnim);};
8386
members.push(animTextBox);
8487
foldableButtons.push(animTextBox);
85-
addLabelOn(animTextBox, "Animation", 12);
88+
addLabelOn(animTextBox, translate("anim"), 12);
8689

8790
positionXStepper = new UINumericStepper(animTextBox.x, animTextBox.y+32+18, animData.x, 0.001, 2, null, null, 64, 22, true);
8891
positionXStepper.onChange = (text:String) -> {
@@ -91,7 +94,7 @@ class CharacterAnimButton extends UIButton {
9194
};
9295
members.push(positionXStepper);
9396
foldableButtons.push(positionXStepper);
94-
addLabelOn(positionXStepper, "Position (X,Y)", 12);
97+
addLabelOn(positionXStepper, translate("position"), 12);
9598

9699
members.push(XYComma = new UIText(positionXStepper.x+104-32+0, positionXStepper.y + 9, 0, ",", 18));
97100
foldableButtons.push(XYComma);
@@ -111,7 +114,7 @@ class CharacterAnimButton extends UIButton {
111114
};
112115
members.push(fpsStepper);
113116
foldableButtons.push(fpsStepper);
114-
addLabelOn(fpsStepper, "FPS", 12);
117+
addLabelOn(fpsStepper, translate("fps"), 12);
115118

116119
loopedCheckbox = new UICheckbox(fpsStepper.x + 82 - 32 + 26, fpsStepper.y, "Looping?", animData.loop, 0, true);
117120
loopedCheckbox.onChecked = (newLooping:Bool) -> {this.changeLooping(newLooping);};
@@ -126,7 +129,7 @@ class CharacterAnimButton extends UIButton {
126129
}
127130
members.push(indicesTextBox);
128131
foldableButtons.push(indicesTextBox);
129-
addLabelOn(indicesTextBox, "Indices (frames)", 12);
132+
addLabelOn(indicesTextBox, translate("indices"), 12);
130133

131134
animIcon = new FlxSprite(x-(10+16), y+8).loadGraphic(Paths.image("editors/character/anim-icons"), true, 16, 12);
132135
animIcon.animation.add("play", [0]);

source/funkin/editors/character/CharacterAnimsWindow.hx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,14 @@ class CharacterAnimsWindow extends UIButtonList<CharacterAnimButton> {
112112
}
113113

114114
public function generateAnimation() {
115-
var animName:String = "New Anim";
115+
var newAnim = TU.translate("characterEditor.characterAnim.defaultAnimName");
116+
var animName:String = newAnim;
116117
var animNames:Array<String> = character.getNameList();
117118

118119
var newAnimCount:Int = 0;
119120
while (animNames.indexOf(animName) != -1) {
120121
newAnimCount++;
121-
animName = 'New Anim - $newAnimCount';
122+
animName = '$newAnim - $newAnimCount';
122123
}
123124

124125
if (__autoCompleteAnims.length <= 0)

source/funkin/editors/character/CharacterCreationScreen.hx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ class CharacterCreationScreen extends UISubstateWindow {
1515
public var saveButton:UIButton;
1616
public var closeButton:UIButton;
1717

18+
inline function translate(id:String, ?args:Array<Dynamic>)
19+
return TU.translate("characterCreationScreen." + id, args);
20+
1821
public function new(?onSave:(String, ImageSaveData, Xml)->Void) {
1922
super();
2023
if (onSave != null) this.onSave = onSave;
2124
}
2225

2326
public override function create() {
24-
winTitle = "Creating New Character";
27+
winTitle = translate("win-title");
2528

2629
winWidth = 360;
2730
winHeight = 520;
@@ -37,14 +40,14 @@ class CharacterCreationScreen extends UISubstateWindow {
3740
characterNameTextBox = new UITextBox(windowSpr.x + 20, windowSpr.y + 30 + 16 + 20, "character", 320);
3841
characterNameTextBox.onChange = (_) -> {checkRequired();};
3942
add(characterNameTextBox);
40-
addLabelOn(characterNameTextBox, "Character File Name").applyMarkup(
41-
"Character File Name $* Required$",
43+
addLabelOn(characterNameTextBox, "").applyMarkup(
44+
translate("charName"),
4245
[new FlxTextFormatMarkerPair(new FlxTextFormat(0xFFAD1212), "$")]);
4346

4447
imageExplorer = new UIImageExplorer(characterNameTextBox.x, characterNameTextBox.y + 30 + 16 + 20, null, 320, 58, (_, _) -> {onLoadImage();}, "images/characters");
4548
add(imageExplorer);
46-
addLabelOn(imageExplorer, "Character Image File").applyMarkup(
47-
"Character Image File $* Required$",
49+
addLabelOn(imageExplorer, "").applyMarkup(
50+
translate("charImgName"),
4851
[new FlxTextFormatMarkerPair(new FlxTextFormat(0xFFAD1212), "$")]);
4952
imageExplorer.maxSize.y -= 100;
5053

@@ -54,7 +57,7 @@ class CharacterCreationScreen extends UISubstateWindow {
5457
}, 125);
5558
add(saveButton);
5659

57-
closeButton = new UIButton(saveButton.x - 20 - saveButton.bWidth, saveButton.y, "Cancel", function() {
60+
closeButton = new UIButton(saveButton.x - 20 - saveButton.bWidth, saveButton.y, TU.translate("editor.cancel"), function() {
5861
close();
5962
}, 125);
6063
add(closeButton);

0 commit comments

Comments
 (0)