Refactor code structure and remove redundant sections for improved readability and maintainability

This commit is contained in:
Kirill
2026-09-21 21:46:43 +03:00
parent 1796829338
commit 8867da569a
34 changed files with 219 additions and 183 deletions
+30 -30
View File
@@ -16,50 +16,50 @@ const PAGE_WIDTH = 1080
const DRAG_TOLERANCE = 360
const SWIPE_DURATION: float = 0.4
@onready var stage_page_scroller: ScrollContainer = $StageRows/PageScroller
@onready var stage_page_scroller: ScrollContainer = $World/PageScroller
@onready var item_pages: Array[Control] = [
$StageRows/PageScroller/HBoxContainer/ForcePage/Forces,
$StageRows/PageScroller/HBoxContainer/ResourcePage/HBoxContainer/Resources,
$StageRows/PageScroller/HBoxContainer/StarPage/Stars,
$StageRows/PageScroller/HBoxContainer/StructurePage/Structures,
$StageRows/PageScroller/HBoxContainer/LifePage/Planets/Life,
$StageRows/PageScroller/HBoxContainer/LifePage/Planets/LivingPlanet,
$StageRows/PageScroller/HBoxContainer/LifePage/Planets/Civ0,
$StageRows/PageScroller/HBoxContainer/LifePage/Planets/Civ1,
$StageRows/PageScroller/HBoxContainer/LifePage/Planets/Civ2,
$StageRows/PageScroller/HBoxContainer/LifePage/Planets/Civ3,
$StageRows/PageScroller/HBoxContainer/LifePage/Planets/Civ4
$World/PageScroller/HBoxContainer/ForcePage/Forces,
$World/PageScroller/HBoxContainer/ResourcePage/HBoxContainer/Resources,
$World/PageScroller/HBoxContainer/StarPage/Stars,
$World/PageScroller/HBoxContainer/StructurePage/Structures,
$World/PageScroller/HBoxContainer/LifePage/Planets/Life,
$World/PageScroller/HBoxContainer/LifePage/Planets/LivingPlanet,
$World/PageScroller/HBoxContainer/LifePage/Planets/Civ0,
$World/PageScroller/HBoxContainer/LifePage/Planets/Civ1,
$World/PageScroller/HBoxContainer/LifePage/Planets/Civ2,
$World/PageScroller/HBoxContainer/LifePage/Planets/Civ3,
$World/PageScroller/HBoxContainer/LifePage/Planets/Civ4
]
@onready var page_actions: Dictionary[int, OwniverseAction] = {
2: $StageRows/PageScroller/HBoxContainer/StarPage/Actions,
3: $StageRows/PageScroller/HBoxContainer/StructurePage/Actions,
2: $World/PageScroller/HBoxContainer/StarPage/Actions,
3: $World/PageScroller/HBoxContainer/StructurePage/Actions,
}
@onready var g_item_descriptions: Array = [
$StageRows/PageScroller/HBoxContainer/ForcePage/Description,
$StageRows/PageScroller/HBoxContainer/ResourcePage/Description,
$StageRows/PageScroller/HBoxContainer/StarPage/Description,
$StageRows/PageScroller/HBoxContainer/StructurePage/Description,
$StageRows/PageScroller/HBoxContainer/LifePage/Description
$World/PageScroller/HBoxContainer/ForcePage/Description,
$World/PageScroller/HBoxContainer/ResourcePage/Description,
$World/PageScroller/HBoxContainer/StarPage/Description,
$World/PageScroller/HBoxContainer/StructurePage/Description,
$World/PageScroller/HBoxContainer/LifePage/Description
]
@onready var date_time: Label = $StageRows/TopMenu/InfoPanel/DateTime
@onready var date_time: Label = $World/TopMenu/InfoPanel/DateTime
@onready var g_speed_icons: Array = [
$StageRows/TopMenu/InfoPanel/Speed/Speed1,
$StageRows/TopMenu/InfoPanel/Speed/Speed2,
$StageRows/TopMenu/InfoPanel/Speed/Speed3,
$StageRows/TopMenu/InfoPanel/Speed/Speed4,
$StageRows/TopMenu/InfoPanel/Speed/Speed5,
$StageRows/TopMenu/InfoPanel/Speed/Speed6,
$StageRows/TopMenu/InfoPanel/Speed/Speed7,
$StageRows/TopMenu/InfoPanel/Speed/Speed8
$World/TopMenu/InfoPanel/Speed/Speed1,
$World/TopMenu/InfoPanel/Speed/Speed2,
$World/TopMenu/InfoPanel/Speed/Speed3,
$World/TopMenu/InfoPanel/Speed/Speed4,
$World/TopMenu/InfoPanel/Speed/Speed5,
$World/TopMenu/InfoPanel/Speed/Speed6,
$World/TopMenu/InfoPanel/Speed/Speed7,
$World/TopMenu/InfoPanel/Speed/Speed8
]
@onready var g_time_minus: TextureButton = $StageRows/TopMenu/TimeMinus
@onready var g_time_plus: TextureButton = $StageRows/TopMenu/TimePlus
@onready var g_time_minus: TextureButton = $World/TopMenu/TimeMinus
@onready var g_time_plus: TextureButton = $World/TopMenu/TimePlus
var g_tween: Tween = null