Skip to content

Commit

Permalink
cleanup (#10405)
Browse files Browse the repository at this point in the history
  • Loading branch information
azum4roll authored Oct 29, 2023
1 parent 8abc362 commit a7dae5c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,6 @@ ALTER TABLE Improvements ADD COLUMN 'MovesChange' INTEGER DEFAULT 0;
-- Improvement requires fresh water, coast, or river adjacency to make valid.
ALTER TABLE Improvements ADD COLUMN 'WaterAdjacencyMakesValid' BOOLEAN DEFAULT 0;

-- Table for Lua elements that we don't want shown in Civ selection screen or in Civilopedia
ALTER TABLE Improvements ADD 'ShowInPedia' BOOLEAN DEFAULT 1;

-- Table for Civilopedia Game Concepts to add more in boxes...
ALTER TABLE Concepts ADD COLUMN 'Extended' TEXT DEFAULT NULL;
ALTER TABLE Concepts ADD COLUMN 'DesignNotes' TEXT DEFAULT NULL;
Expand Down
2 changes: 1 addition & 1 deletion (2) Vox Populi/Database Changes/AI/LeaderFlavorSweeps.sql
Original file line number Diff line number Diff line change
Expand Up @@ -528,4 +528,4 @@ UPDATE Leader_Flavors SET Flavor = 8 WHERE FlavorType = 'FLAVOR_SCIENCE' AND Lea
UPDATE Leader_Flavors SET Flavor = 8 WHERE FlavorType = 'FLAVOR_SPACESHIP' AND LeaderType = 'LEADER_WU_ZETIAN'; -- 5, primary: science
UPDATE Leader_Flavors SET Flavor = 7 WHERE FlavorType = 'FLAVOR_CULTURE' AND LeaderType = 'LEADER_WU_ZETIAN'; -- 10
UPDATE Leader_Flavors SET Flavor = 7 WHERE FlavorType = 'FLAVOR_ARCHAEOLOGY' AND LeaderType = 'LEADER_WU_ZETIAN'; -- 8
UPDATE Leader_Flavors SET Flavor = 9 WHERE FlavorType = 'FLAVOR_GREAT_PEOPLE' AND LeaderType = 'LEADER_WU_ZETIAN'; -- 8, UA
UPDATE Leader_Flavors SET Flavor = 9 WHERE FlavorType = 'FLAVOR_GREAT_PEOPLE' AND LeaderType = 'LEADER_WU_ZETIAN'; -- 8, UA
Original file line number Diff line number Diff line change
Expand Up @@ -1695,4 +1695,4 @@ VALUES
('LEADER_WU_ZETIAN', 'MINOR_CIV_APPROACH_IGNORE', 3),
('LEADER_WU_ZETIAN', 'MINOR_CIV_APPROACH_PROTECTIVE', 9),
('LEADER_WU_ZETIAN', 'MINOR_CIV_APPROACH_BULLY', 5),
('LEADER_WU_ZETIAN', 'MINOR_CIV_APPROACH_CONQUEST', 5);
('LEADER_WU_ZETIAN', 'MINOR_CIV_APPROACH_CONQUEST', 5);
6 changes: 3 additions & 3 deletions (2) Vox Populi/Database Changes/Remapper.sql
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
-- This code is necessary to avoid a UI glitch, do not remove it
CREATE TABLE IDRemapper (id INTEGER PRIMARY KEY AUTOINCREMENT, Type TEXT);
INSERT INTO IDRemapper (Type) SELECT Type FROM HandicapInfos ORDER BY ID;
UPDATE HandicapInfos SET ID = (SELECT IDRemapper.id-1 FROM IDRemapper WHERE HandicapInfos.Type = IDRemapper.Type);
UPDATE HandicapInfos SET ID = (SELECT IDRemapper.id - 1 FROM IDRemapper WHERE HandicapInfos.Type = IDRemapper.Type);
DROP TABLE IDRemapper;

UPDATE sqlite_sequence
SET seq = (SELECT COUNT(ID) FROM HandicapInfos)-1
SET seq = (SELECT COUNT(ID) FROM HandicapInfos) - 1
WHERE name = 'HandicapInfos';
-- End UI glitch fix

Expand Down Expand Up @@ -115,4 +115,4 @@ DROP TABLE IDRemapper;

UPDATE sqlite_sequence
SET seq = (SELECT COUNT(ID) FROM PlayerColors) - 1
WHERE name = 'PlayerColors';
WHERE name = 'PlayerColors';
12 changes: 6 additions & 6 deletions (2) Vox Populi/Database Changes/Triggers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ CREATE TRIGGER Unit_BuildingClassPurchaseRequireds
AFTER INSERT ON Units
WHEN (EXISTS (SELECT Type FROM Units WHERE Type = NEW.Type))
BEGIN
INSERT INTO Unit_BuildingClassPurchaseRequireds
(UnitType, BuildingClassType)
SELECT
NEW.Type, BuildingClassType
FROM Unit_BuildingClassPurchaseRequireds
WHERE UnitType IN (SELECT DefaultUnit FROM UnitClasses WHERE Type = NEW.Class);
INSERT INTO Unit_BuildingClassPurchaseRequireds
(UnitType, BuildingClassType)
SELECT
NEW.Type, BuildingClassType
FROM Unit_BuildingClassPurchaseRequireds
WHERE UnitType IN (SELECT DefaultUnit FROM UnitClasses WHERE Type = NEW.Class);
END;

---------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<Type>IMPROVEMENT_JFD_MACHU_PICCHU</Type>
<Description>TXT_KEY_IMPROVEMENT_JFD_MACHU_PICCHU</Description>
<ArtDefineTag>ART_DEF_IMPROVEMENT_JFD_MACHU</ArtDefineTag>
<GraphicalOnly>1</GraphicalOnly>
<GraphicalOnly>true</GraphicalOnly>
</Row>
<!--
Unique Improvements
Expand Down Expand Up @@ -67,7 +67,7 @@
<ArtDefineTag>ART_DEF_IMPROVEMENT_POLDER</ArtDefineTag>
<PortraitIndex>0</PortraitIndex>
<IconAtlas>EXPANSION_TERRAIN_ATLAS</IconAtlas>
<GraphicalOnly>1</GraphicalOnly>
<GraphicalOnly>true</GraphicalOnly>
</Row>
<Row>
<Type>IMPROVEMENT_MONGOLIA_ORDO</Type>
Expand Down

0 comments on commit a7dae5c

Please sign in to comment.