Commit graph

252 commits

Author SHA1 Message Date
f53d0b63e7 Fix issues uncovered by the tests
- Fixed the game enter API
- Fixed ToggleTimeMode() placing the player underground by using the full switch animation
- Fixed the menu enter/exit events only firing once due to the game keeping the menu loaded
- Moved everything from AppEngine to GameMenuEngine for consistency
- Reimplemented the Block.Static property, it should actually work again too
- Made the block property test only use blocks placed during the previous test, improved error handling and temporarily disabled testing the Material and the Flipped properties as they cause the game to crash
2021-11-06 04:10:00 +01:00
619a5003cf Update to Techblox 2021.11.03.15.56
Save game details were changed, they may not work properly
Game mode change event no longer sends game data, needs fixing
2021-11-04 20:45:21 +01:00
6204b226d1 Seat events, and everything needed to get there
- Added support for seat enter and exit events and a test for them
- Added support for entering and exiting seat from code
- Changed the Id property of ECS objects to non-abstract, requiring it in the constructor, so that the Player class can inherit EcsObjectBase
- Added a weird constructor to EcsObjectBase that allows running code to determine the object Id
- Added interface for engines that receive entity functions
- Exposed the entity submission scheduler and removed it from FullGameFields because it moved from there
- Made the Game.Enter event only fire after the first entity submission so the game is fully initialized and the local player exists
- Added all seat groups to the dictionary
2021-10-11 01:26:35 +02:00
4bd636b8ed Add wrapped event handler, using the existing ECS object instances
- Added a wrapper class that handles the individual wrapping of event handlers to individually handle exceptions - now it tracks the wrapped event handlers so it can unregister them properly
- Fixed an exception that happened when two ECS objects were created with the same EGID
- Added support for returning an existing ECS object if it exists instead of always creating a new one
- Added a parameter to the entity query extension methods to override the group of the ECS object (could be used for the player properties)
2021-10-08 03:58:01 +02:00
8a03277d84 Added block placement in sim and ECS object tracking
ECS objects are stored in a newly created weak dictionary so that events can be called on them and possibly other things can be done with them
2021-10-02 03:50:20 +02:00
aa947eaba1 Update to Techblox 2021.09.27.15.17
Fixed block name print regex
Made Game.WorkshopId obsolete as it's removed from the game
Fixed removing blocks
2021-10-02 00:01:47 +02:00
63295f82c9 Update to Techblox 2021.09.03.10.36
Removed old dependencies, including uREPL
Added new block IDs
Implemented basic command handling to support existing mod commands
2021-09-07 23:15:03 +02:00
033ebdb86d Fix looking at wires, reduce Wire code
Also added two port name properties directly to the wires
Also added support for converting OptionalRefs to Nullables
2021-09-03 01:30:38 +02:00
2513040343 Add code generator and new block classes
Block classes are generated with all of the properties from the given structs
Properties can be renamed, their name is pulled from TweakableStat attributes if possible
Added support for getting the wire being looked at
2021-08-12 01:11:02 +02:00
77d5e59ef6 Add Motor class 2021-08-12 00:44:23 +02:00
9693341d7a Add block types, run tests, remove unintended properties 2021-08-12 00:34:39 +02:00
c0eae77421 Finish code generator (mostly)
Made the generated members public and final
Removed the comment from the start of the files
Generating the files directly into the project folder
Added comments describing the generated constructors and properties
Using SignalingBlock as a base class
Added support for renaming properties
Added support for getting the name from the tweakable stat name
Added/updated functional block classes
2021-08-11 23:44:26 +02:00
3351993936 Automatically generate properties, fixes, engine class 2021-07-29 01:04:27 +02:00
49c3b60963 Get wire looked at, block class generation 2021-07-29 00:08:57 +02:00
ece71c45a6 Update to Techblox 2021.07.21.16.17 2021-07-22 22:20:53 +02:00
2a1676ce0f Update block ID list 2021-07-01 15:41:58 +02:00
74d5a5c6b1
Fix default values getting changed and add test 2021-06-23 01:58:01 +02:00
76faa69c74 Add support for enabling the screenshot taker, even in sim 2021-06-11 19:51:32 +02:00
52ccbe4dad Fix tests and add new materials 2021-06-10 23:57:06 +02:00
0b2ffef0d3 Update block IDs 2021-06-09 22:03:15 +02:00
99f077a917 Update to Techblox 2021.06.08.16.19
Added check for time mode toggle to avoid crashing the game
Added support for having the ref folder outside the solution in gen_csproj.py
Removed BlockIdentifiers class
Added check for invalid player ID when placing blocks
Resolved compilation errors
2021-06-09 20:11:31 +02:00
c1c226ef2a Added support for setting default color/material and static blocks
Also fixed setting game name/description

