Skip to content

Commit

Permalink
hide tracks GalleryList
Browse files Browse the repository at this point in the history
  • Loading branch information
cryham committed May 26, 2024
1 parent bae3418 commit 1125229
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 21 deletions.
1 change: 1 addition & 0 deletions config/editor-default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ water_dist = 10000.000000
columns0 = 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0
columns1 = 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1
columns2 = 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0
columns3 = 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
filter = off
filters0 = 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
filters1 = 32 7 6 4 4 5 5 4 6 4 5 5 35 35 6 1
Expand Down
1 change: 1 addition & 0 deletions config/game-default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ tweak_tab = 0
columns0 = 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0
columns1 = 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1
columns2 = 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0
columns3 = 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
filter = off
filters0 = 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
filters1 = 32 7 6 4 4 5 5 4 6 4 5 5 35 35 6 1
Expand Down
2 changes: 1 addition & 1 deletion data/gui/Editor_Track.layout
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@

<!-- tracks gallery -->
<Widget type="ScrollView" skin="ScrollViewEmpty" position="16 45 355 300" layer="Popup" name="scvTracks">
<Property key="CanvasSize" value="1600 19400"/>
<Property key="CanvasSize" value="1600 11400"/>
</Widget>

<Widget type="ImageBox" skin="ImageBox" position="16 494 24 24">
Expand Down
2 changes: 1 addition & 1 deletion data/gui/Game.layout
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@

<!-- tracks gallery -->
<Widget type="ScrollView" skin="ScrollViewEmpty" position="16 45 355 300" layer="Popup" name="scvTracks">
<Property key="CanvasSize" value="1600 19400"/>
<Property key="CanvasSize" value="1600 11400"/>
</Widget>

<Widget type="ImageBox" skin="ImageBox" position="16 494 24 24">
Expand Down
4 changes: 2 additions & 2 deletions data/gui/core_language_en_tag.xml
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@
<Tag name="ViewList">List</Tag>
<Tag name="ViewListUser">List user</Tag>
<Tag name="ViewListDetail">List wide</Tag>
<Tag name="ViewGallery">Gallery list</Tag>
<Tag name="ViewGalleryBig">Gallery big</Tag>
<Tag name="ViewGalleryList">Gallery list</Tag>
<Tag name="ViewGallery">Gallery</Tag>


<!-- MAIN Track stats -->
Expand Down
2 changes: 1 addition & 1 deletion docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ This section lists changes not yet released, but committed to repositories stunt
- New tab on Setup - Paints - Adjust - **Under glow** for color H,S,V
- Main menu 3rd level for Game Types. Separate for Splitscreen and Multiplayer
- 3D win cups shown on game end
- WIP Fields, areas: teleporters, force fields, speed up, lift, anti-gravity, damping
- Gui
- Tracks view new modes: gallery and gallery list
- Editor
Expand All @@ -20,6 +19,7 @@ This section lists changes not yet released, but committed to repositories stunt
- change type (for look, at end of presets.xml)
- change group (for more sets on 1 track)
- WIP Edit mode for Fields, key H
- areas: teleporters, force fields, speed up, lift, anti-gravity, damping
- Road: wall type, for decoration walls, rectangular
- pipe parameter changes it from wide at 0, to square at 0.5 to tall at 1.0

