forked from teamnwah/openmw-tes3coop
Merge remote-tracking branch 'scrawl/master'
This commit is contained in:
commit
edde1fb727
14 changed files with 355 additions and 192 deletions
|
@ -132,134 +132,141 @@ namespace MWGui
|
||||||
|
|
||||||
void CharacterCreation::spawnDialog(const char id)
|
void CharacterCreation::spawnDialog(const char id)
|
||||||
{
|
{
|
||||||
switch (id)
|
try
|
||||||
{
|
{
|
||||||
case GM_Name:
|
switch (id)
|
||||||
MWBase::Environment::get().getWindowManager()->removeDialog(mNameDialog);
|
{
|
||||||
mNameDialog = 0;
|
case GM_Name:
|
||||||
mNameDialog = new TextInputDialog();
|
MWBase::Environment::get().getWindowManager()->removeDialog(mNameDialog);
|
||||||
mNameDialog->setTextLabel(MWBase::Environment::get().getWindowManager()->getGameSettingString("sName", "Name"));
|
mNameDialog = 0;
|
||||||
mNameDialog->setTextInput(mPlayerName);
|
mNameDialog = new TextInputDialog();
|
||||||
mNameDialog->setNextButtonShow(mCreationStage >= CSE_NameChosen);
|
mNameDialog->setTextLabel(MWBase::Environment::get().getWindowManager()->getGameSettingString("sName", "Name"));
|
||||||
mNameDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onNameDialogDone);
|
mNameDialog->setTextInput(mPlayerName);
|
||||||
mNameDialog->setVisible(true);
|
mNameDialog->setNextButtonShow(mCreationStage >= CSE_NameChosen);
|
||||||
break;
|
mNameDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onNameDialogDone);
|
||||||
|
mNameDialog->setVisible(true);
|
||||||
|
break;
|
||||||
|
|
||||||
case GM_Race:
|
case GM_Race:
|
||||||
MWBase::Environment::get().getWindowManager()->removeDialog(mRaceDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mRaceDialog);
|
||||||
mRaceDialog = 0;
|
mRaceDialog = 0;
|
||||||
mRaceDialog = new RaceDialog(mViewer, mResourceSystem);
|
mRaceDialog = new RaceDialog(mViewer, mResourceSystem);
|
||||||
mRaceDialog->setNextButtonShow(mCreationStage >= CSE_RaceChosen);
|
mRaceDialog->setNextButtonShow(mCreationStage >= CSE_RaceChosen);
|
||||||
mRaceDialog->setRaceId(mPlayerRaceId);
|
mRaceDialog->setRaceId(mPlayerRaceId);
|
||||||
mRaceDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogDone);
|
mRaceDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogDone);
|
||||||
mRaceDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogBack);
|
mRaceDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogBack);
|
||||||
mRaceDialog->setVisible(true);
|
mRaceDialog->setVisible(true);
|
||||||
if (mCreationStage < CSE_NameChosen)
|
if (mCreationStage < CSE_NameChosen)
|
||||||
mCreationStage = CSE_NameChosen;
|
mCreationStage = CSE_NameChosen;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GM_Class:
|
case GM_Class:
|
||||||
MWBase::Environment::get().getWindowManager()->removeDialog(mClassChoiceDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mClassChoiceDialog);
|
||||||
mClassChoiceDialog = 0;
|
mClassChoiceDialog = 0;
|
||||||
mClassChoiceDialog = new ClassChoiceDialog();
|
mClassChoiceDialog = new ClassChoiceDialog();
|
||||||
mClassChoiceDialog->eventButtonSelected += MyGUI::newDelegate(this, &CharacterCreation::onClassChoice);
|
mClassChoiceDialog->eventButtonSelected += MyGUI::newDelegate(this, &CharacterCreation::onClassChoice);
|
||||||
mClassChoiceDialog->setVisible(true);
|
mClassChoiceDialog->setVisible(true);
|
||||||
if (mCreationStage < CSE_RaceChosen)
|
if (mCreationStage < CSE_RaceChosen)
|
||||||
mCreationStage = CSE_RaceChosen;
|
mCreationStage = CSE_RaceChosen;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GM_ClassPick:
|
case GM_ClassPick:
|
||||||
MWBase::Environment::get().getWindowManager()->removeDialog(mPickClassDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mPickClassDialog);
|
||||||
mPickClassDialog = 0;
|
mPickClassDialog = 0;
|
||||||
mPickClassDialog = new PickClassDialog();
|
mPickClassDialog = new PickClassDialog();
|
||||||
mPickClassDialog->setNextButtonShow(mCreationStage >= CSE_ClassChosen);
|
mPickClassDialog->setNextButtonShow(mCreationStage >= CSE_ClassChosen);
|
||||||
mPickClassDialog->setClassId(mPlayerClass.mName);
|
mPickClassDialog->setClassId(mPlayerClass.mName);
|
||||||
mPickClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogDone);
|
mPickClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogDone);
|
||||||
mPickClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogBack);
|
mPickClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogBack);
|
||||||
mPickClassDialog->setVisible(true);
|
mPickClassDialog->setVisible(true);
|
||||||
if (mCreationStage < CSE_RaceChosen)
|
if (mCreationStage < CSE_RaceChosen)
|
||||||
mCreationStage = CSE_RaceChosen;
|
mCreationStage = CSE_RaceChosen;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GM_Birth:
|
case GM_Birth:
|
||||||
MWBase::Environment::get().getWindowManager()->removeDialog(mBirthSignDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mBirthSignDialog);
|
||||||
mBirthSignDialog = 0;
|
mBirthSignDialog = 0;
|
||||||
mBirthSignDialog = new BirthDialog();
|
mBirthSignDialog = new BirthDialog();
|
||||||
mBirthSignDialog->setNextButtonShow(mCreationStage >= CSE_BirthSignChosen);
|
mBirthSignDialog->setNextButtonShow(mCreationStage >= CSE_BirthSignChosen);
|
||||||
mBirthSignDialog->setBirthId(mPlayerBirthSignId);
|
mBirthSignDialog->setBirthId(mPlayerBirthSignId);
|
||||||
mBirthSignDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogDone);
|
mBirthSignDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogDone);
|
||||||
mBirthSignDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogBack);
|
mBirthSignDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogBack);
|
||||||
mBirthSignDialog->setVisible(true);
|
mBirthSignDialog->setVisible(true);
|
||||||
if (mCreationStage < CSE_ClassChosen)
|
if (mCreationStage < CSE_ClassChosen)
|
||||||
mCreationStage = CSE_ClassChosen;
|
mCreationStage = CSE_ClassChosen;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GM_ClassCreate:
|
case GM_ClassCreate:
|
||||||
if (!mCreateClassDialog)
|
if (!mCreateClassDialog)
|
||||||
{
|
|
||||||
mCreateClassDialog = new CreateClassDialog();
|
|
||||||
mCreateClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogDone);
|
|
||||||
mCreateClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogBack);
|
|
||||||
}
|
|
||||||
mCreateClassDialog->setNextButtonShow(mCreationStage >= CSE_ClassChosen);
|
|
||||||
mCreateClassDialog->setVisible(true);
|
|
||||||
if (mCreationStage < CSE_RaceChosen)
|
|
||||||
mCreationStage = CSE_RaceChosen;
|
|
||||||
break;
|
|
||||||
case GM_ClassGenerate:
|
|
||||||
mGenerateClassStep = 0;
|
|
||||||
mGenerateClass = "";
|
|
||||||
mGenerateClassSpecializations[0] = 0;
|
|
||||||
mGenerateClassSpecializations[1] = 0;
|
|
||||||
mGenerateClassSpecializations[2] = 0;
|
|
||||||
showClassQuestionDialog();
|
|
||||||
if (mCreationStage < CSE_RaceChosen)
|
|
||||||
mCreationStage = CSE_RaceChosen;
|
|
||||||
break;
|
|
||||||
case GM_Review:
|
|
||||||
MWBase::Environment::get().getWindowManager()->removeDialog(mReviewDialog);
|
|
||||||
mReviewDialog = 0;
|
|
||||||
mReviewDialog = new ReviewDialog();
|
|
||||||
mReviewDialog->setPlayerName(mPlayerName);
|
|
||||||
mReviewDialog->setRace(mPlayerRaceId);
|
|
||||||
mReviewDialog->setClass(mPlayerClass);
|
|
||||||
mReviewDialog->setBirthSign(mPlayerBirthSignId);
|
|
||||||
|
|
||||||
{
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
|
||||||
const MWMechanics::CreatureStats& stats = player.getClass().getCreatureStats(player);
|
|
||||||
|
|
||||||
mReviewDialog->setHealth ( stats.getHealth() );
|
|
||||||
mReviewDialog->setMagicka( stats.getMagicka() );
|
|
||||||
mReviewDialog->setFatigue( stats.getFatigue() );
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
std::map<int, MWMechanics::AttributeValue > attributes = MWBase::Environment::get().getWindowManager()->getPlayerAttributeValues();
|
|
||||||
for (std::map<int, MWMechanics::AttributeValue >::iterator it = attributes.begin();
|
|
||||||
it != attributes.end(); ++it)
|
|
||||||
{
|
{
|
||||||
mReviewDialog->setAttribute(static_cast<ESM::Attribute::AttributeID> (it->first), it->second);
|
mCreateClassDialog = new CreateClassDialog();
|
||||||
|
mCreateClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogDone);
|
||||||
|
mCreateClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogBack);
|
||||||
}
|
}
|
||||||
}
|
mCreateClassDialog->setNextButtonShow(mCreationStage >= CSE_ClassChosen);
|
||||||
|
mCreateClassDialog->setVisible(true);
|
||||||
|
if (mCreationStage < CSE_RaceChosen)
|
||||||
|
mCreationStage = CSE_RaceChosen;
|
||||||
|
break;
|
||||||
|
case GM_ClassGenerate:
|
||||||
|
mGenerateClassStep = 0;
|
||||||
|
mGenerateClass = "";
|
||||||
|
mGenerateClassSpecializations[0] = 0;
|
||||||
|
mGenerateClassSpecializations[1] = 0;
|
||||||
|
mGenerateClassSpecializations[2] = 0;
|
||||||
|
showClassQuestionDialog();
|
||||||
|
if (mCreationStage < CSE_RaceChosen)
|
||||||
|
mCreationStage = CSE_RaceChosen;
|
||||||
|
break;
|
||||||
|
case GM_Review:
|
||||||
|
MWBase::Environment::get().getWindowManager()->removeDialog(mReviewDialog);
|
||||||
|
mReviewDialog = 0;
|
||||||
|
mReviewDialog = new ReviewDialog();
|
||||||
|
mReviewDialog->setPlayerName(mPlayerName);
|
||||||
|
mReviewDialog->setRace(mPlayerRaceId);
|
||||||
|
mReviewDialog->setClass(mPlayerClass);
|
||||||
|
mReviewDialog->setBirthSign(mPlayerBirthSignId);
|
||||||
|
|
||||||
{
|
|
||||||
std::map<int, MWMechanics::SkillValue > skills = MWBase::Environment::get().getWindowManager()->getPlayerSkillValues();
|
|
||||||
for (std::map<int, MWMechanics::SkillValue >::iterator it = skills.begin();
|
|
||||||
it != skills.end(); ++it)
|
|
||||||
{
|
{
|
||||||
mReviewDialog->setSkillValue(static_cast<ESM::Skill::SkillEnum> (it->first), it->second);
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
}
|
const MWMechanics::CreatureStats& stats = player.getClass().getCreatureStats(player);
|
||||||
mReviewDialog->configureSkills(MWBase::Environment::get().getWindowManager()->getPlayerMajorSkills(), MWBase::Environment::get().getWindowManager()->getPlayerMinorSkills());
|
|
||||||
}
|
|
||||||
|
|
||||||
mReviewDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogDone);
|
mReviewDialog->setHealth ( stats.getHealth() );
|
||||||
mReviewDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogBack);
|
mReviewDialog->setMagicka( stats.getMagicka() );
|
||||||
mReviewDialog->eventActivateDialog += MyGUI::newDelegate(this, &CharacterCreation::onReviewActivateDialog);
|
mReviewDialog->setFatigue( stats.getFatigue() );
|
||||||
mReviewDialog->setVisible(true);
|
}
|
||||||
if (mCreationStage < CSE_BirthSignChosen)
|
|
||||||
mCreationStage = CSE_BirthSignChosen;
|
{
|
||||||
break;
|
std::map<int, MWMechanics::AttributeValue > attributes = MWBase::Environment::get().getWindowManager()->getPlayerAttributeValues();
|
||||||
|
for (std::map<int, MWMechanics::AttributeValue >::iterator it = attributes.begin();
|
||||||
|
it != attributes.end(); ++it)
|
||||||
|
{
|
||||||
|
mReviewDialog->setAttribute(static_cast<ESM::Attribute::AttributeID> (it->first), it->second);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
std::map<int, MWMechanics::SkillValue > skills = MWBase::Environment::get().getWindowManager()->getPlayerSkillValues();
|
||||||
|
for (std::map<int, MWMechanics::SkillValue >::iterator it = skills.begin();
|
||||||
|
it != skills.end(); ++it)
|
||||||
|
{
|
||||||
|
mReviewDialog->setSkillValue(static_cast<ESM::Skill::SkillEnum> (it->first), it->second);
|
||||||
|
}
|
||||||
|
mReviewDialog->configureSkills(MWBase::Environment::get().getWindowManager()->getPlayerMajorSkills(), MWBase::Environment::get().getWindowManager()->getPlayerMinorSkills());
|
||||||
|
}
|
||||||
|
|
||||||
|
mReviewDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogDone);
|
||||||
|
mReviewDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogBack);
|
||||||
|
mReviewDialog->eventActivateDialog += MyGUI::newDelegate(this, &CharacterCreation::onReviewActivateDialog);
|
||||||
|
mReviewDialog->setVisible(true);
|
||||||
|
if (mCreationStage < CSE_BirthSignChosen)
|
||||||
|
mCreationStage = CSE_BirthSignChosen;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (std::exception& e)
|
||||||
|
{
|
||||||
|
std::cerr << "Failed to create chargen window: " << e.what() << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -436,6 +436,20 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
const std::string& script = ptr.getClass().getScript(ptr);
|
const std::string& script = ptr.getClass().getScript(ptr);
|
||||||
|
|
||||||
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
|
|
||||||
|
// early-out for items that need to be equipped, but can't be equipped: we don't want to set OnPcEquip in that case
|
||||||
|
if (!ptr.getClass().getEquipmentSlots(ptr).first.empty())
|
||||||
|
{
|
||||||
|
std::pair<int, std::string> canEquip = ptr.getClass().canBeEquipped(ptr, player);
|
||||||
|
if (canEquip.first == 0)
|
||||||
|
{
|
||||||
|
MWBase::Environment::get().getWindowManager()->messageBox(canEquip.second);
|
||||||
|
updateItemView();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If the item has a script, set its OnPcEquip to 1
|
// If the item has a script, set its OnPcEquip to 1
|
||||||
if (!script.empty()
|
if (!script.empty()
|
||||||
// Another morrowind oddity: when an item has skipped equipping and pcskipequip is reset to 0 afterwards,
|
// Another morrowind oddity: when an item has skipped equipping and pcskipequip is reset to 0 afterwards,
|
||||||
|
@ -455,7 +469,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
boost::shared_ptr<MWWorld::Action> action = ptr.getClass().use(ptr);
|
boost::shared_ptr<MWWorld::Action> action = ptr.getClass().use(ptr);
|
||||||
|
|
||||||
action->execute (MWBase::Environment::get().getWorld()->getPlayerPtr());
|
action->execute (player);
|
||||||
|
|
||||||
mSkippedToEquip = MWWorld::Ptr();
|
mSkippedToEquip = MWWorld::Ptr();
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,31 +92,41 @@ namespace MWGui
|
||||||
|
|
||||||
void CustomMarkerCollection::addMarker(const ESM::CustomMarker &marker, bool triggerEvent)
|
void CustomMarkerCollection::addMarker(const ESM::CustomMarker &marker, bool triggerEvent)
|
||||||
{
|
{
|
||||||
mMarkers.push_back(marker);
|
mMarkers.insert(std::make_pair(marker.mCell, marker));
|
||||||
if (triggerEvent)
|
if (triggerEvent)
|
||||||
eventMarkersChanged();
|
eventMarkersChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomMarkerCollection::deleteMarker(const ESM::CustomMarker &marker)
|
void CustomMarkerCollection::deleteMarker(const ESM::CustomMarker &marker)
|
||||||
{
|
{
|
||||||
std::vector<ESM::CustomMarker>::iterator it = std::find(mMarkers.begin(), mMarkers.end(), marker);
|
std::pair<ContainerType::iterator, ContainerType::iterator> range = mMarkers.equal_range(marker.mCell);
|
||||||
if (it != mMarkers.end())
|
|
||||||
mMarkers.erase(it);
|
|
||||||
else
|
|
||||||
throw std::runtime_error("can't find marker to delete");
|
|
||||||
|
|
||||||
eventMarkersChanged();
|
for (ContainerType::iterator it = range.first; it != range.second; ++it)
|
||||||
|
{
|
||||||
|
if (it->second == marker)
|
||||||
|
{
|
||||||
|
mMarkers.erase(it);
|
||||||
|
eventMarkersChanged();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw std::runtime_error("can't find marker to delete");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomMarkerCollection::updateMarker(const ESM::CustomMarker &marker, const std::string &newNote)
|
void CustomMarkerCollection::updateMarker(const ESM::CustomMarker &marker, const std::string &newNote)
|
||||||
{
|
{
|
||||||
std::vector<ESM::CustomMarker>::iterator it = std::find(mMarkers.begin(), mMarkers.end(), marker);
|
std::pair<ContainerType::iterator, ContainerType::iterator> range = mMarkers.equal_range(marker.mCell);
|
||||||
if (it != mMarkers.end())
|
|
||||||
it->mNote = newNote;
|
|
||||||
else
|
|
||||||
throw std::runtime_error("can't find marker to update");
|
|
||||||
|
|
||||||
eventMarkersChanged();
|
for (ContainerType::iterator it = range.first; it != range.second; ++it)
|
||||||
|
{
|
||||||
|
if (it->second == marker)
|
||||||
|
{
|
||||||
|
it->second.mNote = newNote;
|
||||||
|
eventMarkersChanged();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw std::runtime_error("can't find marker to update");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomMarkerCollection::clear()
|
void CustomMarkerCollection::clear()
|
||||||
|
@ -125,16 +135,21 @@ namespace MWGui
|
||||||
eventMarkersChanged();
|
eventMarkersChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<ESM::CustomMarker>::const_iterator CustomMarkerCollection::begin() const
|
CustomMarkerCollection::ContainerType::const_iterator CustomMarkerCollection::begin() const
|
||||||
{
|
{
|
||||||
return mMarkers.begin();
|
return mMarkers.begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<ESM::CustomMarker>::const_iterator CustomMarkerCollection::end() const
|
CustomMarkerCollection::ContainerType::const_iterator CustomMarkerCollection::end() const
|
||||||
{
|
{
|
||||||
return mMarkers.end();
|
return mMarkers.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CustomMarkerCollection::RangeType CustomMarkerCollection::getMarkers(const ESM::CellId &cellId) const
|
||||||
|
{
|
||||||
|
return mMarkers.equal_range(cellId);
|
||||||
|
}
|
||||||
|
|
||||||
size_t CustomMarkerCollection::size() const
|
size_t CustomMarkerCollection::size() const
|
||||||
{
|
{
|
||||||
return mMarkers.size();
|
return mMarkers.size();
|
||||||
|
@ -299,44 +314,43 @@ namespace MWGui
|
||||||
MyGUI::Gui::getInstance().destroyWidget(*it);
|
MyGUI::Gui::getInstance().destroyWidget(*it);
|
||||||
mCustomMarkerWidgets.clear();
|
mCustomMarkerWidgets.clear();
|
||||||
|
|
||||||
for (std::vector<ESM::CustomMarker>::const_iterator it = mCustomMarkers.begin(); it != mCustomMarkers.end(); ++it)
|
for (int dX = -1; dX <= 1; ++dX)
|
||||||
{
|
{
|
||||||
const ESM::CustomMarker& marker = *it;
|
for (int dY =-1; dY <= 1; ++dY)
|
||||||
|
|
||||||
if (marker.mCell.mPaged != !mInterior)
|
|
||||||
continue;
|
|
||||||
if (mInterior)
|
|
||||||
{
|
{
|
||||||
if (marker.mCell.mWorldspace != mPrefix)
|
ESM::CellId cellId;
|
||||||
continue;
|
cellId.mPaged = !mInterior;
|
||||||
}
|
cellId.mWorldspace = (mInterior ? mPrefix : "sys::default");
|
||||||
else
|
cellId.mIndex.mX = mCurX+dX;
|
||||||
{
|
cellId.mIndex.mY = mCurY+dY;
|
||||||
if (std::abs(marker.mCell.mIndex.mX - mCurX) > 1)
|
|
||||||
continue;
|
|
||||||
if (std::abs(marker.mCell.mIndex.mY - mCurY) > 1)
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
MarkerUserData markerPos (mLocalMapRender);
|
CustomMarkerCollection::RangeType markers = mCustomMarkers.getMarkers(cellId);
|
||||||
MyGUI::IntPoint widgetPos = getMarkerPosition(marker.mWorldX, marker.mWorldY, markerPos);
|
for (CustomMarkerCollection::ContainerType::const_iterator it = markers.first; it != markers.second; ++it)
|
||||||
|
{
|
||||||
|
const ESM::CustomMarker& marker = it->second;
|
||||||
|
|
||||||
MyGUI::IntCoord widgetCoord(widgetPos.left - 8,
|
MarkerUserData markerPos (mLocalMapRender);
|
||||||
widgetPos.top - 8,
|
MyGUI::IntPoint widgetPos = getMarkerPosition(marker.mWorldX, marker.mWorldY, markerPos);
|
||||||
16, 16);
|
|
||||||
MarkerWidget* markerWidget = mLocalMap->createWidget<MarkerWidget>("CustomMarkerButton",
|
MyGUI::IntCoord widgetCoord(widgetPos.left - 8,
|
||||||
widgetCoord, MyGUI::Align::Default);
|
widgetPos.top - 8,
|
||||||
markerWidget->setDepth(Local_MarkerAboveFogLayer);
|
16, 16);
|
||||||
markerWidget->setUserString("ToolTipType", "Layout");
|
MarkerWidget* markerWidget = mLocalMap->createWidget<MarkerWidget>("CustomMarkerButton",
|
||||||
markerWidget->setUserString("ToolTipLayout", "TextToolTipOneLine");
|
widgetCoord, MyGUI::Align::Default);
|
||||||
markerWidget->setUserString("Caption_TextOneLine", MyGUI::TextIterator::toTagsString(marker.mNote));
|
markerWidget->setDepth(Local_MarkerAboveFogLayer);
|
||||||
markerWidget->setNormalColour(MyGUI::Colour(0.6f, 0.6f, 0.6f));
|
markerWidget->setUserString("ToolTipType", "Layout");
|
||||||
markerWidget->setHoverColour(MyGUI::Colour(1.0f, 1.0f, 1.0f));
|
markerWidget->setUserString("ToolTipLayout", "TextToolTipOneLine");
|
||||||
markerWidget->setUserData(marker);
|
markerWidget->setUserString("Caption_TextOneLine", MyGUI::TextIterator::toTagsString(marker.mNote));
|
||||||
markerWidget->setNeedMouseFocus(true);
|
markerWidget->setNormalColour(MyGUI::Colour(0.6f, 0.6f, 0.6f));
|
||||||
customMarkerCreated(markerWidget);
|
markerWidget->setHoverColour(MyGUI::Colour(1.0f, 1.0f, 1.0f));
|
||||||
mCustomMarkerWidgets.push_back(markerWidget);
|
markerWidget->setUserData(marker);
|
||||||
|
markerWidget->setNeedMouseFocus(true);
|
||||||
|
customMarkerCreated(markerWidget);
|
||||||
|
mCustomMarkerWidgets.push_back(markerWidget);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
redraw();
|
redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -411,11 +425,9 @@ namespace MWGui
|
||||||
MWBase::World::DoorMarker marker = *it;
|
MWBase::World::DoorMarker marker = *it;
|
||||||
|
|
||||||
std::vector<std::string> destNotes;
|
std::vector<std::string> destNotes;
|
||||||
for (std::vector<ESM::CustomMarker>::const_iterator it = mCustomMarkers.begin(); it != mCustomMarkers.end(); ++it)
|
CustomMarkerCollection::RangeType markers = mCustomMarkers.getMarkers(marker.dest);
|
||||||
{
|
for (CustomMarkerCollection::ContainerType::const_iterator it = markers.first; it != markers.second; ++it)
|
||||||
if (it->mCell == marker.dest)
|
destNotes.push_back(it->second.mNote);
|
||||||
destNotes.push_back(it->mNote);
|
|
||||||
}
|
|
||||||
|
|
||||||
MarkerUserData data (mLocalMapRender);
|
MarkerUserData data (mLocalMapRender);
|
||||||
data.notes = destNotes;
|
data.notes = destNotes;
|
||||||
|
@ -771,15 +783,19 @@ namespace MWGui
|
||||||
|
|
||||||
MyGUI::Widget* markerWidget = mGlobalMap->createWidget<MyGUI::Widget>("MarkerButton",
|
MyGUI::Widget* markerWidget = mGlobalMap->createWidget<MyGUI::Widget>("MarkerButton",
|
||||||
widgetCoord, MyGUI::Align::Default);
|
widgetCoord, MyGUI::Align::Default);
|
||||||
|
|
||||||
|
markerWidget->setUserString("Caption_TextOneLine", name);
|
||||||
|
|
||||||
|
setGlobalMapMarkerTooltip(markerWidget, x, y);
|
||||||
|
|
||||||
|
markerWidget->setUserString("ToolTipLayout", "TextToolTipOneLine");
|
||||||
|
|
||||||
markerWidget->setNeedMouseFocus(true);
|
markerWidget->setNeedMouseFocus(true);
|
||||||
markerWidget->setColour(MyGUI::Colour::parse(MyGUI::LanguageManager::getInstance().replaceTags("#{fontcolour=normal}")));
|
markerWidget->setColour(MyGUI::Colour::parse(MyGUI::LanguageManager::getInstance().replaceTags("#{fontcolour=normal}")));
|
||||||
markerWidget->setUserString("ToolTipType", "Layout");
|
|
||||||
markerWidget->setUserString("ToolTipLayout", "TextToolTipOneLine");
|
|
||||||
markerWidget->setUserString("Caption_TextOneLine", name);
|
|
||||||
markerWidget->setDepth(Global_MarkerLayer);
|
markerWidget->setDepth(Global_MarkerLayer);
|
||||||
markerWidget->eventMouseDrag += MyGUI::newDelegate(this, &MapWindow::onMouseDrag);
|
markerWidget->eventMouseDrag += MyGUI::newDelegate(this, &MapWindow::onMouseDrag);
|
||||||
markerWidget->eventMouseButtonPressed += MyGUI::newDelegate(this, &MapWindow::onDragStart);
|
markerWidget->eventMouseButtonPressed += MyGUI::newDelegate(this, &MapWindow::onDragStart);
|
||||||
mGlobalMapMarkers.push_back(markerWidget);
|
mGlobalMapMarkers[std::make_pair(x,y)] = markerWidget;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -804,6 +820,45 @@ namespace MWGui
|
||||||
NoDrop::onFrame(dt);
|
NoDrop::onFrame(dt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MapWindow::setGlobalMapMarkerTooltip(MyGUI::Widget* markerWidget, int x, int y)
|
||||||
|
{
|
||||||
|
ESM::CellId cellId;
|
||||||
|
cellId.mIndex.mX = x;
|
||||||
|
cellId.mIndex.mY = y;
|
||||||
|
cellId.mWorldspace = "sys::default";
|
||||||
|
cellId.mPaged = true;
|
||||||
|
CustomMarkerCollection::RangeType markers = mCustomMarkers.getMarkers(cellId);
|
||||||
|
std::vector<std::string> destNotes;
|
||||||
|
for (CustomMarkerCollection::ContainerType::const_iterator it = markers.first; it != markers.second; ++it)
|
||||||
|
destNotes.push_back(it->second.mNote);
|
||||||
|
|
||||||
|
if (!destNotes.empty())
|
||||||
|
{
|
||||||
|
MarkerUserData data (NULL);
|
||||||
|
data.notes = destNotes;
|
||||||
|
data.caption = markerWidget->getUserString("Caption_TextOneLine");
|
||||||
|
markerWidget->setUserData(data);
|
||||||
|
markerWidget->setUserString("ToolTipType", "MapMarker");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
markerWidget->setUserString("ToolTipType", "Layout");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapWindow::updateCustomMarkers()
|
||||||
|
{
|
||||||
|
LocalMapBase::updateCustomMarkers();
|
||||||
|
|
||||||
|
for (std::map<std::pair<int, int>, MyGUI::Widget*>::iterator widgetIt = mGlobalMapMarkers.begin(); widgetIt != mGlobalMapMarkers.end(); ++widgetIt)
|
||||||
|
{
|
||||||
|
int x = widgetIt->first.first;
|
||||||
|
int y = widgetIt->first.second;
|
||||||
|
MyGUI::Widget* markerWidget = widgetIt->second;
|
||||||
|
setGlobalMapMarkerTooltip(markerWidget, x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MapWindow::onDragStart(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id)
|
void MapWindow::onDragStart(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id)
|
||||||
{
|
{
|
||||||
if (_id!=MyGUI::MouseButton::Left) return;
|
if (_id!=MyGUI::MouseButton::Left) return;
|
||||||
|
@ -901,8 +956,8 @@ namespace MWGui
|
||||||
mGlobalMapRender->clear();
|
mGlobalMapRender->clear();
|
||||||
mChanged = true;
|
mChanged = true;
|
||||||
|
|
||||||
for (std::vector<MyGUI::Widget*>::iterator it = mGlobalMapMarkers.begin(); it != mGlobalMapMarkers.end(); ++it)
|
for (std::map<std::pair<int, int>, MyGUI::Widget*>::iterator it = mGlobalMapMarkers.begin(); it != mGlobalMapMarkers.end(); ++it)
|
||||||
MyGUI::Gui::getInstance().destroyWidget(*it);
|
MyGUI::Gui::getInstance().destroyWidget(it->second);
|
||||||
mGlobalMapMarkers.clear();
|
mGlobalMapMarkers.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1022,6 +1077,8 @@ namespace MWGui
|
||||||
|
|
||||||
bool LocalMapBase::MarkerUserData::isPositionExplored() const
|
bool LocalMapBase::MarkerUserData::isPositionExplored() const
|
||||||
{
|
{
|
||||||
|
if (!mLocalMapRender)
|
||||||
|
return true;
|
||||||
return mLocalMapRender->isPositionExplored(nX, nY, cellX, cellY, interior);
|
return mLocalMapRender->isPositionExplored(nX, nY, cellX, cellY, interior);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,14 +42,20 @@ namespace MWGui
|
||||||
|
|
||||||
size_t size() const;
|
size_t size() const;
|
||||||
|
|
||||||
std::vector<ESM::CustomMarker>::const_iterator begin() const;
|
typedef std::multimap<ESM::CellId, ESM::CustomMarker> ContainerType;
|
||||||
std::vector<ESM::CustomMarker>::const_iterator end() const;
|
|
||||||
|
typedef std::pair<ContainerType::const_iterator, ContainerType::const_iterator> RangeType;
|
||||||
|
|
||||||
|
ContainerType::const_iterator begin() const;
|
||||||
|
ContainerType::const_iterator end() const;
|
||||||
|
|
||||||
|
RangeType getMarkers(const ESM::CellId& cellId) const;
|
||||||
|
|
||||||
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
|
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
|
||||||
EventHandle_Void eventMarkersChanged;
|
EventHandle_Void eventMarkersChanged;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<ESM::CustomMarker> mMarkers;
|
ContainerType mMarkers;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LocalMapBase
|
class LocalMapBase
|
||||||
|
@ -120,7 +126,7 @@ namespace MWGui
|
||||||
std::vector<MyGUI::Widget*> mMagicMarkerWidgets;
|
std::vector<MyGUI::Widget*> mMagicMarkerWidgets;
|
||||||
std::vector<MyGUI::Widget*> mCustomMarkerWidgets;
|
std::vector<MyGUI::Widget*> mCustomMarkerWidgets;
|
||||||
|
|
||||||
void updateCustomMarkers();
|
virtual void updateCustomMarkers();
|
||||||
|
|
||||||
void applyFogOfWar();
|
void applyFogOfWar();
|
||||||
|
|
||||||
|
@ -197,6 +203,8 @@ namespace MWGui
|
||||||
|
|
||||||
void onFrame(float dt);
|
void onFrame(float dt);
|
||||||
|
|
||||||
|
virtual void updateCustomMarkers();
|
||||||
|
|
||||||
/// Clear all savegame-specific data
|
/// Clear all savegame-specific data
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
|
@ -215,6 +223,7 @@ namespace MWGui
|
||||||
void onNoteDoubleClicked(MyGUI::Widget* sender);
|
void onNoteDoubleClicked(MyGUI::Widget* sender);
|
||||||
void onChangeScrollWindowCoord(MyGUI::Widget* sender);
|
void onChangeScrollWindowCoord(MyGUI::Widget* sender);
|
||||||
void globalMapUpdatePlayer();
|
void globalMapUpdatePlayer();
|
||||||
|
void setGlobalMapMarkerTooltip(MyGUI::Widget* widget, int x, int y);
|
||||||
|
|
||||||
MyGUI::ScrollView* mGlobalMap;
|
MyGUI::ScrollView* mGlobalMap;
|
||||||
std::auto_ptr<MyGUI::ITexture> mGlobalMapTexture;
|
std::auto_ptr<MyGUI::ITexture> mGlobalMapTexture;
|
||||||
|
@ -242,7 +251,7 @@ namespace MWGui
|
||||||
|
|
||||||
MWRender::GlobalMap* mGlobalMapRender;
|
MWRender::GlobalMap* mGlobalMapRender;
|
||||||
|
|
||||||
std::vector<MyGUI::Widget*> mGlobalMapMarkers;
|
std::map<std::pair<int, int>, MyGUI::Widget*> mGlobalMapMarkers;
|
||||||
|
|
||||||
EditNoteDialog mEditNoteDialog;
|
EditNoteDialog mEditNoteDialog;
|
||||||
ESM::CustomMarker mEditingMarker;
|
ESM::CustomMarker mEditingMarker;
|
||||||
|
|
|
@ -233,6 +233,7 @@ namespace MWGui
|
||||||
if (mResolutionList->findItemIndexWith(str) == MyGUI::ITEM_NONE)
|
if (mResolutionList->findItemIndexWith(str) == MyGUI::ITEM_NONE)
|
||||||
mResolutionList->addItem(str);
|
mResolutionList->addItem(str);
|
||||||
}
|
}
|
||||||
|
highlightCurrentResolution();
|
||||||
|
|
||||||
std::string tf = Settings::Manager::getString("texture filtering", "General");
|
std::string tf = Settings::Manager::getString("texture filtering", "General");
|
||||||
mTextureFilteringButton->setCaption(textureFilteringToStr(tf));
|
mTextureFilteringButton->setCaption(textureFilteringToStr(tf));
|
||||||
|
@ -299,8 +300,28 @@ namespace MWGui
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsWindow::onResolutionCancel()
|
void SettingsWindow::onResolutionCancel()
|
||||||
|
{
|
||||||
|
highlightCurrentResolution();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SettingsWindow::highlightCurrentResolution()
|
||||||
{
|
{
|
||||||
mResolutionList->setIndexSelected(MyGUI::ITEM_NONE);
|
mResolutionList->setIndexSelected(MyGUI::ITEM_NONE);
|
||||||
|
|
||||||
|
int currentX = Settings::Manager::getInt("resolution x", "Video");
|
||||||
|
int currentY = Settings::Manager::getInt("resolution y", "Video");
|
||||||
|
|
||||||
|
for (size_t i=0; i<mResolutionList->getItemCount(); ++i)
|
||||||
|
{
|
||||||
|
int resX, resY;
|
||||||
|
parseResolution (resX, resY, mResolutionList->getItemNameAt(i));
|
||||||
|
|
||||||
|
if (resX == currentX && resY == currentY)
|
||||||
|
{
|
||||||
|
mResolutionList->setIndexSelected(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsWindow::onShadowTextureSizeChanged(MyGUI::ComboBox *_sender, size_t pos)
|
void SettingsWindow::onShadowTextureSizeChanged(MyGUI::ComboBox *_sender, size_t pos)
|
||||||
|
|
|
@ -59,6 +59,7 @@ namespace MWGui
|
||||||
void onResolutionSelected(MyGUI::ListBox* _sender, size_t index);
|
void onResolutionSelected(MyGUI::ListBox* _sender, size_t index);
|
||||||
void onResolutionAccept();
|
void onResolutionAccept();
|
||||||
void onResolutionCancel();
|
void onResolutionCancel();
|
||||||
|
void highlightCurrentResolution();
|
||||||
|
|
||||||
void onShadowTextureSizeChanged(MyGUI::ComboBox* _sender, size_t pos);
|
void onShadowTextureSizeChanged(MyGUI::ComboBox* _sender, size_t pos);
|
||||||
|
|
||||||
|
|
|
@ -539,6 +539,9 @@ namespace MWGui
|
||||||
, mRepeatStepTime(0.1f)
|
, mRepeatStepTime(0.1f)
|
||||||
, mIsIncreasing(true)
|
, mIsIncreasing(true)
|
||||||
{
|
{
|
||||||
|
#if MYGUI_VERSION >= MYGUI_DEFINE_VERSION(3,2,2)
|
||||||
|
ScrollBar::setRepeatEnabled(false);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
MWScrollBar::~MWScrollBar()
|
MWScrollBar::~MWScrollBar()
|
||||||
|
|
|
@ -21,16 +21,16 @@ namespace MWGui
|
||||||
// Events
|
// Events
|
||||||
typedef MyGUI::delegates::CMultiDelegate1<WindowBase*> EventHandle_WindowBase;
|
typedef MyGUI::delegates::CMultiDelegate1<WindowBase*> EventHandle_WindowBase;
|
||||||
|
|
||||||
///Unhides the window
|
/// Notify that window has been made visible
|
||||||
virtual void open() {}
|
virtual void open() {}
|
||||||
///Hides the window
|
/// Notify that window has been hidden
|
||||||
virtual void close () {}
|
virtual void close () {}
|
||||||
///Gracefully exits the window
|
/// Gracefully exits the window
|
||||||
virtual void exit() {}
|
virtual void exit() {}
|
||||||
///Sets the visibility of the window
|
/// Sets the visibility of the window
|
||||||
virtual void setVisible(bool visible);
|
virtual void setVisible(bool visible);
|
||||||
///Returns the visibility state of the window
|
/// Returns the visibility state of the window
|
||||||
virtual bool isVisible();
|
bool isVisible();
|
||||||
void center();
|
void center();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1658,10 +1658,10 @@ namespace MWGui
|
||||||
writer.endRecord(ESM::REC_ASPL);
|
writer.endRecord(ESM::REC_ASPL);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (std::vector<ESM::CustomMarker>::const_iterator it = mCustomMarkers.begin(); it != mCustomMarkers.end(); ++it)
|
for (CustomMarkerCollection::ContainerType::const_iterator it = mCustomMarkers.begin(); it != mCustomMarkers.end(); ++it)
|
||||||
{
|
{
|
||||||
writer.startRecord(ESM::REC_MARK);
|
writer.startRecord(ESM::REC_MARK);
|
||||||
(*it).save(writer);
|
it->second.save(writer);
|
||||||
writer.endRecord(ESM::REC_MARK);
|
writer.endRecord(ESM::REC_MARK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,3 +35,26 @@ bool ESM::operator!= (const CellId& left, const CellId& right)
|
||||||
{
|
{
|
||||||
return !(left==right);
|
return !(left==right);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ESM::operator < (const CellId& left, const CellId& right)
|
||||||
|
{
|
||||||
|
if (left.mPaged < right.mPaged)
|
||||||
|
return true;
|
||||||
|
if (left.mPaged > right.mPaged)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (left.mPaged)
|
||||||
|
{
|
||||||
|
if (left.mIndex.mX < right.mIndex.mX)
|
||||||
|
return true;
|
||||||
|
if (left.mIndex.mX > right.mIndex.mX)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (left.mIndex.mY < right.mIndex.mY)
|
||||||
|
return true;
|
||||||
|
if (left.mIndex.mY > right.mIndex.mY)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return left.mWorldspace < right.mWorldspace;
|
||||||
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ namespace ESM
|
||||||
|
|
||||||
bool operator== (const CellId& left, const CellId& right);
|
bool operator== (const CellId& left, const CellId& right);
|
||||||
bool operator!= (const CellId& left, const CellId& right);
|
bool operator!= (const CellId& left, const CellId& right);
|
||||||
|
bool operator< (const CellId& left, const CellId& right);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -87,6 +87,8 @@ namespace osgMyGUI
|
||||||
throw std::runtime_error("No texturemanager set");
|
throw std::runtime_error("No texturemanager set");
|
||||||
|
|
||||||
mTexture = mTextureManager->getTexture2D(fname, osg::Texture2D::CLAMP_TO_EDGE, osg::Texture2D::CLAMP_TO_EDGE);
|
mTexture = mTextureManager->getTexture2D(fname, osg::Texture2D::CLAMP_TO_EDGE, osg::Texture2D::CLAMP_TO_EDGE);
|
||||||
|
// disable mip-maps
|
||||||
|
mTexture->setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::LINEAR);
|
||||||
|
|
||||||
// FIXME
|
// FIXME
|
||||||
mFormat = MyGUI::PixelFormat::R8G8B8;
|
mFormat = MyGUI::PixelFormat::R8G8B8;
|
||||||
|
|
|
@ -72,7 +72,30 @@ namespace Resource
|
||||||
for (std::map<MapKey, osg::ref_ptr<osg::Texture2D> >::iterator it = mTextures.begin(); it != mTextures.end(); ++it)
|
for (std::map<MapKey, osg::ref_ptr<osg::Texture2D> >::iterator it = mTextures.begin(); it != mTextures.end(); ++it)
|
||||||
{
|
{
|
||||||
osg::ref_ptr<osg::Texture2D> tex = it->second;
|
osg::ref_ptr<osg::Texture2D> tex = it->second;
|
||||||
tex->setFilter(osg::Texture::MIN_FILTER, mMinFilter);
|
|
||||||
|
// Keep mip-mapping disabled if the texture creator explicitely requested it.
|
||||||
|
osg::Texture::FilterMode oldMin = tex->getFilter(osg::Texture::MIN_FILTER);
|
||||||
|
if (oldMin == osg::Texture::LINEAR || oldMin == osg::Texture::NEAREST)
|
||||||
|
{
|
||||||
|
osg::Texture::FilterMode newMin = osg::Texture::LINEAR;
|
||||||
|
switch (mMinFilter)
|
||||||
|
{
|
||||||
|
case osg::Texture::LINEAR:
|
||||||
|
case osg::Texture::LINEAR_MIPMAP_LINEAR:
|
||||||
|
case osg::Texture::LINEAR_MIPMAP_NEAREST:
|
||||||
|
newMin = osg::Texture::LINEAR;
|
||||||
|
break;
|
||||||
|
case osg::Texture::NEAREST:
|
||||||
|
case osg::Texture::NEAREST_MIPMAP_LINEAR:
|
||||||
|
case osg::Texture::NEAREST_MIPMAP_NEAREST:
|
||||||
|
newMin = osg::Texture::NEAREST;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
tex->setFilter(osg::Texture::MIN_FILTER, newMin);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
tex->setFilter(osg::Texture::MIN_FILTER, mMinFilter);
|
||||||
|
|
||||||
tex->setFilter(osg::Texture::MAG_FILTER, mMagFilter);
|
tex->setFilter(osg::Texture::MAG_FILTER, mMagFilter);
|
||||||
tex->setMaxAnisotropy(static_cast<float>(mMaxAnisotropy));
|
tex->setMaxAnisotropy(static_cast<float>(mMaxAnisotropy));
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,12 @@
|
||||||
<MyGUI type="Layout">
|
<MyGUI type="Layout">
|
||||||
<!-- The entire screen -->
|
<!-- The entire screen -->
|
||||||
<Widget type="Widget" layer="Windows" position="0 0 300 300" name="_Main">
|
<Widget type="Widget" layer="Windows" position="0 0 300 300" name="_Main">
|
||||||
<Widget type="TextBox" skin="SandText" position="0 250 280 50" align="Bottom Right" name="VersionText">
|
<Widget type="EditBox" skin="MW_TextBoxEdit" position="0 250 280 50" align="Bottom Right" name="VersionText">
|
||||||
<Property key="TextAlign" value="Right"/>
|
<Property key="TextAlign" value="Right"/>
|
||||||
<Property key="TextShadow" value="true"/>
|
<Property key="TextShadow" value="true"/>
|
||||||
<Property key="TextShadowColour" value="0 0 0"/>
|
<Property key="TextShadowColour" value="0 0 0"/>
|
||||||
|
<Property key="ReadOnly" value="true"/>
|
||||||
|
<Property key="MultiLine" value="true"/>
|
||||||
</Widget>
|
</Widget>
|
||||||
</Widget>
|
</Widget>
|
||||||
</MyGUI>
|
</MyGUI>
|
||||||
|
|
Loading…
Reference in a new issue