When setting the block color or material to default it will look up the default value to use
Blocks can now be set to be static so they don't fall or move at all
2021-06-04 23:07:06 +02:00
NGnius (Graham)
06cb911ea3 Update IMGUI to something roughly TB-like 2021-05-31 17:59:25 -04:00
b31eaa20c0
Check if block type is correct 2021-05-30 02:12:38 +02:00
94c0c1370b
Removed 2 non-OOP classes and fixed fly cam teleport
Remvoed Hotbar and GameClient since their functions are also implemented in OOP classes
Added static methods to add/remove persistent debug info
Made some patches and other things internal
Added support for FlyCams in SetLocation
2021-05-30 01:34:30 +02:00
b8fd14d934 Move speed settings to Player and make it work with players
Probably
2021-05-28 02:52:42 +02:00
5bfd0b7f10 Integrate FlyCam class into Player
Using QueryEntityOptional directly with the player properties
Character structs are camera structs in build mode
The FlyCam rotation is not updated in build mode, only the camera is
2021-05-28 02:12:54 +02:00
220eb02a19
Return descriptions with command names, selected block/color fix 2021-05-25 01:20:46 +02:00
e8515ef42b
Fix events not firing and event exception handling
Copying to Plugins folder on build
Registering deterministic game engines automatically
Each event handler is wrapped so if one fails it will still trigger the rest
2021-05-23 20:53:55 +02:00
f5e3010e48
Removed all obsolete classes and some commented out code 2021-05-21 00:09:36 +02:00
1cbe252727
Move block engines into their own namespace 2021-05-20 23:37:10 +02:00
b3f7dcd36d
Add start of Engine class, removed nonexistent blocks
Not all engine properties are added (yet)
The old block types can be brought back when/if they come back, potentially with different properties
2021-05-20 23:26:22 +02:00
e9df67f462
Use Block.New everywhere, testing *every block property*
Fixed prefab update for nonexistent blocks
Removed Type from block placed/removed event args
Added test to check the block ID enum (whether it has any extra or missing IDs)
Added test to place every block on the ID enum
Added test to set and verify each property of each block type (type-specific properties are also set when they can be through the API)
Added support for enumerator test methods with exception handling
2021-05-19 01:40:15 +02:00
70b322583a
Fix setting the material of a block
Also fixed ID of wood material
2021-05-18 20:00:24 +02:00
4f0645492c
Fix block color and group 2021-05-18 00:44:09 +02:00
58d703f502
Fix block tests and add test command to toggle time mode 2021-05-17 14:55:13 +02:00
NGnius
db08bf1ac0 Fix docs (hopefully) 2021-05-12 20:00:33 -04:00
dd2680abd5
Set the grid scale as well when changing the scale 2021-05-13 01:41:52 +02:00
4807c12387
Fix placing blocks
Most of the removed initialitzers are actually important
Also, the prefab ID was not calculated correctly
Also, the category is 1, not sure why but it is
2021-05-13 00:13:31 +02:00
3432a1ae33
Return block objects based on the group, not a type param
Replaced typeToGroup with GroupToConstructor
The block object's type is determined by the exclusive group instead of a type parameter
Removed the Specialise() method, the API should always return specialised objects

This fixes the not supported exception but not the game crash that follows
2021-05-12 02:33:01 +02:00
7a53e1d32f
Fix command registration 2021-05-12 01:34:40 +02:00
aa12b848d0
Merge branch 'feature-ecs_object_base' 2021-05-12 00:51:56 +02:00
b6b9a29a3c
Convert more things to use EcsObjectBase
Though the major benefit is only for blocks right now (using initializers)
2021-05-12 00:49:01 +02:00
6fedf90380
Remove struct layout stuff
It broke everything using the type
2021-05-12 00:25:07 +02:00
3eef859095
Update gen_csproj script and references 2021-05-11 22:56:36 +02:00
858a5c9b5c
Fix remaining errors, add support for managed entity DB 2021-05-11 00:56:46 +02:00
d238c97906
Remove block info getters and setters
Regex is great

GetBlockInfo\(this, \((\w+) (\w+)\) ?=> ?\2(.+)\);
GetBlockInfo<$1>(this)$3;

SetBlockInfo\(this, \(ref (\w+) (\w+), \w+ (\w+)\) ?=> \2(.*) = \3,\s*value\);
GetBlockInfo<$1>(this)$4 = value;
2021-05-10 23:08:15 +02:00
61184145a9
Start using new extension methods, code cleanup
Removed all of the different block property getter methods
2021-05-10 22:45:07 +02:00
2d99d1d478
Generalize optional references and init data
Added extension methods to query data from ECS objects
Added base class for ECS objects
Added support for representing in-construction ECS objects with an OptionalRef<T>
2021-05-10 02:04:59 +02:00
78ee3b3bcd
Fix block type check on placement 2021-05-10 01:38:15 +02:00