Open-Terraria-API icon indicating copy to clipboard operation
Open-Terraria-API copied to clipboard

OTAPIv3 Client; Windows launcher: Cannot paste text.

Open 0x3fcf1bbd opened this issue 3 years ago • 3 comments

Describe the bug ~~It is possible to copy or cut text from the game, but not to paste text.~~ Attempting to copy or paste text does not do anything, cutting simply deletes the text.

To Reproduce Steps to reproduce the behavior:

  • Download the windows launcher from https://github.com/DeathCradle/Open-Terraria-API/releases/tag/launcher-windows.
  • Extract it, and run OTAPI.Client.Launcher.exe.
  • Press the "Build OTAPI" button, and wait until the operation finishes.
  • Press the "Launch modded Terraria (otapi)" button.
  • Once the game has loaded, join a singleplayer/multiplayer world.
  • Once in the world, copy text from the chat/a sign using Ctrl+C.
  • Attempt to paste it in the chat/a sign using Ctrl+V ->Nothing happens.

Expected behavior It is possible to paste text in game, just as it is possible in vanilla.

Platform and patch info (please complete the following information):

  • OS: Windows 8.1
  • Assembly and version you are patching: Terraria.exe 1.4.3.2
  • Version of OTAPI/git commit: 8f0437f
  • .NET runtime: .NET 6

0x3fcf1bbd avatar Dec 04 '21 19:12 0x3fcf1bbd

I have not tested but i can basically confirm this is a bug since System.Windows.Forms has been shimmed to nothing; i need to redirect those Get/Set clipboard calls to a library that works cross platform. on the list 👍

SignatureBeef avatar Dec 05 '21 23:12 SignatureBeef

Edited it, because actually no, copying and cutting doesn't work either.

As for a possible library, looked it up a bit, and found https://github.com/jtanx/libclipboard. Would this suit your need? Would have to do a C# wrapper though so uh lol

0x3fcf1bbd avatar Dec 06 '21 19:12 0x3fcf1bbd

Edited it, because actually no, copying and cutting doesn't work either.

As for a possible library, looked it up a bit, and found https://github.com/jtanx/libclipboard. Would this suit your need? Would have to do a C# wrapper though so uh lol

yeh i suppose that would work, but a less effort package i stumbled across might be: https://github.com/CopyText/TextCopy

SignatureBeef avatar Dec 06 '21 21:12 SignatureBeef