mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-18 03:55:19 -04:00
Fixed player model being difficult to squeeze through 8 pixel gaps (Thanks Empy), fix first keyboard press not showing up in input bar (Thanks imjonnyboy)
This commit is contained in:
parent
8864c40a98
commit
b1bcfab887
@ -53,7 +53,7 @@ namespace ClassicalSharp.Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override Vector3 CollisionSize {
|
public override Vector3 CollisionSize {
|
||||||
get { return new Vector3( 8/16f - 0.005f, 28.5f/16f - 0.005f, 8/16f - 0.005f ); }
|
get { return new Vector3( 8/16f - 0.4f/16f, 28.5f/16f - 0.4f/16f, 8/16f - 0.4f/16f ); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override BoundingBox PickingBounds {
|
public override BoundingBox PickingBounds {
|
||||||
|
@ -25,6 +25,9 @@ namespace Launcher2 {
|
|||||||
/// <summary> Delegate invoked when the text changes. </summary>
|
/// <summary> Delegate invoked when the text changes. </summary>
|
||||||
public Action<LauncherInputWidget> TextChanged;
|
public Action<LauncherInputWidget> TextChanged;
|
||||||
|
|
||||||
|
/// <summary> Delegate that only lets certain characters be entered. </summary>
|
||||||
|
public Func<char, bool> TextFilter;
|
||||||
|
|
||||||
public LauncherInputWidget( LauncherWindow window ) : base( window ) {
|
public LauncherInputWidget( LauncherWindow window ) : base( window ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,6 +59,8 @@ namespace Launcher2 {
|
|||||||
/// <summary> Appends a character to the end of the currently entered text. </summary>
|
/// <summary> Appends a character to the end of the currently entered text. </summary>
|
||||||
/// <returns> true if a redraw is necessary, false otherwise. </returns>
|
/// <returns> true if a redraw is necessary, false otherwise. </returns>
|
||||||
public bool AppendChar( char c ) {
|
public bool AppendChar( char c ) {
|
||||||
|
if( TextFilter != null && !TextFilter( c ) )
|
||||||
|
return false;
|
||||||
if( c >= ' ' && c <= '~' && Text.Length < MaxTextLength ) {
|
if( c >= ' ' && c <= '~' && Text.Length < MaxTextLength ) {
|
||||||
Text += c;
|
Text += c;
|
||||||
if( TextChanged != null ) TextChanged( this );
|
if( TextChanged != null ) TextChanged( this );
|
||||||
|
@ -6,14 +6,14 @@ namespace Launcher2 {
|
|||||||
|
|
||||||
public static class LauncherSkin {
|
public static class LauncherSkin {
|
||||||
|
|
||||||
public static FastColour BackgroundCol = new FastColour( 151, 122, 172 );
|
public static FastColour BackgroundCol = new FastColour( 153, 127, 172 );
|
||||||
public static FastColour ButtonBorderCol = new FastColour( 97, 81, 110 );
|
public static FastColour ButtonBorderCol = new FastColour( 97, 81, 110 );
|
||||||
public static FastColour ButtonForeActiveCol = new FastColour( 189, 168, 206 );
|
public static FastColour ButtonForeActiveCol = new FastColour( 189, 168, 206 );
|
||||||
public static FastColour ButtonForeCol = new FastColour( 164, 138, 186 );
|
public static FastColour ButtonForeCol = new FastColour( 164, 138, 186 );
|
||||||
public static FastColour ButtonHighlightCol = new FastColour( 182, 158, 201 );
|
public static FastColour ButtonHighlightCol = new FastColour( 182, 158, 201 );
|
||||||
|
|
||||||
public static void ResetToDefault() {
|
public static void ResetToDefault() {
|
||||||
BackgroundCol = new FastColour( 151, 122, 172 );
|
BackgroundCol = new FastColour( 153, 127, 172 );
|
||||||
ButtonBorderCol = new FastColour( 97, 81, 110 );
|
ButtonBorderCol = new FastColour( 97, 81, 110 );
|
||||||
ButtonForeActiveCol = new FastColour( 189, 168, 206 );
|
ButtonForeActiveCol = new FastColour( 189, 168, 206 );
|
||||||
ButtonForeCol = new FastColour( 164, 138, 186 );
|
ButtonForeCol = new FastColour( 164, 138, 186 );
|
||||||
|
@ -254,7 +254,7 @@ namespace OpenTK.Platform.MacOS
|
|||||||
MacOSKeyCode code = (MacOSKeyCode)0;
|
MacOSKeyCode code = (MacOSKeyCode)0;
|
||||||
char charCode = '\0';
|
char charCode = '\0';
|
||||||
|
|
||||||
//Debug.Print("Processing keyboard event {0}", evt.KeyboardEventKind);
|
//Debug.Print("Processing Keyboard event {0}", (KeyboardEventKind)evt.EventKind);
|
||||||
|
|
||||||
switch ((KeyboardEventKind)evt.EventKind)
|
switch ((KeyboardEventKind)evt.EventKind)
|
||||||
{
|
{
|
||||||
@ -277,9 +277,9 @@ namespace OpenTK.Platform.MacOS
|
|||||||
keyboard.KeyRepeat = true;
|
keyboard.KeyRepeat = true;
|
||||||
goto case KeyboardEventKind.RawKeyDown;
|
goto case KeyboardEventKind.RawKeyDown;
|
||||||
|
|
||||||
case KeyboardEventKind.RawKeyDown:
|
case KeyboardEventKind.RawKeyDown:
|
||||||
OnKeyPress(mKeyPressArgs);
|
|
||||||
keyboard[Keymap[code]] = true;
|
keyboard[Keymap[code]] = true;
|
||||||
|
OnKeyPress(mKeyPressArgs);
|
||||||
return OSStatus.NoError;
|
return OSStatus.NoError;
|
||||||
|
|
||||||
case KeyboardEventKind.RawKeyUp:
|
case KeyboardEventKind.RawKeyUp:
|
||||||
@ -564,19 +564,14 @@ namespace OpenTK.Platform.MacOS
|
|||||||
public Point PointToClient(Point point)
|
public Point PointToClient(Point point)
|
||||||
{
|
{
|
||||||
IntPtr handle = window.WindowRef;
|
IntPtr handle = window.WindowRef;
|
||||||
|
|
||||||
Rect r = Carbon.API.GetWindowBounds(window.WindowRef, WindowRegionCode.ContentRegion);
|
Rect r = Carbon.API.GetWindowBounds(window.WindowRef, WindowRegionCode.ContentRegion);
|
||||||
Debug.Print("Rect: {0}", r);
|
|
||||||
|
|
||||||
return new Point(point.X - r.X, point.Y - r.Y);
|
return new Point(point.X - r.X, point.Y - r.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Point PointToScreen(Point point)
|
public Point PointToScreen(Point point)
|
||||||
{
|
{
|
||||||
IntPtr handle = window.WindowRef;
|
IntPtr handle = window.WindowRef;
|
||||||
|
|
||||||
Rect r = Carbon.API.GetWindowBounds(window.WindowRef, WindowRegionCode.ContentRegion);
|
Rect r = Carbon.API.GetWindowBounds(window.WindowRef, WindowRegionCode.ContentRegion);
|
||||||
Debug.Print("Rect: {0}", r);
|
|
||||||
|
|
||||||
return new Point(point.X + r.X, point.Y + r.Y);
|
return new Point(point.X + r.X, point.Y + r.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user