Skip to content

Commit 2033c66

Browse files
amylizzlewixoaGit
andauthored
Appearance Weakrefs (#1815)
Co-authored-by: amylizzle <[email protected]> Co-authored-by: wixoaGit <[email protected]>
1 parent 62fce76 commit 2033c66

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1558
-838
lines changed
268 Bytes
Binary file not shown.

Content.Tests/DMProject/Tests/Image/subclass.dm renamed to Content.IntegrationTests/DMProject/Tests/image.dm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
plane = 123
33
icon_state = "subclass"
44

5-
/proc/RunTest()
5+
/proc/test_images()
6+
ASSERT(image('icons.dmi', "mob") != null)
7+
68
var/image/test = new /image/subclass
79
ASSERT(test.plane == 123)
810
ASSERT(test.icon_state == "subclass")

Content.Tests/DMProject/Tests/Statements/For/nonlocal_var.dm renamed to Content.IntegrationTests/DMProject/Tests/nonlocal_var.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
out += dir
1111
ASSERT(out == 14)
1212

13-
/proc/RunTest()
13+
/proc/test_nonlocal_var()
1414
var/mob/m = new
1515
m.dodir()

Content.IntegrationTests/DMProject/code.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,7 @@
3030
test_color_matrix()
3131
test_range()
3232
test_verb_duplicate()
33+
test_nonlocal_var()
34+
test_images()
3335
test_filter_init()
3436
world.log << "IntegrationTests successful, /world/New() exiting..."

Content.IntegrationTests/DMProject/environment.dme

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#include "Tests/color_matrix.dm"
44
#include "Tests/range.dm"
55
#include "Tests/verb_duplicate.dm"
6+
#include "Tests/nonlocal_var.dm"
7+
#include "Tests/image.dm"
68
#include "Tests/filter_initial.dm"
79
#include "map.dmm"
810
#include "interface.dmf"

Content.Tests/DMProject/Tests/Image/Image.dm

Lines changed: 0 additions & 2 deletions
This file was deleted.

Content.Tests/DMProject/Tests/Savefile/ExportText.dm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
/obj/savetest
2-
var/obj/savetest/recurse = null
1+
/datum/savetest
2+
var/name
3+
var/datum/savetest/recurse = null
34

45
/proc/RunTest()
5-
var/obj/savetest/O = new() //create a test object
6+
var/datum/savetest/O = new() //create a test object
67
O.name = "test"
78
//O.recurse = O //TODO
89

Content.Tests/DummyDreamMapManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ public void InitializeAtoms(List<DreamMapJson>? maps) { }
2626

2727
public void SetTurf(DreamObjectTurf turf, DreamObjectDefinition type, DreamProcArguments creationArguments) { }
2828

29-
public void SetTurfAppearance(DreamObjectTurf turf, IconAppearance appearance) { }
29+
public void SetTurfAppearance(DreamObjectTurf turf, MutableAppearance appearance) { }
3030

31-
public void SetAreaAppearance(DreamObjectArea area, IconAppearance appearance) { }
31+
public void SetAreaAppearance(DreamObjectArea area, MutableAppearance appearance) { }
3232

3333
public void SetArea(DreamObjectTurf turf, DreamObjectArea area) { }
3434

DMCompiler/DMStandard/Types/Image.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/image
22
parent_type = /datum
33

4-
//note these values also need to be set in IconAppearance.cs
4+
//note these values also need to be set in MutableAppearance.cs
55
var/alpha = 255
66
var/appearance
77
var/appearance_flags = 0

OpenDreamClient/EntryPoint.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public override void PostInit() {
8585
IoCManager.Resolve<IDreamSoundEngine>().Initialize();
8686

8787
_netManager.RegisterNetMessage<MsgAllAppearances>(RxAllAppearances);
88+
_netManager.RegisterNetMessage<MsgNewAppearance>(RxNewAppearance);
8889

8990
if (_configurationManager.GetCVar(CVars.DisplayCompat))
9091
_dreamInterface.OpenAlert(
@@ -112,6 +113,15 @@ private void RxAllAppearances(MsgAllAppearances message) {
112113
clientAppearanceSystem.SetAllAppearances(message.AllAppearances);
113114
}
114115

116+
private void RxNewAppearance(MsgNewAppearance message) {
117+
if (!_entitySystemManager.TryGetEntitySystem<ClientAppearanceSystem>(out var clientAppearanceSystem)) {
118+
Logger.GetSawmill("opendream").Error("Received MsgNewAppearance before initializing entity systems");
119+
return;
120+
}
121+
122+
clientAppearanceSystem.OnNewAppearance(message);
123+
}
124+
115125
// As of RobustToolbox v0.90.0.0 there's a TileEdgeOverlay that breaks our rendering
116126
// because we don't have an ITileDefinition for each tile.
117127
// This removes that overlay immediately after MapSystem adds it.

0 commit comments

Comments
 (0)