Skip to content

Commit a92c2df

Browse files
committed
feat: init
1 parent f07af18 commit a92c2df

File tree

15 files changed

+85
-310
lines changed

15 files changed

+85
-310
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Create Release and Update Repository
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
uses: ReiwaTech/DalamudPluginRepo/.github/workflows/reusable_create_release.yml@master
14+
with:
15+
internal_name: HappyIME
16+
solution_name: HappyIME
17+
build_configuration: Release
18+
personal_plugin_repo: ReiwaTech/DalamudPluginRepo
19+
personal_plugin_repo_branch: master
20+
secrets: inherit

Data/goat.png

-19.2 KB
Binary file not shown.

SamplePlugin.sln renamed to HappyIME.sln

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.29709.97
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.5.33627.172
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamplePlugin", "SamplePlugin\SamplePlugin.csproj", "{13C812E9-0D42-4B95-8646-40EEBF30636F}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HappyIME", "HappyIME\HappyIME.csproj", "{13C812E9-0D42-4B95-8646-40EEBF30636F}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -13,12 +13,8 @@ Global
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
1414
{13C812E9-0D42-4B95-8646-40EEBF30636F}.Debug|x64.ActiveCfg = Debug|x64
1515
{13C812E9-0D42-4B95-8646-40EEBF30636F}.Debug|x64.Build.0 = Debug|x64
16-
{13C812E9-0D42-4B95-8646-40EEBF30636F}.Release|x64.ActiveCfg = Release|x64
17-
{13C812E9-0D42-4B95-8646-40EEBF30636F}.Release|x64.Build.0 = Release|x64
18-
{4FEC9558-EB25-419F-B86E-51B8CFDA32B7}.Debug|x64.ActiveCfg = Debug|x64
19-
{4FEC9558-EB25-419F-B86E-51B8CFDA32B7}.Debug|x64.Build.0 = Debug|x64
20-
{4FEC9558-EB25-419F-B86E-51B8CFDA32B7}.Release|x64.ActiveCfg = Release|x64
21-
{4FEC9558-EB25-419F-B86E-51B8CFDA32B7}.Release|x64.Build.0 = Release|x64
16+
{13C812E9-0D42-4B95-8646-40EEBF30636F}.Release|x64.ActiveCfg = Release|Any CPU
17+
{13C812E9-0D42-4B95-8646-40EEBF30636F}.Release|x64.Build.0 = Release|Any CPU
2218
EndGlobalSection
2319
GlobalSection(SolutionProperties) = preSolution
2420
HideSolutionNode = FALSE
File renamed without changes.
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,10 @@
66
<Authors></Authors>
77
<Company></Company>
88
<Version>0.0.0.1</Version>
9-
<Description>A sample plugin.</Description>
9+
<Description>Fix IME being set to full-width.</Description>
1010
<Copyright></Copyright>
11-
<PackageProjectUrl>https://github.com/goatcorp/SamplePlugin</PackageProjectUrl>
11+
<PackageProjectUrl>https://github.com/ReiwaTech/HappyIME</PackageProjectUrl>
1212
<PackageLicenseExpression>AGPL-3.0-or-later</PackageLicenseExpression>
1313
<IsPackable>false</IsPackable>
1414
</PropertyGroup>
15-
16-
<ItemGroup>
17-
<Content Include="..\Data\goat.png">
18-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
19-
<Visible>false</Visible>
20-
</Content>
21-
</ItemGroup>
2215
</Project>

HappyIME/HappyIME.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"Author": "ReiwaTech",
3+
"Name": "HappyIME",
4+
"Punchline": "Fixup IME problems",
5+
"Description": "Fix IME being set to full-width.",
6+
"InternalName": "HappyIME",
7+
"ApplicableVersion": "any",
8+
"Tags": ["ime", "fix"]
9+
}

HappyIME/Plugin.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using Dalamud.IoC;
2+
using Dalamud.Plugin;
3+
using Dalamud.Game;
4+
using Dalamud.Hooking;
5+
6+
namespace HappyIME
7+
{
8+
public sealed class Plugin : IDalamudPlugin
9+
{
10+
public string Name => "HappyIME";
11+
12+
private delegate int GetIMEModeDelegate(nint self);
13+
private readonly Hook<GetIMEModeDelegate>? getIMEModeHook;
14+
15+
public Plugin(
16+
[RequiredVersion("1.0")] ISigScanner sigScanner)
17+
{
18+
nint address = sigScanner.ScanText("E8 ?? ?? ?? ?? 8B D0 EB 0D F6 D3");
19+
getIMEModeHook = Hook<GetIMEModeDelegate>.FromAddress(address, this.DetourGetIMEMode);
20+
getIMEModeHook.Enable();
21+
}
22+
23+
private int DetourGetIMEMode(nint self)
24+
{
25+
var result = getIMEModeHook!.Original(self);
26+
return result == 3 ? 0 : result;
27+
}
28+
29+
public void Dispose()
30+
{
31+
getIMEModeHook?.Dispose();
32+
}
33+
}
34+
}

