You are viewing a potentially older version of this package. View all versions.
toes-Socks-0.2.1 icon

Socks

Socks is a library to facilitate joy in Webfishing mod development

Date uploaded a year ago
Version 0.2.1
Download link toes-Socks-0.2.1.zip
Downloads 9775
Dependency string toes-Socks-0.2.1

This mod requires the following mods to function

toes-NoNameFix-1.0.0 icon
toes-NoNameFix

Hotfix for annoying no-name chat bug, by Toes & Balls

Preferred version: 1.0.0

README

Toes.Socks

WebFishing development library

About

Socks is an evolving (work-in-progress) development library for 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.

The Players module is borrowed from BlueberryWolf's but with performance and developer-experience improvements at the cost of being backward-compatible. Nonetheless, you should find Socks.Players will suit your existing needs without many changes. In addition, our modules introduce convenient utilities to make mod building more straightforward. The Socks.Chat module was created to address the naturally opaque and cumbersome process of hooking into the game's chat methods.

Usage

Documentation is generated from comments within the source files. Be sure to check it out!

Example

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

func _ready():
	Chat.connect("player_messaged", self, "_on_player_messaged")


func _on_player_messaged(message: String, player_name: String, is_self: bool):
	if is_self: return

	Chat.send("Hi, %s!" % player_name)

Example projects

Help

Please feel free to submit RFC issues with ideas for new utilities or even modules. I can be reached on Discord @toes for discussion, collaboration, or questions. If you need general help building mods, I suggest joining the Webfishing Modding Discord.

CHANGELOG

Changelog

v0.1001.5

  • Changed Socks modules to load as early as possible during _init hook rather than _ready
  • Fixed issue rebinding hotkeys with modifiers
  • Added/fixed handling of hotkeys.json should the file become corrupted

v0.1001.3

Happy Holidays ☃️

No changes

v0.1001.1

Happy Thanksgiving 🦃

No changes

v0.1001.00

Fixes regression in Chat module player-name parsing that was introduced in LucysLib compatibility changes

v0.1000.13

Happy Halloween 🦇

No changes

v0.1000.0

  • Add: Chat `player_emoted signal
  • Enhanced reliability of ingame and outgame signals
    • This is potentially a breaking change if your mod relies on inconsistent behavior
  • Added new Players signal at_main_menu
  • Fixed Players.get_lobby_owner throwing assertion errors if there was no Actor assigned to the host
    • This is potentially a breaking change as it now explicitly returns null (safely)

v0.999.1 - Misc

  • Hotfixed skip_if_busy hotkey option not saving
  • Added Players.is_ignored to replace Players.is_player_ignored
  • Changed Players.is_ignored to check and consider if the player has been ignored/blocked through Steam

v0.999.0 - New Socks.Hotkeys module

  • Version 1 pre-release build

v0.5.0

  • New Chat.send_letter wrapper method

v0.4.0

  • New outgame signal emitted from Players
    • You can use this like ingame instead of testing for the existence of Players.local_player etc
  • Fixed Players.in_game was never properly reset to false after leaving a game
    • We'd sorta never ended up using this, personally, and honestly forgot about it until now, sorry!

v0.3.3

  • Hotfixed URI messages causing crash; sorry!
    • This happened because of an infinite loop! Link messages would trigger another link and so on.
    • Fixed this by adding a negative-lookahead to the match to exclude messages with BBCode [url=example.com]link[/url]

v0.3.2

  • Hotfixed Chat module issues caused by recent LucyTools update/conflict causing messages to include unexpected BBCode

v0.3.1

  • Hotfixed issue with URIs not being detected due to presence of BBCode in messages (LucyTools mod conflict)

v0.3.0

  • New Socks.Utils module
  • Added Players.get_lobby_owner for retrieving the current lobby's host
  • Changed Players methods to default to the local player when appropriate:
    • get_username
    • get_title
    • get_id
    • get_chat_color
    • get_position
  • Chat links should now open in your browser rather than within the Steam overlay
  • Opening Discord links will now require viewing a safety warning and confirmation from the user

v0.2.7

  • Fixes Recently Seen Players Steam integration. Now everyone you meet in lobbies will be listed in your Game Overview > Recent Players UI.

v0.2.6

  • Hotfix Players.chat

v0.2.5

  • Added Players.is_player_ignored helpers for checking if a player has been muted or blocked

v0.2.4

  • Links will now generate for URL's in messages even when the message contains other preceding text
  • System messages (e.g., MOTD) will now also generate clickable [LINK]s

v0.2.1

  • Added clickable links for URLs pasted into game chat

v0.2.0

  • Fixed player_removed event not emitting as expected
  • Dependency on NoNameFix changed to v1.0.0

v0.1.99

New Socks.Chat methods

  • get_all, get_chatbox

New Socks.Players methods

  • Players.get_chat_color
  • Players.get_names
  • Players.find