mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-19 04:26:52 -04:00
Announcement texture should be in top quarter, fix non-32 bpp terrain.png files crashing client when saved to texturecache (Thanks goodlyay), fix hotkeys not being removed when closing client then the launcher (Thanks 123DontMessWitMe).
This commit is contained in:
parent
20205a42fb
commit
4811f15bf3
@ -68,7 +68,7 @@ namespace ClassicalSharp {
|
|||||||
clientStatus.Init();
|
clientStatus.Init();
|
||||||
announcement = ChatTextWidget.Create( game, 0, 0, null,
|
announcement = ChatTextWidget.Create( game, 0, 0, null,
|
||||||
Anchor.Centre, Anchor.Centre, announcementFont );
|
Anchor.Centre, Anchor.Centre, announcementFont );
|
||||||
announcement.YOffset = game.Height / 4;
|
announcement.YOffset = -game.Height / 4;
|
||||||
clock = ChatTextWidget.Create( game, 0, 0, null,
|
clock = ChatTextWidget.Create( game, 0, 0, null,
|
||||||
Anchor.BottomOrRight, Anchor.LeftOrTop, chatItalicFont );
|
Anchor.BottomOrRight, Anchor.LeftOrTop, chatItalicFont );
|
||||||
}
|
}
|
||||||
@ -247,7 +247,7 @@ namespace ClassicalSharp {
|
|||||||
|
|
||||||
public override void OnResize( int oldWidth, int oldHeight, int width, int height ) {
|
public override void OnResize( int oldWidth, int oldHeight, int width, int height ) {
|
||||||
announcement.OnResize( oldWidth, oldHeight, width, height );
|
announcement.OnResize( oldWidth, oldHeight, width, height );
|
||||||
announcement.YOffset = height / 4;
|
announcement.YOffset = -height / 4;
|
||||||
announcement.MoveTo( announcement.X, announcement.YOffset - announcement.Height / 2 );
|
announcement.MoveTo( announcement.X, announcement.YOffset - announcement.Height / 2 );
|
||||||
blockSize = (int)(23 * 2 * game.GuiHotbarScale);
|
blockSize = (int)(23 * 2 * game.GuiHotbarScale);
|
||||||
textInput.YOffset = blockSize + 5;
|
textInput.YOffset = blockSize + 5;
|
||||||
|
@ -65,8 +65,13 @@ namespace ClassicalSharp {
|
|||||||
DownloadedItem item;
|
DownloadedItem item;
|
||||||
if( game.AsyncDownloader.TryGetItem( "terrain", out item ) ) {
|
if( game.AsyncDownloader.TryGetItem( "terrain", out item ) ) {
|
||||||
if( item.Data != null ) {
|
if( item.Data != null ) {
|
||||||
game.ChangeTerrainAtlas( (Bitmap)item.Data );
|
Bitmap bmp = (Bitmap)item.Data;
|
||||||
TextureCache.AddToCache( item.Url, (Bitmap)item.Data );
|
if( !FastBitmap.CheckFormat( bmp.PixelFormat ) ) {
|
||||||
|
Utils.LogDebug( "Converting terrain atlas to 32bpp image" );
|
||||||
|
game.Drawer2D.ConvertTo32Bpp( ref bmp );
|
||||||
|
}
|
||||||
|
game.ChangeTerrainAtlas( bmp );
|
||||||
|
TextureCache.AddToCache( item.Url, bmp );
|
||||||
} else if( Is304Status( item.WebEx ) ) {
|
} else if( Is304Status( item.WebEx ) ) {
|
||||||
Bitmap bmp = TextureCache.GetBitmapFromCache( item.Url );
|
Bitmap bmp = TextureCache.GetBitmapFromCache( item.Url );
|
||||||
if( bmp == null ) // Should never happen, but handle anyways.
|
if( bmp == null ) // Should never happen, but handle anyways.
|
||||||
|
@ -159,6 +159,15 @@ namespace ClassicalSharp {
|
|||||||
|
|
||||||
static void LoadFrom( StreamReader reader ) {
|
static void LoadFrom( StreamReader reader ) {
|
||||||
string line;
|
string line;
|
||||||
|
// remove all the unchanged options
|
||||||
|
List<string> toRemoveKeys = new List<string>();
|
||||||
|
foreach( KeyValuePair<string, string> kvp in OptionsSet ) {
|
||||||
|
if( !OptionsChanged.ContainsKey( kvp.Key ) )
|
||||||
|
toRemoveKeys.Add( kvp.Key );
|
||||||
|
}
|
||||||
|
foreach( string key in toRemoveKeys )
|
||||||
|
OptionsSet.Remove( key );
|
||||||
|
|
||||||
while( (line = reader.ReadLine()) != null ) {
|
while( (line = reader.ReadLine()) != null ) {
|
||||||
if( line.Length == 0 && line[0] == '#' ) continue;
|
if( line.Length == 0 && line[0] == '#' ) continue;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user