Skip to content

Commit

Permalink
Revert "Reduced the # of copies of the version string (#93)"
Browse files Browse the repository at this point in the history
This reverts commit 4173cac.
  • Loading branch information
tlentz committed Jan 28, 2021
1 parent 4173cac commit cea33b9
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 19 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,6 @@ Thanks!
## Upcoming Release
* Added ElementalSkills option (+Cold,Lightning,Magic,Poison Skills)

## V0.5.3
* Version # fix (previous 0.5.2 release said 0.5.1 in some places.)

## v0.5.2
* [bugfix] - fixed density overlap in old code, which was squaring density for nightmare, no increase for hell.
* Upped density max to 45 and split between MonStats.txt & Levels.txt so that the density caps are not hit.
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.5.3
v0.5.2
2 changes: 1 addition & 1 deletion cfg.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Version": "v0.5.3",
"Version": "v0.5.1",
"SourceDir": "",
"OutputDir": "",
"MeleeSplash": true,
Expand Down
4 changes: 1 addition & 3 deletions cmd/d2modmaker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"fmt"

"github.com/tlentz/d2modmaker/internal/d2mod"
"github.com/tlentz/d2modmaker/internal/d2mod/config"
)

var (
dataDir string
outDir string
cfgPath string
mode string
Expand All @@ -16,8 +16,6 @@ var (

func main() {

config.Version = version

if mode == "production" {
outDir = "./"
cfgPath = "./cfg.json"
Expand Down
2 changes: 1 addition & 1 deletion gui/react-ui/src/components/D2ModMaker/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const _ = require('lodash');
const axios = require("axios");

const defaultCfg = {
Version: "v0.5.3",
Version: "v0.5.1",
SourceDir: "",
OutputDir: "",
MeleeSplash: true,
Expand Down
12 changes: 2 additions & 10 deletions internal/d2mod/config/cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ import (
"io/ioutil"
)

var (
// Version # stuffed in from main.go:version, from build environment variable.
Version string
)

// RandomOptions are the options for the randomizer
type RandomOptions struct {
Randomize bool `json:"Randomize"`
Expand Down Expand Up @@ -49,6 +44,7 @@ type Data struct {

func DefaultData() Data {
return Data{
Version: "v0.5.1",
SourceDir: "",
OutputDir: "",
MeleeSplash: true,
Expand Down Expand Up @@ -80,20 +76,16 @@ func DefaultData() Data {
}
}

// Read reads a ModConfig from the given json file
// ReadCfg reads a ModConfig from the given json file
func Read(filePath string) Data {
file, _ := ioutil.ReadFile(filePath)
data := DefaultData()
_ = json.Unmarshal([]byte(file), &data)
data.Version = Version

return data
}

// Parse a configuration from jsdon data into a configuration structure
func Parse(jsonData []byte) Data {
data := DefaultData()
_ = json.Unmarshal(jsonData, &data)
data.Version = Version
return data
}

0 comments on commit cea33b9

Please sign in to comment.