Updates and Fixes

**resource.go/assets.go**
*  renamed `resources.go` to `assets.go`
*  added dark glyphs - located in assets.go -> assets/glyphs/dark/
*  moved original glyphs - located in assets.go -> assets/glyph/light/

**glyphbanner.go**
* added option to make glyphs vertical and/or dark

**rpcg.go**
* Added a random portal code generator this function takes no args and returns a string

**README.md**
* Fixed some typos (probably more to be fixed)
* Added example of vertical portal banner
* Added list of options for banner creation
* Added example of ``nmslib.RndPortal()`` usage

**go.mod**
* updated go version to 1.16
This commit is contained in:
Raum0x2A
2021-05-07 16:03:08 +00:00
parent 87bec565f1
commit 284313eacc
10 changed files with 1177 additions and 754 deletions

View File

@@ -6,7 +6,7 @@
NMSlib is a GoLang package for dealing with converting Galactic coordinates to Portal codes and vice versa.
NMSlib also translates in game languages to english.
NMSlib also translates in game languages (Korvax, Gek Vy'Keen and Atlas) to english, and create portal banners.
## Installation
@@ -39,10 +39,11 @@ func main() {
fmt.Printf("Input:\t%s\nExpecting:\t014C:0077:06DA:01F2\nHave:\t%s\n", portalcode, tstvar)
nmslib.CreateBanner(portalcode, "NewLennon.png", 0)
nmslib.CreateBanner(RndPortal(), "Random.png", 0)
fmt.Println(Translate{"KIHTYOMOLES"}.Kor2Eng())
korvax := Translate{"Contraband"}
fmt.Println(korvax.Eng2Kor())
fmt.Println(nmslib.Translate{"KIHTYOMOLES"}.Kor2Eng())
korvax := nmslib.Translate{"Contraband"}
fmt.Println(nmslib.korvax.Eng2Kor())
}
```
@@ -53,7 +54,12 @@ This function takes 3 parameters:
* portalcode: 12 char hex string of portal location
* savename: Save location and name
* Horizontal/Vertical layout: 0 is horizontal, 1 is vertical
* layout:
* 00 or 0 is horizontal in light mode
* 01 or 1 is horizontal in dark mode
* 11 is vertical in dark mode
* 10 is vertical in light mode
**Example:**
@@ -65,6 +71,20 @@ nmslib.CreateBanner("006AFA556C30", "NewLennon.png", 0)
![](NewLennon.png)
Vertical layout for a random address
```golang
nmslib.CreateBanner(nmslib.RndPortal(), "ranportal.png", 11)
```
![](ranportal_scaled.png)
_Note: Images shown in readme.md have been scaled down in gimp._
_Original Vertical: 256x3072px_
_Original: Horizontal: 3072x256px_
### Converting Portal code to Galactic address with P2gc()
This function only takes 1 parameter and returns a string and error
@@ -117,7 +137,7 @@ This function takes only 1 parameter and returns a string
**Example:**
```golang
fmt.Println(Translate{"Paka"}.Atl2Eng())
fmt.Println(nmslib.Translate{"Paka"}.Atl2Eng())
```
Output:
@@ -133,7 +153,7 @@ This function takes only 1 parameter and returns a string
**Example:**
```golang
korvax := Translate{"Contraband"}
korvax := nmslib.Translate{"Contraband"}
fmt.Println(korvax.Eng2Kor())
```
@@ -145,20 +165,20 @@ Output:
### Language commands
Gek:
- ``Translate{word}.Gek2Eng()``
- ``Translate{word}.Eng2Gek()``
- ``Translate{string}.Gek2Eng()``
- ``Translate{string}.Eng2Gek()``
Korvax:
- ``Translate{word}.Kor2Eng()``
- ``Translate{word}.Eng2Kor()``
- ``Translate{string}.Kor2Eng()``
- ``Translate{string}.Eng2Kor()``
Vy'keen:
- ``Translate{word}.Vyk2Eng()``
- ``Translate{word}.Eng2Vyk()``
- ``Translate{string}.Vyk2Eng()``
- ``Translate{string}.Eng2Vyk()``
Atlas:
- ``Translate{word}.Atl2Eng()``
- ``Translate{word}.Eng2Atl()``
- ``Translate{string}.Atl2Eng()``
- ``Translate{string}.Eng2Atl()``
## Random Portal address
@@ -167,12 +187,15 @@ Atlas:
**Example:**
```golang
fmt.Println(RndPortal())
fmt.Println(nmslib.RndPortal())
fmt.Println(nmslib.RndPortal())
```
**Outout:**
**Output:**
``10EFABDEA373``
``11EAB355FC8E``
## License
[MIT](COPYING)