HappyIME/packages.lock.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": 1,
3+
"dependencies": {
4+
"net7.0-windows7.0": {
5+
"DalamudPackager": {
6+
"type": "Direct",
7+
"requested": "[2.1.11, )",
8+
"resolved": "2.1.11",
9+
"contentHash": "9qlAWoRRTiL/geAvuwR/g6Bcbrd/bJJgVnB/RurBiyKs6srsP0bvpoo8IK+Eg8EA6jWeM6/YJWs66w4FIAzqPw=="
10+
}
11+
}
12+
}
13+
}

README.md

Lines changed: 2 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,3 @@
1-
> ⚠️ **Don't click Fork!**
2-
>
3-
> This is a GitHub Template repo. If you want to use this for a plugin, just [use this template][new-repo] to make a new repo!
4-
>
5-
> ![image](https://github.com/goatcorp/SamplePlugin/assets/16760685/d9732094-e1ed-4769-a70b-58ed2b92580c)
1+
# HappyIME
62

7-
# SamplePlugin
8-
9-
[![Use This Template badge](https://img.shields.io/badge/Use%20This%20Template-0?logo=github&labelColor=grey)][new-repo]
10-
11-
12-
Simple example plugin for Dalamud.
13-
14-
This is not designed to be the simplest possible example, but it is also not designed to cover everything you might want to do. For more detailed questions, come ask in [the Discord](https://discord.gg/holdshift).
15-
16-
## Main Points
17-
18-
* Simple functional plugin
19-
* Slash command
20-
* Main UI
21-
* Settings UI
22-
* Image loading
23-
* Plugin json
24-
* Simple, slightly-improved plugin configuration handling
25-
* Project organization
26-
* Copies all necessary plugin files to the output directory
27-
* Does not copy dependencies that are provided by dalamud
28-
* Output directory can be zipped directly and have exactly what is required
29-
* Hides data files from visual studio to reduce clutter
30-
* Also allows having data files in different paths than VS would usually allow if done in the IDE directly
31-
32-
33-
The intention is less that any of this is used directly in other projects, and more to show how similar things can be done.
34-
35-
## How To Use
36-
37-
### Getting Started
38-
39-
To begin, [clone this template repository][new-repo] to your own GitHub account. This will automatically bring in everything you need to get a jumpstart on development. You do not need to fork this repository unless you intend to contribute modifications to it.
40-
41-
Be sure to also check out the [Dalamud Developer Docs][dalamud-docs] for helpful information about building your own plugin. The Developer Docs includes helpful information about all sorts of things, including [how to submit][submit] your newly-created plugin to the official repository. Assuming you use this template repository, the provided project build configuration and license are already chosen to make everything a breeze.
42-
43-
[new-repo]: https://github.com/new?template_name=SamplePlugin&template_owner=goatcorp
44-
[dalamud-docs]: https://dalamud.dev
45-
[submit]: https://dalamud.dev/plugin-development/plugin-submission
46-
47-
### Prerequisites
48-
49-
SamplePlugin assumes all the following prerequisites are met:
50-
51-
* XIVLauncher, FINAL FANTASY XIV, and Dalamud have all been installed and the game has been run with Dalamud at least once.
52-
* XIVLauncher is installed to its default directories and configurations.
53-
* If a custom path is required for Dalamud's dev directory, it must be set with the `DALAMUD_HOME` environment variable.
54-
* A .NET Core 7 SDK has been installed and configured, or is otherwise available. (In most cases, the IDE will take care of this.)
55-
56-
### Building
57-
58-
1. Open up `SamplePlugin.sln` in your C# editor of choice (likely [Visual Studio 2022](https://visualstudio.microsoft.com) or [JetBrains Rider](https://www.jetbrains.com/rider/)).
59-
2. Build the solution. By default, this will build a `Debug` build, but you can switch to `Release` in your IDE.
60-
3. The resulting plugin can be found at `SamplePlugin/bin/x64/Debug/SamplePlugin.dll` (or `Release` if appropriate.)
61-
62-
### Activating in-game
63-
64-
1. Launch the game and use `/xlsettings` in chat or `xlsettings` in the Dalamud Console to open up the Dalamud settings.
65-
* In here, go to `Experimental`, and add the full path to the `SamplePlugin.dll` to the list of Dev Plugin Locations.
66-
2. Next, use `/xlplugins` (chat) or `xlplugins` (console) to open up the Plugin Installer.
67-
* In here, go to `Dev Tools > Installed Dev Plugins`, and the `SamplePlugin` should be visible. Enable it.
68-
3. You should now be able to use `/pmycommand` (chat) or `pmycommand` (console)!
69-
70-
Note that you only need to add it to the Dev Plugin Locations once (Step 1); it is preserved afterwards. You can disable, enable, or load your plugin on startup through the Plugin Installer.
71-
72-
### Reconfiguring for your own uses
73-
74-
Basically, just replace all references to `SamplePlugin` in all of the files and filenames with your desired name, then start building the plugin of your dreams. You'll figure it out 😁
75-
76-
Dalamud will load the JSON file (by default, `SamplePlugin/SamplePlugin.json`) next to your DLL and use it for metadata, including the description for your plugin in the Plugin Installer. Make sure to update this with information relevant to _your_ plugin!
3+
Fix IME being set to full-width.

SamplePlugin/Configuration.cs

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)