Přidány sprity pro kancelář a monitor. Graficky viditelné zavírání a otevírání dveří, zapínání a vypínání monitoru. Podpora pouze pro specifická rozlišení.
This commit is contained in:
parent
952aae10de
commit
2cd215cc33
13 changed files with 202 additions and 41 deletions
|
|
@ -11,9 +11,9 @@ public class Screen {
|
|||
public static Dictionary<string, Screen> Screens = new();
|
||||
public static Screen CurrentScreen{ get; private set; }
|
||||
|
||||
public static void AddScreens((string id, Screen screen)[] screens) {
|
||||
foreach (var tuple in screens){
|
||||
Screens.Add(tuple.id, tuple.screen);
|
||||
public static void AddScreens(Screen[] screens) {
|
||||
foreach (var screen in screens){
|
||||
Screens.Add(screen.Label, screen);
|
||||
}
|
||||
}
|
||||
public static void AddScreen(string id, Screen screen, bool activate = false) {
|
||||
|
|
@ -29,28 +29,24 @@ public class Screen {
|
|||
public static void RemoveScreen(string id) {
|
||||
Screens.Remove(id);
|
||||
}
|
||||
|
||||
public enum ScreenType {
|
||||
MAIN_MENU,
|
||||
OFFICE,
|
||||
CAMERAS
|
||||
}
|
||||
|
||||
|
||||
public ScreenType Type{ get; private set; }
|
||||
|
||||
|
||||
public string Label;
|
||||
private Dictionary<string, UIElement> elements = new();
|
||||
public bool Active { get; private set; } = false;
|
||||
private InputListenerHook mouseInputHook = new(true);
|
||||
|
||||
public Screen(ScreenType type) {
|
||||
Type = type;
|
||||
public Screen(string label) {
|
||||
Label = label;
|
||||
InputManager.AddListener(InputManager.MouseButton.LEFT, () => ProcessMouseInput(InputManager.MouseState), InputTiming.PRESS, mouseInputHook);
|
||||
}
|
||||
|
||||
public Screen(ScreenType type, Dictionary<string, UIElement> elements) {
|
||||
public Screen(string label, Dictionary<string, UIElement> elements) {
|
||||
this.elements = elements;
|
||||
Type = type;
|
||||
Label = label;
|
||||
}
|
||||
|
||||
public UIElement this[string id] => elements[id];
|
||||
|
||||
public void AddElement(string id, UIElement element) {
|
||||
elements.Add(id, element);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue