Regained linux compability

- set winforms to false in Scripts.csproj (was that on for just the colors for report graphs??)
- added functions that work the same way as the Light and Dark functions, should be the same (untested, but working crossplatform)
- unified the makefile, previously you had to use make -f :makexxx, now back to just make, make release, make debug

updated the readme
This commit is contained in:
PyrO 2025-11-23 02:23:32 +01:00 committed by Voxpire
parent 869fbe93b3
commit 836702fad3
7 changed files with 73 additions and 61 deletions

View file

@ -26,16 +26,30 @@ Run `_winrelease.bat` for production environment.
#### Other Platforms
Run `_makedebug` for development, attaching a debugger and/or extended output.
Run `make debug` for development, attaching a debugger and/or extended output.
Run `_makerelease` for production environment.
Run `make' or 'make release` for production environment. Writing release is optinal by default
### Linux Dependencies
#### Ubuntu / Debian
```
sudo add-apt-repository ppa:dotnet/backports
sudo apt-get update
sudo apt-get -y install zlib1g mono-complete dotnet-sdk-10.0 dotnet-runtime-10.0
```
#### Arch-based
```
sudo pacman -S make mono dotnet-sdk dotnet-runtime
```
### Summary
1. Starting with the `/Config` directory, find and edit `Server.cfg` to set up the essentials.
1. Starting with the `/Config` directory, make sure to read the readme first, then find and edit `Server.cfg` to set up the essentials.
2. Go through the remaining `*.cfg` files to ensure they suit your needs.
3. For Windows, run `_winrelease.bat` to produce `ServUO.exe`, OSX/Linux users may run `_makerelease`.
3. For Windows, run `_winrelease.bat` to produce `ServUO.exe`, OSX/Linux users may run `make`.
4. Run `ServUO`
5. ???
6. Profit!

View file

@ -8,7 +8,7 @@
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<UseVSHostingProcess>False</UseVSHostingProcess>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<UseWindowsForms>True</UseWindowsForms>
<UseWindowsForms>false</UseWindowsForms>
<Platforms>x64</Platforms>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">

View file

@ -396,10 +396,10 @@ namespace Server.Engines.Reports
graph.FillPolygon(barBrush, new PointF[] { pts[2], pts[3], pts[6], pts[5] });
using (SolidBrush ltBrsh = new SolidBrush(System.Windows.Forms.ControlPaint.Light(item.ItemColor, 0.1f)))
using (SolidBrush ltBrsh = new SolidBrush(item.ItemColor.Lighten(0.1f)))
graph.FillPolygon(ltBrsh, new PointF[] { pts[0], pts[2], pts[5], pts[4] });
using (SolidBrush drkBrush = new SolidBrush(System.Windows.Forms.ControlPaint.Dark(item.ItemColor, 0.05f)))
using (SolidBrush drkBrush = new SolidBrush(item.ItemColor.Darken(0.05f)))
graph.FillPolygon(drkBrush, new PointF[] { pts[0], pts[1], pts[3], pts[2] });
graph.DrawLine(pen, pts[0], pts[1]);

View file

@ -10,6 +10,7 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
using System.Linq;
using System.Drawing;
#endregion
namespace Server
@ -1696,4 +1697,22 @@ namespace Server
}
}
}
public static class ColorExtensions
{
public static Color Darken(this Color c, float level)
{
if(level <= 0.0f) return c;
return Color.FromArgb(c.A,(int)(c.R/level),(int)(c.G/level),(int)(c.B/level));
}
public static Color Lighten(this Color c, float level)
{
level = Math.Max(0, Math.Min(1, level));
return Color.FromArgb(c.A,
(int)(c.R + (255 - c.R) * level),
(int)(c.G + (255 - c.G) * level),
(int)(c.B + (255 - c.B) * level));
}
}
}

View file

@ -1,27 +0,0 @@
EXENAME=ServUO
BUILD_DIR='pwd'
EXE=$(BUILD_DIR)/$(EXENAME)
.PHONY: all build run clean
all: build run
build:
@echo "Compile $(EXENAME) for Linux"
@dotnet build -c Debug
@echo "Done!"
run: build
@if [ -f "$(EXE)" ]; then \
clear; \
echo "Running $(EXENAME)..."; \
$(EXE) -debug; \
else \
echo "Executable not found. Did the build succeed?"; \
exit 1; \
fi
clean:
@dotnet clean
@echo "Cleaned build files."

View file

@ -1,27 +0,0 @@
EXENAME=ServUO
BUILD_DIR='pwd'
EXE=$(BUILD_DIR)/$(EXENAME)
.PHONY: all build run clean
all: build run
build:
@echo "Compile $(EXENAME) for Linux"
@dotnet build -c Release
@echo "Done!"
run: build
@if [ -f "$(EXE)" ]; then \
clear; \
echo "Running $(EXENAME)..."; \
$(EXE) -release; \
else \
echo "Executable not found. Did the build succeed?"; \
exit 1; \
fi
clean:
@dotnet clean
@echo "Cleaned build files."

33
makefile Normal file
View file

@ -0,0 +1,33 @@
EXENAME=ServUO
CONFIG=release
BUILD_DIR=${CURDIR}
EXE=$(BUILD_DIR)/$(EXENAME).exe
.PHONY: all build run clean release debug
all: build run
release: CONFIG = release
release: run
debug: CONFIG = debug
debug: run
build:
@echo "Compile $(EXENAME) for Linux ($(CONFIG))"
@dotnet build -c $(CONFIG)
@echo "Done!"
run: build
@if [ -f "$(EXE)" ]; then \
clear; \
echo "Running $(EXENAME) in $(CONFIG) mode..."; \
mono $(EXE) -$(CONFIG); \
else \
echo "Executable not found. Did the build succeed?"; \
exit 1; \
fi
clean:
@dotnet clean
@echo "Cleaned build files."