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, Make( 140, 0, "Arial chat font", OnWidgetClick,
g => g.Drawer2D.UseBitmappedChat ? "no" : "yes", 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, Make( 140, 50, "Chat font name", OnWidgetClick,
g => g.FontName, g => g.FontName,
(g, v) => { g.FontName = v; (g, v) => { g.FontName = v;
Options.Set( OptionsKey.FontName, v ); Options.Set( OptionsKey.FontName, v );
g.RefreshHud(); HandleFontChange();
Recreate();
} ), } ),
MakeBack( false, titleFont, MakeBack( false, titleFont,
@ -86,9 +89,7 @@ namespace ClassicalSharp {
okayIndex = widgets.Length - 1; okayIndex = widgets.Length - 1;
} }
void HandleArialChatFont( Game g, string v ) { void HandleFontChange() {
g.Drawer2D.UseBitmappedChat = v == "no";
Options.Set( OptionsKey.ArialChatFont, v == "yes" );
game.Events.RaiseChatFontChanged(); game.Events.RaiseChatFontChanged();
if( inputWidget != null ) { if( inputWidget != null ) {
@ -96,9 +97,8 @@ namespace ClassicalSharp {
} }
if( descWidget != null ) { if( descWidget != null ) {
descWidget.Dispose(); descWidget = null; descWidget.Dispose(); descWidget = null;
} }
game.RefreshHud();
g.RefreshHud();
Recreate(); Recreate();
} }
@ -107,7 +107,7 @@ namespace ClassicalSharp {
new BooleanValidator(), new BooleanValidator(),
new BooleanValidator(), new BooleanValidator(),
new RealValidator( 0.25f, 5f ), new RealValidator( 0.25f, 5f ),
new RealValidator( 0.25f, 5f ), new RealValidator( 0.25f, 5f ),
new BooleanValidator(), new BooleanValidator(),
new BooleanValidator(), new BooleanValidator(),

View File

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

View File

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