Skip to content

Commit

Permalink
winget("windows"/"panes"/"menus"/"macros") (#1446)
Browse files Browse the repository at this point in the history
* that was easy

* todo: test this

* test

* match

* Apply suggestions from code review

Co-authored-by: wixoa <[email protected]>

---------

Co-authored-by: amy <[email protected]>
Co-authored-by: wixoa <[email protected]>
  • Loading branch information
3 people authored Sep 8, 2023
1 parent eafb93a commit 8841689
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions OpenDreamClient/Interface/DreamInterfaceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using SixLabors.ImageSharp;
using System.Linq;

namespace OpenDreamClient.Interface;

Expand Down Expand Up @@ -535,6 +536,16 @@ string GetProperty(string elementId) {
// But also have it here in case a local winget ever wants it
case "hwmode":
return "true";
case "windows":
return string.Join(';',
Windows.Where(pair => !((WindowDescriptor)pair.Value.ElementDescriptor).IsPane).Select(pair => pair.Key));
case "panes":
return string.Join(';',
Windows.Where(pair => ((WindowDescriptor)pair.Value.ElementDescriptor).IsPane).Select(pair => pair.Key));
case "menus":
return string.Join(';', Menus.Keys);
case "macros":
return string.Join(';', MacroSets.Keys);
default:
_sawmill.Error($"Special winget \"{queryValue}\" is not implemented");
return string.Empty;
Expand Down
7 changes: 7 additions & 0 deletions TestGame/code.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@
src.client.screen += new /obj/order_test_item/plane_master //used for render tests
src.add_client_image()

verb/winget_test()
usr << "windows: [json_encode(winget(usr, null, "windows"))]"
usr << "panes: [json_encode(winget(usr, null, "panes"))]"
usr << "menus: [json_encode(winget(usr, null, "menus"))]"
usr << "macros: [json_encode(winget(usr, null, "macros"))]"


verb/rotate()
for(var/i in 1 to 8)
src.transform = src.transform.Turn(45)
Expand Down

0 comments on commit 8841689

Please sign in to comment.