mirror of
https://github.com/HolographicHat/Yae.git
synced 2025-12-17 03:48:16 +08:00
allow copy cocogoat import url
This commit is contained in:
@@ -52,6 +52,7 @@ public static class Export {
|
|||||||
var responseText = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();
|
var responseText = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();
|
||||||
var responseJson = JsonSerializer.Deserialize(responseText, CocogoatResponseContext.Default.CocogoatResponse)!;
|
var responseJson = JsonSerializer.Deserialize(responseText, CocogoatResponseContext.Default.CocogoatResponse)!;
|
||||||
var cocogoatUrl = $"https://cocogoat.work/achievement?memo={responseJson.Key}";
|
var cocogoatUrl = $"https://cocogoat.work/achievement?memo={responseJson.Key}";
|
||||||
|
Utils.SetQuickEditMode(true);
|
||||||
Console.WriteLine(cocogoatUrl);
|
Console.WriteLine(cocogoatUrl);
|
||||||
if (Utils.ShellOpen(cocogoatUrl))
|
if (Utils.ShellOpen(cocogoatUrl))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.Json;
|
|
||||||
using Windows.Win32;
|
|
||||||
using Windows.Win32.System.Console;
|
|
||||||
using YaeAchievement.Parsers;
|
using YaeAchievement.Parsers;
|
||||||
using YaeAchievement.res;
|
using YaeAchievement.res;
|
||||||
using YaeAchievement.Utilities;
|
using YaeAchievement.Utilities;
|
||||||
@@ -68,11 +65,8 @@ internal static class Program {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[ModuleInitializer]
|
[ModuleInitializer]
|
||||||
internal static unsafe void SetupConsole() {
|
internal static void SetupConsole() {
|
||||||
var handle = Native.GetStdHandle(STD_HANDLE.STD_INPUT_HANDLE);
|
SetQuickEditMode(false);
|
||||||
CONSOLE_MODE mode = default;
|
|
||||||
Native.GetConsoleMode(handle, &mode);
|
|
||||||
Native.SetConsoleMode(handle, mode & ~CONSOLE_MODE.ENABLE_QUICK_EDIT_MODE);
|
|
||||||
Console.InputEncoding = Console.OutputEncoding = Encoding.UTF8;
|
Console.InputEncoding = Console.OutputEncoding = Encoding.UTF8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using System.Net.Sockets;
|
|||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using Windows.Win32;
|
using Windows.Win32;
|
||||||
using Windows.Win32.Foundation;
|
using Windows.Win32.Foundation;
|
||||||
|
using Windows.Win32.System.Console;
|
||||||
using Proto;
|
using Proto;
|
||||||
using YaeAchievement.res;
|
using YaeAchievement.res;
|
||||||
using YaeAchievement.Utilities;
|
using YaeAchievement.Utilities;
|
||||||
@@ -214,4 +215,12 @@ public static class Utils {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static unsafe void SetQuickEditMode(bool enable) {
|
||||||
|
var handle = Native.GetStdHandle(STD_HANDLE.STD_INPUT_HANDLE);
|
||||||
|
CONSOLE_MODE mode = default;
|
||||||
|
Native.GetConsoleMode(handle, &mode);
|
||||||
|
mode = enable ? mode | CONSOLE_MODE.ENABLE_QUICK_EDIT_MODE : mode &~CONSOLE_MODE.ENABLE_QUICK_EDIT_MODE;
|
||||||
|
Native.SetConsoleMode(handle, mode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user