Skip to content
This repository has been archived by the owner on Oct 22, 2022. It is now read-only.

Commit

Permalink
Update to VS 1.5.3-rc1
Browse files Browse the repository at this point in the history
- ModBase is now ModSystem
- Update to new modinfo.json format
  • Loading branch information
copygirl committed May 1, 2018
1 parent aac39e4 commit c06fc26
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion CarryCapacity.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<AssemblyTitle>CarryCapacity</AssemblyTitle>
<Authors>copygirl</Authors>
<Version>0.2.5</Version>
<Version>0.3.0-rc1</Version>

<Description>Vintage Story mod which adds the capability to carry various things</Description>
<RepositoryUrl>https://github.com/copygirl/CarryCapacity</RepositoryUrl>
Expand Down
12 changes: 8 additions & 4 deletions resources/modinfo.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@

{
"type": "code",
"name": "CarryCapacity",
"modid": "carrycapacity",
"version": "0.3.0-rc1",

"description" : "Adds the capability to carry various things",
"website": "https://github.com/copygirl/CarryCapacity",
"author": "copygirl",
"version": "0.2.5",
"gameversions": [ "1.5.2.6+" ]
"authors": [ "copygirl" ],

"dependencies": {
"game": "1.5.3-rc1"
}
}
2 changes: 1 addition & 1 deletion src/CarriedBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace CarryCapacity
public class CarriedBlock
{
public static string ATTRIBUTE_ID { get; } =
$"{ CarryCapacityMod.MOD_ID }:CarriedBlock";
$"{ CarrySystem.MOD_ID }:CarriedBlock";


public Block Block { get; }
Expand Down
22 changes: 9 additions & 13 deletions src/CarryCapacityMod.cs → src/CarrySystem.cs
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
using CarryCapacity.Client;
using CarryCapacity.Client;
using CarryCapacity.Handler;
using CarryCapacity.Network;
using Vintagestory.API.Client;
using Vintagestory.API.Common;
using Vintagestory.API.MathTools;
using Vintagestory.API.Server;

[assembly: ModInfo( "CarryCapacity",
Description = "Adds the capability to carry various things",
Website = "https://github.com/copygirl/CarryCapacity",
Authors = new []{ "copygirl" })]

namespace CarryCapacity
{
/// <summary> Main class for the "Carry Capacity" mod, which allows certain
/// <summary> Main system for the "CarryCapacity" mod, which allows certain
/// blocks such as chests to be picked up and carried around. </summary>
public class CarryCapacityMod : ModBase
public class CarrySystem : ModSystem
{
public static ModInfo MOD_INFO { get; } = new ModInfo {
Name = "CarryCapacity",
Description = "Adds the capability to carry various things",
Website = "https://github.com/copygirl/CarryCapacity",
Author = "copygirl",
};

public static string MOD_ID => MOD_INFO.Name.ToLowerInvariant();
public static string MOD_ID = "carrycapacity";

public override ModInfo GetModInfo() => MOD_INFO;
public override bool AllowRuntimeReload() => true;


// Client
public ICoreClientAPI ClientAPI { get; private set; }
public IClientNetworkChannel ClientChannel { get; private set; }
Expand Down
4 changes: 2 additions & 2 deletions src/Client/HudOverlayRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ public void OnRenderFrame(float deltaTime, EnumRenderStage stage)

// TODO: Render at mouse cursor, not center of screen.
// Gotta wait for the API to add MouseMove event.
var x = API.Render.ScreenWidth / 2;
var y = API.Render.ScreenHeight / 2;
var x = API.Render.FrameWidth / 2;
var y = API.Render.FrameHeight / 2;

rend.GlPushMatrix();
rend.GlTranslate(x, y, 0);
Expand Down
4 changes: 2 additions & 2 deletions src/Handler/CarryHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public class CarryHandler
private CurrentAction _action = CurrentAction.None;
private BlockPos _selectedBlock = null;

private CarryCapacityMod Mod { get; }
private CarrySystem Mod { get; }

public CarryHandler(CarryCapacityMod mod)
public CarryHandler(CarrySystem mod)
=> Mod = mod;

public void InitClient()
Expand Down

0 comments on commit c06fc26

Please sign in to comment.