mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-13 11:40:38 +02:00
commit
d772521d59
@ -307,6 +307,8 @@
|
||||
"vcmi.systemOptions.enableLargeSpellbookButton.help" : "{Large Spell Book}\n\nEnables larger spell book that fits more spells per page. Spell book page change animation does not work with this setting enabled.",
|
||||
"vcmi.systemOptions.audioMuteFocus.hover" : "Mute on inactivity",
|
||||
"vcmi.systemOptions.audioMuteFocus.help" : "{Mute on inactivity}\n\nMute audio on inactive window focus. Exceptions are ingame messages and new turn sound.",
|
||||
"vcmi.systemOptions.enableOverlayButton.hover" : "Enable Overlay",
|
||||
"vcmi.systemOptions.enableOverlayButton.help" : "{Enable Overlay}\n\nEnable overlays for showing additional infos such as building names using the ALT key or the two finger gesture.",
|
||||
|
||||
"vcmi.adventureOptions.infoBarPick.hover" : "Show Messages in Info Panel",
|
||||
"vcmi.adventureOptions.infoBarPick.help" : "{Show Messages in Info Panel}\n\nWhenever possible, game messages from visiting map objects will be shown in the info panel, instead of popping up in a separate window.",
|
||||
|
@ -307,6 +307,8 @@
|
||||
"vcmi.systemOptions.enableLargeSpellbookButton.help" : "{Großes Zauberbuch}\n\nErmöglicht ein größeres Zauberbuch, in das mehr Zaubersprüche pro Seite passen. Die Animation des Seitenwechsels im Zauberbuch funktioniert nicht, wenn diese Einstellung aktiviert ist.",
|
||||
"vcmi.systemOptions.audioMuteFocus.hover" : "Stumm bei Inaktivität",
|
||||
"vcmi.systemOptions.audioMuteFocus.help" : "{Stumm bei Inaktivität}\n\nSchaltet Audio bei inaktiven Fenster-Fokus stumm. Ausnahmen sind Ingame-Nachrichten und der Neuer-Zug-Sound.",
|
||||
"vcmi.systemOptions.enableOverlayButton.hover" : "Overlay aktivieren",
|
||||
"vcmi.systemOptions.enableOverlayButton.help" : "{Overlay aktivieren}\n\nAktiviere Overlays, die zusätzliche Infos, wie Gebäudenamen anzeigen, wenn die ALT-Taste gedrückt oder die Zwei-Finger-Geste genutzt wird.",
|
||||
|
||||
"vcmi.adventureOptions.infoBarPick.hover" : "Meldungen im Infobereich anzeigen",
|
||||
"vcmi.adventureOptions.infoBarPick.help" : "{Meldungen im Infobereich anzeigen}\n\nWann immer möglich, werden Spielnachrichten von besuchten Kartenobjekten in der Infoleiste angezeigt, anstatt als Popup-Fenster zu erscheinen",
|
||||
|
@ -210,7 +210,12 @@ void MapView::onMapZoomLevelChanged(int stepsChange, bool useDeadZone)
|
||||
void MapView::onViewMapActivated()
|
||||
{
|
||||
controller->activateAdventureContext();
|
||||
controller->setTileSize(Point(32, 32));
|
||||
|
||||
int zoom = settings["adventure"]["tileZoom"].Integer();
|
||||
if(zoom)
|
||||
controller->setTileSize(Point(zoom, zoom));
|
||||
else
|
||||
controller->setTileSize(Point(32, 32));
|
||||
}
|
||||
|
||||
PuzzleMapView::PuzzleMapView(const Point & offset, const Point & dimensions, const int3 & tileToCenter)
|
||||
|
@ -72,7 +72,7 @@ void MapViewController::setViewCenter(const Point & position, int level)
|
||||
adventureInt->onMapViewMoved(model->getTilesTotalRect(), model->getLevel());
|
||||
}
|
||||
|
||||
void MapViewController::setTileSize(const Point & tileSize)
|
||||
void MapViewController::setTileSize(const Point & tileSize, bool setTarget)
|
||||
{
|
||||
Point oldSize = model->getSingleTileSize();
|
||||
model->setTileSize(tileSize);
|
||||
@ -87,6 +87,9 @@ void MapViewController::setTileSize(const Point & tileSize)
|
||||
|
||||
// force update of view center since changing tile size may invalidated it
|
||||
setViewCenter(newViewCenter, model->getLevel());
|
||||
|
||||
if(setTarget)
|
||||
targetTileSize = tileSize;
|
||||
}
|
||||
|
||||
void MapViewController::modifyTileSize(int stepsChange, bool useDeadZone)
|
||||
@ -125,7 +128,7 @@ void MapViewController::modifyTileSize(int stepsChange, bool useDeadZone)
|
||||
if(actualZoom.y >= defaultTileSize - zoomTileDeadArea && actualZoom.y <= defaultTileSize + zoomTileDeadArea)
|
||||
actualZoom.y = defaultTileSize;
|
||||
}
|
||||
|
||||
|
||||
bool isInDeadZone = targetTileSize != actualZoom || actualZoom == Point(defaultTileSize, defaultTileSize);
|
||||
|
||||
if(!wasInDeadZone && isInDeadZone)
|
||||
@ -133,7 +136,13 @@ void MapViewController::modifyTileSize(int stepsChange, bool useDeadZone)
|
||||
|
||||
wasInDeadZone = isInDeadZone;
|
||||
|
||||
setTileSize(actualZoom);
|
||||
setTileSize(actualZoom, false);
|
||||
|
||||
if (adventureContext)
|
||||
{
|
||||
Settings tileZoom = settings.write["adventure"]["tileZoom"];
|
||||
tileZoom->Integer() = actualZoom.x;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -224,7 +233,7 @@ void MapViewController::updateState()
|
||||
adventureContext->settingShowVisitable = settings["session"]["showVisitable"].Bool();
|
||||
adventureContext->settingShowBlocked = settings["session"]["showBlocked"].Bool();
|
||||
adventureContext->settingSpellRange = settings["session"]["showSpellRange"].Bool();
|
||||
adventureContext->settingTextOverlay = GH.isKeyboardAltDown() || GH.input().getNumTouchFingers() == 2;
|
||||
adventureContext->settingTextOverlay = (GH.isKeyboardAltDown() || GH.input().getNumTouchFingers() == 2) && settings["general"]["enableOverlay"].Bool();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ public:
|
||||
|
||||
void setViewCenter(const int3 & position);
|
||||
void setViewCenter(const Point & position, int level);
|
||||
void setTileSize(const Point & tileSize);
|
||||
void setTileSize(const Point & tileSize, bool setTarget = true);
|
||||
void modifyTileSize(int stepsChange, bool useDeadZone);
|
||||
void tick(uint32_t timePassed);
|
||||
void afterRender();
|
||||
|
@ -20,6 +20,8 @@
|
||||
#include "../gui/CGuiHandler.h"
|
||||
#include "../render/IScreenHandler.h"
|
||||
|
||||
#include "../../lib/CConfigHandler.h"
|
||||
|
||||
#include <tbb/parallel_for.h>
|
||||
#include <tbb/task_arena.h>
|
||||
|
||||
@ -270,7 +272,10 @@ SDLImageShared::SDLImageShared(const SDLImageShared * from, int integerScaleFact
|
||||
upscalingInProgress = false;
|
||||
};
|
||||
|
||||
upscalingArena.enqueue(scalingTask);
|
||||
if(settings["video"]["asyncUpscaling"].Bool())
|
||||
upscalingArena.enqueue(scalingTask);
|
||||
else
|
||||
scalingTask();
|
||||
}
|
||||
|
||||
bool SDLImageShared::isLoading() const
|
||||
|
@ -177,7 +177,7 @@ void CBuildingRect::show(Canvas & to)
|
||||
{
|
||||
uint32_t stageDelay = BUILDING_APPEAR_TIMEPOINT;
|
||||
|
||||
bool showTextOverlay = GH.isKeyboardAltDown() || GH.input().getNumTouchFingers() == 2;
|
||||
bool showTextOverlay = (GH.isKeyboardAltDown() || GH.input().getNumTouchFingers() == 2) && settings["general"]["enableOverlay"].Bool();
|
||||
|
||||
if(stateTimeCounter < BUILDING_APPEAR_TIMEPOINT)
|
||||
{
|
||||
@ -770,7 +770,7 @@ void CCastleBuildings::show(Canvas & to)
|
||||
{
|
||||
CIntObject::show(to);
|
||||
|
||||
bool showTextOverlay = GH.isKeyboardAltDown() || GH.input().getNumTouchFingers() == 2;
|
||||
bool showTextOverlay = (GH.isKeyboardAltDown() || GH.input().getNumTouchFingers() == 2) && settings["general"]["enableOverlay"].Bool();
|
||||
if(showTextOverlay)
|
||||
drawOverlays(to, buildings);
|
||||
}
|
||||
|
@ -475,7 +475,7 @@ CKingdomInterface::CKingdomInterface()
|
||||
statusbar = CGStatusBar::create(std::make_shared<CPicture>(ImagePath::builtin("KSTATBAR"), 10,pos.h - 45));
|
||||
resdatabar = std::make_shared<CResDataBar>(ImagePath::builtin("KRESBAR"), 7, 111+footerPos, 29, 3, 76, 81);
|
||||
|
||||
activateTab(persistentStorage["gui"]["lastKindomInterface"].Integer());
|
||||
activateTab(settings["general"]["lastKindomInterface"].Integer());
|
||||
}
|
||||
|
||||
void CKingdomInterface::generateObjectsList(const std::vector<const CGObjectInstance * > &ownedObjects)
|
||||
@ -640,7 +640,7 @@ void CKingdomInterface::generateButtons()
|
||||
|
||||
void CKingdomInterface::activateTab(size_t which)
|
||||
{
|
||||
Settings s = persistentStorage.write["gui"]["lastKindomInterface"];
|
||||
Settings s = settings.write["general"]["lastKindomInterface"];
|
||||
s->Integer() = which;
|
||||
|
||||
btnHeroes->block(which == 0);
|
||||
|
@ -160,6 +160,10 @@ GeneralOptionsTab::GeneralOptionsTab()
|
||||
{
|
||||
setBoolSetting("general", "hapticFeedback", value);
|
||||
});
|
||||
addCallback("enableOverlayChanged", [](bool value)
|
||||
{
|
||||
setBoolSetting("general", "enableOverlay", value);
|
||||
});
|
||||
addCallback("enableUiEnhancementsChanged", [](bool value)
|
||||
{
|
||||
setBoolSetting("general", "enableUiEnhancements", value);
|
||||
@ -223,6 +227,10 @@ GeneralOptionsTab::GeneralOptionsTab()
|
||||
if (hapticFeedbackCheckbox)
|
||||
hapticFeedbackCheckbox->setSelected(settings["general"]["hapticFeedback"].Bool());
|
||||
|
||||
std::shared_ptr<CToggleButton> enableOverlayCheckbox = widget<CToggleButton>("enableOverlayCheckbox");
|
||||
if (enableOverlayCheckbox)
|
||||
enableOverlayCheckbox->setSelected(settings["general"]["enableOverlay"].Bool());
|
||||
|
||||
std::shared_ptr<CToggleButton> enableUiEnhancementsCheckbox = widget<CToggleButton>("enableUiEnhancementsCheckbox");
|
||||
if (enableUiEnhancementsCheckbox)
|
||||
enableUiEnhancementsCheckbox->setSelected(settings["general"]["enableUiEnhancements"].Bool());
|
||||
|
@ -42,7 +42,9 @@
|
||||
"savePrefix",
|
||||
"startTurnAutosave",
|
||||
"enableUiEnhancements",
|
||||
"audioMuteFocus"
|
||||
"audioMuteFocus",
|
||||
"enableOverlay",
|
||||
"lastKindomInterface"
|
||||
],
|
||||
"properties" : {
|
||||
"playerName" : {
|
||||
@ -146,6 +148,14 @@
|
||||
"audioMuteFocus" : {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"enableOverlay" : {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"lastKindomInterface" : {
|
||||
"type" : "number",
|
||||
"default" : 0
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -189,7 +199,8 @@
|
||||
"upscalingFilter",
|
||||
"fontUpscalingFilter",
|
||||
"downscalingFilter",
|
||||
"allowPortrait"
|
||||
"allowPortrait",
|
||||
"asyncUpscaling"
|
||||
],
|
||||
"properties" : {
|
||||
"resolution" : {
|
||||
@ -281,6 +292,10 @@
|
||||
"allowPortrait" : {
|
||||
"type" : "boolean",
|
||||
"default" : false
|
||||
},
|
||||
"asyncUpscaling" : {
|
||||
"type" : "boolean",
|
||||
"default" : true
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -362,7 +377,7 @@
|
||||
"type" : "object",
|
||||
"additionalProperties" : false,
|
||||
"default" : {},
|
||||
"required" : [ "heroMoveTime", "enemyMoveTime", "scrollSpeedPixels", "heroReminder", "quickCombat", "objectAnimation", "terrainAnimation", "forceQuickCombat", "borderScroll", "leftButtonDrag", "rightButtonDrag", "smoothDragging", "backgroundDimLevel", "hideBackground", "backgroundDimSmallWindows" ],
|
||||
"required" : [ "heroMoveTime", "enemyMoveTime", "scrollSpeedPixels", "heroReminder", "quickCombat", "objectAnimation", "terrainAnimation", "forceQuickCombat", "borderScroll", "leftButtonDrag", "rightButtonDrag", "smoothDragging", "backgroundDimLevel", "hideBackground", "backgroundDimSmallWindows", "tileZoom" ],
|
||||
"properties" : {
|
||||
"heroMoveTime" : {
|
||||
"type" : "number",
|
||||
@ -426,6 +441,10 @@
|
||||
"backgroundDimSmallWindows" : {
|
||||
"type" : "boolean",
|
||||
"default" : false
|
||||
},
|
||||
"tileZoom" : {
|
||||
"type" : "number",
|
||||
"default" : 32
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -67,6 +67,9 @@
|
||||
"text": "vcmi.systemOptions.hapticFeedbackButton.hover",
|
||||
"created" : "mobile"
|
||||
},
|
||||
{
|
||||
"text": "vcmi.systemOptions.enableOverlayButton.hover"
|
||||
},
|
||||
{
|
||||
"text": "vcmi.systemOptions.enableUiEnhancementsButton.hover"
|
||||
}
|
||||
@ -98,6 +101,7 @@
|
||||
{
|
||||
"created" : "mobile"
|
||||
},
|
||||
{},
|
||||
{}
|
||||
]
|
||||
},
|
||||
@ -159,6 +163,11 @@
|
||||
"callback": "hapticFeedbackChanged",
|
||||
"created" : "mobile"
|
||||
},
|
||||
{
|
||||
"name": "enableOverlayCheckbox",
|
||||
"help": "vcmi.systemOptions.enableOverlayButton",
|
||||
"callback": "enableOverlayChanged"
|
||||
},
|
||||
{
|
||||
"name": "enableUiEnhancementsCheckbox",
|
||||
"help": "vcmi.systemOptions.enableUiEnhancementsButton",
|
||||
|
Loading…
x
Reference in New Issue
Block a user