Skip to content

Commit

Permalink
Renamed to TeleportHotkey from QuickTeleport
Browse files Browse the repository at this point in the history
Fixed GD Point Dumper
Added more aliases
Added more known GD Points
  • Loading branch information
mdn522 committed Dec 5, 2021
1 parent 33dd601 commit be137a7
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 40 deletions.
34 changes: 31 additions & 3 deletions GDPointTags.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,40 @@ Dumped

## Known GD Point Tags

| GD Point Tag | Alias | Note |
*Alias is subject to change if a more proper GD Point Tag is found

| GD Point Tag | Alias | Location/Note |
| ------------- | ----- | ----- |
| camp_idle_1 | RefugeeCamp | Somewhere Outside Refugee Camp |
| cellar_d | Cellar | **Cellar** |
| cellar_storage_d | | **Cellar** Crate Storage |
| church_inside_1 | Church | **Church**: Inside |
| dungeon | | **Bee Farm** |
| enter_to_church | ChurchGateOutside | **Graveyard** Church Gate |
| graveyard_to_church | | **Graveyard**: Center |
| gd_player_stand | SacrificeZone | **Sacrifice Zone**: South of the Dungeon |
| gd_player_respawn | Home | **Home**: Inside |
| gd_player_respawn_1 | QuarryHut | **Quarry**: Inside Hut |
| gd_player_respawn_1 | QuarryHut | **Quarry Hut**: |
| gd_enbl_mining_hut_workyard | Quarry | **Quarry**: Between Building Area and Marble Deposit |
| camp_idle_1 | RefugeeCamp | Somewhere Outside Refugee Camp |
| mf_wood_d | | **Workyard**: Left Entrance |
| mf_wood_d_2 | Workyard | **Workyard**: Left Entrance (Little Bit Right) |
| player_tavern_cellar_d | TavernCellar | **Tavern Cellar** |
| stone_workyard_d | QuarrySouth | **Quarry**: South of Hut |
| storage_d | | **Merchant Storage**: |
| storage_merchant_point | | **Merchant Storage**: Middle of Crates |
| swamp_fishing_spot_point | SwampFishingSpot | **Swamp**: Fishing Spot |
| vineyard_d | Vinyard | **Vinyard** |

### Proper GD Points Still Unknown for Following Locations:
* Dead Horse
* Lighthouse
* Mountain Fort
* Morgue
* Alchemy Lab
* Talking Skull
* etc.

You have to search through all GD points below to find them if it exists. it's a very time consuming task. if you find it. let us know ;)

---

Expand Down
4 changes: 0 additions & 4 deletions QuickTeleport/files/Alias.txt

This file was deleted.

4 changes: 0 additions & 4 deletions QuickTeleport/files/config.txt

This file was deleted.

11 changes: 0 additions & 11 deletions QuickTeleport/files/mod.json

This file was deleted.

2 changes: 1 addition & 1 deletion QuickTeleport.sln → TeleportHotkey.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29613.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickTeleport", "QuickTeleport\QuickTeleport.csproj", "{700C6F12-C0FF-4B98-AA54-C52BCC102563}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeleportHotkey", "TeleportHotkey\TeleportHotkey.csproj", "{700C6F12-C0FF-4B98-AA54-C52BCC102563}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
6 changes: 3 additions & 3 deletions QuickTeleport/Helper.cs → TeleportHotkey/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
using System.Collections.Generic;
using System.IO;

