Skip to content

Operation Oopsies!

Latest

Choose a tag to compare

@TheCascadian TheCascadian released this 22 Nov 04:35
· 2 commits to main since this release
d4711c9

HOI4 Focus GUI v1.0.12 - Operation Oopsies!

All notable changes made to HOI4 Focus GUI v1.0.12, bumped from 1.0.11 (which was accidentally still identified as 1.0.9 in some files).

Build, Performance & Onboarding Updates
  • Parallel PyInstaller build path resolution: Updated scripts/build_appimage.sh and scripts/build_windows_exe.sh to use absolute $ROOT_DIR paths, including Wine-compatible path conversion, fixing resource and entrypoint resolution during parallel builds.

  • Focus tree generator optimization: Replaced repeated title generation and library lookups with a cached, pre-shuffled title pool and O(1) fallback. Replaced quadratic parent lookups and node removal with O(1) map lookups and swap-and-pop operations. Removed the obsolete simple_layout pass, precomputed sibling offsets, optimized collision detection, and improved seeded ID generation. Also replaced quadratic generated-node ID collision checks with set lookups. ID generation is approximately 19x faster at 5,000 nodes.

  • Lineage highlighting: Optimized _collect_lineage_ids() to traverse existing connection references instead of scanning every node. Added redundant-operation checks and batched view repaints.

  • Interactive Starter Tutorial: Replaced the blocking tutorial dialog with a draggable, non-modal InteractiveTutorialCoach and click-through spotlight overlay. Added plain-English explanations, automatically detected interactive tasks, one-click "Do it for me" helpers, and a three-focus example project.

  • Focus & Event Properties dialogs: Fixed an incompatible PyQt5 font database reference that prevented properties dialogs from opening.

  • Missing image logging: Added missing-path checks and negative caching to prevent repeated FileNotFoundError tracebacks during focus rendering.

  • Generate Focuses tooltips: Added descriptive tooltips to all Basic and Advanced generator controls, including mutex settings, networks, background execution, randomized effects, modifiers, availability conditions, and effect categories.

Bug Fixes
  • Auto-save & settings persistence: Fixed initialization of settings and autosave attributes, restored prefer_app_settings loading, preserved autosave preferences, prevented user-selected settings directories from being incorrectly overwritten, and made Settings → Apply persist changes unconditionally.

  • Note editing: Fixed garbled text and missing cursor rendering by switching note text items from DeviceCoordinateCache to NoCache.

  • Accidental deletions: Prevented Backspace/Delete from deleting selected canvas objects while editing note text. Canvas Backspace now also requires confirmation.

  • Focus deletion cleanup: Fixed incomplete removal of deleted focus IDs from other focuses' prerequisites_groups and relative_position_id fields.

  • Live connection graph updates: Added FocusTreeCanvas.sync_focus_connections() so prerequisite connection lines and node visuals update immediately after editing or undoing focus changes.

  • Disappearing notes: Added confirmation before deleting notes through their close button and automatically enabled notes when loading projects containing them.

  • Position tooltips & focus properties: Fixed coordinate tooltip clipping and corrected keyboard focus handling so Edit Properties remains accessible after editing notes.

  • Qt6 compatibility: Removed the Qt5-only QGraphicsView.OptimizationFlag.DontClipPainter call that caused compatibility errors.

Performance & Renderer
  • Zoomed-in rendering & caching: Added scaled icon caching to FocusNode and glyph QPainterPath caching to draw_outlined_text() to avoid repeatedly rebuilding and rescaling graphics.

  • Grid & viewport rendering: Replaced 1,200+ individual grid scene objects with viewport-based background rendering. Only visible grid lines are drawn, with minor lines omitted at low zoom levels. Updated viewport strategies to use SmartViewportUpdate and CacheNone, retained antialiasing and smooth pixmap transformations, and removed unnecessary scene invalidation after panning.

  • Note rendering: Replaced the per-frame 16px CPU drop-shadow effect with lightweight vector shadow rendering.

  • Multi-selection: Simplified focus and event selection updates, removing unnecessary geometry changes, connection updates, and full-scene invalidation during box selection.

UX & UI Improvements
  • Menu bar & toolbar: Moved File, Edit, Tools, View, Library, Help, and Settings into the top-level menu bar. Made Tree ID compact and automatically expandable, updated the mute toggle, and hid State Viewport from the toolbar by default. Added an option to restore it through View → Show State Viewport on Toolbar.

  • Non-blocking feedback & exit safety: Replaced routine informational popups for saving, loading, copying, pasting, colorizing, arranging, and other operations with status bar notifications. Added an Unsaved Changes dialog with Save, Discard, and Cancel options.

  • Note & focus editing: Added Alt+drag support anywhere on a NoteNode, including over its text items. Added searchable Pick… dialogs alongside Prerequisites and Mutually Exclusive in the focus editor.

  • Starter Tutorial: Added a five-step tutorial covering project basics, focus creation and editing, connections, notes, generation, and HOI4 export. Available at startup when enabled or through Help → Starter Tutorial….

Random Focus Tree Generator
  • Opt-in base-game effects & state modifiers: Added optional randomized effects, state modifiers, and availability conditions to the Generate Project dialog.

  • Added configurable minimum and maximum effects per focus, alongside Political, Economy, Military, and Research category toggles.

  • Implemented _build_random_reward() and _build_random_available() using generic base-game HOI4 effects and inline add_state_modifier blocks.

  • Each focus receives a unique completion_reward when enabled. No additional events, ideas, characters, or countries are generated.

  • All new options are disabled by default.

Hardening & Code Quality
  • Removed global QMessageBox monkeypatching: Replaced global QMessageBox.information, warning, critical, and question overrides with explicit show_message_box() and _silent_dialog() helpers.

  • Canonical model & state synchronization: Removed unnecessary settings/database loading from contextMenuEvent(). Improved continuous synchronization between focus scene coordinates and model coordinates, focus ID renaming, canvas node keys, prerequisite references, mutually exclusive references, and parent focus collections.

  • Undo/Redo field coverage: Introduced _copy_focus_fields() using dataclasses.fields(Focus) with deep-copied containers, improving field preservation in focus deletion and editing undo/redo operations.

  • Atomic persistence, dirty tracking & crash recovery: Converted settings and database writes to atomic temporary-file operations using os.fsync() and os.replace(). Added _project_dirty tracking for non-undoable edits, including Tree ID, Country, and event changes. Added emergency .crash_recovery.json autosaving through the uncaught exception handler. Serialization errors are now surfaced instead of silently dropping affected focuses.

  • silent_operation cleanup: Removed 713 redundant silent_operation context-manager blocks throughout the source code, allowing real exceptions to surface cleanly while reducing unnecessary overhead in frequently executed rendering paths.


Downloads: https://github.com/TheCascadian/HOI4FocusGUI/releases/tag/1.0.12