This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { ForgeConfig } from "@electron-forge/shared-types"; | |
import { MakerSquirrel } from "@electron-forge/maker-squirrel"; | |
import { MakerZIP } from "@electron-forge/maker-zip"; | |
import { WebpackPlugin } from "@electron-forge/plugin-webpack"; | |
import { mainConfig, rendererConfig } from "./webpack.config"; | |
const config: ForgeConfig = { | |
packagerConfig: { | |
name: "App Name", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class_name App | |
extends Node | |
@export var WSS_URL: String = "ws://127.0.0.1:3000/server" | |
@export var client: Client = null | |
var _logger: Logger = null | |
func _enter_tree() -> void: | |
_logger = preload("res://src/classes/logger.gd").new("%s -> %s" % [get_parent().name, name]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends HBoxContainer | |
@export_dir var flagDir : String = "" | |
@export var flagImg : TextureRect = null | |
@export var optionBtn : OptionButton = null | |
var _flags : Array[Dictionary] = [] | |
var _logger : Logger = null | |
func _enter_tree() -> void: | |
_logger = preload("res://src/core/scripts/logger.gd").new("%s -> %s" % [get_parent().name, name]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Node | |
@onready var scene_root = get_tree().root if not Engine.is_editor_hint() else Engine.get_main_loop().editor_scene_root | |
@onready var rng := RandomNumberGenerator.new() | |
func _ready() -> void: | |
rng.randomize() | |
func wait_for(time: float, function: Callable, node: Node = null) -> Signal: | |
var _time = float(time) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Node | |
signal is_completed | |
@export_range(1.0, 10.0, 0.5) var LOADER_WAIT_TIME : float = 3.0 | |
@onready var _logger = null # preload("res://utils/scripts/logger.gd").new().set_module("%s -> %s" % [self.get_parent().name, self.name]) | |
var _queue : Dictionary = {} | |
var _progress : Array[float] = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Node2D | |
class_name MovementController | |
var player : CharacterBody2D = null | |
func _ready(): | |
var parent = self.get_parent() | |
if parent: | |
if parent.get_class() == "CharacterBody2D": player = parent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func look_at_direction(velocity : Vector2) -> String: | |
return _get_direction_string(velocity.angle()) | |
func _get_direction_string(angle : float) -> String: | |
var angle_deg = round(rad_to_deg(angle)) | |
var direction : String = "" | |
if angle_deg <= 15.0 and angle_deg >= -15.0: direction = "RIGHT" | |
elif angle_deg <= 60.0 and angle_deg >= 15.0: direction = "BOTTOMRIGHT" | |
elif angle_deg <= 120.0 and angle_deg >= 60.0: direction = "BOTTOM" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Words<S extends string> = S extends S ? string extends S ? string[] : WordsAgg<S, []> : never; | |
type WordsAgg<S extends string, L extends string[]> = S extends "" | |
? L | |
: S extends `${AsciiUpper}${AsciiLower}${string}` | |
? PascalWord<S, L> | |
: S extends `${AsciiUpper}${string}` | |
? UpperWord<S, L> | |
: S extends `${AsciiLower}${string}` | |
? CharsetWord<S, L, AsciiLower> | |
: S extends `${AsciiDigit}${string}` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs, { Dirent } from 'node:fs' | |
import path from 'node:path' | |
type Awaitable<T> = T | PromiseLike<T>; | |
export interface File { | |
[key: string]: any | |
default?: { | |
[key: string]: any | |
fileObj: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function sendMessage( | |
channel: TextChannel | DMChannel | BaseGuildTextChannel | GuildTextBasedChannel | PartialDMChannel, | |
user: User | undefined, | |
options: string | MessagePayload | MessageOptions | |
) { | |
let message; | |
try { | |
message = await channel.send(options); | |
} catch (error) { |