mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-01-18 18:46:43 +00:00
Return nil if clipboard does not contain any text
This commit is contained in:
parent
ac9081cf89
commit
001ce2f626
1 changed files with 5 additions and 2 deletions
|
@ -110,7 +110,7 @@ public class Machine : IComponent
|
||||||
if (!L.IsNoneOrNil(1))
|
if (!L.IsNoneOrNil(1))
|
||||||
{
|
{
|
||||||
var newTitle = L.CheckString(1);
|
var newTitle = L.CheckString(1);
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(newTitle))
|
if (string.IsNullOrEmpty(newTitle))
|
||||||
{
|
{
|
||||||
newTitle = "Capy64 " + Capy64.Version;
|
newTitle = "Capy64 " + Capy64.Version;
|
||||||
|
@ -130,7 +130,10 @@ public class Machine : IComponent
|
||||||
{
|
{
|
||||||
var L = Lua.FromIntPtr(state);
|
var L = Lua.FromIntPtr(state);
|
||||||
|
|
||||||
L.PushString(SDL.GetClipboardText());
|
if (SDL.HasClipboardText())
|
||||||
|
L.PushString(SDL.GetClipboardText());
|
||||||
|
else
|
||||||
|
L.PushNil();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue