Skip to content

Commit

Permalink
menu add split,mplr, collect,career
Browse files Browse the repository at this point in the history
  • Loading branch information
cryham committed Apr 27, 2024
1 parent 8530fbd commit 3e60d57
Show file tree
Hide file tree
Showing 10 changed files with 166 additions and 49 deletions.
151 changes: 123 additions & 28 deletions data/gui/Game_Main.layout
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Property key="Snap" value="true"/>
<UserString key="NotSized" value="1"/>

<!-- 0 pan +8 img +12 btn +72 12 84 156 228 300 336 408 480 -->
<!-- +8 img 0 pan +12 btn +72 rows 0 y = 12 84 156 228 300 336 408 480 -->

<!-- level 1 Main menu -->
<Widget type="ImageBox" skin="ImageBox" position="0 520 589 201">
Expand Down Expand Up @@ -109,35 +109,55 @@
<Property key="Snap" value="true"/>
<UserString key="NotSized" value="1"/>

<Widget type="ImageBox" skin="ImageBox" position="32 20 56 56">
<Property key="ImageCoord" value="0 0 128 128"/>
<Widget type="ImageBox" skin="ImageBox" position="32 92 56 56">
<Property key="ImageCoord" value="256 0 128 128"/>
<Property key="Colour" value="0.7 0.7 0.7"/>
<Property key="InheritsAlpha" value="false"/>
<Property key="ImageTexture" value="gui_icons.png"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="92 12 436 72" name="PanSetup0">
<Property key="Colour" value="1.0 0.9 0.6"/>
<Widget type="ImageBox" skin="ImageBox" position="92 84 436 72" name="PanSetup0">
<Property key="Colour" value="0.9 1 0.6"/>
<Property key="ImageTexture" value="menu_cur.png"/>
<Property key="InheritsAlpha" value="false"/>
</Widget>
<Widget type="Button" skin="Button" position="108 24 404 50" align="Left" name="BtnSetup0">
<Property key="Caption" value="#{NewGame}"/>
<Property key="Colour" value="1.0 0.9 0.6"/>
<Property key="TextColour" value="1.0 0.9 0.6"/>
<Widget type="Button" skin="Button" position="108 96 404 50" align="Left" name="BtnSetup0">
<Property key="Caption" value="#{GameTypes}"/>
<Property key="Colour" value="0.9 1 0.6"/>
<Property key="TextColour" value="0.9 1 0.6"/>
<Property key="InheritsAlpha" value="false"/>
<Property key="FontName" value="font.big"/>
</Widget>


<Widget type="ImageBox" skin="ImageBox" position="32 166 56 56">
<Property key="ImageCoord" value="128 768 128 128"/>
<Property key="Alpha" value="0.8"/>
<Property key="InheritsAlpha" value="false"/>
<Property key="ImageTexture" value="gui_icons.png"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="92 156 436 72" name="PanSetup1">
<Property key="Colour" value="0.5 0.75 1"/>
<Property key="ImageTexture" value="menu_cur.png"/>
<Property key="InheritsAlpha" value="false"/>
</Widget>
<Widget type="Button" skin="Button" position="108 168 404 47" name="BtnSetup1">
<Property key="Caption" value="#{HowToPlay}"/>
<Property key="Colour" value="0.5 0.75 1"/>
<Property key="TextColour" value="0.5 0.8 1"/>
<Property key="InheritsAlpha" value="false"/>
<Property key="FontName" value="font.big"/>
</Widget>

