Skip to content

Commit

Permalink
Games: Add Agent Dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
garbear committed Jul 6, 2023
1 parent 066d190 commit 177dbfa
Show file tree
Hide file tree
Showing 30 changed files with 1,548 additions and 22 deletions.
9 changes: 8 additions & 1 deletion addons/resource.language.en_gb/resources/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -18290,7 +18290,14 @@ msgctxt "#35171"
msgid "Mouse"
msgstr ""

#empty strings from id 35172 to 35199
#. Name of window for configuring players while playing a game
#: addons/skin.estuary/xml/GameOSD.xml
#: addons/skin.estuary/xml/Includes_Games.xml
msgctxt "#35172"
msgid "Players"
msgstr ""

#empty strings from id 35173 to 35199

#. This string is an early meme from the late 1990's that made fun of the poor translation in the 16-bit game Zero Wing from the late 1980's. DO NOT TRANSLATE!
#: system/settings/settings.xml
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions addons/skin.estuary/xml/DialogGameControllers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
but adding new XML windows breaks old skins, so it has been repurposed
for any game-related windows.
</description>
<defaultcontrol>3</defaultcontrol>
<defaultcontrol always="true">3</defaultcontrol>
<include>Animation_DialogPopupOpenClose</include>
<controls>
<include condition="Window.IsActive(gamecontrollers)">GameDialogControllers</include>
<include condition="Window.IsActive(gameports)">GameDialogPorts</include>
<include condition="Window.IsDialogTopMost(gamecontrollers)">GameDialogControllers</include>
<include condition="Window.IsDialogTopMost(gameports)">GameDialogPorts</include>
<include condition="Window.IsDialogTopMost(gameagents)">GameDialogAgents</include>
</controls>
<controls>
</controls>
Expand Down
24 changes: 15 additions & 9 deletions addons/skin.estuary/xml/GameOSD.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<depth>DepthOSD</depth>
<controls>
<control type="group" id="1">
<visible>!Window.IsActive(1101) + !Window.IsActive(GameVideoFilter) + !Window.IsActive(GameStretchMode) + !Window.IsActive(GameControllers) + !Window.IsActive(GameVideoRotation) + !Window.IsActive(InGameSaves)</visible>
<visible>!Window.IsActive(1101) + !Window.IsActive(GameVideoFilter) + !Window.IsActive(GameStretchMode) + !Window.IsActive(GameControllers) + !Window.IsActive(GameVideoRotation) + !Window.IsActive(InGameSaves) + !Window.IsActive(GameAgents)</visible>
<include>Visible_Fade</include>
<control type="group" id="10">
<visible>System.GetBool(gamesgeneral.showosdhelp)</visible>
Expand Down Expand Up @@ -63,21 +63,21 @@
<control type="group" id="20">
<visible>!System.GetBool(gamesgeneral.showosdhelp)</visible>
<centerleft>50%</centerleft>
<height>480</height>
<height>560</height>
<centertop>50%</centertop>
<width>700</width>
<animation effect="fade" time="200">VisibleChange</animation>
<include content="DialogBackgroundCommons">
<param name="width" value="700" />
<param name="height" value="480" />
<param name="height" value="560" />
<param name="header_label" value="$LOCALIZE[35221]" />
<param name="header_id" value="3" />
</include>
<control type="group" id="2000">
<top>80</top>
<control type="list" id="1103">
<defaultcontrol always="true">2101</defaultcontrol>
<height>480</height>
<height>560</height>
<orientation>vertical</orientation>
<itemlayout condition="!Control.IsVisible(2200)" width="700" height="80">
<control type="image">
Expand Down Expand Up @@ -200,33 +200,39 @@
</control>
</focusedlayout>
<content>
<item id="2101">
<item>
<description>Pause / Resume button</description>
<label>$LOCALIZE[35224]</label>
<label2>$LOCALIZE[31059]</label2>
<icon>osd/fullscreen/buttons/play.png</icon>
<onclick>Play</onclick>
</item>
<item id="2102">
<item>
<description>Save / Load button</description>
<label>$LOCALIZE[35249]</label>
<icon>osd/fullscreen/buttons/saves.png</icon>
<onclick>ActivateWindow(InGameSaves)</onclick>
</item>
<item id="2103">
<item>
<description>Players button</description>
<label>$LOCALIZE[35172]</label>
<icon>osd/fullscreen/buttons/agent.png</icon>
<onclick>ActivateWindow(GameAgents)</onclick>
</item>
<item>
<description>Reset button</description>
<label>$LOCALIZE[13007]</label>
<icon>osd/fullscreen/buttons/reset.png</icon>
<onclick>PlayerControl(Reset)</onclick>
</item>
<item id="2104">
<item>
<description>Stop button</description>
<label>$LOCALIZE[35222]</label>
<label2>$LOCALIZE[31060]</label2>
<icon>osd/fullscreen/buttons/stop.png</icon>
<onclick>Stop</onclick>
</item>
<item id="2105">
<item>
<description>Settings button</description>
<label>$LOCALIZE[5]</label>
<icon>osd/fullscreen/buttons/settings.png</icon>
Expand Down
140 changes: 140 additions & 0 deletions addons/skin.estuary/xml/Includes_Games.xml
Original file line number Diff line number Diff line change
Expand Up @@ -321,4 +321,144 @@
</control>
</control>
</include>
<include name="GameDialogAgents">
<control type="group">
<centertop>50%</centertop>
<centerleft>50%</centerleft>
<width>1780</width>
<height>962</height>
<include content="DialogBackgroundCommons">
<param name="width" value="1780" />
<param name="height" value="962" />
<param name="header_label" value="$LOCALIZE[35172]" />
<param name="header_id" value="2" />
</include>
<control type="group">
<description>Content area</description>
<top>110</top>
<bottom>40</bottom>
<left>40</left>
<right>40</right>
<control type="group">
<description>Area of the dialog for ports</description>
<height>96</height>
<control type="button" id="3">
<description>Ports button</description>
<top>-20</top>
<bottom>-20</bottom>
<left>-20</left>
<right>-20</right>
<ondown>5</ondown>
<label>$LOCALIZE[35110]</label>
<font>font37</font>
<textoffsetx>36</textoffsetx>
<align>left</align>
<aligny>center</aligny>
<texturefocus border="40" colordiffuse="button_focus">buttons/dialogbutton-fo.png</texturefocus>
<texturenofocus border="40">buttons/dialogbutton-nofo.png</texturenofocus>
<onclick>ActivateWindow(GamePorts)</onclick>
</control>
<control type="list" id="4">
<description>Active port list</description>
<right>0</right>
<width>864</width>
<orientation>horizontal</orientation>
<enable>false</enable>
<itemlayout width="96" height="96">
<control type="gamecontroller">
<texture>$INFO[ListItem.Icon]</texture>
</control>
</itemlayout>
<focusedlayout width="96" height="96">
<control type="gamecontroller">
<texture>$INFO[ListItem.Icon]</texture>
</control>
</focusedlayout>
</control>
</control>
<control type="group">
<description>Area of the dialog for players</description>
<top>136</top>
<height>576</height>
<control type="image">
<description>Player list background</description>
<top>-20</top>
<bottom>-20</bottom>
<left>-20</left>
<right>-20</right>
<texture border="40">buttons/dialogbutton-nofo.png</texture>
</control>
<control type="list" id="5">
<description>Player list</description>
<onup>3</onup>
<ondown>6</ondown>
<pagecontrol>61</pagecontrol>
<scrolltime tween="sine">200</scrolltime>
<orientation>vertical</orientation>
<itemlayout width="1700" height="96">
<include>GameDialogAgentList</include>
</itemlayout>
<focusedlayout width="1700" height="96">
<control type="image">
<top>-20</top>
<bottom>-20</bottom>
<left>-20</left>
<right>-20</right>
<texture border="40" colordiffuse="button_focus">buttons/dialogbutton-fo.png</texture>
<visible>Control.HasFocus(5)</visible>
</control>
<include>GameDialogAgentList</include>
</focusedlayout>
</control>
</control>
<control type="scrollbar" id="61">
<description>Agent list scroll bar</description>
<top>136</top>
<height>576</height>
<right>-12</right>
<width>12</width>
<orientation>vertical</orientation>
</control>
<control type="grouplist" id="6">
<description>Action buttons</description>
<left>-20</left>
<right>-20</right>
<bottom>-20</bottom>
<height>100</height>
<onup>5</onup>
<orientation>horizontal</orientation>
<itemgap>dialogbuttons_itemgap</itemgap>
<include content="DefaultDialogButton">
<param name="width" value="330" />
<param name="id" value="18" />
<param name="label" value="$LOCALIZE[186]" />
</include>
</control>
</control>
</control>
</include>
<include name="GameDialogAgentList">
<control type="label">
<description>Player name</description>
<top>20</top>
<left>20</left>
<label>$INFO[ListItem.Label]</label>
<font>font37</font>
<shadowcolor>text_shadow</shadowcolor>
<align>left</align>
</control>
<control type="gamecontrollerlist">
<description>Player's game controller list. Length should fit 9 listitems (8 players and one "input disabled" indicator).</description>
<right>0</right>
<width>864</width>
<orientation>horizontal</orientation>
<enable>false</enable>
<itemlayout width="96" height="96">
<control type="gamecontroller" />
</itemlayout>
<focusedlayout width="96" height="96">
<control type="gamecontroller" />
</focusedlayout>
</control>
</include>
</includes>
2 changes: 2 additions & 0 deletions cmake/treedata/common/games.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ xbmc/games/addons/cheevos games/addons/cheevos
xbmc/games/addons/input games/addons/input
xbmc/games/addons/streams games/addons/streams
xbmc/games/agents games/agents
xbmc/games/agents/windows games/agents/windows
xbmc/games/controllers games/controllers
xbmc/games/controllers/dialogs games/controllers/dialogs
xbmc/games/controllers/guicontrols games/controllers/guicontrols
Expand All @@ -12,6 +13,7 @@ xbmc/games/controllers/types games/controllers/types
xbmc/games/controllers/windows games/controllers/windows
xbmc/games/dialogs games/dialogs
xbmc/games/dialogs/osd games/dialogs/osd
xbmc/games/ports/guicontrols games/ports/guicontrols
xbmc/games/ports/input games/ports/input
xbmc/games/ports/types games/ports/types
xbmc/games/ports/windows games/ports/windows
Expand Down
11 changes: 11 additions & 0 deletions xbmc/games/agents/windows/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
set(SOURCES GUIAgentList.cpp
GUIAgentWindow.cpp
)

set(HEADERS GUIAgentDefines.h
GUIAgentList.h
GUIAgentWindow.h
IAgentList.h
)

core_add_library(games_agents_windows)
18 changes: 18 additions & 0 deletions xbmc/games/agents/windows/GUIAgentDefines.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (C) 2017-2023 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#pragma once

// Skin XML file
#define AGENT_DIALOG_XML "DialogGameControllers.xml"

// GUI control IDs
#define CONTROL_ACTIVE_PORT_LIST 4
#define CONTROL_AGENT_LIST 5

// GUI button IDs
#define CONTROL_CLOSE_BUTTON 18
Loading

0 comments on commit 177dbfa

Please sign in to comment.