Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
maxr
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Bernd Kosmahl
maxr
Commits
95a8e09c
Commit
95a8e09c
authored
Aug 29, 2017
by
Eiko Oltmanns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restore buildListFirstItemSignalConnections when loading game
parent
5891786e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
18 deletions
+18
-18
src/game/data/units/building.cpp
src/game/data/units/building.cpp
+16
-18
src/game/data/units/building.h
src/game/data/units/building.h
+2
-0
No files found.
src/game/data/units/building.cpp
View file @
95a8e09c
...
...
@@ -372,6 +372,7 @@ void cBuilding::render_rubble (SDL_Surface* surface, const SDL_Rect& dest, float
}
}
//------------------------------------------------------------------------------
void
cBuilding
::
render_beton
(
SDL_Surface
*
surface
,
const
SDL_Rect
&
dest
,
float
zoomFactor
)
const
{
SDL_Rect
tmp
=
dest
;
...
...
@@ -399,6 +400,18 @@ void cBuilding::render_beton (SDL_Surface* surface, const SDL_Rect& dest, float
}
}
//------------------------------------------------------------------------------
void
cBuilding
::
connectFirstBuildListItem
()
{
buildListFirstItemSignalConnectionManager
.
disconnectAll
();
if
(
!
buildList
.
empty
())
{
buildListFirstItemSignalConnectionManager
.
connect
(
buildList
[
0
].
remainingMetalChanged
,
[
this
]()
{
buildListFirstItemDataChanged
();
});
buildListFirstItemSignalConnectionManager
.
connect
(
buildList
[
0
].
typeChanged
,
[
this
]()
{
buildListFirstItemDataChanged
();
});
}
}
//------------------------------------------------------------------------------
void
cBuilding
::
render_simple
(
SDL_Surface
*
surface
,
const
SDL_Rect
&
dest
,
float
zoomFactor
,
unsigned
long
long
animationTime
,
int
alpha
)
const
{
int
frameNr
=
dir
;
...
...
@@ -1329,12 +1342,7 @@ void cBuilding::setBuildList (std::vector<cBuildListItem> buildList_)
{
buildList
=
std
::
move
(
buildList_
);
buildListFirstItemSignalConnectionManager
.
disconnectAll
();
if
(
!
buildList
.
empty
())
{
buildListFirstItemSignalConnectionManager
.
connect
(
buildList
[
0
].
remainingMetalChanged
,
[
this
]()
{
buildListFirstItemDataChanged
();
});
buildListFirstItemSignalConnectionManager
.
connect
(
buildList
[
0
].
typeChanged
,
[
this
]()
{
buildListFirstItemDataChanged
();
});
}
connectFirstBuildListItem
();
buildListChanged
();
}
...
...
@@ -1344,12 +1352,7 @@ void cBuilding::addBuildListItem (cBuildListItem item)
{
buildList
.
push_back
(
std
::
move
(
item
));
buildListFirstItemSignalConnectionManager
.
disconnectAll
();
if
(
!
buildList
.
empty
())
{
buildListFirstItemSignalConnectionManager
.
connect
(
buildList
[
0
].
remainingMetalChanged
,
[
this
]()
{
buildListFirstItemDataChanged
();
});
buildListFirstItemSignalConnectionManager
.
connect
(
buildList
[
0
].
typeChanged
,
[
this
]()
{
buildListFirstItemDataChanged
();
});
}
connectFirstBuildListItem
();
buildListChanged
();
}
...
...
@@ -1359,12 +1362,7 @@ void cBuilding::removeBuildListItem (size_t index)
{
buildList
.
erase
(
buildList
.
begin
()
+
index
);
buildListFirstItemSignalConnectionManager
.
disconnectAll
();
if
(
!
buildList
.
empty
())
{
buildListFirstItemSignalConnectionManager
.
connect
(
buildList
[
0
].
remainingMetalChanged
,
[
this
]()
{
buildListFirstItemDataChanged
();
});
buildListFirstItemSignalConnectionManager
.
connect
(
buildList
[
0
].
typeChanged
,
[
this
]()
{
buildListFirstItemDataChanged
();
});
}
connectFirstBuildListItem
();
buildListChanged
();
}
...
...
src/game/data/units/building.h
View file @
95a8e09c
...
...
@@ -316,6 +316,7 @@ public:
uiData
=
UnitsUiData
.
getBuildingUI
(
data
.
getId
());
}
registerOwnerEvents
();
connectFirstBuildListItem
();
}
}
...
...
@@ -330,6 +331,7 @@ private:
void
render_rubble
(
SDL_Surface
*
surface
,
const
SDL_Rect
&
dest
,
float
zoomFactor
,
bool
drawShadow
)
const
;
void
render_beton
(
SDL_Surface
*
surface
,
const
SDL_Rect
&
dest
,
float
zoomFactor
)
const
;
void
connectFirstBuildListItem
();
bool
isWorking
;
// is the building currently working?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment