Permalink
Browse files

Merge pull request #232 from redv/researchscreen

refactoring Researchscreen
  • Loading branch information...
JonnyH committed Nov 3, 2017
2 parents b3c9a82 + 6794823 commit e67b4f842c3de083bf914594b7d3a39772826a6c
@@ -136,9 +136,25 @@
<alignment horizontal="centre" vertical="centre"/>
<font>smalfont</font>
</label>
<listbox id="LIST_LABS">
<position x="277" y="58"/>
<size height="100" width="264"/>
<scroll id="LIST_SMALL_LABS_SCROLL">
<position x="278" y="58"/>
<size height="16" width="262"/>
</scroll>
<scroll id="LIST_LARGE_LABS_SCROLL">
<position x="272" y="98"/>
<size height="16" width="274"/>
</scroll>
<listbox id="LIST_SMALL_LABS" scrollbarid="LIST_SMALL_LABS_SCROLL">
<position x="278" y="58"/>
<size height="35" width="262"/>
<item size="0" spacing="6"/>
<orientation>horizontal</orientation>
<hovercolour r="255" g="255" b="255" a="255"/>
<selcolour r="255" g="0" b="0" a="255"/>
</listbox>
<listbox id="LIST_LARGE_LABS" scrollbarid="LIST_LARGE_LABS_SCROLL">
<position x="272" y="98"/>
<size height="70" width="274"/>
<item size="0" spacing="6"/>
<orientation>horizontal</orientation>
<hovercolour r="255" g="255" b="255" a="255"/>
View
@@ -440,7 +440,7 @@ void ListBox::setSelected(sp<Control> c)
break;
}
}
if (!found)
if (c && !found)
{
LogError(
"Trying set ListBox selected control to something that isn't a member of the list");
@@ -20,4 +20,7 @@
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments>--Game.SkipIntro=true</LocalDebuggerCommandArguments>
</PropertyGroup>
<PropertyGroup>
<ShowAllFiles>true</ShowAllFiles>
</PropertyGroup>
</Project>
View
@@ -22,6 +22,8 @@ class Base : public StateObject, public std::enable_shared_from_this<Base>
public:
std::vector<std::vector<bool>> corridors;
std::vector<sp<Facility>> facilities;
// Each base has its own selected lab
std::weak_ptr<Facility> selectedLab;
// For ammunition, this is actually the count of bullets, not clips
std::map<UString, unsigned> inventoryBioEquipment;
std::map<UString, unsigned> inventoryAgentEquipment;
@@ -236,6 +236,14 @@ void ResearchState::resortTopicList()
});
}
Lab::~Lab()
{
for (auto &agent : assigned_agents)
{
agent->assigned_to_lab = false;
}
}
void Lab::setResearch(StateRef<Lab> lab, StateRef<ResearchTopic> topic, sp<GameState> state)
{
if (topic)
@@ -116,6 +116,7 @@ class Lab : public StateObject
STATE_OBJECT(Lab)
public:
Lab() = default;
~Lab() override;
ResearchTopic::LabSize size = ResearchTopic::LabSize::Small;
ResearchTopic::Type type = ResearchTopic::Type::BioChem;
StateRef<ResearchTopic> current_project;
Oops, something went wrong.

0 comments on commit e67b4f8

Please sign in to comment.