Quick fix for FPS screen not having its font changed.

This commit is contained in:
UnknownShadow200 2016-02-01 18:22:17 +11:00
parent 70243e6838
commit d7972f43f3
3 changed files with 13 additions and 11 deletions

View File

@ -67,14 +67,17 @@ namespace ClassicalSharp {
Make( 140, 0, "Arial chat font", OnWidgetClick,
g => g.Drawer2D.UseBitmappedChat ? "no" : "yes",
HandleArialChatFont ),
(g, v) => { g.ChatLines = Int32.Parse( v );
g.Drawer2D.UseBitmappedChat = v == "no";
Options.Set( OptionsKey.ArialChatFont, v == "yes" );
HandleFontChange();
} ),
Make( 140, 50, "Chat font name", OnWidgetClick,
g => g.FontName,
(g, v) => { g.FontName = v;
Options.Set( OptionsKey.FontName, v );
g.RefreshHud();
Recreate();
HandleFontChange();
} ),
MakeBack( false, titleFont,
@ -86,9 +89,7 @@ namespace ClassicalSharp {
okayIndex = widgets.Length - 1;
}
void HandleArialChatFont( Game g, string v ) {
g.Drawer2D.UseBitmappedChat = v == "no";
Options.Set( OptionsKey.ArialChatFont, v == "yes" );
void HandleFontChange() {
game.Events.RaiseChatFontChanged();
if( inputWidget != null ) {
@ -97,8 +98,7 @@ namespace ClassicalSharp {
if( descWidget != null ) {
descWidget.Dispose(); descWidget = null;
}
g.RefreshHud();
game.RefreshHud();
Recreate();
}

View File

@ -230,6 +230,7 @@ namespace ClassicalSharp {
string text = inputWidget.GetText();
if( inputWidget.Validator.IsValidValue( text ) )
targetWidget.SetValue( game, text );
if( inputWidget != null )
inputWidget.Dispose();
inputWidget = null;
UpdateDescription( targetWidget );

View File

@ -85,6 +85,7 @@ namespace Launcher2 {
} catch( Exception ) {
FontName = "Arial";
Options.Set( "gui-fontname", "Arial" );
FontFamily.Families;
}
}