Expand Down
8 changes: 4 additions & 4 deletions src/common/GuiCom_Track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ void CGuiCom::AddTrkL(std::string name, int user,
txt->setFontName("font.small");

// setOrigPos(img, "GameWnd"); //?
if (pSet->tracks_view == TV_GalleryList)
/*if (pSet->tracks_view == TV_GalleryList)
yTrk += sm + yt;
else
else*/
{ xTrk += sm;
if (xTrk > 800)
{ xTrk = 0;
Expand Down Expand Up @@ -245,8 +245,8 @@ void CGuiCom::GuiInitTrack()
auto* cmb = cmbTrkView;
cmb->removeAllItems();
cmb->addItem(TR("#{ViewList}")); cmb->addItem(TR("#{ViewListUser}"));
cmb->addItem(TR("#{ViewListDetail}"));
cmb->addItem(TR("#{ViewGallery}")); cmb->addItem(TR("#{ViewGalleryBig}"));
cmb->addItem(TR("#{ViewListDetail}")); // cmb->addItem(TR("#{ViewGalleryList}"));
cmb->addItem(TR("#{ViewGallery}"));
cmb->setIndexSelected(pSet->tracks_view);

imgTrkIco1 = fImg("TrkView2icons1");
Expand Down
11 changes: 8 additions & 3 deletions src/common/GuiCom_TrackUpd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ void CGuiCom::updTrkListDim()
int c, sum, cnt, sw, xt, yt;

int v = pSet->tracks_view;
bool gal = v >= TV_GalleryList;
bool gal = v >= TV_GalleryBig; // >= TV_GalleryList;
if (!gal)
{
sum = 0; cnt = trkList->getColumnCount();
Expand Down Expand Up @@ -376,16 +376,21 @@ void CGuiCom::updTrkListDim()
#endif
trkList->setVisible(!gal);

// gallery ::
// 🏞️ tracks gallery ::
//-------------------------------
scvTracks->setVisible(gal);
if (gal)
{
int xt = 0.017*wi.width, yt = 0.062*wi.height;
float wg = v == TV_GalleryBig ? 0.62 : 0.18;
scvTracks->setCoord(xt, yt, wg*wi.width, 0.73*wi.height);
// scvTracks->setCanvasSize(1600, 9400);

// scvTracks->setCanvasSize(1200, yy*2 + 100); // todo: gallery list..
// if (bGI) // resize
// doSizeGUI(scvTracks->getEnumerator());
}


// 🚗 car list
//-------------------------------
#ifndef SR_EDITOR // game
Expand Down
11 changes: 6 additions & 5 deletions src/common/settings_com.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void SETcom::SerializeCommon(bool w, CONFIGFILE & c)
int i,v,ii,a;

if (w) // write ----
{ for (v=0; v < TrkViews; ++v)
{ for (v=0; v < TV_ALL; ++v)
{
s = ""; ii = COL_VIS;
for (i=0; i < ii; ++i)
Expand All @@ -128,7 +128,7 @@ void SETcom::SerializeCommon(bool w, CONFIGFILE & c)
}
}else // read ----
{
for (v=0; v < TrkViews; ++v)
for (v=0; v < TV_ALL; ++v)
{
if (Param(c,w, "gui_tracks.columns"+iToStr(v), s))
{ std::stringstream sc(s);
Expand Down Expand Up @@ -156,17 +156,18 @@ int SETcom::GetTexSize(int n)
SETcom::SETcom() /// Defaults
{
int i,v;
for (v=0; v < TrkViews; ++v)
for (v=0; v < TV_ALL; ++v)
for (i=0; i < COL_VIS; ++i) col_vis[v][i] = colVisDef[v][i];
for (v=0; v < 2; ++v)
for (i=0; i < COL_FIL; ++i) col_fil[v][i] = colFilDef[v][i];
}

// 🏞️📃🏛️ tracks list views columns --
const bool SETcom::colVisDef[TrkViews][COL_VIS] =
const bool SETcom::colVisDef[TV_ALL][COL_VIS] =
{{0,0,1, 0,0,0, 1,1, 0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,1, 0,0,0, 1,0, 0,0,0,0,0,0,0,0,0,0,0,1,1},
{1,0,1, 1,1,1, 1,1, 1,1,1,1,1,1,1,1,1,1,1,0,0}};
{1,0,1, 1,1,1, 1,1, 1,1,1,1,1,1,1,1,1,1,1,0,0},
{0,0,1, 0,0,0, 0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0}}; // unused

const char SETcom::colFilDef[2][COL_FIL] =
// ver diff rating objects obstacles fluids bumps jumps loops pipes banked frenzy sum longn
Expand Down
7 changes: 3 additions & 4 deletions src/common/settings_com.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ enum EShadowType
{ Sh_None=0, Sh_Depth, Sh_Soft };

enum ETracksView
{ TV_List=0, TV_ListUser, TV_ListWide, TV_GalleryList, TV_GalleryBig, TV_ALL };
{ TV_List=0, TV_ListUser, TV_ListWide, /*TV_GalleryList,*/ TV_GalleryBig, TV_ALL };

const static int
COL_VIS = 21, COL_FIL = 16;
Expand Down Expand Up @@ -112,15 +112,14 @@ class SETcom

// 📰🔻 Tracks list ----
// view, sort column, filter on
const static int TrkViews = 3; // list, not all ETracksView
int tracks_view =0, tracks_sort =2;
bool tracks_sortup =1, tracks_filter =0;


bool col_vis[TrkViews][COL_VIS]; // visible columns for track views
bool col_vis[TV_ALL][COL_VIS]; // visible columns for track views
int col_fil[2][COL_FIL]; // filtering range for columns 0min-1max

const static bool colVisDef[TrkViews][COL_VIS]; // view columns
const static bool colVisDef[TV_ALL][COL_VIS]; // view columns
const static char colFilDef[2][COL_FIL]; // min,max


Expand Down

0 comments on commit 1125229

Please sign in to comment.