<Widget type="ImageBox" skin="ImageBox" position="32 340 56 56">
<Property key="ImageCoord" value="0 0 32 32"/>
<Property key="ImageTexture" value="track_icons.png"/>
<Property key="InheritsAlpha" value="false"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="92 336 436 72" name="PanSetup1">
<Widget type="ImageBox" skin="ImageBox" position="92 336 436 72" name="PanSetup2">
<Property key="Colour" value="0.7 0.85 1.0"/>
<Property key="ImageTexture" value="menu_cur.png"/>
<Property key="InheritsAlpha" value="false"/>
</Widget>
<Widget type="Button" skin="TextBox" position="108 354 194 50" align="Left" name="BtnSetup1">
<Widget type="Button" skin="TextBox" position="108 354 194 50" align="Left" name="BtnSetup2">
<Property key="Caption" value="#{Difficulty}"/>
<Property key="Colour" value="0.6 0.7 0.8"/>
<Property key="TextColour" value="0.8 0.9 1.0"/>
Expand Down Expand Up @@ -167,12 +187,12 @@
<Property key="InheritsAlpha" value="false"/>
<Property key="ImageTexture" value="gui_icons.png"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="92 408 436 72" name="PanSetup2">
<Widget type="ImageBox" skin="ImageBox" position="92 408 436 72" name="PanSetup3">
<Property key="Colour" value="0.7 0.85 1.0"/>
<Property key="ImageTexture" value="menu_cur.png"/>
<Property key="InheritsAlpha" value="false"/>
</Widget>
<Widget type="Button" skin="TextBox" position="108 426 194 50" align="Left" name="BtnSetup2">
<Widget type="Button" skin="TextBox" position="108 426 194 50" align="Left" name="BtnSetup3">
<Property key="Caption" value="#{Simulation}"/>
<Property key="Colour" value="0.6 0.7 0.8"/>
<Property key="TextColour" value="0.8 0.9 1.0"/>
Expand All @@ -196,8 +216,7 @@
<UserString key="tip" value="#{SimulationHelp}"/>
</Widget>


<Widget type="ImageBox" skin="ImageBox" position="32 484 56 56">
<!-- <Widget type="ImageBox" skin="ImageBox" position="32 484 56 56">
<Property key="ImageCoord" value="128 768 128 128"/>
<Property key="Alpha" value="0.8"/>
<Property key="InheritsAlpha" value="false"/>
Expand All @@ -214,7 +233,7 @@
<Property key="TextColour" value="0.5 0.8 1"/>
<Property key="InheritsAlpha" value="false"/>
<Property key="FontName" value="font.big"/>
</Widget>
</Widget> -->

<Widget type="ImageBox" skin="ImageBox" position="32 580 56 56">
<Property key="ImageCoord" value="256 896 128 128"/>
Expand All @@ -237,7 +256,7 @@


<!-- level 3 Game modes -->
<Widget type="Window" skin="WindowC" position="1768 156 600 730" align="Center" layer="Overlapped" name="MainGamesWnd">
<Widget type="Window" skin="WindowC" position="1768 156 1100 730" align="Center" layer="Overlapped" name="MainGamesWnd">
<Property key="MinSize" value="500 400"/>
<Property key="Caption" value="#{NewGame} - #{GameTypes}"/>
<Property key="Alpha" value="0.7"/>
Expand All @@ -263,71 +282,147 @@
</Widget>

<Widget type="ImageBox" skin="ImageBox" position="32 92 56 56">
<Property key="ImageCoord" value="0 128 128 128"/>
<Property key="ImageCoord" value="768 0 128 128"/>
<Property key="InheritsAlpha" value="false"/>
<Property key="ImageTexture" value="gui_icons.png"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="92 84 436 72" name="PanGames1">
<Property key="Colour" value="1.0 0.7 0.3"/>
<Property key="Colour" value="0.5 0.9 0.9"/>
<Property key="ImageTexture" value="menu_cur.png"/>
<Property key="InheritsAlpha" value="false"/>
</Widget>
<Widget type="Button" skin="Button" position="108 96 404 50" align="Left" name="BtnGames1">
<Property key="Caption" value="#A0D0F0#{SplitScreen}"/>
<Property key="Colour" value="0.5 0.9 0.9"/>
<Property key="InheritsAlpha" value="false"/>
<Property key="FontName" value="font.big"/>
</Widget>

<Widget type="ImageBox" skin="ImageBox" position="32 164 56 56">
<Property key="ImageCoord" value="640 0 128 128"/>
<Property key="Alpha" value="0.6"/>
<Property key="InheritsAlpha" value="false"/>
<Property key="ImageTexture" value="gui_icons.png"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="92 156 436 72" name="PanGames2">
<Property key="Colour" value="0.7 0.7 1"/>
<Property key="ImageTexture" value="menu_cur.png"/>
<Property key="InheritsAlpha" value="false"/>
</Widget>
<Widget type="Button" skin="Button" position="108 168 404 50" align="Left" name="BtnGames2">
<Property key="Caption" value="#A0A0FF#{Multiplayer}"/>
<Property key="Colour" value="0.7 0.7 1"/>
<Property key="InheritsAlpha" value="false"/>
<Property key="FontName" value="font.big"/>
</Widget>

<!-- 2nd column -->
<Widget type="ImageBox" skin="ImageBox" position="532 92 56 56">
<Property key="ImageCoord" value="0 128 128 128"/>
<Property key="InheritsAlpha" value="false"/>
<Property key="ImageTexture" value="gui_icons.png"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="592 84 436 72" name="PanGames3">
<Property key="Colour" value="1.0 0.7 0.3"/>
<Property key="ImageTexture" value="menu_cur.png"/>
<Property key="InheritsAlpha" value="false"/>
</Widget>
<Widget type="Button" skin="Button" position="608 96 404 50" align="Left" name="BtnGames3">
<Property key="Caption" value="#{Tutorial}"/>
<Property key="Colour" value="1.0 0.7 0.4"/>
<Property key="TextColour" value="1.0 0.7 0.4"/>
<Property key="InheritsAlpha" value="false"/>
<Property key="FontName" value="font.big"/>
</Widget>

<Widget type="ImageBox" skin="ImageBox" position="32 164 56 56">
<Widget type="ImageBox" skin="ImageBox" position="532 164 56 56">
<Property key="ImageCoord" value="0 256 128 128"/>
<Property key="InheritsAlpha" value="false"/>
<Property key="ImageTexture" value="gui_icons.png"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="92 156 436 72" name="PanGames2">
<Widget type="ImageBox" skin="ImageBox" position="592 156 436 72" name="PanGames4">
<Property key="Colour" value="0.6 1 0.6"/>
<Property key="ImageTexture" value="menu_cur.png"/>
<Property key="InheritsAlpha" value="false"/>
</Widget>
<Widget type="Button" skin="Button" position="108 168 404 50" align="Left" name="BtnGames2">
<Widget type="Button" skin="Button" position="608 168 404 50" align="Left" name="BtnGames4">
<Property key="Caption" value="#{Championship}"/>
<Property key="Colour" value="0.6 1 0.6"/>
<Property key="TextColour" value="0.6 1 0.6"/>
<Property key="InheritsAlpha" value="false"/>
<Property key="FontName" value="font.big"/>
</Widget>

<Widget type="ImageBox" skin="ImageBox" position="32 236 56 56">
<Widget type="ImageBox" skin="ImageBox" position="532 236 56 56">
<Property key="ImageCoord" value="0 384 128 128"/>
<Property key="InheritsAlpha" value="false"/>
<Property key="ImageTexture" value="gui_icons.png"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="92 228 436 72" name="PanGames3">
<Widget type="ImageBox" skin="ImageBox" position="592 228 436 72" name="PanGames5">
<Property key="Colour" value="0.8 0.8 1"/>
<Property key="ImageTexture" value="menu_cur.png"/>
<Property key="InheritsAlpha" value="false"/>
</Widget>
<Widget type="Button" skin="Button" position="108 240 404 50" align="Left" name="BtnGames3">
<Widget type="Button" skin="Button" position="608 240 404 50" align="Left" name="BtnGames5">
<Property key="Caption" value="#{Challenge}"/>
<Property key="Colour" value="0.8 0.8 1"/>
<Property key="TextColour" value="0.8 0.8 1"/>
<Property key="InheritsAlpha" value="false"/>
<Property key="FontName" value="font.big"/>
</Widget>

<!-- +8 img 0 pan +12 btn +72 rows 0 y = 12 84 156 228 300 372 444 516 -->

<Widget type="ImageBox" skin="ImageBox" position="532 308 56 56">
<Property key="ImageCoord" value="768 128 128 128"/>
<Property key="Alpha" value="0.7"/>
<Property key="InheritsAlpha" value="false"/>
<Property key="ImageTexture" value="gui_icons.png"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="592 300 436 72" name="PanGames6">
<Property key="Colour" value="0.8 0.6 1"/>
<Property key="ImageTexture" value="menu_cur.png"/>
<Property key="InheritsAlpha" value="false"/>
</Widget>
<Widget type="Button" skin="Button" position="608 312 404 50" align="Left" name="BtnGames6">
<Property key="Caption" value="#{Collection}"/>
<Property key="Colour" value="0.8 0.6 1"/>
<Property key="TextColour" value="0.8 0.6 1"/>
<Property key="InheritsAlpha" value="false"/>
<Property key="FontName" value="font.big"/>
</Widget>

<Widget type="ImageBox" skin="ImageBox" position="532 380 56 56">
<Property key="ImageCoord" value="768 256 128 128"/>
<Property key="Alpha" value="0.9"/>
<Property key="InheritsAlpha" value="false"/>
<Property key="ImageTexture" value="gui_icons.png"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="592 372 436 72" name="PanGames7">
<Property key="Colour" value="1 0.6 0.6"/>
<Property key="ImageTexture" value="menu_cur.png"/>
<Property key="InheritsAlpha" value="false"/>
</Widget>
<Widget type="Button" skin="Button" position="608 384 404 50" align="Left" name="BtnGames7">
<Property key="Caption" value="#{Career}"/>
<Property key="Colour" value="1 0.6 0.6"/>
<Property key="TextColour" value="1 0.6 0.6"/>
<Property key="InheritsAlpha" value="false"/>
<Property key="FontName" value="font.big"/>
</Widget>


<Widget type="ImageBox" skin="ImageBox" position="32 580 56 56">
<Property key="ImageCoord" value="256 896 128 128"/>
<Property key="InheritsAlpha" value="false"/>
<Property key="ImageTexture" value="gui_icons.png"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="92 572 436 72" name="PanGames4">
<Widget type="ImageBox" skin="ImageBox" position="92 572 436 72" name="PanGames8">
<Property key="Colour" value="0.9 0.9 0.9"/>
<Property key="ImageTexture" value="menu_cur.png"/>
<Property key="InheritsAlpha" value="false"/>
</Widget>
<Widget type="Button" skin="Button" position="108 584 404 50" name="BtnGames4">
<Widget type="Button" skin="Button" position="108 584 404 50" name="BtnGames8">
<Property key="Caption" value="&lt;#{BackMenu}"/>
<Property key="Colour" value="0.8 0.8 0.8"/>
<Property key="TextColour" value="0.9 0.9 0.9"/>
Expand Down
Binary file modified data/hud/gui_icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions src/game/BaseApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ class CarModel; class SETTINGS; class GraphicsSystem;

// main, race menus
enum Menu_Btns { Menu_Setup, Menu_Replays, Menu_Help, Menu_Options, ciMainBtns };
enum Setup_Btns { Setup_Games, Setup_Difficulty, Setup_Simulation, Setup_HowToPlay, Setup_Back, ciSetupBtns };
enum Games_Btns { Games_Single, Games_Tutorial, Games_Champ, Games_Challenge, Games_Back, ciGamesBtns };
enum Setup_Btns { Setup_Games, Setup_HowToPlay, Setup_Difficulty, Setup_Simulation, Setup_Back, ciSetupBtns };
enum Games_Btns { Games_Single, Games_SplitScreen, Games_Multiplayer,
Games_Tutorial, Games_Champ, Games_Challenge, Games_Collection, Games_Career, Games_Back, ciGamesBtns };
// gui
enum TAB_Game { TAB_Back=0, TAB_Track,TAB_Car, TAB_Setup, TAB_Split,TAB_Multi, TAB_Champs,TAB_Stages,TAB_Stage };
enum TAB_Options { TABo_Back=0, TABo_Screen, TABo_Input, TABo_View, TABo_Graphics, TABo_Sound, TABo_Settings, TABo_Tweak };
Expand Down
2 changes: 1 addition & 1 deletion src/game/CGui.h
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ class CGui : public BGui
void btnNewGame(WP), btnNewGameStart(WP);

// 👥 split screen
void btnNumPlayers(WP);
void btnNumPlayers(WP), SetNumPlayers(int num);
Txt valLocPlayers =0;
Ck ckSplitVert;
void chkStartOrd(WP);
Expand Down
9 changes: 6 additions & 3 deletions src/game/CGui_Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,14 @@ void CGui::btnMainMenu(WP wp)
if (wp == app->mMainGamesBtns[i])
{ switch (i)
{
case Games_Single: pSet->iMenu = MN_Single; break;
case Games_Single: GuiShortcut(MN_Single, TAB_Track); SetNumPlayers(1); break;
case Games_SplitScreen: GuiShortcut(MN_Single, TAB_Split); SetNumPlayers(-2); break; // 👥
case Games_Multiplayer: GuiShortcut(MN_Single, TAB_Multi); SetNumPlayers(1); break; // 📡

case Games_Tutorial: pSet->iMenu = MN_Tutorial; break;
case Games_Champ: pSet->iMenu = MN_Champ; break;
case Games_Challenge: pSet->iMenu = MN_Chall; break;
case Setup_Back: pSet->iMenu = MN1_Setup; break;
case Games_Back: pSet->iMenu = MN1_Setup; break;
}
app->gui->toggleGui(false);
return;
Expand Down Expand Up @@ -252,7 +255,7 @@ void CGui::comboDiff(Cmb cmb, size_t val)
case 5: SetDiff(0,17, 0,6, 4,4, L, 0,0,0,0, "SX", "Mos5-Factory"); break; // Isl17-AdapterIslands
case 6: SetDiff(0,17, 0,D, 4,4, L, 0,0,0,0, "U6", "Uni7-GlassStairs"); break;
}
app->mMainGamesBtns[1]->setVisible(val < 4); // tutorials
app->mMainGamesBtns[Games_Tutorial]->setVisible(val < 4); // tutorials hide
gcom->TrackListUpd(true); gcom->listTrackChng(gcom->trkList,0);
listCarChng(carList,0);

Expand Down
23 changes: 17 additions & 6 deletions src/game/Gui_Events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,19 +169,30 @@ void CGui::radKmh(WP wp){ radUpd(true); }
void CGui::radMph(WP wp){ radUpd(false); }


void CGui::btnNumPlayers(WP wp)
// 👥 Splitscreen
void CGui::SetNumPlayers(int plr)
{
auto& plr = pSet->gui.local_players;
if (wp)
sscanf(wp->getName().c_str(), "btnPlayers%d", &plr);
auto& splr = pSet->gui.local_players;
if (plr >= 0)
splr = plr;
else if (splr == 1) // split sets more plrs
splr = -plr;

if (valLocPlayers)
valLocPlayers->setCaption(toStr(plr));
valLocPlayers->setCaption(toStr(splr));
UpdWndTitle();

for (int t = 0; t < 2; ++t) // hide tabs
for (int p = 1; p < (t == 0 ? MAX_Vehicles : MAX_Players); ++p)
tbPlr[t]->setButtonWidthAt(p, plr > p ? -1 : 1);
tbPlr[t]->setButtonWidthAt(p, splr > p ? -1 : 1);
}

void CGui::btnNumPlayers(WP wp)
{
auto& plr = pSet->gui.local_players;
if (wp)
sscanf(wp->getName().c_str(), "btnPlayers%d", &plr);
SetNumPlayers(plr);
}

void CGui::chkStartOrd(WP wp)
Expand Down
2 changes: 1 addition & 1 deletion src/game/Gui_InitChamps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void CGui::InitGuiChamps()
Slider* sl; SV* sv; Ck* ck;
Mli2 li;
int i,c;
app->mMainSetupBtns[1]->setVisible(pSet->difficulty < 4); // tutorials
app->mMainGamesBtns[Games_Tutorial]->setVisible(pSet->difficulty < 4); // tutorials hide

// track descr 2nd set
gcom->panTrkDesc[1] = fWP("panTrkDesc1");
Expand Down
Loading

0 comments on commit 3e60d57

Please sign in to comment.