Merge branch 'main' of https://github.com/OpenStarbound/OpenStarbound
4
.github/workflows/build_macos.yml
vendored
@ -51,7 +51,7 @@ jobs:
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: OpenStarbound-Dev-macOS-Intel
|
||||
name: OpenStarbound-macOS-Intel
|
||||
path: dist/*
|
||||
|
||||
build-arm:
|
||||
@ -93,5 +93,5 @@ jobs:
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: OpenStarbound-Dev-macOS-Silicon
|
||||
name: OpenStarbound-macOS-Silicon
|
||||
path: dist/*
|
2
.github/workflows/build_windows.yml
vendored
@ -85,5 +85,5 @@ jobs:
|
||||
- name: Upload Installer
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Installer
|
||||
name: OpenStarbound-Windows-Installer
|
||||
path: installer/*
|
||||
|
64
README.md
@ -9,13 +9,17 @@ Original README is as follows, if you're here reading it, you can skip the steps
|
||||
This is a fork of Starbound. Contributions are welcome!
|
||||
You **must** own a copy of Starbound to use it. Base game assets are not provided for obvious reasons.
|
||||
|
||||
It is still **work-in-progress**. You can download the very latest build below, or the occasional releases (though those aren't very up to date yet!)
|
||||
## Nightly Builds
|
||||
It is still **work-in-progress**.
|
||||
|
||||
At the moment, you must copy the game assets (**packed.pak**) from your normal Starbound install to the OpenStarbound assets directory.
|
||||
## Installation
|
||||
You can download a nightly build below, or the [latest release](https://github.com/OpenStarbound/OpenStarbound/releases/latest). At the moment, you must copy the game assets (**packed.pak**) from your normal Starbound install to the OpenStarbound assets directory before playing.
|
||||
|
||||
An installer is available for Windows. otherwise, extract the client/server zip for your platform and copy the game assets (packed.pak) to the OpenStarbound assets folder. the macOS releases currently lack the sbinit.config and folder structure that the Linux & Windows zips have, so you'll need to create those before running them. For macOS releases, it is recommended to build them from source (See guide below).
|
||||
### Nightly Builds
|
||||
These link directly to the latest build from the [Actions](https://github.com/OpenStarbound/OpenStarbound/actions?query=branch%3Amain) tab.
|
||||
|
||||
[**Windows**](https://nightly.link/OpenStarbound/OpenStarbound/workflows/build_windows/main):
|
||||
[Installer](https://nightly.link/OpenStarbound/OpenStarbound/workflows/build_windows/main/Installer.zip),
|
||||
[Installer](https://nightly.link/OpenStarbound/OpenStarbound/workflows/build_windows/main/OpenStarbound-Windows-Installer.zip),
|
||||
[Client](https://nightly.link/OpenStarbound/OpenStarbound/workflows/build_windows/main/OpenStarbound-Windows-Client.zip),
|
||||
[Server](https://nightly.link/OpenStarbound/OpenStarbound/workflows/build_windows/main/OpenStarbound-Windows-Server.zip)
|
||||
|
||||
@ -27,8 +31,6 @@ At the moment, you must copy the game assets (**packed.pak**) from your normal S
|
||||
[Intel](https://nightly.link/OpenStarbound/OpenStarbound/workflows/build_macos/main/OpenStarbound-Dev-macOS-Intel.zip),
|
||||
[ARM](https://nightly.link/OpenStarbound/OpenStarbound/workflows/build_macos/main/OpenStarbound-Dev-macOS-Silicon.zip)
|
||||
|
||||
These link directly to the latest build from the [Actions](https://github.com/OpenStarbound/OpenStarbound/actions?query=branch%3Amain) tab.
|
||||
|
||||
## Changes
|
||||
Note: Not every function from [StarExtensions](https://github.com/StarExtensions/StarExtensions) has been ported yet, but near-full compatibility with mods that use StarExtensions features is planned.
|
||||
|
||||
@ -42,8 +44,10 @@ Note: Not every function from [StarExtensions](https://github.com/StarExtensions
|
||||
* These scripts can modify, read, patch and create new assets!
|
||||
* Lua patch files now exist - **.patch.lua**
|
||||
* These can patch JSON assets, as well as images!
|
||||
### Bug Fixes
|
||||
* Invalid character inventories are updated when loading in, allowing players to swap inventory mods with pre-existing characters.
|
||||
### Misc
|
||||
* Player functions for saving/loading, modifying the humanoid identity
|
||||
* Player functions for saving/loading, modifying the humanoid identity, manipulating the inventory. [Documentation](https://github.com/OpenStarbound/OpenStarbound/blob/main/doc/lua/openstarbound.md)
|
||||
* Character swapping (rewrite from StarExtensions, currently command-only: `/swap name` case-insensitive, only substring required)
|
||||
* Custom user input support with a keybindings menu (rewrite from StarExtensions)
|
||||
* Positional Voice Chat that works on completely vanilla servers, uses Opus for crisp, HD audio (rewrite from StarExtensions)
|
||||
@ -52,11 +56,15 @@ Note: Not every function from [StarExtensions](https://github.com/StarExtensions
|
||||
* **.woff2** fonts are much smaller than **.ttf**, [here's a web conversion tool](https://kombu.kanejaku.org/)!
|
||||
* Experimental changes to the storage of directives in memory to reduce copying - can reduce their impact on frametimes when very long directives are present
|
||||
* Works especially well when extremely long directives are used for "vanilla multiplayer-compatible" creations, like [generated clothing](https://silverfeelin.github.io/Starbound-NgOutfitGenerator/) or custom items/objects.
|
||||
* Perfectly Generic Items will retain the data for what item they were if a mod is uninstalled, and will attempt to restore themselves if re-installed.
|
||||
* Musical instruments have their own volume slider in the options menu.
|
||||
* Players can use items while lounging
|
||||
|
||||
* Client-side tile placement prediction (rewrite from StarExtensions)
|
||||
* You can also resize the placement area of tiles on the fly.
|
||||
* Support for placing foreground tiles with a custom collision type (rewrite from StarExtensions, requires OpenSB server)
|
||||
* Additionally, objects can be placed under non-solid foreground tiles.
|
||||
* Admin characters have unlimited and unobstructed interaction/placement ranges
|
||||
|
||||
* Some minor polish to UI
|
||||
* The Skybox's sun now matches the system type you're currently in.
|
||||
@ -203,6 +211,44 @@ LD_LIBRARY_PATH="$LD_LIBRARY_PATH:./" padsp ./starbound "$@"`
|
||||
</details>
|
||||
|
||||
</details>
|
||||
<details>
|
||||
<summary><b>macOS</b></summary>
|
||||
|
||||
* First, you will need to have brew installed. Check out how to install [Homebrew](https://brew.sh/)
|
||||
* Install cmake using `brew install cmake`
|
||||
* Install ninja using `brew install ninja`
|
||||
* Install pkg config using `brew install pkg-config`
|
||||
* Next, install vcpkg by following the commands below.
|
||||
* Run `cd ~`. This is just so that everything is local to here.
|
||||
* Run ` git clone https://github.com/microsoft/vcpkg.git `
|
||||
* Run `cd vcpkg && ./bootstrap-vcpkg.sh`
|
||||
* Lastly, run ``` export VCPKG_ROOT=~/vcpkg && export PATH=$VCPKG_ROOT:$PATH ```
|
||||
* This last command makes vcpkg added to the current terminal path. This lasts only while the terminal is active, and will have to be rerun for new terminal instances.
|
||||
* Download the source code [here](https://github.com/OpenStarbound/OpenStarbound/archive/refs/heads/main.zip). This is the current code in main. Unpack the code to your downloads folder.
|
||||
* Unpack the zip, and open it up. Navigate to OpenStarbound-main/source using the terminal -> `cd ~/Downloads/OpenStarbound-main`. Then navigate to the source folder, using `cd source`.
|
||||
<details>
|
||||
<summary>If using an Arm Mac</summary>
|
||||
|
||||
### macOS
|
||||
To be written.
|
||||
* While in the source folder in your terminal, run ` cmake --preset macos-arm-release `. This will get dependencies.
|
||||
* After that command has finished, run ` cmake --build --preset macos-arm-release `. Wait for this to finish, then go to Finder. Navigate to the OpenStarbound-main folder using Finder.
|
||||
* There will be a folder called <b>dist</b>. Inside dist will be your game files, but you still need to do a few more things to run it.
|
||||
* First, in the OpenStarbound-main folder, there will be lib. Open lib, and open the osx folder. Inside is libsteam_api.dylib. Copy this file, and paste it into OpenStarbound-main/dist, so that it is in the same directory as the game files.
|
||||
* Navigate back to OpenStarbound-main/lib/osx, and open up the folder arm64. Here, rename libdiscord_game_sdk.dylib to discord_game_sdk.dylib. The name must be that, or else the game won't be able to load.
|
||||
* Grab the packed.pak file from your current Starbound install. It will be located in the assets folder. Copy that file into OpenStarbound-main/assets.
|
||||
* Make a new file called sbinit.config (Make sure it is .config, not .somethingelse), and copy and paste in the sbinit.config text from above, located right underneath the title Building. Place sbinit.config inside OpenStarbound-main/dist. To make a new file, open the program called TextEdit on your mac, paste in the sbinit.config text from above, and click File (located at the very top of your screen), then click Save. It will prompt you, asking where to save it. Save As: sbinit.config, Where: Navigate to OpenStarbound-main/dist. Find the file you just saved, and rename it to get rid of the wrong extension, making sure the full name and extension looks like sbinit.config.
|
||||
* You can now run the game by double clicking on the file called starbound in dist/. If it says unverified developer, open up the same folder where the game is in in the terminal. ` xattr -d com.apple.quarantine starbound `, which will get rid of the lock on the file. If that doesn't work, run ` sudo spctl --master-disable ` to allow all unverified apps.
|
||||
</details>
|
||||
<details>
|
||||
<summary>If using an Intel Mac</summary>
|
||||
|
||||
* While in the source folder in your terminal, run ` cmake --preset macos-release `. This will get dependencies.
|
||||
* After that command has finished, run ` cmake --build --preset macos-release `. Wait for this to finish, then go to Finder. Navigate to the OpenStarbound-main folder using Finder.
|
||||
* There will be a folder called <b>dist</b>. Inside dist will be your game files, but you still need to do a few more things to run it.
|
||||
* First, in the OpenStarbound-main folder, there will be lib. Open lib, and open the osx folder. Inside is libsteam_api.dylib. Copy this file, and paste it into OpenStarbound-main/dist, so that it is in the same directory as the game files.
|
||||
* Navigate back to OpenStarbound-main/lib/osx, and open up the folder x64. Here, rename libdiscord_game_sdk.dylib to discord_game_sdk.dylib. The name must be that, or else the game won't be able to load.
|
||||
* Grab the packed.pak file from your current Starbound install. It will be located in the assets folder. Copy that file into OpenStarbound-main/assets.
|
||||
* Make a new file called sbinit.config (Make sure it is .config, not .somethingelse), and copy and paste in the sbinit.config text from above, located right underneath the title Building. Place sbinit.config inside OpenStarbound-main/dist. To make a new file, open the program called TextEdit on your mac, paste in the sbinit.config text from above, and click File (located at the very top of your screen), then click Save. It will prompt you, asking where to save it. Save As: sbinit.config, Where: Navigate to OpenStarbound-main/dist. Find the file you just saved, and rename it to get rid of the wrong extension, making sure the full name and extension looks like sbinit.config.
|
||||
* You can now run the game by double clicking on the file called starbound in dist/. If it says unverified developer, open up the same folder where the game is in in the terminal. ` xattr -d com.apple.quarantine starbound `, which will get rid of the lock on the file. If that doesn't work, run ` sudo spctl --master-disable ` to allow all unverified apps.
|
||||
|
||||
</details>
|
||||
</details>
|
||||
|
@ -9,5 +9,6 @@
|
||||
"deployCinematicBase" : {
|
||||
"scissor" : false,
|
||||
"letterbox" : false
|
||||
}
|
||||
}
|
||||
},
|
||||
"postProcessLayers": []
|
||||
}
|
||||
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"scale" : 1
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"scale" : 1
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"scale" : 1
|
||||
}
|
@ -1,5 +1,16 @@
|
||||
{
|
||||
"basicHelpText" : "Basic commands are: {}",
|
||||
"adminHelpText" : "Admin commands are: {}",
|
||||
"debugHelpText" : "Debug commands are: {}"
|
||||
}
|
||||
"basicHelpText": "Basic commands are: {}",
|
||||
"adminHelpText": "Admin commands are: {}",
|
||||
"debugHelpText": "Debug commands are: {}",
|
||||
"openSbHelpText": "OpenSB commands are: {}",
|
||||
"openSbDebugHelpText": "OpenSB Debug commands are: {}",
|
||||
|
||||
"openSbDebugCommands": {
|
||||
"run": "Usage /run <lua>. Executes a script on the player and outputs the return value to chat."
|
||||
},
|
||||
|
||||
"openSbCommands": {
|
||||
"swap": "Usage /swap <name>. Swaps the current character, case-insensitive, only substring required.",
|
||||
"respawninworld": "Usage /respawninworld. Sets the respawn flag for the current world until you teleport away."
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ function patch(original)
|
||||
image:copyInto({0, 0}, original:process("?crop=0;0;236;96"))
|
||||
local checkbox = image:process("?crop=19;26;117;35")
|
||||
image:copyInto({119, 26}, checkbox) -- Anti-Aliasing
|
||||
image:copyInto({19, 15}, checkbox) -- Object Lighting
|
||||
image:copyInto({19, 15}, checkbox) -- New Lighting
|
||||
image:copyInto({119, 15}, checkbox) -- Hardware Cursor
|
||||
|
||||
image:copyInto({119, 68}, image:process("?crop=19;68;117;87")) -- Camera Pan Speed
|
||||
|
@ -29,12 +29,16 @@ local function getMods(key)
|
||||
if bindMods[1] then return bindMods end
|
||||
end
|
||||
|
||||
local function finishBind(type, value)
|
||||
local function finishBind(a, b)
|
||||
widget.blur("snare")
|
||||
snared = false
|
||||
snareFinished{ type = type, value = value, mods = getMods(value) }
|
||||
for i, mod in ipairs(mods) do
|
||||
mod.active = false
|
||||
if (type(a) == "table") then
|
||||
snareFinished(a)
|
||||
else
|
||||
snareFinished{ type = a, value = b, mods = getMods(value) }
|
||||
for i, mod in ipairs(mods) do
|
||||
mod.active = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -50,6 +54,8 @@ local function scanInputEvents()
|
||||
return finishBind("key", data.key)
|
||||
elseif type == "MouseButtonDown" then
|
||||
return finishBind("mouse", data.mouseButton)
|
||||
elseif type == "ControllerButtonDown" then
|
||||
return finishBind{ type = "controller", value = data.controllerButton, controller = data.controller }
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -127,9 +133,9 @@ function bindsToString(binds)
|
||||
str = str .. v .. " + "
|
||||
end
|
||||
end
|
||||
if bind.type == "key" then
|
||||
str = str .. bind.value
|
||||
elseif bind.type == "mouse" then
|
||||
if bind.type == "controller" then
|
||||
str = str .. "🎮 " .. bind.value
|
||||
else
|
||||
str = str .. bind.value
|
||||
end
|
||||
local _i = (i - 1) * 2
|
||||
@ -362,7 +368,7 @@ local function initCallbacks()
|
||||
end
|
||||
|
||||
function init()
|
||||
--log = sb.logInfo
|
||||
--log = chat and chat.addMessage or sb.logInfo
|
||||
|
||||
widget.clearListItems(CATEGORY_LIST_WIDGET)
|
||||
initCallbacks()
|
||||
|
@ -35,9 +35,9 @@ function patch(config)
|
||||
-- Create anti-aliasing toggle
|
||||
shift(clone(layout, "multiTextureLabel", "antiAliasingLabel"), 98).value = "SUPER-SAMPLED AA"
|
||||
shift(clone(layout, "multiTextureCheckbox", "antiAliasingCheckbox"), 99)
|
||||
-- Create object lighting toggle
|
||||
shift(clone(layout, "multiTextureLabel", "objectLightingLabel"), 0, -11).value = "NEW OBJECT LIGHTS"
|
||||
shift(clone(layout, "multiTextureCheckbox", "objectLightingCheckbox"), 0, -11)
|
||||
-- Create new lighting toggle
|
||||
shift(clone(layout, "multiTextureLabel", "newLightingLabel"), 0, -11).value = "NEW LIGHTING"
|
||||
shift(clone(layout, "multiTextureCheckbox", "newLightingCheckbox"), 0, -11)
|
||||
-- Create hardware cursor toggle
|
||||
shift(clone(layout, "multiTextureLabel", "hardwareCursorLabel"), 98, -11).value = "HARDWARE CURSOR"
|
||||
shift(clone(layout, "multiTextureCheckbox", "hardwareCursorCheckbox"), 99, -11)
|
||||
|
@ -1,5 +1,8 @@
|
||||
{
|
||||
"password" : {
|
||||
"hidden" : true
|
||||
}
|
||||
"panefeature" : {
|
||||
"type" : "panefeature",
|
||||
"anchor" : "center",
|
||||
"positionLocked" : true
|
||||
},
|
||||
"password" : { "hidden" : true }
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
{
|
||||
"paneLayout" : {
|
||||
"group" : {
|
||||
"position" : [8, 71]
|
||||
},
|
||||
"search" : {
|
||||
"type" : "textbox",
|
||||
"position" : [86, 71],
|
||||
"hint" : "Search",
|
||||
"maxWidth" : 50
|
||||
},
|
||||
"lblBandInput" : {
|
||||
"position" : [3, 68]
|
||||
},
|
||||
"lblSearchInput" : {
|
||||
"type" : "image",
|
||||
"file" : "/interface/songbook/band.png",
|
||||
"position" : [81, 68],
|
||||
"zlevel" : -3
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
function patch(config)
|
||||
local scrollBG = config.paneLayout.scrollBG
|
||||
local scrollSize = assets.image(scrollBG.file):size()
|
||||
config.paneLayout.search = {
|
||||
type = "textbox",
|
||||
position = {scrollBG.position[1] + 3,
|
||||
scrollBG.position[2] + scrollSize[2] - 10},
|
||||
hint = "^#999;Type here to search for a song",
|
||||
maxWidth = scrollSize[1] - 6
|
||||
}
|
||||
return config
|
||||
end
|
@ -8,10 +8,10 @@ function patch(data)
|
||||
data.backdropImages = jarray{
|
||||
jarray{
|
||||
jarray{0, 0},
|
||||
"/interface/title/" .. (sb.makeRandomSource():randUInt(100) == 0 and "barst" or "starb") .. "ound.png",
|
||||
"/interface/title/" .. (sb.makeRandomSource():randUInt(300) == 0 and "barst" or "starb") .. "ound.png",
|
||||
0.5,
|
||||
jarray{0.5, 0.5}
|
||||
}
|
||||
}
|
||||
return data
|
||||
end
|
||||
end
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"lighting" : {
|
||||
"brightnessLimit" : 1.5
|
||||
"brightnessLimit" : 1.4
|
||||
}
|
||||
}
|
@ -1,6 +1,22 @@
|
||||
--local function drop(color)
|
||||
-- if type(color) == "table" then
|
||||
-- for i = 1, #color do
|
||||
-- color[i] = color[i] * 0.8
|
||||
-- end
|
||||
-- end
|
||||
--end
|
||||
|
||||
function patch(object, path)
|
||||
if object.pointLight ~= true and (object.lightColor or object.lightColors) then
|
||||
object.lightType = "PointAsSpread"
|
||||
return object;
|
||||
return object
|
||||
--elseif type(object.lightColor) == "table" then
|
||||
-- drop(object.lightColor)
|
||||
-- return object
|
||||
--elseif type(object.lightColors) == "table" then
|
||||
-- for i, v in pairs(object.lightColors) do
|
||||
-- drop(v)
|
||||
-- end
|
||||
-- return object
|
||||
end
|
||||
end
|
BIN
assets/opensb/opensb/coconut.png
Normal file
After Width: | Height: | Size: 54 KiB |
7
assets/opensb/rendering/effects/basic.vert
Normal file
@ -0,0 +1,7 @@
|
||||
#version 140
|
||||
|
||||
in vec2 vertexPosition;
|
||||
|
||||
void main() {
|
||||
gl_Position = vec4(vertexPosition, 0.0, 1.0);
|
||||
}
|
@ -1,13 +1,7 @@
|
||||
{
|
||||
"blitFrameBuffer" : "main",
|
||||
|
||||
"effectParameters" : {
|
||||
"vertexRounding" : {
|
||||
"type" : "bool",
|
||||
"default" : false,
|
||||
"uniform" : "vertexRounding"
|
||||
}
|
||||
},
|
||||
"effectParameters" : {},
|
||||
"effectTextures" : {},
|
||||
|
||||
"effectShaders" : {
|
||||
|
@ -1,4 +1,4 @@
|
||||
#version 130
|
||||
#version 140
|
||||
|
||||
uniform sampler2D texture0;
|
||||
uniform sampler2D texture1;
|
||||
@ -14,13 +14,13 @@ out vec4 outColor;
|
||||
void main() {
|
||||
vec4 texColor;
|
||||
if (fragmentTextureIndex == 3)
|
||||
texColor = texture2D(texture3, fragmentTextureCoordinate);
|
||||
texColor = texture(texture3, fragmentTextureCoordinate);
|
||||
else if (fragmentTextureIndex == 2)
|
||||
texColor = texture2D(texture2, fragmentTextureCoordinate);
|
||||
texColor = texture(texture2, fragmentTextureCoordinate);
|
||||
else if (fragmentTextureIndex == 1)
|
||||
texColor = texture2D(texture1, fragmentTextureCoordinate);
|
||||
texColor = texture(texture1, fragmentTextureCoordinate);
|
||||
else
|
||||
texColor = texture2D(texture0, fragmentTextureCoordinate);
|
||||
texColor = texture(texture0, fragmentTextureCoordinate);
|
||||
|
||||
if (texColor.a <= 0.0)
|
||||
discard;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#version 130
|
||||
#version 140
|
||||
|
||||
uniform vec2 textureSize0;
|
||||
uniform vec2 textureSize1;
|
||||
@ -6,7 +6,6 @@ uniform vec2 textureSize2;
|
||||
uniform vec2 textureSize3;
|
||||
uniform vec2 screenSize;
|
||||
uniform mat3 vertexTransform;
|
||||
uniform bool vertexRounding;
|
||||
|
||||
in vec2 vertexPosition;
|
||||
in vec4 vertexColor;
|
||||
@ -21,13 +20,6 @@ void main() {
|
||||
vec2 screenPosition = (vertexTransform * vec3(vertexPosition, 1.0)).xy;
|
||||
gl_Position = vec4(screenPosition / screenSize * 2.0 - 1.0, 0.0, 1.0);
|
||||
|
||||
if (vertexRounding) {
|
||||
if (((vertexData >> 3) & 0x1) == 1)
|
||||
screenPosition.x = round(screenPosition.x);
|
||||
if (((vertexData >> 4) & 0x1) == 1)
|
||||
screenPosition.y = round(screenPosition.y);
|
||||
}
|
||||
|
||||
int vertexTextureIndex = vertexData & 0x3;
|
||||
if (vertexTextureIndex == 3)
|
||||
fragmentTextureCoordinate = vertexTextureCoordinate / textureSize3;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#version 130
|
||||
#version 140
|
||||
|
||||
uniform sampler2D texture0;
|
||||
uniform sampler2D texture1;
|
||||
@ -27,7 +27,7 @@ vec4 cubic(float v) {
|
||||
return vec4(x, y, z, w);
|
||||
}
|
||||
|
||||
vec4 bicubicSample(sampler2D texture, vec2 texcoord, vec2 texscale) {
|
||||
vec4 bicubicSample(sampler2D tex, vec2 texcoord, vec2 texscale) {
|
||||
texcoord = texcoord - vec2(0.5, 0.5);
|
||||
|
||||
float fx = fract(texcoord.x);
|
||||
@ -42,10 +42,10 @@ vec4 bicubicSample(sampler2D texture, vec2 texcoord, vec2 texscale) {
|
||||
vec4 s = vec4(xcubic.x + xcubic.y, xcubic.z + xcubic.w, ycubic.x + ycubic.y, ycubic.z + ycubic.w);
|
||||
vec4 offset = c + vec4(xcubic.y, xcubic.w, ycubic.y, ycubic.w) / s;
|
||||
|
||||
vec4 sample0 = texture2D(texture, vec2(offset.x, offset.z) * texscale);
|
||||
vec4 sample1 = texture2D(texture, vec2(offset.y, offset.z) * texscale);
|
||||
vec4 sample2 = texture2D(texture, vec2(offset.x, offset.w) * texscale);
|
||||
vec4 sample3 = texture2D(texture, vec2(offset.y, offset.w) * texscale);
|
||||
vec4 sample0 = texture(tex, vec2(offset.x, offset.z) * texscale);
|
||||
vec4 sample1 = texture(tex, vec2(offset.y, offset.z) * texscale);
|
||||
vec4 sample2 = texture(tex, vec2(offset.x, offset.w) * texscale);
|
||||
vec4 sample3 = texture(tex, vec2(offset.y, offset.w) * texscale);
|
||||
|
||||
float sx = s.x / (s.x + s.y);
|
||||
float sy = s.z / (s.z + s.w);
|
||||
@ -67,13 +67,13 @@ vec3 sampleLight(vec2 coord, vec2 scale) {
|
||||
void main() {
|
||||
vec4 texColor;
|
||||
if (fragmentTextureIndex == 3)
|
||||
texColor = texture2D(texture3, fragmentTextureCoordinate);
|
||||
texColor = texture(texture3, fragmentTextureCoordinate);
|
||||
else if (fragmentTextureIndex == 2)
|
||||
texColor = texture2D(texture2, fragmentTextureCoordinate);
|
||||
texColor = texture(texture2, fragmentTextureCoordinate);
|
||||
else if (fragmentTextureIndex == 1)
|
||||
texColor = texture2D(texture1, fragmentTextureCoordinate);
|
||||
texColor = texture(texture1, fragmentTextureCoordinate);
|
||||
else
|
||||
texColor = texture2D(texture0, fragmentTextureCoordinate);
|
||||
texColor = texture(texture0, fragmentTextureCoordinate);
|
||||
|
||||
if (texColor.a <= 0.0)
|
||||
discard;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#version 130
|
||||
#version 140
|
||||
|
||||
uniform vec2 textureSize0;
|
||||
uniform vec2 textureSize1;
|
||||
|
Before Width: | Height: | Size: 145 B After Width: | Height: | Size: 145 B |
Before Width: | Height: | Size: 178 B After Width: | Height: | Size: 178 B |
Before Width: | Height: | Size: 174 B After Width: | Height: | Size: 174 B |
@ -1,4 +1,5 @@
|
||||
-- Revert cursor frames if a mod replaced cursors.png with a SD version again
|
||||
-- Otherwise, scale down our HD cursors
|
||||
if assets.image("/cursors/cursors.png"):size()[1] == 64 then
|
||||
local path = "/cursors/opensb/revert.cursor.patch"
|
||||
assets.add(path, '{"scale":null}')
|
||||
@ -8,6 +9,14 @@ if assets.image("/cursors/cursors.png"):size()[1] == 64 then
|
||||
path = "/cursors/opensb/revert.frames.patch"
|
||||
assets.add(path, '{"frameGrid":{"size":[16,16]}}')
|
||||
assets.patch("/cursors/cursors.frames", path)
|
||||
else
|
||||
local cursors = assets.json("/cursors/cursors.frames:frameGrid.names")
|
||||
local path = "/cursors/%s.cursor.patch"
|
||||
for i = 1, #cursors do
|
||||
for j = 1, #cursors[i] do
|
||||
assets.add(string.format(path, cursors[i][j]), '{"scale":1}')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Add object patches
|
||||
@ -15,4 +24,9 @@ local objects = assets.byExtension("object")
|
||||
local path = "/objects/opensb/object.patch.lua"
|
||||
for i = 1, #objects do
|
||||
assets.patch(objects[i], path)
|
||||
end
|
||||
end
|
||||
|
||||
assets.patch(
|
||||
"/interface/windowconfig/songbook.config",
|
||||
"/interface/windowconfig/songbook_search_patch.lua"
|
||||
)
|
@ -21,6 +21,8 @@ command("run", function(src)
|
||||
local success, result = pcall(result)
|
||||
if not success then
|
||||
return "^#f00;error: " .. result
|
||||
elseif result == nil then
|
||||
return nil
|
||||
else
|
||||
local success, printed = pcall(sb.printJson, result)
|
||||
if not success then
|
||||
|
@ -3,41 +3,57 @@ local logHelp = "Available OpenStarbound server commands:\n"
|
||||
local userHelp = logHelp .. "^cyan;"
|
||||
local adminHelp = userHelp
|
||||
|
||||
local function cmd(name, description, permission, func)
|
||||
local function cmd(meta, func)
|
||||
local first = next(commands) == nil
|
||||
logHelp = logHelp .. (first and name or ", " .. name)
|
||||
userHelp = userHelp .. (first and name or ", ^cyan;" .. name)
|
||||
adminHelp = adminHelp .. (first and name or ", ^cyan;" .. name)
|
||||
local name = meta.name
|
||||
local description = meta.description
|
||||
local permission = meta.permission
|
||||
if not meta.hidden then
|
||||
logHelp = logHelp .. (first and name or ", " .. name)
|
||||
userHelp = userHelp .. (first and name or ", ^cyan;" .. name)
|
||||
adminHelp = adminHelp .. (first and name or ", ^cyan;" .. name)
|
||||
end
|
||||
|
||||
local keyName = name:lower()
|
||||
if permission == "tell" then
|
||||
commands[keyName] = function(connectionId, ...)
|
||||
commands[keyName] = {meta = meta, func = function(connectionId, ...)
|
||||
return func(universe.isAdmin(connectionId), connectionId, ...)
|
||||
end
|
||||
end}
|
||||
elseif permission == "admin" then
|
||||
commands[keyName] = function(connectionId, ...)
|
||||
commands[keyName] = {meta = meta, func = function(connectionId, ...)
|
||||
local error = CommandProcessor.adminCheck(connectionId, description:sub(1, 1):lower() .. description:sub(2))
|
||||
if error then
|
||||
return error
|
||||
else
|
||||
return func(connectionId, ...)
|
||||
end
|
||||
end
|
||||
end}
|
||||
elseif permission == "user" then
|
||||
commands[keyName] = func
|
||||
commands[keyName] = {meta = meta, func = func}
|
||||
else
|
||||
error(string.format("Command '%s' has invalid permission", name))
|
||||
end
|
||||
end
|
||||
|
||||
cmd("openhelp", "Get help", "tell", function(isAdmin, connectionId)
|
||||
cmd({
|
||||
name = "openhelp",
|
||||
description = "Get help",
|
||||
permission = "tell"
|
||||
},
|
||||
function(isAdmin, connectionId)
|
||||
return isAdmin and adminHelp or userHelp
|
||||
end)
|
||||
|
||||
do
|
||||
|
||||
local objects = nil
|
||||
cmd("packetTest", "Do science", "admin", function(connectionId)
|
||||
cmd({
|
||||
name = "packetTest",
|
||||
description = "Do science",
|
||||
permission = "admin",
|
||||
hidden = true
|
||||
},
|
||||
function(connectionId)
|
||||
if not objects then
|
||||
objects = {}
|
||||
local paths = root.assetsByExtension("object")
|
||||
@ -69,7 +85,7 @@ function command(commandName, connectionId, args)
|
||||
|
||||
local command = commands[commandName:lower()]
|
||||
if command then
|
||||
local success, ret = pcall(command, connectionId, table.unpack(args))
|
||||
local success, ret = pcall(command.func, connectionId, table.unpack(args))
|
||||
if not success then
|
||||
sb.logError("Error in OpenStarbound server command /%s: %s", commandName, ret)
|
||||
return "command error: " .. ret
|
||||
|
415
doc/lua/openstarbound.md
Normal file
@ -0,0 +1,415 @@
|
||||
# Unsorted
|
||||
|
||||
These are functions that aren't in any specific table.
|
||||
|
||||
---
|
||||
|
||||
#### `Maybe<LuaFunction>, Maybe<String>` loadstring(`String` source, [`String` name, [`LuaValue` env]])
|
||||
|
||||
Compiles the provided **source** and returns it as a callable function.
|
||||
If there are any syntax errors, returns `nil` and the error as a string instead.
|
||||
|
||||
- **name** is used for error messages, the default is the name of the script that called `loadstring`.
|
||||
- **env** is used as the environment of the returned function, the default is `_ENV`.
|
||||
|
||||
---
|
||||
|
||||
# Root
|
||||
|
||||
The root table now contains extra asset bindings and bindings to return the tile variant that is used for material and matmods at any position.
|
||||
|
||||
---
|
||||
|
||||
#### `String[]` root.assetsByExtension(`String` extension)
|
||||
|
||||
Returns an array containing all assets with the specified file extension.
|
||||
|
||||
By the way, here's a list of every file extension the game does Special Things™ for when loading assets.
|
||||
|
||||
<details><summary><b>File Extensions</b></summary>
|
||||
|
||||
- Items: `item`, `liqitem`, `matitem`, `miningtool`, `flashlight`, `wiretool`, `beamaxe`, `tillingtool`, `painttool`, `harvestingtool`, `head`, `chest`, `legs`, `back`, `currency`, `consumable`, `blueprint`, `inspectiontool`, `instrument`, `thrownitem`, `unlock`, `activeitem`, `augment`
|
||||
- Materials: `material`, `matmod`
|
||||
- Liquids: `liquid`
|
||||
- NPCs: `npctype`
|
||||
- Tenants: `tenant`
|
||||
- Objects: `object`
|
||||
- Vehicles: `vehicle`
|
||||
- Monsters: `monstertype`, `monsterpart`, `monsterskill`, `monstercolors`
|
||||
- Plants: `modularstem`, `modularfoliage`, `grass`, `bush`
|
||||
- Projectiles: `projectile`
|
||||
- Particles: `particle`
|
||||
- Name Gen: `namesource`
|
||||
- AI Missions: `aimission`
|
||||
- Quests: `questtemplate`
|
||||
- Radio Messages: `radiomessages`
|
||||
- Spawn Types: `spawntypes`
|
||||
- Species: `species`
|
||||
- Stagehand: `stagehand`
|
||||
- Behaviors: `nodes`, `behavior`
|
||||
- Biomes: `biome`, `weather`
|
||||
- Terrain: `terrain`
|
||||
- Treasure: `treasurepools`, `treasurechests`
|
||||
- Codex Entries: `codex`
|
||||
- Collections: `collection`
|
||||
- Statistics: `event`, `achievement`
|
||||
- Status Effects: `statuseffect`
|
||||
- Functions: `functions`, `2functions`, `configfunctions`
|
||||
- Tech: `tech`
|
||||
- Damage: `damage`
|
||||
- Dances: `dance`
|
||||
- Effect Sources: `effectsource`
|
||||
- Command Macros: `macros`
|
||||
- Recipes: `recipe`
|
||||
</details>
|
||||
|
||||
#### `String` root.assetData(`String` path)
|
||||
|
||||
Returns the raw data of an asset.
|
||||
|
||||
#### `String, Maybe<LuaTable>` root.assetOrigin(`String` path, [`bool` getPatches])
|
||||
|
||||
Returns the asset source path of an asset, or nil if the asset doesn't exist. If you specify getPatches as true then also returns the patches for the asset as an array, each element containing the source path and patch path in indexes 1 and 2 respectively.
|
||||
|
||||
#### `LuaTable` root.assetSourcePaths([`bool` withMetadata])
|
||||
|
||||
Without metadata: Returns an array with all the asset source paths.
|
||||
With metadata: Returns a table, key/value being source path/metadata.
|
||||
|
||||
#### `?` root.assetImage(`String` image)
|
||||
|
||||
*TODO*
|
||||
|
||||
#### `JsonArray` root.assetPatches(`String` asset)
|
||||
|
||||
Returns a list of asset sources which patch the specified asset and the paths to those patches.
|
||||
|
||||
---
|
||||
|
||||
#### `Json` root.getConfiguration(`String` key)
|
||||
|
||||
Gets a configuration value in `/storage/starbound.config`.
|
||||
|
||||
#### `Json` root.getConfigurationPath(`String` path)
|
||||
|
||||
Gets a configuration value in `/storage/starbound.config` by path.
|
||||
|
||||
*Both getters will error if you try to get `title`, as that can contain the player's saved server login.*
|
||||
|
||||
#### `Json` root.setConfiguration(`String` key, `Json` value)
|
||||
|
||||
Sets a configuration value in `/storage/starbound.config`.
|
||||
|
||||
#### `Json` root.setConfigurationPath(`String` path, `Json` value)
|
||||
|
||||
Sets a configuration value in `/storage/starbound.config` by path.
|
||||
|
||||
*Both setters will error if you try to set `safeScripts`, as that can break Starbound's sandbox.*
|
||||
|
||||
---
|
||||
|
||||
#### `JsonArray` root.allRecipes()
|
||||
|
||||
Returns all recipes.
|
||||
|
||||
---
|
||||
|
||||
# Player
|
||||
|
||||
The player table now contains bindings which contains functions to save/load, access and modify the player's identity, mode, aim, emote and more.
|
||||
|
||||
---
|
||||
|
||||
#### `Json` player.save()
|
||||
|
||||
Serializes the player to Json the same way Starbound does for disk storage and returns it.
|
||||
|
||||
#### `void` player.load(`Json` save)
|
||||
|
||||
Reloads the player from a Json **save**. This will reset active ScriptPanes and scripts running on the player.
|
||||
|
||||
---
|
||||
|
||||
#### `String` player.name()
|
||||
|
||||
Returns the player's name.
|
||||
|
||||
#### `void` player.setName(`String` name)
|
||||
|
||||
Sets the player's name.
|
||||
|
||||
---
|
||||
|
||||
#### `String` player.description()
|
||||
|
||||
Returns the player's description.
|
||||
|
||||
#### `void` player.setDescription(`String` description)
|
||||
|
||||
Sets the player's description. The new description will not be networked buntil the player warps or respawns.
|
||||
|
||||
---
|
||||
|
||||
#### `void` player.setSpecies(`String` species)
|
||||
|
||||
Sets the player's species. Must be a valid species.
|
||||
|
||||
---
|
||||
|
||||
#### `void` player.setGender(`String` gender)
|
||||
|
||||
Sets the player's gender.
|
||||
|
||||
---
|
||||
|
||||
#### `String` player.imagePath()
|
||||
|
||||
If the player has a custom humanoid image path set, returns it. otherwise, returns `nil`.
|
||||
|
||||
#### `void` player.setImagePath(`String` imagePath)
|
||||
|
||||
Sets the player's image path. Specify `nil` to remove the image path.
|
||||
|
||||
---
|
||||
|
||||
#### `Personality` player.personality()
|
||||
|
||||
Returns the player's personality as a `table` containing a `string` idle, `string` armIdle, `Vec2F` headOffset and `Vec2F` armOffset.
|
||||
|
||||
#### `void` player.setPersonality(`Personality` personality)
|
||||
|
||||
Sets the player's personality. The **personality** must be a `table` containing at least one value as returned by `player.personality()`.
|
||||
|
||||
---
|
||||
|
||||
#### `String` player.bodyDirectives()
|
||||
|
||||
Returns the player's body directives.
|
||||
|
||||
#### `void` player.setBodyDirectives(`String` bodyDirectives)
|
||||
|
||||
Sets the player's body directives.
|
||||
|
||||
---
|
||||
|
||||
#### `String` player.emoteDirectives()
|
||||
|
||||
Returns the player's emote directives.
|
||||
|
||||
#### `void` player.setEmoteDirectives(`String` emoteDirectives)
|
||||
|
||||
Sets the player's emote directives.
|
||||
|
||||
---
|
||||
|
||||
#### `String` player.hair()
|
||||
|
||||
Returns the player's hair group.
|
||||
|
||||
#### `void` player.setHair(`String` hairGroup)
|
||||
|
||||
Sets the player's hair group.
|
||||
|
||||
---
|
||||
|
||||
#### `String` player.hairType()
|
||||
|
||||
Returns the player's hair type.
|
||||
|
||||
#### `void` player.setHairType(`String` hairType)
|
||||
|
||||
Sets the player's hair type.
|
||||
|
||||
---
|
||||
|
||||
#### `String` player.hairDirectives()
|
||||
|
||||
Returns the player's hair directives.
|
||||
|
||||
#### `void` player.setHairDirectives(`String` hairDirectives)
|
||||
|
||||
Sets the player's hair directives.
|
||||
|
||||
---
|
||||
|
||||
#### `String` player.facialHair()
|
||||
|
||||
Returns the player's facial hair type. Same as player.facialHairType?
|
||||
|
||||
#### `void` player.setFacialHair(`String` facialHairGroup, `String` facialHairType, `String` facialHairDirectives)
|
||||
|
||||
Sets the player's facial hair group, type, and directives.
|
||||
|
||||
---
|
||||
|
||||
#### `String` player.facialHairType()
|
||||
|
||||
Returns the player's facial hair type.
|
||||
|
||||
#### `void` player.setFacialHairType(`String` facialHairType)
|
||||
|
||||
Sets the player's facial hair type.
|
||||
|
||||
---
|
||||
|
||||
#### `String` player.facialHairGroup()
|
||||
|
||||
Returns the player's facial hair group.
|
||||
|
||||
#### `void` player.setFacialHairGroup(`String` facialHairGroup)
|
||||
|
||||
Sets the player's facial hair group.
|
||||
|
||||
---
|
||||
|
||||
#### `String` player.facialHairDirectives()
|
||||
|
||||
Returns the player's facial hair directives.
|
||||
|
||||
#### `void` player.setFacialHairDirectives(`String` facialHairDirectives)
|
||||
|
||||
Sets the player's facial hair directives.
|
||||
|
||||
---
|
||||
|
||||
#### `String` player.facialMask()
|
||||
|
||||
Returns the player's facial mask group.
|
||||
|
||||
#### `void` player.setFacialMask(`String` facialMaskGroup, `String` facialMaskType, `String` facialMaskDirectives)
|
||||
|
||||
Sets the player's facial mask group, type, and directives.
|
||||
|
||||
---
|
||||
|
||||
#### `String` player.facialMaskDirectives()
|
||||
|
||||
Returns the player's facial mask directives.
|
||||
|
||||
#### `void` player.setFacialMaskDirectives(`String` facialMaskDirectives)
|
||||
|
||||
Sets the player's facial mask directives.
|
||||
|
||||
---
|
||||
|
||||
#### `PlayerMode` player.mode()
|
||||
|
||||
Returns the player's mode.
|
||||
|
||||
#### `void` player.setMode(`String` mode)
|
||||
|
||||
Sets the player's mode. **mode** must be either `"casual"`, `"survival"` or `"hardcore"`.
|
||||
|
||||
---
|
||||
|
||||
#### `Color` player.favoriteColor()
|
||||
|
||||
Returns the player's favorite color.
|
||||
It is used for the beam shown when wiring, placing, and highlighting with beam-tools (Matter Manipulator).
|
||||
|
||||
#### `void` player.setFavoriteColor(`Color` color)
|
||||
|
||||
Sets the player's favorite color. **color** can have an optional fourth value for transparency.
|
||||
|
||||
---
|
||||
|
||||
#### `Vec2F` player.aimPosition()
|
||||
|
||||
Returns the player's aim position.
|
||||
|
||||
---
|
||||
|
||||
#### `void` player.emote(`String` emote, [`float` cooldown])
|
||||
|
||||
Makes the player do an emote with the default cooldown unless a **cooldown** is specified.
|
||||
|
||||
#### `String, float` player.currentEmote()
|
||||
|
||||
Returns the player's current emote and the seconds left in it.
|
||||
|
||||
---
|
||||
|
||||
#### `unsigned` player.actionBarGroup()
|
||||
|
||||
Returns the player's active action bar.
|
||||
|
||||
#### `void` player.setActionBarGroup(`unsigned` barId)
|
||||
|
||||
Sets the player's active action bar.
|
||||
|
||||
#### `Variant<unsigned, EssentialItem>` player.selectedActionBarSlot()
|
||||
|
||||
Returns the player's selected action bar slot.
|
||||
|
||||
#### `void` player.setSelectedActionBarSlot(`Variant<unsigned, EssentialItem>` slot)
|
||||
|
||||
Sets the player's selected action bar slot.
|
||||
|
||||
#### `void` player.setDamageTeam(`DamageTeam` team)
|
||||
|
||||
Sets the player's damage team. This must be called every frame to override the current damage team that the server has given the player (normally controlled by /pvp)
|
||||
|
||||
---
|
||||
|
||||
#### `void` player.say(`String` line)
|
||||
|
||||
Makes the player say a string.
|
||||
|
||||
---
|
||||
|
||||
#### `Json` player.humanoidIdentity()
|
||||
|
||||
Returns the specific humanoid identity of the player, containing information such as hair style and idle pose.
|
||||
|
||||
#### `void` player.setHumanoidIdentity(`Json` humanoidIdentity)
|
||||
|
||||
Sets the specific humanoid identity of the player.
|
||||
|
||||
---
|
||||
|
||||
#### `ItemDescriptor` player.item(`ItemSlot` itemSlot)
|
||||
|
||||
Returns the contents of the specified itemSlot.
|
||||
|
||||
#### `void` player.setItem(`ItemSlot` itemSlot, `ItemDescriptor` item)
|
||||
|
||||
Puts the specified item into the specified itemSlot.
|
||||
Item slots in item bags are structured like so: `{String bagName, int slot}`
|
||||
|
||||
---
|
||||
|
||||
#### `int` player.itemBagSize(`String` itemBagName)
|
||||
|
||||
Returns the size of an item bag.
|
||||
|
||||
#### `bool` player.itemAllowedInBag(`String` itemBagName, `ItemDescriptor` item)
|
||||
|
||||
Returns whether the specified item can enter the specified item bag.
|
||||
|
||||
---
|
||||
|
||||
#### `ActionBarLink` player.actionBarSlotLink(`int` slot, `String` hand)
|
||||
|
||||
Returns the contents of the specified action bar link slot's specified hand.
|
||||
|
||||
#### `bool` player.setActionBarSlotLink(`String` itemBagName, `ItemDescriptor` item)
|
||||
|
||||
Returns whether the specified item can enter the specified item bag.
|
||||
|
||||
---
|
||||
|
||||
#### `Float` player.interactRadius()
|
||||
|
||||
Returns the player's interact radius.
|
||||
|
||||
#### `void` player.setInteractRadius(`Float` interactRadius)
|
||||
|
||||
Sets the player's interact radius. This does not persist upon returning to the main menu.
|
||||
|
||||
---
|
||||
|
||||
#### `JsonArray` player.availableRecipes()
|
||||
|
||||
Returns all the recipes the player can craft with their currently held items and currencies.
|
||||
|
||||
---
|
@ -21,6 +21,7 @@ cp \
|
||||
lib/linux/libsteam_api.so \
|
||||
scripts/ci/linux/sbinit.config \
|
||||
scripts/ci/linux/run-client.sh \
|
||||
scripts/steam_appid.txt \
|
||||
client_distribution/linux/
|
||||
|
||||
mkdir -p server_distribution
|
||||
@ -33,11 +34,21 @@ touch server_distribution/mods/mods_go_here
|
||||
|
||||
mkdir -p server_distribution/linux
|
||||
|
||||
# makes the server function on older Linux versions (this is so stupid)
|
||||
nm --dynamic --undefined-only --with-symbol-versions dist/starbound_server | grep GLIBC_2.29
|
||||
./scripts/ci/linux/patchelf dist/starbound_server \
|
||||
--clear-symbol-version exp \
|
||||
--clear-symbol-version exp2 \
|
||||
--clear-symbol-version log \
|
||||
--clear-symbol-version log2 \
|
||||
--clear-symbol-version pow
|
||||
|
||||
cp \
|
||||
dist/starbound_server \
|
||||
dist/btree_repacker \
|
||||
scripts/ci/linux/run-server.sh \
|
||||
scripts/ci/linux/sbinit.config \
|
||||
scripts/steam_appid.txt \
|
||||
server_distribution/linux/
|
||||
|
||||
tar -cvf dist.tar dist
|
||||
|
BIN
scripts/ci/linux/patchelf
Executable file
@ -24,4 +24,5 @@ cp \
|
||||
dist/planet_mapgen \
|
||||
scripts/ci/macos/sbinit.config \
|
||||
scripts/ci/macos/run-server.sh \
|
||||
scripts/steam_appid.txt \
|
||||
client_distribution/osx/
|
@ -8,6 +8,7 @@ mkdir %client%\mods
|
||||
mkdir %client%\logs
|
||||
mkdir %client%\assets
|
||||
mkdir %client%\win
|
||||
echo 211820 > %client%\win\steam_appid.txt
|
||||
|
||||
set server=server_distribution
|
||||
if exist %server% rmdir %server% /S /Q
|
||||
|
@ -136,6 +136,8 @@ endif()
|
||||
|
||||
option(STAR_LUA_APICHECK "Use lua api checks" OFF)
|
||||
option(STAR_USE_JEMALLOC "Use jemalloc allocators" OFF)
|
||||
option(STAR_USE_MIMALLOC "Use mimalloc allocators" OFF)
|
||||
option(STAR_USE_RPMALLOC "Use rpmalloc allocators" OFF)
|
||||
|
||||
# Report all the discovered system / environment settings and all options.
|
||||
|
||||
@ -174,6 +176,8 @@ endif()
|
||||
|
||||
message(STATUS "Using Lua API checks: ${STAR_LUA_APICHECK}")
|
||||
message(STATUS "Using jemalloc: ${STAR_USE_JEMALLOC}")
|
||||
message(STATUS "Using mimalloc: ${STAR_USE_MIMALLOC}")
|
||||
message(STATUS "Using rpmalloc: ${STAR_USE_RPMALLOC}")
|
||||
|
||||
# Set C defines and cmake variables based on the build settings we have now
|
||||
# determined...
|
||||
@ -244,6 +248,10 @@ endif()
|
||||
|
||||
if(STAR_USE_JEMALLOC)
|
||||
add_definitions(-DSTAR_USE_JEMALLOC)
|
||||
elseif(STAR_USE_MIMALLOC)
|
||||
add_definitions(-DSTAR_USE_MIMALLOC)
|
||||
elseif(STAR_USE_RPMALLOC)
|
||||
add_definitions(-DSTAR_USE_RPMALLOC -DENABLE_PRELOAD)
|
||||
endif()
|
||||
|
||||
# Set C/C++ compiler flags based on build environment...
|
||||
@ -449,6 +457,11 @@ if(STAR_USE_JEMALLOC)
|
||||
set(STAR_EXT_LIBS ${JEMALLOC_LIBRARY})
|
||||
endif()
|
||||
|
||||
if (STAR_USE_MIMALLOC)
|
||||
find_package(mimalloc CONFIG REQUIRED)
|
||||
set(STAR_EXT_LIBS ${STAR_EXT_LIBS} $<IF:$<TARGET_EXISTS:mimalloc-static>,mimalloc-static,mimalloc>)
|
||||
endif()
|
||||
|
||||
find_package(ZLIB REQUIRED)
|
||||
find_package(PNG REQUIRED)
|
||||
find_package(Freetype REQUIRED)
|
||||
|
@ -31,7 +31,8 @@
|
||||
"VCPKG_TARGET_TRIPLET": "x64-windows-mixed-md",
|
||||
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL",
|
||||
"CMAKE_INCLUDE_PATH": "${sourceParentDir}/lib/windows/include",
|
||||
"CMAKE_LIBRARY_PATH": "${sourceParentDir}/lib/windows"
|
||||
"CMAKE_LIBRARY_PATH": "${sourceParentDir}/lib/windows",
|
||||
"STAR_USE_RPMALLOC": true
|
||||
},
|
||||
"vendor": {
|
||||
"microsoft.com/VisualStudioSettings/CMake/1.0": {
|
||||
|
@ -18,6 +18,10 @@ namespace Star {
|
||||
LPWSTR* argsList = CommandLineToArgvW(GetCommandLineW(), &nArgs); \
|
||||
Star::StringList args; \
|
||||
for (int i = 0; i < nArgs; ++i) args.append(Star::String(argsList[i])); \
|
||||
if (IsDebuggerPresent() && AllocConsole()) { \
|
||||
freopen("CONOUT$", "w", stdout); \
|
||||
freopen("CONOUT$", "w", stderr); \
|
||||
} \
|
||||
return Star::runMainApplication(Star::make_unique<ApplicationClass>(), args); \
|
||||
}
|
||||
|
||||
|
@ -90,23 +90,23 @@ Maybe<Key> keyFromSdlKeyCode(SDL_Keycode sym) {
|
||||
{SDLK_y, Key::Y},
|
||||
{SDLK_z, Key::Z},
|
||||
{SDLK_DELETE, Key::Delete},
|
||||
{SDLK_KP_0, Key::Kp0},
|
||||
{SDLK_KP_1, Key::Kp1},
|
||||
{SDLK_KP_2, Key::Kp2},
|
||||
{SDLK_KP_3, Key::Kp3},
|
||||
{SDLK_KP_4, Key::Kp4},
|
||||
{SDLK_KP_5, Key::Kp5},
|
||||
{SDLK_KP_6, Key::Kp6},
|
||||
{SDLK_KP_7, Key::Kp7},
|
||||
{SDLK_KP_8, Key::Kp8},
|
||||
{SDLK_KP_9, Key::Kp9},
|
||||
{SDLK_KP_PERIOD, Key::Kp_period},
|
||||
{SDLK_KP_DIVIDE, Key::Kp_divide},
|
||||
{SDLK_KP_MULTIPLY, Key::Kp_multiply},
|
||||
{SDLK_KP_MINUS, Key::Kp_minus},
|
||||
{SDLK_KP_PLUS, Key::Kp_plus},
|
||||
{SDLK_KP_ENTER, Key::Kp_enter},
|
||||
{SDLK_KP_EQUALS, Key::Kp_equals},
|
||||
{SDLK_KP_0, Key::Keypad0},
|
||||
{SDLK_KP_1, Key::Keypad1},
|
||||
{SDLK_KP_2, Key::Keypad2},
|
||||
{SDLK_KP_3, Key::Keypad3},
|
||||
{SDLK_KP_4, Key::Keypad4},
|
||||
{SDLK_KP_5, Key::Keypad5},
|
||||
{SDLK_KP_6, Key::Keypad6},
|
||||
{SDLK_KP_7, Key::Keypad7},
|
||||
{SDLK_KP_8, Key::Keypad8},
|
||||
{SDLK_KP_9, Key::Keypad9},
|
||||
{SDLK_KP_PERIOD, Key::KeypadPeriod},
|
||||
{SDLK_KP_DIVIDE, Key::KeypadDivide},
|
||||
{SDLK_KP_MULTIPLY, Key::KeypadMultiply},
|
||||
{SDLK_KP_MINUS, Key::KeypadMinus},
|
||||
{SDLK_KP_PLUS, Key::KeypadPlus},
|
||||
{SDLK_KP_ENTER, Key::KeypadEnter},
|
||||
{SDLK_KP_EQUALS, Key::KeypadEquals},
|
||||
{SDLK_UP, Key::Up},
|
||||
{SDLK_DOWN, Key::Down},
|
||||
{SDLK_RIGHT, Key::Right},
|
||||
@ -131,6 +131,15 @@ Maybe<Key> keyFromSdlKeyCode(SDL_Keycode sym) {
|
||||
{SDLK_F13, Key::F13},
|
||||
{SDLK_F14, Key::F14},
|
||||
{SDLK_F15, Key::F15},
|
||||
{SDLK_F16, Key::F16},
|
||||
{SDLK_F17, Key::F17},
|
||||
{SDLK_F18, Key::F18},
|
||||
{SDLK_F19, Key::F19},
|
||||
{SDLK_F20, Key::F20},
|
||||
{SDLK_F21, Key::F21},
|
||||
{SDLK_F22, Key::F22},
|
||||
{SDLK_F23, Key::F23},
|
||||
{SDLK_F24, Key::F24},
|
||||
{SDLK_NUMLOCKCLEAR, Key::NumLock},
|
||||
{SDLK_CAPSLOCK, Key::CapsLock},
|
||||
{SDLK_SCROLLLOCK, Key::ScrollLock},
|
||||
@ -235,7 +244,9 @@ public:
|
||||
SDL_free(basePath);
|
||||
}
|
||||
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 18)
|
||||
SDL_SetHint(SDL_HINT_IME_SHOW_UI, "1");
|
||||
#endif
|
||||
|
||||
m_signalHandler.setHandleInterrupt(true);
|
||||
m_signalHandler.setHandleFatal(true);
|
||||
@ -303,6 +314,10 @@ public:
|
||||
int height;
|
||||
SDL_GetWindowSize(m_sdlWindow, &width, &height);
|
||||
m_windowSize = Vec2U(width, height);
|
||||
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
|
||||
|
||||
m_sdlGlContext = SDL_GL_CreateContext(m_sdlWindow);
|
||||
if (!m_sdlGlContext)
|
||||
|
@ -81,7 +81,11 @@ void PcP2PNetworkingService::setJoinRemote(HostAddressWithPort location) {
|
||||
setJoinLocation(JoinRemote(location));
|
||||
}
|
||||
|
||||
void Star::PcP2PNetworkingService::setActivityData([[maybe_unused]] String const& title, [[maybe_unused]] Maybe<pair<uint16_t, uint16_t>> party) {
|
||||
void Star::PcP2PNetworkingService::setActivityData(
|
||||
[[maybe_unused]] const char* title,
|
||||
[[maybe_unused]] const char* details,
|
||||
[[maybe_unused]] int64_t startTime,
|
||||
[[maybe_unused]] Maybe<pair<uint16_t, uint16_t>> party) {
|
||||
#ifdef STAR_ENABLE_DISCORD_INTEGRATION
|
||||
MutexLocker discordLocker(m_state->discordMutex);
|
||||
#endif
|
||||
@ -92,19 +96,25 @@ void Star::PcP2PNetworkingService::setActivityData([[maybe_unused]] String const
|
||||
if (m_discordUpdatingActivity)
|
||||
return;
|
||||
|
||||
if (title != m_discordActivityTitle || party != m_discordPartySize || m_discordForceUpdateActivity) {
|
||||
if (title != m_discordActivityTitle
|
||||
|| details != m_discordActivityDetails
|
||||
|| startTime != m_discordActivityStartTime || party != m_discordPartySize || m_discordForceUpdateActivity) {
|
||||
m_discordForceUpdateActivity = false;
|
||||
m_discordPartySize = party;
|
||||
m_discordActivityTitle = title;
|
||||
m_discordActivityDetails = details;
|
||||
m_discordActivityStartTime = startTime;
|
||||
|
||||
discord::Activity activity = {};
|
||||
activity.SetType(discord::ActivityType::Playing);
|
||||
activity.SetName("Starbound");
|
||||
activity.SetState(title.utf8Ptr());
|
||||
|
||||
if (auto p = party) {
|
||||
activity.GetParty().GetSize().SetCurrentSize(p->first);
|
||||
activity.GetParty().GetSize().SetMaxSize(p->second);
|
||||
activity.SetState(title);
|
||||
activity.SetDetails(details);
|
||||
activity |