Jump to content

A real minimap (not map screen) or better checks of when the map screen is up

Recommended Posts

In single-player the absence of a minimap was somewhat tolerable because the game paused on the map screen. That being said, it was still pretty annoying to switch back-and-forth between, meaning that pretty much anyone who was willing to look at mods had Minimap HUD installed.


It would be really, really awesome if we had an official implementation of a minimap, since to really do it properly requires changes to the C code.


I've worked really hard on trying to keep Minimap HUD functional in DST, but it's getting really yucky to maintain. Currently the DS and DST code uses TheWorld.minimap.MiniMap:IsVisible() as a check of whether the map screen is up, which means that this always returns true with Minimap HUD. So I have to provide in the mod a rewrite of any function that does that, which is really bad -- large functions that could definitely need to be changed in the future to fix bugs or change functionality, in which case the mod would then have a copied-modified-outdated version.


Examples of where this is a problem:

Playercontoller's IsEnabled function:

function PlayerController:IsEnabled()    return self.classified ~= nil and        self.classified.iscontrollerenabled:value() and        (self.inst.sg == nil or not self.inst.sg:HasStateTag("nocontrol")) and        (self.inst.HUD == nil or        not ( TheWorld.minimap.MiniMap:IsVisible()      or --this is the problem here              self.inst.HUD:IsChatInputScreenOpen()     or              self.inst.HUD:IsControllerCraftingOpen()  or              self.inst.HUD:IsControllerInventoryOpen() or              self.inst.HUD:IsPauseScreenOpen()         or              self.inst.HUD:IsConsoleScreenOpen() )      )end

This means that without rewriting the function to check mapscreen, Minimap HUD freezes all playercontroller input.


Player_classified's OnPlayerHUDDirty function:

local function OnPlayerHUDDirty(inst)    if inst._parent ~= nil and inst._parent.HUD ~= nil then        if inst.ishudvisible:value() then            inst._parent.HUD:Show()        else            inst._parent.HUD:Hide()        end        inst._parent.HUD.controls.status:SetGhostMode(inst.isghostmode:value())        inst._parent:EnableMovementPrediction(not inst.isghostmode:value())        if inst.ismapcontrolsvisible:value() then            inst._parent.HUD.controls.mapcontrols.minimapBtn:Show()        else            if TheWorld.minimap.MiniMap:IsVisible() then                TheFrontEnd:PopScreen() -- this is a huge problem            end            inst._parent.HUD.controls.mapcontrols.minimapBtn:Hide()        end			TheWorld.minimap.MiniMap:EnablePlayerMinimapUpdate(not inst.isghostmode:value())    endend 

So without rewriting this function, or inserting some awful hack into PopScreen, this means that if this ever gets called with Minimap HUD, the entire playerhud screen gets popped.


I don't even see a good way to rewrite this right now, since it's a local function embedded in an event callback (that is, without providing my own player_classified, which would be horrible for compatibility).


So if we don't get a proper implementation of a minimap, can those checks at least be replaced with something that's actually talking to mapscreen, not TheWorld.minimap.MiniMap?

Link to comment
Share on other sites

Or maybe we could just implement an animation on the player models for when someone is looking at their map, make the map a tiny bit smaller than the screen to allow to see incoming threats, and allow movement with WSAD while the map is up.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

  • Create New...