[1.4] Moody (v2.6.0) A colonist mood dashboard

Started by GiantSpaceHamster, December 26, 2016, 10:52:52 PM

Previous topic - Next topic

[deleted]

[deleted]
0 (0%)
[deleted]
0 (0%)
[deleted]
0 (0%)
[deleted]
0 (0%)
[deleted]
0 (0%)
[deleted]
0 (0%)

Total Members Voted: 0

GiantSpaceHamster

Quote from: hoaxdream on June 15, 2017, 01:19:17 AM
nice mod, btw is there an option to resize the font when its minimize? as shown on the screenshot or make the background of moody minimize transparent

Resizing the font would not get you much. Most of the space is taken up by the border which is part of the base RimWorld window class I am using. I would have to override more base code than I want to reduce that.

Hopefully it's small enough that you can place it out of the way somewhere when you don't need it.

(Sorry for the delay I thought I replied to you a while back)

GiantSpaceHamster

Quote from: MrWeeGee on June 30, 2017, 09:02:31 AM
Love the mod, thought you might like a little suggestion, if possible: it'd add a lot of control over the mod if you could set a hotkey to collapse/expand the window.

This is just me -- but I tend to keep the mod closest to the top-right corner, using a lot of vertical space to show all colonists side-by-side. Eventually it collides with the side popups, and you can spend a lot of time repeatedly min/maxing and dragging around. You could prevent a lot of the "screen fighting" if there were a way to min/max as easily as you pause and resume.

Thanks for the work you've already done, it's definitely a must-have mod.

I have not really looked into integrating hotkeys. I'm not sure offhand if there's a way to register hotkeys with the base game so they show up in the game options. You're not the first to ask though so I'll add it to my backlog, but no guarantees on if/when.

wwWraith

Quote from: GiantSpaceHamster on June 30, 2017, 01:26:29 PM
I have not really looked into integrating hotkeys. I'm not sure offhand if there's a way to register hotkeys with the base game so they show up in the game options.

There are some way to register hotkeys as e.g. Quicksaver (https://ludeon.com/forums/index.php?topic=24532) does it.

And a couple of more suggestions :)
1. Saving the size and position of the window.
2. Ability to change the size of GUI elements like font, bars and maybe icons to make more information fit into smaller window.

And thanks for your work!
Think about it. Think around it. Perhaps you'll get some new good idea even if it would be completely different from my words.

GiantSpaceHamster

Quote from: wwWraith on June 30, 2017, 02:53:57 PM
Quote from: GiantSpaceHamster on June 30, 2017, 01:26:29 PM
I have not really looked into integrating hotkeys. I'm not sure offhand if there's a way to register hotkeys with the base game so they show up in the game options.

There are some way to register hotkeys as e.g. Quicksaver (https://ludeon.com/forums/index.php?topic=24532) does it.

And a couple of more suggestions :)
1. Saving the size and position of the window.
2. Ability to change the size of GUI elements like font, bars and maybe icons to make more information fit into smaller window.

And thanks for your work!

Thanks, I will take a look.

I am looking into something to save the size and position without impacting the ability to enable/disable Moody in existing saves. Basically just a custom config file stored in the mod folder.

Font/GUI element sizes are a bit trickier. I would need to ensure the UI looks good at all available sizes. I do understand not everyone plays at the same high resolution I do but it's also not a high priority at the moment.

GiantSpaceHamster

I've been working on some updates and need to do some more testing but I have a beta version available below if anyone wants to give it a try. Summary of new stuff:
- Integrated with mod options screen
- Save Moody size and position
- Tiny Mode for smaller displays (and good eyes)
- Mode toggle between colonists, prisoners, and animals. Much of the information is not applicable to animals, but some could be useful like temperatures or hunger in extreme biomes.
- Hotkey support for a few things. Listed under new Moody section at the bottom of the key config screen.

None of the new stuff should cause any problems when enabling/disabling Moody in an existing game, nor should upgrading cause any issues. Of course if you have any issues, please let me know and provide lots of details!

https://www.dropbox.com/s/1289dru3mviesak/Moody-2.0.0.1b.zip

wwWraith

I'm afraid there are issues...

1. Tried to use it in a current savegame. After loading the whole map became gray like it was completely fogged. The names of the pawns were visible. Same thing with the world map. But even after unpausing there were no changes (nothing moves) like it was still paused. When I swithched the Moody's mode to show prisoners, these things became normal, but bugged again when switched to the colonists or animals. Probably it's because I have animals but no prisoners atm. Also there are slightly varied white messages spamming in the console:

Moody settings saved
Verse.Log:Message(String)
Moody.Settings:ExposeData()
Verse.Scribe_Deep:Look(ModSettings&, Boolean, String, Object[])
Verse.Scribe_Deep:Look(ModSettings&, String, Object[])
Verse.LoadedModManager:WriteModSettings(String, String, ModSettings)
Verse.ModSettings:Write()
Verse.Mod:WriteSettings()
Moody.Settings:SaveSettings()
Moody.Settings:set_SizeAndPosition(Rect)
Moody.MoodyWindow:WindowOnGUI()
Verse.WindowStack:WindowStackOnGUI()
RimWorld.UIRoot_Play:UIRootOnGUI_Patch1(Object)
Verse.Root:OnGUI()

Moody settings saved
Verse.Log:Message(String)
Moody.Settings:ExposeData()
Verse.Scribe_Deep:Look(ModSettings&, Boolean, String, Object[])
Verse.Scribe_Deep:Look(ModSettings&, String, Object[])
Verse.LoadedModManager:WriteModSettings(String, String, ModSettings)
Verse.ModSettings:Write()
Verse.Mod:WriteSettings()
Moody.Settings:SaveSettings()
Moody.Settings:DoSettingsWindowContents(Rect)
Moody.Moody:DoSettingsWindowContents(Rect)
RimWorld.Dialog_VanillaModSettings:DoWindowContents(Rect)
Verse.<WindowOnGUI>c__AnonStorey2C4:<>m__1B1(Int32)
UnityEngine.GUI:CallWindowDelegate(WindowFunction, Int32, GUISkin, Int32, Single, Single, GUIStyle)

Moody settings saved
Verse.Log:Message(String)
Moody.Settings:ExposeData()
Verse.Scribe_Deep:Look(ModSettings&, Boolean, String, Object[])
Verse.Scribe_Deep:Look(ModSettings&, String, Object[])
Verse.LoadedModManager:WriteModSettings(String, String, ModSettings)
Verse.ModSettings:Write()
Verse.Mod:WriteSettings()
Moody.Settings:SaveSettings()
Moody.Settings:set_TinyMode(Boolean)
Moody.MoodyController:checkHotkeys()
Moody.MoodyController:MapComponentOnGUI()
Verse.MapComponentUtility:MapComponentOnGUI(Map)
RimWorld.MapInterface:MapInterfaceOnGUI_BeforeMainTabs()
RimWorld.UIRoot_Play:UIRootOnGUI_Patch1(Object)
Verse.Root:OnGUI()

Cache Updated. Total pawns: 11, Skipped: 0
Verse.Log:Message(String)
Moody.DataCache:updateCache(Boolean)
Moody.MoodyTab:drawTab(Rect, Boolean)
Moody.PawnModeTab:drawTab(Rect, Boolean)
Moody.MoodyWindow:drawExpandedHeader(Rect)
Moody.MoodyWindow:DoWindowContents(Rect)
Moody.<>c__DisplayClass69_0:<WindowOnGUIBase>b__0(Int32)
UnityEngine.GUI:CallWindowDelegate(WindowFunction, Int32, GUISkin, Int32, Single, Single, GUIStyle)

Cache Updated. Total pawns: 0, Skipped: 0
Verse.Log:Message(String)
Moody.DataCache:updateCache(Boolean)
Moody.MoodyWindow:WindowUpdate()
Verse.WindowStack:WindowsUpdate()
Verse.UIRoot:UIRootUpdate()
RimWorld.UIRoot_Play:UIRootUpdate()
Verse.Root:Update_Patch1(Object)
Verse.Root_Play:Update()


The last message kept spamming with Moody in prisoners mode even when the game was paused.

2. It didn't show colonists/animals names/professions/portraits until the game was restarted (then it became as intended).

3. Seems like it doesn't allow to save its window position if it's higher or righter than default (I'd like to make it strictly close to the upper right corner).

4. Tried a new game without other mods. Right after loading in the console was a message about cache updated but then red error spamming:

Division by zero
  at Moody.DataCache.updateCache (Boolean viewChanged) [0x00000] in <filename unknown>:0
  at Moody.MoodyWindow.WindowUpdate () [0x00000] in <filename unknown>:0
  at Verse.WindowStack.WindowsUpdate () [0x00000] in <filename unknown>:0
  at Verse.UIRoot.UIRootUpdate () [0x00000] in <filename unknown>:0
  at RimWorld.UIRoot_Play.UIRootUpdate () [0x00000] in <filename unknown>:0
  at Verse.Root.Update () [0x00000] in <filename unknown>:0


The game was still paused, but there were no way to stop it or change anything.
Think about it. Think around it. Perhaps you'll get some new good idea even if it would be completely different from my words.

GiantSpaceHamster

Quote from: wwWraith on July 05, 2017, 07:28:12 AM
I'm afraid there are issues...

[truncated]


Thanks for the feedback, I'll take a look.

The "Cache Updated" spam is debug output I just haven't removed yet, nothing to worry about there.

#2) Do you mean you just had to reload the same save game again or you had to start a new game?

#3) There is a minimum buffer between the edge of the screen that I use to prevent it from going offscreen. That's likely what you've encountered.

#4) If you can attach the save game that you started and encountered errors with right away (where you only had Moody enabled) that might help me track down this particular issue.

#1 is odd and I have not encountered this problem in my testing. If you can reproduce it with a game that doesn't have other mods enabled attaching that save game would help. Otherwise I will see what I can find.

wwWraith

Quote from: GiantSpaceHamster on July 05, 2017, 01:20:27 PM
#2) Do you mean you just had to reload the same save game again or you had to start a new game?

#3) There is a minimum buffer between the edge of the screen that I use to prevent it from going offscreen. That's likely what you've encountered.

#4) If you can attach the save game that you started and encountered errors with right away (where you only had Moody enabled) that might help me track down this particular issue.

#1 is odd and I have not encountered this problem in my testing. If you can reproduce it with a game that doesn't have other mods enabled attaching that save game would help. Otherwise I will see what I can find.

#2: I closed the game, started in again and then reloaded the same file. Probably it was just because it was lacking saved config at first run.
#3: I thought so, but is it really needed? Even if the user will move it offscreen, (s)he can just uncheck "Remember size and position" in options and then after reloading the window will come back, won't it?
#4: I can't attach the file because I couldn't do literally anything, the console were active all the time and other GUI elements weren't responding.
#1: I put the file in the attachment. In order to avoid issue #4 I started the new game with only Core, saved it, then added Moody, restarted and loaded that savefile, then saved it again :)

Looking at the amount of this strangeness, I have a suspicion that something could go wrong while you compiled or packed it, so the downloaded mod may have differences from the version you used for testing.

[attachment deleted by admin due to age]
Think about it. Think around it. Perhaps you'll get some new good idea even if it would be completely different from my words.

GiantSpaceHamster

Quote from: wwWraith on July 05, 2017, 02:09:33 PM

#2: I closed the game, started in again and then reloaded the same file. Probably it was just because it was lacking saved config at first run.
#3: I thought so, but is it really needed? Even if the user will move it offscreen, (s)he can just uncheck "Remember size and position" in options and then after reloading the window will come back, won't it?
#4: I can't attach the file because I couldn't do literally anything, the console were active all the time and other GUI elements weren't responding.
#1: I put the file in the attachment. In order to avoid issue #4 I started the new game with only Core, saved it, then added Moody, restarted and loaded that savefile, then saved it again :)

Looking at the amount of this strangeness, I have a suspicion that something could go wrong while you compiled or packed it, so the downloaded mod may have differences from the version you used for testing.

Thanks for the additional info.

#3 I added it more to move Moody on-screen if the resolution is reduced, but I may change that to only happen when the resolution changes instead of all resize/movements. We'll see.

khearn

I'm having an issue that may be related to #3 above. I have the UI scaling set to 1.25x, and every time the game saves, the moody window moves downward. Actually, I'm not sure if it happens every time, or just once, I just move it back up after it happens every time.

If you're not used to using the UI scaling, when you have it set to something bigger than 1x, when the game saves the UI switches to 1x scaling for a moment (moving everything towards the lower left), then switches back to what it was before. This is vanilla behavior, and is a minor annoyance by itself. But the moody window moves to the lower left, then moves back to the right, but not back up. At least, that's what it looks like its doing. Maybe it's just moving out of the buffer area mentioned above. If so, I think the buffer is a bit large. On my screen, it moves the top of the moody window from the top edge to below the bottom of the character icons in the row at the top of the screen, which puts it into fairly prime central real estate.

The minimap mod used to also move every time the game rescaled during a save, but its author managed to fix it, so you might check with him to see what the fix was.

GiantSpaceHamster

Quote from: khearn on July 05, 2017, 04:35:00 PM
I'm having an issue that may be related to #3 above. I have the UI scaling set to 1.25x, and every time the game saves, the moody window moves downward. Actually, I'm not sure if it happens every time, or just once, I just move it back up after it happens every time.

If you're not used to using the UI scaling, when you have it set to something bigger than 1x, when the game saves the UI switches to 1x scaling for a moment (moving everything towards the lower left), then switches back to what it was before. This is vanilla behavior, and is a minor annoyance by itself. But the moody window moves to the lower left, then moves back to the right, but not back up. At least, that's what it looks like its doing. Maybe it's just moving out of the buffer area mentioned above. If so, I think the buffer is a bit large. On my screen, it moves the top of the moody window from the top edge to below the bottom of the character icons in the row at the top of the screen, which puts it into fairly prime central real estate.

The minimap mod used to also move every time the game rescaled during a save, but its author managed to fix it, so you might check with him to see what the fix was.

Thanks for the details, will look into it. Should be fixable.

GiantSpaceHamster

#86
See next reply for new beta build

wwWraith I believe most of your issues were caused by a bug with the new mod settings integration. I think I have resolved the issue there so let me know if you still encounter any problems. I also verified Moody is being clamped to the screen when the resolution changes or a game loads, so that explains why the save position cannot be any closer to the edge of the screen or off-screen. The current edge margin enforced is 20px on the right and 100px on the top (to avoid overlapping long colonist bars). I will give some thought to changing this, or maybe at least providing a way to change those margins in the settings.

khearn The window clamping behavior I mentioned above is also why Moody may not always revert to the same position after a toggling UI scaling back and forth.

I will give some thought to the clamping behavior and see if I can come up with any good ways to improve the experience.

GiantSpaceHamster

New beta build: https://www.dropbox.com/s/6vtx7awd89fre8a/Moody-2.0.0.3b.zip

- Fix for mod settings integration.
- Separated the initial screen position from the edge margins and reduced the clamping margins to 3px all sides.

wwWraith

Thanks for your work! Those issues are gone now :)

But there are a new minor one: hotkeys don't work if set to anything other than defaults.
Think about it. Think around it. Perhaps you'll get some new good idea even if it would be completely different from my words.

GiantSpaceHamster

Quote from: wwWraith on July 06, 2017, 05:04:03 AM
Thanks for your work! Those issues are gone now :)

But there are a new minor one: hotkeys don't work if set to anything other than defaults.

Thanks for bringing this to my attention. It looks like it's not actually that only the defaults work, it's that only the F# keys work. You can change the hotkeys to other F# keys but changing them to other keys doesn't work for some reason. Looking into it.