Skip to content

Commit f597665

Browse files
committed
RocketMod 5.
1 parent 2419f11 commit f597665

File tree

5 files changed

+37
-43
lines changed

5 files changed

+37
-43
lines changed

Main.cs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ protected override void OnUnload()
2828

2929
public override Dictionary<string, string> DefaultTranslations => new Dictionary<string, string>
3030
{
31-
{"gun_headshot","{0} [GUN - {3}] {2} {1}"},
32-
{"gun","{0} [GUN - {2}] {1}"},
31+
{"gun_headshot","{1} [GUN - {3}] {2} {0}"},
32+
{"gun","{1} [GUN - {2}] {0}"},
3333
{"food","[FOOD] {0}"},
3434
{"arena","[ARENA] {0}"},
3535
{"shred","[SHRED] {0}"},
36-
{"punch_headshot","{0} [PUNCH] {2} {1}"},
36+
{"punch_headshot","{1} [PUNCH] {2} {0}"},
3737
{"punch","{0} [PUNCH] {1}"},
3838
{"bones","[BONES] {0}"},
39-
{"melee_headshot","{0} [MELEE - {3}] {2} {1}"},
39+
{"melee_headshot","{1} [MELEE - {3}] {2} {0}"},
4040
{"melee","{0} [MELEE- {2}] {1}"},
4141
{"water","[WATER] {0}"},
4242
{"breath","[BREATH] {0}"},
@@ -48,7 +48,7 @@ protected override void OnUnload()
4848
{"burning","[BURNING] {0}"},
4949
{"headshot","+ [HEADSHOT]" },
5050
{"landmine","[LANDMINE] {0}"},
51-
{"roadkill","{0} [ROADKILL] {1}"},
51+
{"roadkill","{1} [ROADKILL] {0}"},
5252
{"bleeding","[BLEEDING] {0}"},
5353
{"freezing","[FREEZING] {0}"},
5454
{"sentry","[SENTRY] {0}"},
@@ -73,11 +73,11 @@ public void HandleEvent(IEventEmitter emitter, UnturnedPlayerDeathEvent @event)
7373
{
7474
var player = (UnturnedPlayer)@event.Player;
7575

76-
UnturnedPlayer killer = ((UnturnedPlayerEntity)@event.Killer).UnturnedPlayer;
76+
UnturnedPlayer killer = ((UnturnedPlayerEntity)@event.Killer).Player;
7777
var cause = @event.DeathCause;
7878
var limb = @event.Limb;
7979

80-
var deathmessageColor = Color.Green; //ConfigurationInstance.DeathMessagesColor;
80+
var deathmessageColor = Color.Red; //ConfigurationInstance.DeathMessagesColor;
8181

8282

8383
string headshot = Translations.Get("headshot");
@@ -106,35 +106,35 @@ public void HandleEvent(IEventEmitter emitter, UnturnedPlayerDeathEvent @event)
106106
else if (cause.ToString() == "MELEE" || cause.ToString() == "GUN")
107107
{
108108
if (limb == ELimb.SKULL)
109-
_userManager.BroadcastLocalized(Translations, cause.ToString().ToLower() + "_headshot", deathmessageColor, player.DisplayName, killer.DisplayName, headshot, killer.Player.equipment.asset.itemName);
109+
_userManager.BroadcastLocalized(Translations, cause.ToString().ToLower() + "_headshot", deathmessageColor, player.DisplayName, killer.DisplayName, headshot, killer.NativePlayer.equipment.asset.itemName);
110110
else
111-
_userManager.BroadcastLocalized(Translations, cause.ToString().ToLower(), deathmessageColor, player.DisplayName, killer.DisplayName, headshot, killer.Player.equipment.asset.itemName);
111+
_userManager.BroadcastLocalized(Translations, cause.ToString().ToLower(), deathmessageColor, player.DisplayName, killer.DisplayName, headshot, killer.NativePlayer.equipment.asset.itemName);
112112
}
113113
else if (cause.ToString() == "PUNCH")
114114
{
115115
_userManager.BroadcastLocalized(Translations,
116116
limb == ELimb.SKULL ? "punch_headshot" : "punch", deathmessageColor, player.DisplayName, killer.DisplayName, headshot);
117117
}
118+
119+
return;
118120
}
119-
else //No need to update the plugin later! (Just add the translation)
121+
122+
if (Translations.Get(cause.ToString().ToLower()) != null)
120123
{
121-
if (Translations.Get(cause.ToString().ToLower()) != null)
124+
if (Translations.Get(cause.ToString().ToLower()).Contains("{1}"))
122125
{
123-
if (Translations.Get(cause.ToString().ToLower()).Contains("{1}"))
124-
{
125-
_userManager.BroadcastLocalized(Translations, cause.ToString().ToLower(), deathmessageColor, player.DisplayName, killer.DisplayName, headshot);
126-
}
127-
else
128-
{
129-
_userManager.BroadcastLocalized(Translations, cause.ToString().ToLower(), deathmessageColor, player.DisplayName, headshot);
130-
}
126+
_userManager.BroadcastLocalized(Translations, cause.ToString().ToLower(), deathmessageColor, player.DisplayName, killer.DisplayName, headshot);
131127
}
132128
else
133129
{
134-
Logger.LogError("Please add translation for " + cause +
135-
" | Parameters for custom translation: {0} = Player , {1} = Killer");
130+
_userManager.BroadcastLocalized(Translations, cause.ToString().ToLower(), deathmessageColor, player.DisplayName, headshot);
136131
}
132+
133+
return;
137134
}
135+
136+
Logger.LogError("Please add translation for " + cause +
137+
" | Parameters for custom translation: {0} = Player , {1} = Killer");
138138
}
139139
}
140140
}

