// Copyright 2023 drey7925 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 syntax = "proto3"; package perovskite.protocol.ui; message TextField { // The key used for this textfield in the response string key = 1; // If non-empty, label to show next to the textfield string label = 2; // The initial value for the textfield string initial = 3; // Whether the textfield is editable bool enabled = 4; // Whether the textfield is multiline bool multiline = 5; // todo other styling } message Checkbox { // The key used for this checkbox in the response string key = 1; // If non-empty, label to show next to the checkbox string label = 2; // The initial value for the checkbox bool initial = 3; // Whether the checkbox is editable bool enabled = 4; } message Button { // The key used to identify that this button was clicked string key = 1; // Text to put on the button itself string label = 2; // Whether the button is enabled bool enabled = 3; // If true, clicking the button will close the popup bool will_close_popup = 4; } message InventoryView { uint64 inventory_key = 1; bool can_place = 2; bool can_take = 3; string label = 4; } message UiElement { oneof element { string label = 1; TextField text_field = 2; Button button = 3; InventoryView inventory = 4; SideBySideLayout side_by_side = 5; Checkbox checkbox = 6; } } message SideBySideLayout { string header = 1; repeated UiElement element = 2; } message PopupDescription { uint64 popup_id = 1; string title = 2; repeated UiElement element = 3; } message PopupResponse { uint64 popup_id = 1; bool closed = 2; string clicked_button = 3; map text_fields = 4; map checkboxes = 5; }