Details

Last Updated
3 hours ago
First Uploaded
3 hours ago
Downloads
23K
Likes
4
Size
104KB
Dependency string
toes-Socks-0.999.2
Dependants

Socks

Sockpuppet pixel art
Sockpuppet pixel art by okayo top hat

Socks is the best library for Webfishing modders writing GDWeave mods.

Our motivation publishing this library is primarily to share these solutions and utilities we've written to address problems we've personally encountered while making mods, with the hopes you might be able to spend more time focused on fun than overcoming technical roadblocks.

You may also like to check out Better Webfishing Mod Template for a template/guide to making patch mods that write over the game's code.


## Example Usage of building a mod with Socks

onready var Players = get_node("/root/ToesSocks/Players")
onready var Chat = get_node("/root/ToesSocks/Chat")

var currently_worn_hat := "hat_none"
var is_lobby_owner := false

func _ready():
	Chat.connect("player_messaged", self, "_on_player_messaged")
	Players.connect("ingame", self, "_on_ingame")
	Players.connect("outgame", self, "_on_outgame")


func _on_player_messaged(message: String, player_name: String, is_self: bool):
	if is_self: return
	Chat.send("Hi, %s!" % player_name)


func _on_ingame() -> void:
	# Initialize mod, once we are in-game
	currently_worn_hat = Players.get_cosmetics()["hat"]
	is_lobby_owner = Players.local_player == Players.get_lobby_owner()


func _on_outgame() -> void:
	# Teardown in prep for next lobby
	currently_worn_hat = "hat_none"
	is_lobby_owner = false

Modules

GDScriptify has started breaking when generating our docs - forgive our outdated docs in the meantime until we fix that...

Chat

Players

Hotkeys

# tablecopter.gd

var enabled := false
func _ready():
	# T Hotkey
	var toggle_signal_name = Hotkeys.add(
		{"name": "toggle_tablecopter", "label": "Toggle Tablecopter", "key_code": KEY_T, "repeat": false }
	)
	Hotkeys.connect(toggle_signal_name, self, "_handle_toggle")

	# CTRL+T Hotkey
	var mode_toggle_signal_name = Hotkeys.add(
		{"name": HOTKEY_NAME + "_mode", "label": HOTKEY_LABEL + " Mode", "key_code": KEY_T, "repeat": false, "modifiers": ["control"] }
	)
	Hotkeys.connect(mode_toggle_signal_name, self, "_handle_mode_toggle")

func _handle_toggle():
	enabled = !enabled

See Hotkey Configuration Documentation for all hotkey options

Example projects


📚 Project Links

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.