Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
spreedated committed Aug 1, 2024
0 parents commit 9620bec
Show file tree
Hide file tree
Showing 28 changed files with 748 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#### Factorio-Mod
# Welcome MOTD Box
---

[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoffee.com/spreed){:target="_blank"}

### Features

- Supports Factorio Rich-Text
- Enables you to use item icons, colors and fonts
- See [https://wiki.factorio.com/Rich_text](https://wiki.factorio.com/Rich_text) for more information
- Check `\Factorio\data\base\locale\en\base.cfg` for item names under section `[item-name]`
- Player and Admin settings
- Enforce MOTD display
- Toggle parts on/off
- GUI Icon
- Customizable size (width & height)
- Shortcut `ALT + I` to display the window

### Screenshots

![Plenty of room](screenshots/big_1.png)

![Smallbox scrollable](screenshots/small_1.png)
![Smallbox scrollable](screenshots/small_2.png)

![Settings](screenshots/global_settings.png)

### Trivia

String used in the example:<br> `This is just another Factorio Server\nPlaying Vanilla, no mods, just [font=default-bold]Fun[/font]![fluid=crude-oil]\n\n[color=orange][font=default-bold]\tRules[/font][/color]\n\t- No flaming\n\t- No laming\n\t- No Griefing\n\n\t\t\t[item=automation-science-pack][item=logistic-science-pack][item=chemical-science-pack][item=military-science-pack][item=production-science-pack][item=utility-science-pack][item=space-science-pack]`

### Enjoying this?
Just star the repo or make a donation.

[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoffee.com/spreed){:target="_blank"}

Your help is valuable since this is a hobby project for all of us: we do development during out-of-office hours.

### Contribution
Pull requests are very welcome.
### Copyrights
Initially created by **Markus Karl Wackermann**.
15 changes: 15 additions & 0 deletions copySourcecodeToFactorioPath.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#This copies the src files to your Factorio Mod folder
$host.ui.RawUI.WindowTitle = "Copying Source Files"

$version = (Get-Content .\src\info.json | ConvertFrom-Json).version
$factorioModPath = $env:appdata + "\Factorio\mods\"
$motdPath = $factorioModPath + "welcomemotdbox_" + $version + "\"
$srcPath = (Invoke-Command -ScriptBlock { & cmd.exe /c cd }) + "\src\"

foreach($item in Get-ChildItem -Path $factorioModPath -Filter "welcomemotdbox*")
{
Remove-Item -LiteralPath $item.Fullname -Force -Recurse
}

Write-Host "Copying..."
Write-Host ("Copied " + (Copy-Item -Path $srcPath -Destination $motdPath -Recurse -force -passThru).count + " items")
Binary file added screenshots/big_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/global_settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/small_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/small_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions src/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "factoriomod",
"request": "launch",
"name": "Factorio Mod Debug"
},
{
"type": "factoriomod",
"request": "launch",
"name": "Factorio Mod Debug (Settings & Data)",
"hookSettings": true,
"hookData": true
},
{
"type": "factoriomod",
"request": "launch",
"name": "Factorio Mod Debug (Profile)",
"hookMode": "profile"
}
]
}
16 changes: 16 additions & 0 deletions src/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"factorio.versions": [
{
"name": "1.1.0",
"factorioPath": "h:\\SteamLibrary\\steamapps\\common\\Factorio\\bin\\x64\\factorio.exe",
"active": true
}
],
"Lua.workspace.library": [
"h:\\SteamLibrary\\steamapps\\common\\Factorio\\data"
],
"Lua.workspace.userThirdParty": [
"c:\\Users\\SpReeD\\AppData\\Roaming\\Code\\User\\workspaceStorage\\1e3f1f81448a32b067876b7512f1cbe9\\justarandomgeek.factoriomod-debug\\sumneko-3rd"
],
"Lua.workspace.checkThirdParty": "ApplyInMemory"
}
9 changes: 9 additions & 0 deletions src/changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 1.0.437
Date: 31.07.2024
Changes:
- Initial release
Locale:
- Added DE & EN
Bugfixes:
- None
1 change: 1 addition & 0 deletions src/control.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
WelcomeMOTDBoxx = require('scripts/WelcomeMOTDBox/main')
4 changes: 4 additions & 0 deletions src/data.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require("prototypes/input")
require("prototypes/signal")
require("prototypes/style")
require("prototypes/sprite")
Binary file added src/graphics/icons/pr0gramm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/graphics/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions src/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "welcomemotdbox",
"version": "1.0.437",
"title": "Welcome MOTD Box",
"author": "SpReeD, xXCleanXx",
"dependencies": [
"base >= 1.1.0"
],
"description": "The only Server-MOTD you really need!",
"factorio_version": "1.1",
"package": {
"ignore": ["**"],
"extra": [
{
"root": ".build"
}
]
}
}
14 changes: 14 additions & 0 deletions src/locale/de/strings.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[motd]
titlebar=Message of the day [__CONTROL__welcomemotdbox__]
title=Willkommen __1__!

[mod-setting-name]
welcomemotdbox-motd-content=Inhalt
welcomemotdbox-show-big-logo=Logo in Beschreibung anzeigen
welcomemotdbox-show-greeting-string=Begrüßung anzeigen
welcomemotdbox-motd-heading-1=Überschrift 1 (optional)
welcomemotdbox-motd-heading-2=Überschrift 2 (optional)
welcomemotdbox-force-user-motd=Anzeige von MOTD erzwingen, unabhängig von der Benutzereinstellung
welcomemotdbox-show-motd=MOTD anzeigen (kann durch Admin erzwungen werden)
welcomemotdbox-window-height=Fensterhöhe (min. 240)
welcomemotdbox-window-width=Fensterbreite (min. 240)
14 changes: 14 additions & 0 deletions src/locale/en/strings.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[motd]
titlebar=Message of the day [__CONTROL__welcomemotdbox__]
title=Welcome __1__!

[mod-setting-name]
welcomemotdbox-motd-content=Content
welcomemotdbox-show-big-logo=Show logo in content
welcomemotdbox-show-greeting-string=Show greeting
welcomemotdbox-motd-heading-1=Heading 1 (optional)
welcomemotdbox-motd-heading-2=Heading 2 (optional)
welcomemotdbox-force-user-motd=Force display of MOTD, regardless of usersetting
welcomemotdbox-show-motd=Show MOTD (can be enforced by admin)
welcomemotdbox-window-height=Window height (min. 240)
welcomemotdbox-window-width=Window width (min. 240)
8 changes: 8 additions & 0 deletions src/prototypes/input.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
data:extend{
{
type = 'custom-input',
name = 'welcomemotdbox',
key_sequence = "ALT + I",
enabled_while_spectating = true,
},
}
17 changes: 17 additions & 0 deletions src/prototypes/signal.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-- utility sprites don't work right now so use hidden signals
data:extend({
{
type = "virtual-signal",
name = "logo",
icon = "__welcomemotdbox__/graphics/icons/pr0gramm.png",
icon_size = 64,
subgroup = "virtual-signal-utility",
order = "i[welcomemotdbox]",
},
{
type = "item-subgroup",
name = "virtual-signal-utility",
group = "signals",
order = "u-a"
},
})
11 changes: 11 additions & 0 deletions src/prototypes/sprite.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
data:extend{
{
type = "sprite",
name = "logobig",
filename = "__welcomemotdbox__/graphics/logo.png",
width = 128,
height = 128,
flags = {"icon"},
priority = "no-atlas"
}
}
Loading

0 comments on commit 9620bec

Please sign in to comment.