Skip to content

Commit

Permalink
Fix UI
Browse files Browse the repository at this point in the history
  • Loading branch information
RestoreMonarchy committed May 5, 2024
1 parent 5007588 commit bbb8a97
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Simple apartment and house plugin for roleplay servers.
* **battletom1233** for sponsoring the addition of the UI to the plugin

## Workshop (optional)
[Sell Door UI](https://steamcommunity.com/sharedfiles/filedetails/?id=3239860033) - `3239860033`
[Sell Door UI](https://steamcommunity.com/sharedfiles/filedetails/?id=3239968404) - `3239968404`

## Commands
* **/selldoor <price\>** – Puts the door on sale
Expand Down
2 changes: 1 addition & 1 deletion SellDoor/SellDoor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net48</TargetFramework>
<LangVersion>latest</LangVersion>
<RootNamespace>RestoreMonarchy.SellDoor</RootNamespace>
<Version>3.0.0</Version>
<Version>3.0.1</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
8 changes: 7 additions & 1 deletion SellDoor/Services/UIService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ private void OnPlayerUpdateGesture(UnturnedPlayer unturnedPlayer, UnturnedPlayer
{
Player player = unturnedPlayer.Player;

if (gesture != UnturnedPlayerEvents.PlayerGesture.PunchRight)
if (gesture != UnturnedPlayerEvents.PlayerGesture.PunchRight
&& gesture != UnturnedPlayerEvents.PlayerGesture.PunchLeft
&& gesture != UnturnedPlayerEvents.PlayerGesture.Point)
{
return;
}
Expand Down Expand Up @@ -96,6 +98,7 @@ private void OnPlayerUpdateGesture(UnturnedPlayer unturnedPlayer, UnturnedPlayer
EffectManager.sendUIEffectVisibility(EffectKey, player.TransportConnection(), true, "SellDoorUI", true);

player.enablePluginWidgetFlag(EPluginWidgetFlags.Modal);
player.disablePluginWidgetFlag(EPluginWidgetFlags.ShowCenterDot);
}

private void OnEffectButtonClicked(Player player, string buttonName)
Expand Down Expand Up @@ -140,6 +143,7 @@ private void HandleSellButtonClick(Player player)

EffectManager.askEffectClearByID(EffectId, player.TransportConnection());
player.disablePluginWidgetFlag(EPluginWidgetFlags.Modal);
player.enablePluginWidgetFlag(EPluginWidgetFlags.ShowCenterDot);
}

private void HandleBuyButtonClick(Player player)
Expand All @@ -150,13 +154,15 @@ private void HandleBuyButtonClick(Player player)
{
EffectManager.askEffectClearByID(EffectId, player.TransportConnection());
player.disablePluginWidgetFlag(EPluginWidgetFlags.Modal);
player.enablePluginWidgetFlag(EPluginWidgetFlags.ShowCenterDot);
}
}

private void HandleCloseButtonClick(Player player)
{
EffectManager.askEffectClearByID(EffectId, player.TransportConnection());
player.disablePluginWidgetFlag(EPluginWidgetFlags.Modal);
player.enablePluginWidgetFlag(EPluginWidgetFlags.ShowCenterDot);
}
}
}
Binary file modified mod/SellDoorUI/SellDoorUI.unity3d
Binary file not shown.
Binary file modified selldoorui.unitypackage
Binary file not shown.

0 comments on commit bbb8a97

Please sign in to comment.