Skip to content
This repository has been archived by the owner on Jul 11, 2018. It is now read-only.

Commit

Permalink
1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandroliu committed Oct 31, 2016
1 parent 1c2ad1e commit caf3cf6
Show file tree
Hide file tree
Showing 8 changed files with 613 additions and 107 deletions.
87 changes: 67 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,44 @@
<img src="https://raw.githubusercontent.com/Muirfield/BasicHUD/master/media/hud.jpg" style="width:64px;height:64px" width="64" height="64"/>

# BasicHUD
BasicHUD
========

* Summary: A configurable heads up display
* Dependency Plugins: n/a
* PocketMine-MP version: 1.5 - API 1.12.0
* PocketMine-MP version: 1.5 (API:1.12.0)
* DependencyPlugins: -
* OptionalPlugins: -
* Categories: Informational
* Plugin Access: Other Plugins

## Overview

<!-- php: $v_forum_thread = "http://forums.pocketmine.net/threads/basichud.1222/"; -->
<!-- template: prologue.md -->

**DO NOT POST QUESTION/BUG-REPORTS/REQUESTS IN THE REVIEWS**

It is difficult to carry a conversation in the reviews. If you
have a question/bug-report/request please use the
[Thread](http://forums.pocketmine.net/threads/basichud.1222/) for
that. You are more likely to get a response and help that way.

**NOTE:**

This documentation was last updated for version **1.0.5**.

Please go to
[github](https://github.com/alejandroliu/bad-plugins/tree/master/BasicHUD)
for the most up-to-date documentation.

You can also download this plugin from this [page](https://github.com/alejandroliu/pocketmine-plugins/releases/tag//BasicHUD-1.0.5).

<!-- template-end -->

This plugin lets you configure a basic Heads-Up Display (HUD) for
players.

### Basic Usage
## Basic Usage

* **/hud** _[on|off|format]_
* If none specified, will show the current mode info.
Expand All @@ -26,11 +49,25 @@ players.

### Configuration

In the `config.yml` you can configure the following:
Configuration is throug the `config.yml` file.
The following sections are defined:

#### main

* ticks: how quickly to show the pop-up. Lower the number updates
faster but introduces lags.
* format: Text to display
* ticks: How often to refresh the popup
* format: Display format


### Permission Nodes

* basichud.user : Allow players to have an HUD
* basichud.cmd : Allow players to access HUD command
* basichud.cmd.toggle : Allow players to toggle HUD on/off
* basichud.cmd.switch : Allow players to switch formats
(Defaults to Op)


## Configured Formats

The displayed text can be:

Expand All @@ -44,6 +81,7 @@ The default variables are:

* {BasicHUD}
* {MOTD}
* {tps}
* {player}
* {world}
* {x}
Expand All @@ -52,6 +90,12 @@ The default variables are:
* {yaw}
* {pitch}
* {bearing}
* {10SPACE}
* {20SPACE}
* {30SPACE}
* {40SPACE}
* {50SPACE}
* {NL}
* {BLACK}
* {DARK_BLUE}
* {DARK_GREEN}
Expand Down Expand Up @@ -88,15 +132,15 @@ inactive until you log-in. If you are using something other than
`SimpleAuth` you can copy the `message-example.php` to `message.php`
and do whatever checks you need to do.

### Multi-Format options
## Multi-Format options

BasicHUD supports multiple formats. These can be configured through
the `config.yml`. So instead of **format** only having **one** format
configured, you can configure multiple, like this example:

````YAML
[CODE]
format:
format:
lv3: '{GREEN}{BasicHUD} {YELLOW}Lv3 {WHITE}{world} ({x},{y},{z}) {bearing} {RED}EUR:{money} Pts:{score}'
lv2: '{GREEN}{BasicHUD} {GREEN}Lv2 {WHITE}{world} ({x},{y},{z}) {bearing} {RED}EUR:{money} Pts:{score}'
lv1: '{GREEN}{BasicHUD} {BLUE}Lv1 {WHITE}{world} ({x},{y},{z}) {bearing} {RED}EUR:{money} Pts:{score}'
Expand All @@ -118,32 +162,35 @@ Switching formats is not saved. So on join the player always gets the
default format. If you want HUD format choices to be saved you need a
permissions plugin.

### Permission Nodes

* basichud.cmd: Allow players to access HUD command
* basichud.cmd.toggle: Allow players to toggle HUD on/off
* basichud.cmd.switch: Allow players to switch formats
* basichud.rank.*: If multiple formats, these selects them.

# API

Since **BasicHUD** takes over the built-in _sendPopup_ functionality,
it provides a replacement function for it. To use it you need this
fragment of code:

````PHP
[CODE]
[PHP]
if (($hud = $this->getServer()->getPluginManager()->getPlugin("BasicHUD")) !== null) {
$hud->sendPopup($player,$msg);
} else {
$player->sendPopup($msg);
}
[/CODE]
[/PHP]

````

# Changes

* 1.0.5: Performance tweaks
* Cache permissions for selecting formats
* An empty vars.php yields an empty function (saving a comparison)
* Constant vars are calculated once.
* Fixed bug around permissions (to change formats)
* Added translation (but not for bearing to avoid the translation overhead)
* New {vars}:
* {tps}
* {NL}
* {10SPACE}, {20SPACE}, {30SPACE}, {40SPACE}, {50SPACE}
* 1.0.3: First public release
* Added a "use" permission.
* More correct use of permission
Expand All @@ -158,8 +205,7 @@ if (($hud = $this->getServer()->getPluginManager()->getPlugin("BasicHUD")) !== n
* Added API
* 1.0.0: First release

Copyright
---------
# Copyright

BasicHUD
Copyright (C) 2015 Alejandro Liu
Expand All @@ -177,3 +223,4 @@ Copyright

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

3 changes: 2 additions & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: BasicHUD
version: 1.0.3
version: 1.0.5
main: aliuly\hud\Main
api: 1.12.0
load: POSTWORLD
website: https://github.com/alejandroliu/bad-plugins/tree/master/BasicHUD

description: A configurable heads up display
author: aliuly
Expand Down
2 changes: 1 addition & 1 deletion resources/message-example.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@

if (($sa = $plugin->getServer()->getPluginManager()->getPlugin("SimpleAuth")) !== null) {
// SimpleAuth also has a HUD when not logged in...
if (!$sa->isPlayerAuthenticated($player)) return "";
if (!$sa->isPlayerAuthenticated($player)) return null;
}
return $plugin->defaultGetMessage($player);
15 changes: 15 additions & 0 deletions resources/messages/messages.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
; messages.ini
"%1%-mode"=""
"Adventure"=""
"Available formats: %1%"=""
"Creative"=""
"HUD is OFF"=""
"HUD is ON"=""
"HUD using format %1%"=""
"Spectator"=""
"Survival"=""
"Switching to format %1%"=""
"Turning off HUD"=""
"Turning on HUD"=""
"You can only do this in-game"=""
"You do not have permission to do that."=""
34 changes: 34 additions & 0 deletions resources/messages/spa.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
; spa.ini
"%1%-mode"="modo-%1%"
"Adventure"="Aventura"
"Available formats: %1%"="Formats disponibles: %1%"
"Creative"="Creativo"
"HUD is OFF"="HUD deshabilitado"
"HUD is ON"="HUD habilitado"
"HUD using format %1%"="Usando formato %1%"
"Spectator"="Espectador"
"Survival"="Supervivencia"
"Switching to format %1%"="Cambiando a formato %1%"
"Turning off HUD"="Des-habilitando HUD"
"Turning on HUD"="Habilitando HUD"
"You can only do this in-game"="Esto sólo se puede hacer dentro del juego"
"You do not have permission to do that."="No tiene permiso para hacer eso."
"#* EconomyAPI or"="* EconomyAPI ó"
"#* GoldStd"="* GoldStd"
"#* MassiveEconomy"="* MassiveEconomy"
"#* PocketMoney"="* PocketMoney"
"#. Please install one of the following:"=". Por favor instale uno de los siguientes:"
"#Available sub-commands for %1%"="Subcomandos disponibles para %1%"
"#Description: "="Descripción: "
"#Enable %1% features"="Activando %1% módulos"
"#Enabled one feature"="Activando un módulo"
"#Help: "="Ayuda: "
"# MISSING MONEY API PLUGIN"="# NO SE ENCONTRÓ UN PLUGIN DE ECONOMÍA"
"#NO features enabled"="NO módulos activados"
"#No help for %1%"="No hay ayuda para %1%"
"#No sub-command specified"="No sub-comando proporcionado"
"#Unknown feature \"%1%\" ignored."="Módulo \"%1%\" desconocido, ignorando..."
"#Unknown sub-command %2% (try /%1% help)"="Sub-comando %2% desconocido. (Pruebe /%1% help)"
"#Usage: "="Uso: "
"#Using money API from %1%"="Usando el API de economí de %1%"
"#You are not allowed to do this"="No esta autorizado a hacer esto"
Loading

0 comments on commit caf3cf6

Please sign in to comment.