mirror of
https://github.com/koloml/vs-manual-cartography.git
synced 2026-06-23 18:22:21 +00:00
Initial commit from Vintage Story mod template
This commit adds dummy compass item wich will just send the angle into the chat when you click RMB on it.
This commit is contained in:
20
ManualCartography/Items/ItemCompass.cs
Normal file
20
ManualCartography/Items/ItemCompass.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using Vintagestory.API.Client;
|
||||
using Vintagestory.API.Common;
|
||||
|
||||
namespace ManualCartography.Items;
|
||||
|
||||
public class ItemCompass : Item
|
||||
{
|
||||
public override void OnHeldInteractStart(
|
||||
ItemSlot slot,
|
||||
EntityAgent byEntity,
|
||||
BlockSelection blockSel,
|
||||
EntitySelection entitySel,
|
||||
bool firstEvent,
|
||||
ref EnumHandHandling handling
|
||||
)
|
||||
{
|
||||
(api as ICoreClientAPI)?.TriggerChatMessage("Yaw: " + (byEntity.Pos.Yaw * 180 / Math.PI));
|
||||
}
|
||||
}
|
||||
29
ManualCartography/ManualCartography.csproj
Normal file
29
ManualCartography/ManualCartography.csproj
Normal file
@@ -0,0 +1,29 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<OutputPath>bin\$(Configuration)\Mods\mod</OutputPath>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="VintagestoryAPI">
|
||||
<HintPath>$(VINTAGE_STORY)/VintagestoryAPI.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="modinfo.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="modicon.png" Condition="Exists('modicon.png')">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
13
ManualCartography/ManualCartographyModSystem.cs
Normal file
13
ManualCartography/ManualCartographyModSystem.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using ManualCartography.Items;
|
||||
using Vintagestory.API.Common;
|
||||
using Vintagestory.API.Server;
|
||||
|
||||
namespace ManualCartography;
|
||||
|
||||
public class ManualCartographyModSystem : ModSystem
|
||||
{
|
||||
public override void Start(ICoreAPI api)
|
||||
{
|
||||
api.RegisterItemClass(Mod.Info.ModID + ".itemcompass", typeof(ItemCompass));
|
||||
}
|
||||
}
|
||||
16
ManualCartography/Properties/launchSettings.json
Normal file
16
ManualCartography/Properties/launchSettings.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"profiles": {
|
||||
"Client": {
|
||||
"commandName": "Executable",
|
||||
"executablePath": "dotnet",
|
||||
"commandLineArgs": "\"$(VINTAGE_STORY)/Vintagestory.dll\" --tracelog --addModPath \"$(ProjectDir)/bin/$(Configuration)/Mods\" --addOrigin \"$(ProjectDir)/assets\"",
|
||||
"workingDirectory": "$(VINTAGE_STORY)"
|
||||
},
|
||||
"Server": {
|
||||
"commandName": "Executable",
|
||||
"executablePath": "dotnet",
|
||||
"commandLineArgs": "\"$(VINTAGE_STORY)/VintagestoryServer.dll\" --tracelog --addModPath \"$(ProjectDir)/bin/$(Configuration)/Mods\" --addOrigin \"$(ProjectDir)/assets\"",
|
||||
"workingDirectory": "$(VINTAGE_STORY)"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"code": "compass",
|
||||
"class": "manualcartography.itemcompass",
|
||||
"maxstacksize": 1,
|
||||
"shape": {
|
||||
"base": "game:shapes/item/utility/compass"
|
||||
},
|
||||
"creativeinventory": {
|
||||
"items": [ "*" ],
|
||||
"manualcartography": [ "*" ]
|
||||
}
|
||||
}
|
||||
4
ManualCartography/assets/manualcartography/lang/en.json
Normal file
4
ManualCartography/assets/manualcartography/lang/en.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"item-compass": "Compass",
|
||||
"tabname-manualcartography": "Manual Cartography"
|
||||
}
|
||||
14
ManualCartography/modinfo.json
Normal file
14
ManualCartography/modinfo.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "https://moddbcdn.vintagestory.at/schema/modinfo.latest.json",
|
||||
"type": "Code",
|
||||
"modid": "manualcartography",
|
||||
"name": "Manual Cartography",
|
||||
"authors": [
|
||||
"KoloMl"
|
||||
],
|
||||
"description": "Bundle of instruments to create maps of your world. Manually!",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"game": "1.22.2"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user