Enforced singleton pattern in FSkin.

Converted FSkin to static factory.
Updated all uses of FSkin as appropriate.
Removed all extra references/storages to FSkin.
This commit is contained in:
Doublestrike
2012-02-06 13:51:02 +00:00
parent 453f602d61
commit 84c1ae6b5f
53 changed files with 515 additions and 645 deletions

View File

@@ -40,6 +40,7 @@ import forge.properties.ForgePreferences.FPref;
import forge.quest.data.QuestPreferences;
import forge.util.FileUtil;
import forge.util.HttpUtil;
import forge.view.toolbox.FSkin;
/**
* The default Model implementation for Forge.
@@ -100,13 +101,19 @@ public class FModel {
// Unfortunately, they're tied up in legacy code in the Display interface,
// currently in GuiTopLevel. When that code is updated, this TODO should be resolved.
// Doublestrike 24-01-12
// ==
// It's looking like all the settings at the same time, here only.
// Doublestrike 06-02-12
Constant.Runtime.DEV_MODE[0] = preferences.getPrefBoolean(FPref.DEV_MODE_ENABLED);
Constant.Runtime.SKIN_NAME = preferences.getPref(FPref.UI_SKIN);
// Load splash image and preloader swatches for skin
FSkin.loadLight(Constant.Runtime.SKIN_NAME);
// Instantiate AI
AllZone.setInputControl(new InputControl(FModel.this));
AllZone.getInputControl().setComputer(new ComputerAIInput(new ComputerAIGeneral()));
// Set gameplay preferences and constants
final HttpUtil pinger = new HttpUtil();
final String url = ForgeProps.getProperty(NewConstants.CARDFORGE_URL) + "/draftAI/ping.php";