v1.4.4
This commit is contained in:
commit
9c94d113d3
10260 changed files with 1237388 additions and 0 deletions
BIN
assets/devel/objects/scriptpaneconsole/consolebody.png
Normal file
BIN
assets/devel/objects/scriptpaneconsole/consolebody.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/devel/objects/scriptpaneconsole/consoleheader.png
Normal file
BIN
assets/devel/objects/scriptpaneconsole/consoleheader.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 424 B |
BIN
assets/devel/objects/scriptpaneconsole/icon.png
Normal file
BIN
assets/devel/objects/scriptpaneconsole/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 330 B |
|
@ -0,0 +1,66 @@
|
|||
{
|
||||
"animatedParts" : {
|
||||
"stateTypes" : {
|
||||
"switchState" : {
|
||||
"default" : "on",
|
||||
"states" : {
|
||||
"off" : {
|
||||
"frames" : 1
|
||||
},
|
||||
"on" : {
|
||||
"frames" : 3,
|
||||
"cycle" : 0.5,
|
||||
"mode" : "loop"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"parts" : {
|
||||
"bg" : {
|
||||
"properties" : {
|
||||
"centered" : false
|
||||
},
|
||||
|
||||
"partStates" : {
|
||||
"switchState" : {
|
||||
"off" : {
|
||||
"properties" : {
|
||||
"image" : "<partImage>:<color>.off"
|
||||
}
|
||||
},
|
||||
|
||||
"on" : {
|
||||
"properties" : {
|
||||
"image" : "<partImage>:<color>.<frame>",
|
||||
"fullbright" : true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"fg" : {
|
||||
"properties" : {
|
||||
"centered" : false,
|
||||
"zLevel" : 1
|
||||
},
|
||||
|
||||
"partStates" : {
|
||||
"switchState" : {
|
||||
"off" : {
|
||||
"properties" : {
|
||||
"image" : "<partImage>:<color>.off"
|
||||
}
|
||||
},
|
||||
|
||||
"on" : {
|
||||
"properties" : {
|
||||
"image" : "<partImage>:<color>.<frame>"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
|
||||
"frameGrid" : {
|
||||
"size" : [24, 24],
|
||||
"dimensions" : [4, 1],
|
||||
"names" : [
|
||||
[ "default.1", "default.2", "default.3", "default.off" ]
|
||||
]
|
||||
},
|
||||
|
||||
"aliases" : {
|
||||
"default.default" : "default.off"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
function init()
|
||||
|
||||
end
|
||||
|
||||
function update(dt)
|
||||
|
||||
end
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"objectName" : "scriptpaneconsole",
|
||||
"rarity" : "Common",
|
||||
"description" : "Object for testing a scripted pane.",
|
||||
"shortdescription" : "Script Pane Console",
|
||||
"race" : "generic",
|
||||
"category" : "wire",
|
||||
|
||||
"inventoryIcon" : "icon.png",
|
||||
"orientations" : [
|
||||
{
|
||||
"image" : "scriptpaneconsole.png:<color>.<frame>",
|
||||
"flipImages" : true,
|
||||
"direction" : "left",
|
||||
|
||||
"imagePosition" : [-8, 0],
|
||||
"frames" : 3,
|
||||
"animationCycle" : 0.5,
|
||||
|
||||
"spaceScan" : 0.1,
|
||||
"anchors" : [ "bottom" ]
|
||||
},
|
||||
{
|
||||
"image" : "scriptpaneconsole.png:<color>.<frame>",
|
||||
"direction" : "right",
|
||||
|
||||
"imagePosition" : [-8, 0],
|
||||
"frames" : 3,
|
||||
"animationCycle" : 0.5,
|
||||
|
||||
"spaceScan" : 0.1,
|
||||
"anchors" : [ "bottom" ]
|
||||
}
|
||||
],
|
||||
|
||||
"scripts" : ["scriptpaneconsole.lua"],
|
||||
"scriptDelta" : 5,
|
||||
|
||||
"animation" : "scriptpaneconsole.animation",
|
||||
"animationCustom" : {},
|
||||
"animationParts" : {
|
||||
"bg" : "scriptpaneconsole.png",
|
||||
"fg" : "scriptpaneconsolelit.png"
|
||||
},
|
||||
"animationPosition" : [-8, 0],
|
||||
|
||||
"interactAction" : "ScriptPane",
|
||||
"interactData" : "/objects/scriptpaneconsole/scriptpaneconsolegui.config"
|
||||
}
|
BIN
assets/devel/objects/scriptpaneconsole/scriptpaneconsole.png
Normal file
BIN
assets/devel/objects/scriptpaneconsole/scriptpaneconsole.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 599 B |
|
@ -0,0 +1,141 @@
|
|||
{
|
||||
"gui" : {
|
||||
"background" : {
|
||||
"zlevel" : 0,
|
||||
"type" : "background",
|
||||
"fileHeader" : "/objects/scriptpaneconsole/consoleheader.png",
|
||||
"fileBody" : "/objects/scriptpaneconsole/consolebody.png"
|
||||
},
|
||||
"lblTestLabel" : {
|
||||
"type" : "label",
|
||||
"position" : [50, 50],
|
||||
"hAnchor" : "left",
|
||||
"value" : "count 0"
|
||||
},
|
||||
"btnTestButton" : {
|
||||
"type" : "button",
|
||||
"base" : "/interface/button.png",
|
||||
"hover" : "/interface/buttonhover.png",
|
||||
"position" : [120, 50],
|
||||
"caption" : "Butt(on)",
|
||||
"callback" : "buttonPressed"
|
||||
},
|
||||
"tbTestTextbox" : {
|
||||
"type" : "textbox",
|
||||
"position" : [190, 50],
|
||||
"textAlign" : "center",
|
||||
"maxWidth" : 30,
|
||||
// "regex" : "x?\\d{0,4}",
|
||||
"hint" : "textbox",
|
||||
"callback" : "textboxChanged"
|
||||
},
|
||||
"grpTestGroup" : {
|
||||
"type" : "radioGroup",
|
||||
"position" : [260, 50],
|
||||
|
||||
"buttons" : [
|
||||
{
|
||||
"id" : 0,
|
||||
"baseImage" : "/interface/crafting/sortuncommon.png",
|
||||
"baseImageChecked" : "/interface/crafting/sortuncommonselected.png",
|
||||
"position" : [0, 0],
|
||||
"size" : [7, 9],
|
||||
"pressedOffset" : [0,0],
|
||||
"data" : {
|
||||
"color" : "green"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id" : 1,
|
||||
"baseImage" : "/interface/crafting/sortrare.png",
|
||||
"baseImageChecked" : "/interface/crafting/sortrareselected.png",
|
||||
"position" : [10, 0],
|
||||
"size" : [7, 9],
|
||||
"pressedOffset" : [0,0],
|
||||
"data" : {
|
||||
"color" : "blue"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id" : 2,
|
||||
"baseImage" : "/interface/crafting/sortlegendary.png",
|
||||
"baseImageChecked" : "/interface/crafting/sortlegendaryselected.png",
|
||||
"position" : [20, 0],
|
||||
"size" : [7, 9],
|
||||
"pressedOffset" : [0,0],
|
||||
"data" : {
|
||||
"color" : "red"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
"callback" : "radioGroupChanged"
|
||||
},
|
||||
"btnTestCheckbox" : {
|
||||
"type" : "button",
|
||||
"base" : "/interface/title/checkboxnocheck.png",
|
||||
"hover" : "/interface/title/checkboxnocheckhover.png",
|
||||
"baseImageChecked" : "/interface/title/checkboxcheck.png",
|
||||
"hoverImageChecked" : "/interface/title/checkboxcheckhover.png",
|
||||
"checkable" : true,
|
||||
"checked" : true,
|
||||
"position" : [300, 50],
|
||||
"callback" : "checkboxChanged"
|
||||
},
|
||||
"imgTestImage" : {
|
||||
"type" : "image",
|
||||
"file" : "/animations/cat/cat.png",
|
||||
"centered" : true,
|
||||
"position" : [100, 110],
|
||||
"maxSize" : [60, 60]
|
||||
},
|
||||
"prgTestProgress" : {
|
||||
"type" : "progress",
|
||||
"position" : [150, 90],
|
||||
"background" : "/interface/emptybar.png",
|
||||
"size" : [60, 8],
|
||||
"progressSet" : {
|
||||
"inner" : "/interface/healthbar.png",
|
||||
"type" : "repeat"
|
||||
},
|
||||
"direction" : "horizontal",
|
||||
"max" : 100,
|
||||
"initial" : 0
|
||||
},
|
||||
"sldTestSlider" : {
|
||||
"type" : "slider",
|
||||
"position" : [250, 90],
|
||||
"gridImage" : "/interface/optionsmenu/largeselection.png",
|
||||
"callback" : "sliderChanged",
|
||||
"range" : [0, 100, 1]
|
||||
},
|
||||
"close" : {
|
||||
"zlevel" : 2,
|
||||
"type" : "button",
|
||||
"base" : "/interface/x.png",
|
||||
"hover" : "/interface/xhover.png",
|
||||
"pressed" : "/interface/xpress.png",
|
||||
"pressedOffset" : [0, 0],
|
||||
"callback" : "close",
|
||||
"position" : [413, 263]
|
||||
},
|
||||
"cvsTest" : {
|
||||
"zlevel" : 1,
|
||||
"type" : "canvas",
|
||||
"rect" : [50, 150, 300, 300],
|
||||
"captureMouseEvents" : true,
|
||||
"captureKeyboardEvents" : true
|
||||
}
|
||||
},
|
||||
|
||||
"scriptWidgetCallbacks" : [
|
||||
"buttonPressed",
|
||||
"textboxChanged",
|
||||
"sliderChanged",
|
||||
"radioGroupChanged",
|
||||
"checkboxChanged"
|
||||
],
|
||||
|
||||
"scripts" : ["/objects/scriptpaneconsole/scriptpaneconsolegui.lua"],
|
||||
"scriptDelta" : 1
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
require "/scripts/vec2.lua"
|
||||
|
||||
function init()
|
||||
self.buttonPresses = 0
|
||||
|
||||
self.canvas = widget.bindCanvas("cvsTest")
|
||||
|
||||
local rs = sb.makeRandomSource(1234)
|
||||
self.canvasOffsetMagnitude = 40
|
||||
self.canvasOffsetAngle = 0
|
||||
end
|
||||
|
||||
function update(dt)
|
||||
self.canvas:clear()
|
||||
self.canvasOffsetAngle = self.canvasOffsetAngle + 0.01
|
||||
local canvasOffset = vec2.withAngle(self.canvasOffsetAngle, self.canvasOffsetMagnitude)
|
||||
self.canvas:drawTiledImage("/interface/xhover.png", {0, 0}, {0, 0, 100, 100}, 1)
|
||||
self.canvas:drawTiledImage("/interface/xhover.png", {0, 0}, {105, 0, 205, 100}, 2)
|
||||
end
|
||||
|
||||
function buttonPressed(widgetName, widgetData)
|
||||
self.buttonPresses = self.buttonPresses + 1
|
||||
widget.setText("lblTestLabel", "count " .. self.buttonPresses)
|
||||
widget.focus("tbTestTextbox")
|
||||
widget.playSound("/sfx/npc/monsters/monster_surprise.ogg")
|
||||
end
|
||||
|
||||
function textboxChanged(widgetName, widgetData)
|
||||
widget.setText("btnTestButton", widget.getText(widgetName))
|
||||
end
|
||||
|
||||
function sliderChanged(widgetName, widgetData)
|
||||
widget.setProgress("prgTestProgress", widget.getSliderValue(widgetName))
|
||||
widget.setImageRotation("imgTestImage", 2 * math.pi * widget.getSliderValue(widgetName) / 100)
|
||||
end
|
||||
|
||||
function radioGroupChanged(widgetName, widgetData)
|
||||
if widgetData and widgetData.color then
|
||||
widget.setImage("imgTestImage", "/animations/cat/cat" .. widgetData.color .. ".png")
|
||||
end
|
||||
end
|
||||
|
||||
function checkboxChanged(widgetName, widgetData)
|
||||
widget.setButtonEnabled("btnTestButton", widget.getChecked(widgetName))
|
||||
end
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
|
||||
"frameGrid" : {
|
||||
"size" : [24, 24],
|
||||
"dimensions" : [4, 1],
|
||||
"names" : [
|
||||
[ "default.1", "default.2", "default.3", "default.off" ]
|
||||
]
|
||||
},
|
||||
|
||||
"aliases" : {
|
||||
"default.default" : "default.off"
|
||||
}
|
||||
}
|
BIN
assets/devel/objects/scriptpaneconsole/scriptpaneconsolelit.png
Normal file
BIN
assets/devel/objects/scriptpaneconsole/scriptpaneconsolelit.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 537 B |
Loading…
Add table
Add a link
Reference in a new issue