Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Globalization;
- using Turbo.Plugins.Default;
- using System.Linq;
- using SharpDX.DirectInput;
- using System;
- using System.Text;
- using System.Collections.Generic;
- namespace Turbo.Plugins.DavUtil
- {
- public class DAV_MapPlugin : BasePlugin, IInGameTopPainter {
- public bool showEnglish { get; set; } = true;
- public bool showLocalized { get; set; } = true;
- public IFont WhiteFont { get; set; }
- public List<DAV_Map> MapList { get; set; } = new List<DAV_Map>();
- public DAV_MapPlugin() {
- Enabled = true;
- }
- public override void Load(IController hud) {
- base.Load(hud);
- WhiteFont = Hud.Render.CreateFont("tahoma", 8, 255, 255, 255, 51, true, false, false);
- MapList.Add(new DAV_Map("Halls of Agony", "苦痛刑牢", "a1dun_leor"));
- MapList.Add(new DAV_Map("Ancient Waterway", "遠古水道", "a2dun_aqd"));
- MapList.Add(new DAV_Map("Flooded Cave", "積水的洞穴", "a2dun_cave_flooded"));
- MapList.Add(new DAV_Map("Cave of the Betrayer", "背叛者的洞穴", "a2dun_cave"));
- MapList.Add(new DAV_Map("Tidal Cave", "湧潮洞穴", "px_cave_a"));
- MapList.Add(new DAV_Map("Cave", "洞穴", "trdun_cave")); // Act 1
- MapList.Add(new DAV_Map("Winding Cave", "曲折洞穴", "x1_bogcave"));
- MapList.Add(new DAV_Map("Caverns of Araneae", "艾瑞妮洞窟 (蜘蛛洞)", "a2dun_spider"));
- MapList.Add(new DAV_Map("Sewers of Caldeum", "卡爾蒂姆下水道", "a2dun_swr"));
- MapList.Add(new DAV_Map("Vault of the Assassin", "刺客地庫 (沒有光幕)", "a2dun_zolt_random"));
- MapList.Add(new DAV_Map("Archives of Zultun Kulle", "佐敦庫勒秘庫 (有光幕)", "a2dun_zolt"));
- MapList.Add(new DAV_Map("Hell Rift", "地獄之門 (小地核)", "a4dun_hellportal"));
- MapList.Add(new DAV_Map("Hell Rift", "地獄之門 (小地核)", "a3dun_crater_e_dead_end"));
- MapList.Add(new DAV_Map("Hell Rift", "地獄之門 (小地核)", "a3dun_crater_s_dead_end"));
- MapList.Add(new DAV_Map("Arreat Crater", "亞瑞特巨坑 (大地核)", "a3dun_crater"));
- MapList.Add(new DAV_Map("Caverns of Frost", "寒霜洞窟", "a3dun_icecaves"));
- MapList.Add(new DAV_Map("The Keep Depths", "要塞 (兵營)", "a3dun_keep"));
- MapList.Add(new DAV_Map("The Silver Spire", "銀光尖塔", "a4dun_spire_corrupt"));
- MapList.Add(new DAV_Map("Greyhollow Island", "灰荒島", "p4_forest_coast_border"));
- MapList.Add(new DAV_Map("Eternal Woods", "永恆之林", "p4_forest_snow_border"));
- MapList.Add(new DAV_Map("Temple of the Firstborn", "初民神殿", "p6_church"));
- MapList.Add(new DAV_Map("Shrouded Moors", "迷霧荒原", "p6_moor"));
- MapList.Add(new DAV_Map("Desert", "沙漠", "px_desert_120_border"));
- MapList.Add(new DAV_Map("The Festering Woods", "腐潰之林", "px_festeringwoods"));
- MapList.Add(new DAV_Map("Cathedral", "大教堂", "trdun_cath"));
- MapList.Add(new DAV_Map("Crypt", "墓穴", "trdun_crypt"));
- MapList.Add(new DAV_Map("Plague Tunnels", "瘟疫地道 (老鼠洞)", "x1_abattoir"));
- MapList.Add(new DAV_Map("Ruins of Corvus", "寇佛斯遺跡 (愛德莉亞)", "x1_catacombs"));
- MapList.Add(new DAV_Map("Pandemonium Fortress", "混沌界要塞", "x1_fortress"));
- MapList.Add(new DAV_Map("Battlefields of Eternity", "永恆戰場", "x1_pand_ext_120_edge"));
- MapList.Add(new DAV_Map("Realm of the Banished", "遺逐之境 (懸崖)", "x1_pand_hexmaze"));
- MapList.Add(new DAV_Map("Westmarch Heights", "衛斯馬屈山城區", "x1_westm", "fire"));
- MapList.Add(new DAV_Map("Westmarch Commons", "衛斯馬屈城中區", "x1_westm"));
- }
- public void PaintTopInGame(ClipState clipState) {
- if (clipState != ClipState.BeforeClip) return;
- if (Hud.Game.SpecialArea != SpecialArea.GreaterRift) return;
- if (Hud.Game.Me.Scene == null) return;
- var curScene = Hud.Game.Me.Scene.SnoScene.Code;
- var curMapName = "Unknown";
- foreach (var map in MapList)
- if (map.Match(curScene)) {
- curMapName = map.Name(showLocalized, showEnglish);
- break;
- }
- var uiMinimapRect = Hud.Render.MinimapUiElement.Rectangle;
- var layout = WhiteFont.GetTextLayout(curMapName);
- WhiteFont.DrawText(layout, uiMinimapRect.Left, uiMinimapRect.Top);
- }
- }
- public class DAV_Map {
- public string NameEnglish { get; set; }
- public string NameLocalized { get; set; }
- public string MapAffix { get; set; }
- public string MapAffix2 { get; set; }
- public DAV_Map(string name1, string name2, string start, string end = "") {
- NameEnglish = name1;
- NameLocalized = name2;
- MapAffix = start;
- MapAffix2 = end;
- }
- public string Name(bool nameLoc, bool nameEng) {
- var name = "";
- if (nameLoc)
- name += NameLocalized;
- if (nameEng) {
- if (nameLoc) name += "\n";
- name += NameEnglish;
- }
- return name;
- }
- public bool Match(string sceneName) {
- if (!sceneName.StartsWith(MapAffix)) return false;
- if (MapAffix2 == "" || sceneName.EndsWith(MapAffix2))
- return true;
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement