Skip to content

Commit

Permalink
add script.original_name
Browse files Browse the repository at this point in the history
tracks the original casing of a script name
  • Loading branch information
mcmonkey4eva committed Nov 11, 2014
1 parent d20b5ca commit 6aebc96
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/main/java/net/aufdemrand/denizen/objects/dScript.java
Expand Up @@ -257,13 +257,24 @@ public String getAttribute(Attribute attribute) {
// @attribute <s@script.filename>
// @returns Element
// @description
// Returns the filename that contains the script.
// Returns the absolute filename that contains the script.
// -->
if (attribute.startsWith("filename")) {
return new Element(container.getFileName().replace("\\", "/"))
.getAttribute(attribute.fulfill(1));
}

// <--[tag]
// @attribute <s@script.original_name>
// @returns Element
// @description
// Returns the originally cased script name.
// -->
if (attribute.startsWith("original_name")) {
return new Element(container.getOriginalName())
.getAttribute(attribute.fulfill(1));
}

// <--[tag]
// @attribute <s@script.constant[<constant_name>]>
// @returns Element or dList
Expand Down
Expand Up @@ -123,6 +123,10 @@ public String getFileName() {
return ScriptHelper.getSource(getName());
}

public String getOriginalName() {
return ScriptHelper.getOriginalName(getName());
}


/**
* Gets a dScript object that represents this container.
Expand Down

0 comments on commit 6aebc96

Please sign in to comment.