Skip to content
This repository has been archived by the owner on Oct 29, 2022. It is now read-only.

Commit

Permalink
sold plot popup changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonw4331 committed Oct 5, 2020
1 parent 7a7d67b commit 7dfa09c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion resources/deu.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

; Popup when entering a plot
popup=Du hast das Grundstück {%0} betreten.
popup.buy=Du kannst dieses Grundtück für ${%0} kaufen
popup.owner=Dieses Grundstück gehört {%0}
popup.forsale=Du kannst dieses Grundtück für ${%0} kaufen
popup.available=Dieses Grundstück ist verfügbar! Benutze /p claim, um es zu beanspruchen.
popup.denied=Du darfst dieses Grundstück nicht betreten!

Expand Down
2 changes: 1 addition & 1 deletion resources/eng.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

; Popup when entering a plot
popup=You entered plot {%0}.
popup.buy=You can buy this Plot for ${%0}
popup.owner=Owned by {%0}
popup.forsale=This plot is for sale by {%0}. Use /p buy to claim the plot for ${%0}.
popup.available=This plot is open. Use /p claim to claim the plot for ${%0}.
popup.denied=You are denied access to this plot

Expand Down
8 changes: 5 additions & 3 deletions src/MyPlot/EventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,13 @@ private function onEventOnMove(Player $player, $event) : void {
if(!$this->plugin->getConfig()->get("ShowPlotPopup", true))
return;
$popup = $this->plugin->getLanguage()->translateString("popup", [TextFormat::GREEN . $plot . TextFormat::RESET]);
if($plot->isForSale())
$popup .= " " . $this->plugin->getLanguage()->translateString("popup.buy", [TextFormat::GREEN . $plot->price . TextFormat::RESET]);
if(!empty($plot->owner)) {
$owner = TextFormat::GREEN . $plot->owner;
$ownerPopup = $this->plugin->getLanguage()->translateString("popup.owner", [$owner]);
if($plot->price > 0) {
$ownerPopup = $this->plugin->getLanguage()->translateString("popup.buy", [$owner.TextFormat::RESET, $plot->price]);
}else{
$ownerPopup = $this->plugin->getLanguage()->translateString("popup.owner", [$owner]);
}
}else{
$ownerPopup = $this->plugin->getLanguage()->translateString("popup.available", [$plot->price]);
}
Expand Down

0 comments on commit 7dfa09c

Please sign in to comment.