namespace QuickTeleport {
namespace TeleportHotkey {
public static class Helper {
public static string logPath = ".\\QMods\\QuickTeleport\\log.txt";
public static string errorPath = ".\\QMods\\QuickTeleport\\error.txt";
public static string logPath = ".\\QMods\\TeleportHotkey\\log.txt";
public static string errorPath = ".\\QMods\\TeleportHotkey\\error.txt";

public static void Log(string v, bool error = false) {
using (StreamWriter streamWriter = File.AppendText(error ? Helper.errorPath : Helper.logPath))
Expand Down
16 changes: 10 additions & 6 deletions QuickTeleport/MainPatcher.cs → TeleportHotkey/MainPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
using UnityEngine;
using System.Collections.Generic;

namespace QuickTeleport {
namespace TeleportHotkey {
public class MainPatcher {
public static void Patch() {
HarmonyInstance harmony = HarmonyInstance.Create("com.mdn522.quickteleport.mod");
HarmonyInstance harmony = HarmonyInstance.Create("com.mdn522.teleporthotkey.mod");
harmony.PatchAll(Assembly.GetExecutingAssembly());
}
}
Expand Down Expand Up @@ -100,7 +100,7 @@ public Options(Options opts) {
}

public static void Log(string line) {
File.AppendAllText(@"./QMods/QuickTeleport/log.txt", line);
File.AppendAllText(@"./QMods/TeleportHotkey/log.txt", line);
}

private static bool parseBool(string raw) {
Expand Down Expand Up @@ -141,8 +141,8 @@ public static Options GetOptions(bool forceReload) {
return options_;
}

string cfgPath = @"./QMods/QuickTeleport/config.txt";
string aliasPath = @"./QMods/QuickTeleport/Alias.txt";
string cfgPath = @"./QMods/TeleportHotkey/config.txt";
string aliasPath = @"./QMods/TeleportHotkey/Alias.txt";

options_.ArbitraryGDPointKeys.Clear();
options_.GDPointAliases.Clear();
Expand All @@ -166,7 +166,11 @@ public static Options GetOptions(bool forceReload) {
break;
case "DumpGDPointsKey":
try {
options_.DumpGDPointsKey.ChangeKey(Enum<KeyCode>.Parse(rawVal));
if (options_.DumpGDPointsKey == null) {
options_.DumpGDPointsKey = new SinglePressKey(Enum<KeyCode>.Parse(rawVal));
} else {
options_.DumpGDPointsKey.ChangeKey(Enum<KeyCode>.Parse(rawVal));
}
}
catch { }
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
using System.Linq;
using Harmony;
using UnityEngine;
using static QuickTeleport.Config;
using static TeleportHotkey.Config;

namespace QuickTeleport {
namespace TeleportHotkey {
[HarmonyPatch(typeof(EnvironmentEngine))]
[HarmonyPatch("Update")]
class EnvironmentEngine_Update_Patch {
Expand All @@ -18,19 +18,20 @@ static bool Prefix(EnvironmentEngine __instance) {
Config.Options opts = Config.GetOptions();
if (opts.ConfigReloadKey.IsPressed()) {
Config.GetOptions(true);
EffectBubblesManager.ShowImmediately(MainGame.me.player.pos3, "QuickTeleport configuration reloaded");
EffectBubblesManager.ShowImmediately(MainGame.me.player.pos3, "TeleportHotkey configuration reloaded");
} else if (opts.DumpGDPointsKey != null && opts.DumpGDPointsKey.IsPressed()) {
Helper.Log("Dumping GD Points", false);
Helper.Log("-------------------------------------", false);
foreach (GDPoint gd_point in WorldMap.gd_points) {
Helper.Log(string.Format("TAG: \"{0}\"; IS DISABLED: {1}", gd_point.gd_tag, gd_point.IsDisabled().ToString()), false);
Helper.Log(string.Format("TAG: \"{0}\"; NAME: \"{1}\" IS DISABLED: {2}", gd_point.gd_tag, gd_point.name, gd_point.IsDisabled().ToString()), false);
}

EffectBubblesManager.ShowImmediately(MainGame.me.player.pos3, "Dumped GD Points to Log.txt");
} else {
foreach (KeyValuePair<string, SinglePressKey> kvp in opts.ArbitraryGDPointKeys.ToArray()) {
string gd_point = kvp.Key;

// Alias Resolving
if (opts.GDPointAliases.ContainsKey(gd_point)) {
gd_point = opts.GDPointAliases[gd_point];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("QuickTeleport")]
[assembly: AssemblyTitle("TeleportHotkey")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("QuickTeleport")]
[assembly: AssemblyProduct("TeleportHotkey")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ProjectGuid>{700C6F12-C0FF-4B98-AA54-C52BCC102563}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>QuickTeleport</RootNamespace>
<AssemblyName>QuickTeleport</AssemblyName>
<RootNamespace>TeleportHotkey</RootNamespace>
<AssemblyName>TeleportHotkey</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
Expand Down
14 changes: 14 additions & 0 deletions TeleportHotkey/files/Alias.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# For More GD Points Refer to https://github.com/mdn522/GYK-QuickTeleport/blob/main/GDPointTags.md
Cellar=cellar_d
Church=church_inside_1
ChurchGateOutside=enter_to_church
Home=gd_player_respawn
RefugeeCamp=camp_idle_1
Quarry=gd_enbl_mining_hut_workyard
QuarryHut=gd_player_respawn_1
QuarrySouth=stone_workyard_d
SacrificeZone=gd_player_stand
SwampFishingSpot=swamp_fishing_spot_point
TavernCellar=player_tavern_cellar_d
Vinyard=vineyard_d
Workyard=mf_wood_d_2
8 changes: 8 additions & 0 deletions TeleportHotkey/files/config.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ConfigReloadKey=F5
# DumpGDPointsKey=F6

Home=Keypad0
Workyard=Keypad1
QuarrySouth=Keypad4
RefugeeCamp=Keypad8

11 changes: 11 additions & 0 deletions TeleportHotkey/files/mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"Id": "TeleportHotkey",
"DisplayName": "TeleportHotkey",
"Author": "Abdullah Mallik",
"Version": "0.1.1",
"Requires": [ ],
"Enable": true,
"AssemblyName": "TeleportHotkey.dll",
"EntryMethod": "TeleportHotkey.MainPatcher.Patch",
"Config": {}
}

0 comments on commit be137a7

Please sign in to comment.