mods dialogues fonts fix

This commit is contained in:
⍚~Nex
2024-10-08 15:51:40 +02:00
parent 620650bb81
commit a8860604e8
2 changed files with 14 additions and 3 deletions
+13 -2
View File
@@ -116,17 +116,28 @@ class Paths
return scriptPath;
}
static public function chart(song:String, ?difficulty:String = "normal"):String {
static public function chart(song:String, ?difficulty:String = "normal"):String
{
difficulty = difficulty.toLowerCase();
song = song.toLowerCase();
return getPath('songs/$song/charts/$difficulty.json', null);
}
static public function character(character:String):String {
inline static public function character(character:String):String
{
return getPath('data/characters/$character.xml', null);
}
/**
* Gets the name of a registered font.
* @param font The font's path (if it's already passed as a font name, the same name will be returned)
*/
inline static public function getFontName(font:String)
{
return OpenFlAssets.exists(font, FONT) ? OpenFlAssets.getFont(font).fontName : font;
}
inline static public function font(key:String)
{
return getPath('fonts/$key');
+1 -1
View File
@@ -582,7 +582,7 @@ class CoolUtil
var fmt = new FlxTextFormat();
fmt.format.color = Reflect.hasField(fmtt, "color") ? FlxColor.fromString(fmtt.color) : text.color;
fmt.format.font = Reflect.hasField(fmtt, "font") ? Paths.font(fmtt.font) : text.font;
fmt.format.font = Reflect.hasField(fmtt, "font") ? Paths.getFontName(Paths.font(fmtt.font)) : text.font;
fmt.format.size = Reflect.hasField(fmtt, "size") ? Std.parseInt(fmtt.size) : text.size;
fmt.format.italic = Reflect.hasField(fmtt, "italic") ? fmtt.italic == "true" : text.italic;
fmt.format.bold = Reflect.hasField(fmtt, "bold") ? fmtt.bold == "true" : text.bold;