SimpleDeathMessages.csproj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,25 @@
4040
</PropertyGroup>
4141
<ItemGroup>
4242
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
43-
<HintPath>packages\Rocket.Unturned.5.0.0.126\lib\net35\Assembly-CSharp.dll</HintPath>
43+
<HintPath>packages\Rocket.Unturned.5.0.0.130\lib\net35\Assembly-CSharp.dll</HintPath>
4444
</Reference>
4545
<Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
46-
<HintPath>packages\Rocket.Unturned.5.0.0.126\lib\net35\Assembly-CSharp-firstpass.dll</HintPath>
46+
<HintPath>packages\Rocket.Unturned.5.0.0.130\lib\net35\Assembly-CSharp-firstpass.dll</HintPath>
4747
</Reference>
48-
<Reference Include="Rocket.API, Version=5.0.0.459, Culture=neutral, processorArchitecture=MSIL">
49-
<HintPath>packages\Rocket.API.5.0.0.459\lib\net35\Rocket.API.dll</HintPath>
48+
<Reference Include="Rocket.API, Version=5.0.0.467, Culture=neutral, processorArchitecture=MSIL">
49+
<HintPath>packages\Rocket.API.5.0.0.467\lib\net35\Rocket.API.dll</HintPath>
5050
</Reference>
51-
<Reference Include="Rocket.Compatibility, Version=5.0.0.459, Culture=neutral, processorArchitecture=MSIL">
52-
<HintPath>packages\Rocket.Compatibility.5.0.0.459\lib\net35\Rocket.Compatibility.dll</HintPath>
51+
<Reference Include="Rocket.Compatibility, Version=5.0.0.467, Culture=neutral, processorArchitecture=MSIL">
52+
<HintPath>packages\Rocket.Compatibility.5.0.0.467\lib\net35\Rocket.Compatibility.dll</HintPath>
5353
</Reference>
54-
<Reference Include="Rocket.Core, Version=5.0.0.459, Culture=neutral, processorArchitecture=MSIL">
55-
<HintPath>packages\Rocket.Core.5.0.0.459\lib\net35\Rocket.Core.dll</HintPath>
54+
<Reference Include="Rocket.Core, Version=5.0.0.467, Culture=neutral, processorArchitecture=MSIL">
55+
<HintPath>packages\Rocket.Core.5.0.0.467\lib\net35\Rocket.Core.dll</HintPath>
5656
</Reference>
5757
<Reference Include="Rocket.UnityEngine, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
5858
<HintPath>packages\Rocket.UnityEngine.5.0.0.29\lib\net35\Rocket.UnityEngine.dll</HintPath>
5959
</Reference>
6060
<Reference Include="Rocket.Unturned, Version=5.0.0.0, Culture=neutral, processorArchitecture=MSIL">
61-
<HintPath>packages\Rocket.Unturned.5.0.0.126\lib\net35\Rocket.Unturned.dll</HintPath>
61+
<HintPath>packages\Rocket.Unturned.5.0.0.130\lib\net35\Rocket.Unturned.dll</HintPath>
6262
</Reference>
6363
<Reference Include="System" />
6464
<Reference Include="System.Core" />

SimpleDeathMessagesConfiguration.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,10 @@
66

77
namespace coolpuppy24.simpledeathmessages
88
{
9-
public class SimpleDeathMessagesConfiguration : IRocketPluginConfiguration
9+
public class SimpleDeathMessagesConfiguration
1010
{
11-
public string DeathMessagesColor;
12-
public bool ShowSuicideMSG;
13-
14-
public void LoadDefaults()
15-
{
16-
DeathMessagesColor = "Red";
17-
ShowSuicideMSG = true;
18-
}
11+
//public string DeathMessagesColor = "Red";
12+
public bool ShowSuicideMSG = true;
1913
}
2014
}
2115

-11.5 KB
Binary file not shown.

packages.config

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Rocket.API" version="5.0.0.459" targetFramework="net35" />
4-
<package id="Rocket.Compatibility" version="5.0.0.459" targetFramework="net35" />
5-
<package id="Rocket.Core" version="5.0.0.459" targetFramework="net35" />
3+
<package id="Rocket.API" version="5.0.0.467" targetFramework="net35" />
4+
<package id="Rocket.Compatibility" version="5.0.0.467" targetFramework="net35" />
5+
<package id="Rocket.Core" version="5.0.0.467" targetFramework="net35" />
66
<package id="Rocket.UnityEngine" version="5.0.0.29" targetFramework="net35" />
7-
<package id="Rocket.Unturned" version="5.0.0.126" targetFramework="net35" />
7+
<package id="Rocket.Unturned" version="5.0.0.130" targetFramework="net35" />
88
</packages>

0 commit comments

Comments
 (0)